-
Notifications
You must be signed in to change notification settings - Fork 594
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
chore(flags) remove deprecated flags #866
Conversation
Remove deprecated 0.x.x flags. Remove logic for giving deprecated flags precedece. Update docs to mention modern flags only.
cli/ingress-controller/flags.go
Outdated
kongAdminURL = newURL | ||
flagURL := viper.GetString("kong-admin-url") | ||
if flagURL != defaultKongAdminURL { | ||
kongAdminURL = flagURL | ||
} |
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.
This should be simplified further as the complicated logic is going away:
config.KongAdminURL = viper.GetString("kong-admin-url")
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.
Not blocking:
Food for thought: we might want to drop all the binding (config.Xxx = viper.GetXxx(Xxx)
) logic by unmarshaling from viper directly into a config
struct:
https://godoc.org/github.com/spf13/viper#UnmarshalExact
It would be even easier if we weren't using viper (because we could declare StringVar
, IntVar
instead of String
, Int
which would write directly to the config
struct) but we need viper as long as we want to support the flag/envvar dualism of config values.
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.
tracked in #868
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.
👍
Remaining if block (for |
What this PR does / why we need it:
Remove deprecated 0.x.x flags. Remove logic for giving deprecated flags
precedece. Update docs to mention modern flags only.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #840Special notes for your reviewer:
Related tests removed entirely, as we no longer have any deprecated flags. Will we have any in the future? Probably. Figured it made more sense to cut out the existing tests entirely for now rather than leaving no-op stubs. We can always retrieve the old diff assuming we need to re-add similar tests later for future deprecations.