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

invalid memory address or nil pointer dereference from kustomize edit fix --vars #5323

Closed
yujunz opened this issue Sep 8, 2023 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@yujunz
Copy link
Member

yujunz commented Sep 8, 2023

What happened?

kustomize edit fix --vars
# Warning: 'vars' is deprecated. Please use 'replacements' instead. [EXPERIMENTAL] Run 'kustomize edit fix' to update your Kustomization automatically.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10117d1b4]

What did you expect to happen?

Update vars to replacements

How can we reproduce it (as minimally and precisely as possible)?

N/A

Expected output

Update vars to replacements

Actual output

kustomize edit fix --vars
# Warning: 'vars' is deprecated. Please use 'replacements' instead. [EXPERIMENTAL] Run 'kustomize edit fix' to update your Kustomization automatically.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10117d1b4]

goroutine 1 [running]:
sigs.k8s.io/kustomize/api/types.(*Selector).Copy(...)
	sigs.k8s.io/kustomize/api/types/selector.go:32
sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix.writePatchTargets({{0x140007f2e70, 0x16}, {0x0, 0x0}, 0x0, 0x0}, 0x101455b18?, {0x14002674910, 0x1, 0x3?}, ...)
	sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix/convert.go:287 +0x64
sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix.constructTargets({0x140018a7bc0?, 0x1400179cb00?}, 0x1014611d0?, {0x14002674910?, 0x1, 0x1}, {0x14002439b58, 0x1, 0x1})
	sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix/convert.go:244 +0x198
sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix.addTargets(0x140011b3b40, {0x1400179cb00, 0xe}, {0x1400101f200?, 0x9, 0x7?}, {0x1014611d0, 0x1019e2888})
	sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix/convert.go:120 +0x128
sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix.ConvertVarsToReplacements({0x1014611d0, 0x1019e2888}, 0x14000e098c0)
	sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix/convert.go:36 +0x234
sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix.RunFix({0x1014611d0, 0x1019e2888}, {0x101457398, 0x14000010018})
	sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix/fix.go:63 +0xe0
sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix.NewCmdFix.func1(0x1400023af00?, {0x10119029b?, 0x1?, 0x1?})
	sigs.k8s.io/kustomize/kustomize/v5/commands/edit/fix/fix.go:35 +0x2c
github.com/spf13/cobra.(*Command).execute(0x1400023af00, {0x140001f9d30, 0x1, 0x1})
	github.com/spf13/[email protected]/command.go:940 +0x5c8
github.com/spf13/cobra.(*Command).ExecuteC(0x1400027a000)
	github.com/spf13/[email protected]/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(0x13267a0?)
	github.com/spf13/[email protected]/command.go:992 +0x1c
main.main()
	sigs.k8s.io/kustomize/kustomize/v5/main.go:14 +0x20

Kustomize version

v5.1.1

Operating system

None

@yujunz yujunz added the kind/bug Categorizes issue or PR as related to a bug. label Sep 8, 2023
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 8, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@annasong20
Copy link
Contributor

Cannot reproduce. Closing as completed by #5211. Please re-open with more details if this was closed prematurely.
/close

@k8s-ci-robot
Copy link
Contributor

@annasong20: Closing this issue.

In response to this:

Cannot reproduce. Closing as completed by #5211. Please re-open with more details if this was closed prematurely.
/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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

3 participants