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 violation when run cc #18

Closed
sn3d opened this issue Jul 24, 2023 · 0 comments · Fixed by #19
Closed

segmentation violation when run cc #18

sn3d opened this issue Jul 24, 2023 · 0 comments · Fixed by #19
Assignees
Labels
bug Something isn't working

Comments

@sn3d
Copy link
Owner

sn3d commented Jul 24, 2023

When I run kconf cc, I've got

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x104a2b73c]

goroutine 1 [running]:
github.com/sn3d/kconf/pkg/tui.ShowContextList({0x14000030e80, 0x20}, {0x1400020e400, 0x37}, 0x1400000e978)
	/home/runner/work/kconf/kconf/pkg/tui/context_list.go:69 +0x14c
github.com/sn3d/kconf/cmd/kconf/cc.showList(...)
	/home/runner/work/kconf/kconf/cmd/kconf/cc/cc.go:51
github.com/sn3d/kconf/cmd/kconf/cc.glob..func1(0x1400010d680)
	/home/runner/work/kconf/kconf/cmd/kconf/cc/cc.go:33 +0xbc
github.com/urfave/cli/v2.(*Command).Run(0x1050207e0, 0x1400010d680, {0x14000177190, 0x1, 0x1})
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.24.3/command.go:273 +0x75c
github.com/urfave/cli/v2.(*Command).Run(0x1400011ef20, 0x1400010d540, {0x1400001e040, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.24.3/command.go:266 +0x97c
github.com/urfave/cli/v2.(*App).RunContext(0x1400019a3c0, {0x104c5a978?, 0x1400002a0c8}, {0x1400001e040, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.24.3/app.go:332 +0x604
github.com/urfave/cli/v2.(*App).Run(...)
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.24.3/app.go:309

This is caused in kubeconf file when context is refering to cluster which is not existing in YAML

@sn3d sn3d added the bug Something isn't working label Jul 24, 2023
@sn3d sn3d self-assigned this Jul 24, 2023
@sn3d sn3d linked a pull request Jul 24, 2023 that will close this issue
@sn3d sn3d closed this as completed in #19 Jul 24, 2023
sn3d added a commit that referenced this issue Jul 24, 2023
When you do kconf cc for a kubeconfig file, where is context reffering
to non-existing cluster, the app will crash. That's because I always
expected the existing cluster - not broken configuration.

Anyway even broken configuration should somehow work. I've fixed it by
checking if cluster exist. If not, then the empty URL is used in list.

see #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant