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

fix: enforce yaml config #63 #81

Merged
merged 1 commit into from
Dec 13, 2022
Merged

fix: enforce yaml config #63 #81

merged 1 commit into from
Dec 13, 2022

Conversation

raffis
Copy link
Owner

@raffis raffis commented Dec 13, 2022

Current situation

Currently the exporter requires a .yaml suffix for the config file, otherwise it fails to start:

panic: Unsupported Config Type ""

goroutine 1 [running]:
github.com/raffis/mongodb-query-exporter/cmd.initConfig()
	/home/raffi/mongodb-query-exporter/cmd/root.go:169 +0x125
github.com/spf13/cobra.(*Command).preRun(...)
	/home/raffi/.gvm/pkgsets/go1.18/global/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:946
github.com/spf13/cobra.(*Command).execute(0x12ab340, {0xc000032190, 0x2, 0x2})
	/home/raffi/.gvm/pkgsets/go1.18/global/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:876 +0x563
github.com/spf13/cobra.(*Command).ExecuteC(0x12ab340)
	/home/raffi/.gvm/pkgsets/go1.18/global/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	/home/raffi/.gvm/pkgsets/go1.18/global/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/raffis/mongodb-query-exporter/cmd.Execute(...)
	/home/raffi/mongodb-query-exporter/cmd/root.go:118
main.main()
	/home/raffi/mongodb-query-exporter/main.go:8 +0x25
exit status 2

Proposal

Config type is now always yaml no matter the file suffix given.

@raffis raffis merged commit 53cc493 into master Dec 13, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant