Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/apis/workspaces/v1alpha2/component_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Container struct {

// +optional
// Annotations that should be added to specific resources for this container
Annotation Annotation `json:"annotation,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
Annotation *Annotation `json:"annotation,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

// +optional
// List of volumes mounts that should be mounted is this container.
Expand Down
24 changes: 20 additions & 4 deletions pkg/apis/workspaces/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/validation/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package validation

import (
"fmt"
"reflect"
"strings"

"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
Expand Down Expand Up @@ -63,7 +62,7 @@ func ValidateComponents(components []v1alpha2.Component) (returnedErr error) {
}

// if annotation is not empty and dedicatedPod is false
if !reflect.DeepEqual(component.Container.Annotation, v1alpha2.Annotation{}) && component.Container.DedicatedPod != nil && !(*component.Container.DedicatedPod) {
if component.Container.Annotation != nil && component.Container.DedicatedPod != nil && !(*component.Container.DedicatedPod) {
for key, value := range component.Container.Annotation.Deployment {
if processedVal, exist := processedDeploymentAnnotations[key]; exist && processedVal != value {
// only append the error for a single key once
Expand Down
2 changes: 1 addition & 1 deletion pkg/validation/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func generateDummyContainerComponent(name string, volMounts []v1alpha2.VolumeMou
Container: &v1alpha2.ContainerComponent{
Container: v1alpha2.Container{
Image: image,
Annotation: annotation,
Annotation: &annotation,
Env: envs,
VolumeMounts: volMounts,
MountSources: &mountSources,
Expand Down