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

Add backoff rules to provider config #187

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

eiabea
Copy link
Contributor

@eiabea eiabea commented Apr 4, 2023

Checklist

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request

@eiabea eiabea requested a review from marioreggiori April 4, 2023 14:21
@codeclimate
Copy link

codeclimate bot commented Apr 4, 2023

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.

@eiabea
Copy link
Contributor Author

eiabea commented Apr 4, 2023

@marioreggiori could you please have a look at this PoC? I am not quite sure if ProviderConfig is the correct place for this settings and if we should put even more parameters in there to justify the new struct

@marioreggiori
Copy link
Contributor

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 LoadBalancer.

@eiabea eiabea force-pushed the anxkube-840/configure-backoff-rules branch from fab9bcb to 259a13e Compare April 5, 2023 12:38
@eiabea eiabea marked this pull request as ready for review April 5, 2023 12:38
Copy link
Contributor

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

@eiabea eiabea force-pushed the anxkube-840/configure-backoff-rules branch from a41908e to 7a5fecd Compare April 6, 2023 10:07
@eiabea
Copy link
Contributor Author

eiabea commented Apr 6, 2023

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 default: foo of envconf is "stronger" than actual values in the yaml config file

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:

{   anxkube-ccm-lb false  [] [] 10}

I am thinking about switching to a more up-to-date env parsing library like env

@marioreggiori
Copy link
Contributor

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 default: foo of envconf is "stronger" than actual values in the yaml config file

...

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

@eiabea eiabea force-pushed the anxkube-840/configure-backoff-rules branch from caa3355 to 12791bd Compare April 12, 2023 16:12
@eiabea
Copy link
Contributor Author

eiabea commented Apr 12, 2023

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 default: foo of envconf is "stronger" than actual values in the yaml config file
...
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

As discussed, this will be part of a bigger refactoring task

@eiabea eiabea force-pushed the anxkube-840/configure-backoff-rules branch from 9a5f57c to 1f4adf0 Compare April 12, 2023 17:02
@eiabea eiabea requested a review from marioreggiori April 12, 2023 17:04
Copy link
Contributor

@marioreggiori marioreggiori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@eiabea eiabea merged commit a635ceb into main Apr 13, 2023
@LittleFox94 LittleFox94 added enhancement New feature or request patch labels Apr 15, 2023
@marioreggiori marioreggiori deleted the anxkube-840/configure-backoff-rules branch May 2, 2023 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants