-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add backoff rules to provider config #187
Conversation
Code Climate has analyzed commit 1f4adf0 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 57.1% (50% is the threshold). This pull request will bring the total coverage in the repository to 55.8% (0.0% change). View more on Code Climate. |
@marioreggiori could you please have a look at this PoC? I am not quite sure if |
A constant might be sufficient too. But since we don't yet have data on how many steps are normal, a field in the provider config could be justifiable. I'd prefer a simple int value instead of a struct tho. And we should probably prefix it at least with |
fab9bcb
to
259a13e
Compare
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.
Some minor comments. Please remember to document changes in CHANGELOG.md
.
anx/provider/loadbalancer/reconciliation/reconciliation_test.go
Outdated
Show resolved
Hide resolved
anx/provider/loadbalancer/reconciliation/reconciliation_test.go
Outdated
Show resolved
Hide resolved
a41908e
to
7a5fecd
Compare
I kind of went down a rabbit-hole by adding tests to the configuration parsing, my current conclusion is that it currently isn't working as intended. With the current implementation the e.g.: defaults: AutoDiscoveryTagPrefix string `yaml:"autoDiscoveryTagPrefix,omitempty" split_words:"true" default:"anxkube-ccm-lb"`
LoadBalancerBackoffSteps int `yaml:"loadBalancerBackoffSteps" default:"10"` config: loadBalancerBackoffSteps: 123
autoDiscoveryTagPrefix: "awesome" resulting provider config:
I am thinking about switching to a more up-to-date env parsing library like env |
I can confirm that our NewProviderConfig function probably doesn't work as intended. I'm not sure if the lib you proposed solves the problem, as it also only reads env variables. spf13/viper might be something to consider. Ping @LittleFox94 |
caa3355
to
12791bd
Compare
As discussed, this will be part of a bigger refactoring task |
9a5f57c
to
1f4adf0
Compare
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.
LGTM 👍
Checklist
Unreleased
section in CHANGELOG.mdReferences
Community Note