-
Notifications
You must be signed in to change notification settings - Fork 327
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
control-plane: config by yaml and envs #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I/Should I separate config location for each feature? For example ApiServerConfig could reside in config.go next to server.go and PostgresStoreConfig could be near postgresResourceStore
Indeed, I would to prefer to see configuration split into pieces.
But instead of putting them next to implementation code, they should remain under pkg/config
.
E.g., like it was discussed in #48 (comment)
components/konvoy-control-plane/pkg/plugins/resources/postgres/store_test.go
Outdated
Show resolved
Hide resolved
cf813ac
to
5081494
Compare
components/konvoy-control-plane/pkg/config/app/konvoy-cp/config.go
Outdated
Show resolved
Hide resolved
components/konvoy-control-plane/pkg/config/app/konvoy-cp/config.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor issues to be fixed before the merge.
8c9130c
to
c3e54ea
Compare
This PR introduces config by YAML and ENV variables.
First YAML file is loaded, then ENV variables. Env vars can override yaml config.
Config file is not mandatory for Konvoy Control Plane to run, you can configure everything by env vars.
Can I/Should I separate config location for each feature? For example
ApiServerConfig
could reside inconfig.go
next toserver.go
andPostgresStoreConfig
could be nearpostgresResourceStore
envconfig
contains full environment variable name on leaves instead of embedding, since weird behaviour of this lib kelseyhightower/envconfig#148