Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

fix(defaults): Checks for set backoff and rate limit values #3890

Closed

Conversation

thomastaylor312
Copy link
Contributor

What this PR does / why we need it:
The defaults file was always setting rate limits and backoff to true for the azure cloud config. This checks if the value exists before setting defaults

Release note:

The defaults file was always setting rate limits and backoff to true for the azure cloud config. This checks if the value exists before setting defaults

…faulting

The defaults file was always setting rate limits and backoff to true for the azure
cloud config. This checks if the value exists before setting defaults
@acs-bot
Copy link

acs-bot commented Sep 21, 2018

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: thomastaylor312
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: brendandburns

If they are not already assigned, you can assign the PR to them by writing /assign @brendandburns in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@acs-bot acs-bot added the size/M label Sep 21, 2018
}
if o.KubernetesConfig.CloudProviderBackoffRetries == 0 {
o.KubernetesConfig.CloudProviderBackoffRetries = DefaultKubernetesCloudProviderBackoffRetries
if o.KubernetesConfig.CloudProviderBackoff {
Copy link
Contributor

Choose a reason for hiding this comment

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

where is the default for CloudProviderBackoff being set if it's nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a bool, so the zero value is false

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we should still set it to the default constant https://github.com/Azure/acs-engine/blob/master/pkg/acsengine/const.go#L82 in case we ever decide to change that default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but that probably shouldn't be set here. It could be the user has set it to false or that it defaulted to false

}
if o.KubernetesConfig.CloudProviderRateLimitBucket == 0 {
o.KubernetesConfig.CloudProviderRateLimitBucket = DefaultKubernetesCloudProviderRateLimitBucket
if o.KubernetesConfig.CloudProviderRateLimit && k8sSemVer.GTE(minVersion) {
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon Sep 21, 2018

Choose a reason for hiding this comment

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

same question with o.KubernetesConfig.CloudProviderRateLimit

if o.KubernetesConfig.CloudProviderRateLimitQPS == 0 {
o.KubernetesConfig.CloudProviderRateLimitQPS = DefaultKubernetesCloudProviderRateLimitQPS
}
if o.KubernetesConfig.CloudProviderRateLimitBucket == 0 {
Copy link
Contributor

@tariq1890 tariq1890 Sep 21, 2018

Choose a reason for hiding this comment

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

Could we have a helper method to get the values for these? The helper method would return a default value is the said field has nil or its equivalent as its value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were pre-existing. I do think that would be a good idea though.

@codecov
Copy link

codecov bot commented Sep 21, 2018

Codecov Report

Merging #3890 into master will decrease coverage by 0.1%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #3890      +/-   ##
==========================================
- Coverage   56.43%   56.32%   -0.11%     
==========================================
  Files         109      109              
  Lines       16569    16569              
==========================================
- Hits         9350     9333      -17     
- Misses       6414     6428      +14     
- Partials      805      808       +3

@thomastaylor312
Copy link
Contributor Author

@jackfrancis put together a more fully featured PR in #3891 that addresses this. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants