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

Segmentation fault if resource namespace does not match #1230

Closed
rgladwell opened this issue Jun 21, 2019 · 5 comments
Closed

Segmentation fault if resource namespace does not match #1230

rgladwell opened this issue Jun 21, 2019 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@rgladwell
Copy link

Getting segmentation fault on macOS version 10.14.5 for kustomize version 2.1.0 installed via Homebrew formula when trying to build for overlay of config map where namespace does not match.

The base config-map.yaml is as follows:

apiVersion: v1
kind: ConfigMap

metadata:
  name: hello-world-map
  namespace: hello-world-ns

data: {}

The overlay config-map.yml is as follows:

apiVersion: v1
kind: ConfigMap

metadata:
  name: hello-world-map

data:
  ingress_host: "example.org"

We get the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4a95c01]

goroutine 1 [running]:
sigs.k8s.io/kustomize/k8sdeps/transformer/patch.(*transformer).Transform(0xc0003961e0, 0x4eb1c00, 0xc000349080, 0x6400d98, 0x4015a2a)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/k8sdeps/transformer/patch/transformer.go:51 +0x341
sigs.k8s.io/kustomize/pkg/transformers.(*multiTransformer).transform(0xc00050eb80, 0x4eb1c00, 0xc000349080, 0x1, 0x6)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/transformers/multitransformer.go:60 +0x79
sigs.k8s.io/kustomize/pkg/transformers.(*multiTransformer).Transform(0xc00050eb80, 0x4eb1c00, 0xc000349080, 0x6, 0xc0004276e0)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/transformers/multitransformer.go:56 +0x84
sigs.k8s.io/kustomize/pkg/accumulator.(*ResAccumulator).Transform(...)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/accumulator/resaccumulator.go:133
sigs.k8s.io/kustomize/pkg/target.(*KustTarget).runTransformers(0xc000294440, 0xc0002a72f0, 0x0, 0x0)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/target/kusttarget.go:322 +0x3fb
sigs.k8s.io/kustomize/pkg/target.(*KustTarget).AccumulateTarget(0xc000294440, 0xc000162200, 0xc000130170, 0xc000347c78)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/target/kusttarget.go:241 +0x2b6
sigs.k8s.io/kustomize/pkg/target.(*KustTarget).makeCustomizedResMap(0xc000294440, 0x1, 0xc0000cc798, 0x4e60560, 0x57414d8, 0xc00039ebf0)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/target/kusttarget.go:126 +0x2f
sigs.k8s.io/kustomize/pkg/target.(*KustTarget).MakeCustomizedResMap(...)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/target/kusttarget.go:117
sigs.k8s.io/kustomize/pkg/commands/build.(*Options).RunBuild(0xc000336480, 0x4e60420, 0xc0000c8000, 0x4e8d860, 0x57414d8, 0x4ea3560, 0x57414d8, 0xc0000cc798, 0x4e60560, 0x57414d8, ...)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/commands/build/build.go:130 +0x145
sigs.k8s.io/kustomize/pkg/commands/build.NewCmdBuild.func1(0xc0002a4000, 0xc00039ed90, 0x1, 0x1, 0x0, 0x0)
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/pkg/commands/build/build.go:80 +0x193
github.com/spf13/cobra.(*Command).execute(0xc0002a4000, 0xc00039ed50, 0x1, 0x1, 0xc0002a4000, 0xc00039ed50)
	/private/tmp/kustomize-20190619-88330-1s3g6c/pkg/mod/github.com/spf13/[email protected]/command.go:756 +0x465
github.com/spf13/cobra.(*Command).ExecuteC(0xc000139900, 0x4acb8a4, 0xc000347f88, 0xc0000a2058)
	/private/tmp/kustomize-20190619-88330-1s3g6c/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
	/private/tmp/kustomize-20190619-88330-1s3g6c/pkg/mod/github.com/spf13/[email protected]/command.go:794
main.main()
	/private/tmp/kustomize-20190619-88330-1s3g6c/src/kubernetes-sigs/kustomize/cmd/kustomize/main.go:13 +0x28

If the namespace is copied to the overlay no error occurs.

The expected result should be a meaningful validation message.

@jbrette
Copy link
Contributor

jbrette commented Jun 21, 2019

@rgladwell This has been addressed by the following pull request: #1206

@Liujingfang1 Liujingfang1 added the kind/bug Categorizes issue or PR as related to a bug. label Jun 26, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 24, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 24, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants