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

kwatch with no config.yaml present panics after warning about config.yaml file not found #122

Open
jfkw opened this issue Jul 26, 2022 · 0 comments

Comments

@jfkw
Copy link

jfkw commented Jul 26, 2022

Describe the bug

With kwatch v0.6.1 built using go1.18.4, running kwatch with no config.yaml in present directory, the kwatch application panics after issuing WARN about the missing config file:

$ ./kwatch
INFO[0000] :tada: kwatch@dev just started!
WARN[0000] unable to load config file: open config.yaml: no such file or directory
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 1 [running]:
github.com/abahmed/kwatch/util.GetProviders()
        /home/abuild/rpmbuild/BUILD/kwatch-0.6.1/util/util.go:121 +0x1316
main.main()
        /home/abuild/rpmbuild/BUILD/kwatch-0.6.1/main.go:36 +0x1f3


$ ./kwatch --help
INFO[0000] :tada: kwatch@dev just started!
WARN[0000] unable to load config file: open config.yaml: no such file or directory
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 1 [running]:
github.com/abahmed/kwatch/util.GetProviders()
        /home/abuild/rpmbuild/BUILD/kwatch-0.6.1/util/util.go:121 +0x1316
main.main()
        /home/abuild/rpmbuild/BUILD/kwatch-0.6.1/main.go:36 +0x1f3

To Reproduce

Build kwatch v0.6.1 built using go1.18.4. Execute kwatch binary in a directory with no config.yaml and none present in locations expected by kwatch

Expected behavior

Warning that a config file is needed (this is the case currently) followed by instructions on how to create a valid minimal one.

Better yet would be if kwatch had defaults (even if empty / no-op) and only required a config file be present for operations that connect to a Kubernetes instance. E.g. kwatch --help should execute with no configuration file found.

Actual behavior

Warning (expected) followed by panic (unexpected).

Version/Commit

kwatch v0.6.1 built using go1.18.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant