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

control-plane: config by yaml and envs #69

Merged
merged 5 commits into from
Jul 25, 2019
Merged

Conversation

jakubdyszkiewicz
Copy link
Contributor

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 in config.go next to server.go and PostgresStoreConfig could be near postgresResourceStore

envconfig contains full environment variable name on leaves instead of embedding, since weird behaviour of this lib kelseyhightower/envconfig#148

Copy link
Contributor

@yskopets yskopets left a 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/config/loader.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/config.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/config.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/config.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/config.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/config.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/config.go Outdated Show resolved Hide resolved
components/konvoy-control-plane/pkg/config/loader.go Outdated Show resolved Hide resolved
Copy link
Contributor

@yskopets yskopets left a 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.

@jakubdyszkiewicz jakubdyszkiewicz merged commit 90df05c into master Jul 25, 2019
@yskopets yskopets deleted the feature/config branch August 13, 2019 22:28
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

Successfully merging this pull request may close these issues.

None yet

2 participants