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

Config file without .yaml extension is silently ignored #265

Closed
abitrolly opened this issue Dec 25, 2019 · 1 comment
Closed

Config file without .yaml extension is silently ignored #265

abitrolly opened this issue Dec 25, 2019 · 1 comment

Comments

@abitrolly
Copy link
Contributor

✗ dive --config dive.yaml --source podman fcc
Using config file: dive.yaml
...
✗ mv dive.yaml dive.cfg
✗ dive --config dive.cfg --source podman fcc
Image Source: podman://fcc
...

I did expected dive to care about config file extension. Strange that no error is shown.

@abitrolly
Copy link
Contributor Author

dive/cmd/root.go

Lines 69 to 70 in 8d8c84c

filepathToCfg := getCfgFile(cfgFile)
viper.SetConfigFile(filepathToCfg)

Instead of viper.SetConfigFile, viper.AddConfigPath can be used to detect and load default configs https://github.com/spf13/viper#reading-config-files

wagoodman added a commit that referenced this issue Feb 9, 2020
Do not ignore missing file from --config option (fixes #265)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant