Skip to content
New issue

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

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

Already on GitHub? # to your account

Panic occurs when config on disk is not equivalent to app config #40

Closed
spiffcs opened this issue Feb 5, 2024 · 0 comments · Fixed by #41
Closed

Panic occurs when config on disk is not equivalent to app config #40

spiffcs opened this issue Feb 5, 2024 · 0 comments · Fixed by #41
Labels
bug Something isn't working

Comments

@spiffcs
Copy link
Contributor

spiffcs commented Feb 5, 2024

What happened:
When migrating between versions of syft a user encountered the following when trying to see the new help command:

./syft
panic: error loading config object: `:`: 1 error(s) decoding:

* 'file' expected a map, got 'string'

goroutine 1 [running]:
github.com/anchore/clio.showConfigInRootHelp.func1(0x14000466300, {0x1047c3320, 0x0, 0x0})
        /home/runner/go/pkg/mod/github.com/anchore/clio@v0.0.0-20231016125544-c98a83e1c7fc/help_template.go:65 +0x350
github.com/spf13/cobra.(*Command).Help(0x140006f5ab8?)

What you expected to happen:
No panic should occur and the command using clio should surface an error loading the config

How to reproduce it (as minimally and precisely as possible):

  • Download the latest version of syft
  • Change the file field in the config from a map to empty string file: ''

Anything else we need to know?:

#39

@spiffcs spiffcs added the bug Something isn't working label Feb 5, 2024
@kzantow kzantow closed this as completed Feb 10, 2024
@kzantow kzantow linked a pull request Feb 10, 2024 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants