-
Notifications
You must be signed in to change notification settings - Fork 218
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
feat: support config versioning #1225
Conversation
…to config-version * 'config-version' of https://github.com/flipt-io/flipt:
@@ -173,6 +181,15 @@ func bindEnvVars(v *viper.Viper, prefix string, field reflect.StructField) { | |||
v.MustBindEnv(key) | |||
} | |||
|
|||
func (c *Config) validate() (err error) { | |||
if c.Version != "" { | |||
if strings.TrimSpace(c.Version) != "1.0" { |
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.
id like to make this smarter in the future, potentially using some form of semver parsing (to two places x.x
), wyt?
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.
Yeah, that could be good. Like a way to ratchet up minor version changes in the config.
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.
Nice. Very valuable going forward.
adds optional version number support to our config