Skip to content

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/[email protected]/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/[email protected]/command.go:876 +0x563
github.com/spf13/cobra.(*Command).ExecuteC(0x12ab340)
	/home/raffi/.gvm/pkgsets/go1.18/global/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	/home/raffi/.gvm/pkgsets/go1.18/global/pkg/mod/github.com/spf13/[email protected]/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
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