Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merging] passing in nil in MergeDevWorkspaceTemplateSpec causes panic #295

Closed
amisevsk opened this issue Jan 11, 2021 · 0 comments · Fixed by #308
Closed

[Merging] passing in nil in MergeDevWorkspaceTemplateSpec causes panic #295

amisevsk opened this issue Jan 11, 2021 · 0 comments · Fixed by #308
Labels
area/devworkspace Improvent or additions to the DevWorkspaces CRD

Comments

@amisevsk
Copy link
Contributor

Describe the bug

Passing nil for parentFlattenedContent or pluginFlattenedContent in overriding.MergeDevWorkspaceTemplateSpec causes a panic due to nil pointer.

Stacktrace:

E0111 12:31:43.096684   57531 runtime.go:78] Observed a panic: "value method github.com/devfile/api/pkg/apis/workspaces/v1alpha2.DevWorkspaceTemplateSpecContent.GetToplevelLists called using nil *DevWorkspaceTemplateSpecContent pointer" (value method github.com/devfile/api/pkg/apis/workspaces/v1alpha2.DevWorkspaceTemplateSpecContent.GetToplevelLists called using nil *DevWorkspaceTemplateSpecContent pointer)
goroutine 679 [running]:
panic(0x1d8d280, 0xc000908b30)
	/usr/lib/golang/src/runtime/panic.go:975 +0x41b
github.com/devfile/api/pkg/apis/workspaces/v1alpha2.(*DevWorkspaceTemplateSpecContent).GetToplevelLists(0x0, 0x0)
	<autogenerated>:1 +0xde
github.com/devfile/api/pkg/utils/overriding.checkKeys(0x20187f0, 0xc000a4b9c0, 0x2, 0x2, 0x0, 0x0)
	/home/amisevsk/go/pkg/mod/github.com/devfile/api@v0.0.0-20201125082321-aeda60d43619/pkg/utils/overriding/keys.go:26 +0x175
github.com/devfile/api/pkg/utils/overriding.ensureNoConflictWithParent(0xc00037cf50, 0x0, 0x0, 0x0)
	/home/amisevsk/go/pkg/mod/github.com/devfile/api@v0.0.0-20201125082321-aeda60d43619/pkg/utils/overriding/merging.go:156 +0xf3
github.com/devfile/api/pkg/utils/overriding.MergeDevWorkspaceTemplateSpec(0xc00037cf50, 0x0, 0xc000492d08, 0x1, 0x1, 0x0, 0x0, 0x0)
	/home/amisevsk/go/pkg/mod/github.com/devfile/api@v0.0.0-20201125082321-aeda60d43619/pkg/utils/overriding/merging.go:32 +0x28f

Expected behavior

Nil check should be done, and that component should be skipped

@amisevsk amisevsk added the area/devworkspace Improvent or additions to the DevWorkspaces CRD label Jan 11, 2021
amisevsk added a commit to amisevsk/devworkspace-api that referenced this issue Jan 15, 2021
These tests are expected to fail due to devfile#295

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
amisevsk added a commit to amisevsk/devworkspace-api that referenced this issue Jan 15, 2021
These tests are expected to fail due to devfile#295

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
amisevsk added a commit to amisevsk/devworkspace-api that referenced this issue Jan 15, 2021
These tests are expected to fail due to devfile#295

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
amisevsk added a commit to amisevsk/devworkspace-api that referenced this issue Jan 20, 2021
These tests are expected to fail due to devfile#295

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
amisevsk added a commit that referenced this issue Jan 21, 2021
These tests are expected to fail due to #295

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devworkspace Improvent or additions to the DevWorkspaces CRD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant