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

fix: zero-value abortScaleDownDelay was not honored with setCanaryScale #1375

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

jessesuen
Copy link
Member

@jessesuen jessesuen commented Jul 27, 2021

Recent PR did not rebase ontop of new scaledowndelay on abort behavior and the two caused a conflict in behavior

Signed-off-by: Jesse Suen jesse_suen@intuit.com

@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #1375 (14f8ffa) into master (e5a933d) will increase coverage by 0.02%.
The diff coverage is 96.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1375      +/-   ##
==========================================
+ Coverage   81.29%   81.31%   +0.02%     
==========================================
  Files         108      108              
  Lines       10033    10037       +4     
==========================================
+ Hits         8156     8162       +6     
+ Misses       1317     1315       -2     
  Partials      560      560              
Impacted Files Coverage Δ
utils/replicaset/canary.go 82.56% <75.00%> (+0.91%) ⬆️
rollout/replicaset.go 68.42% <100.00%> (+0.89%) ⬆️
rollout/sync.go 76.47% <100.00%> (ø)
utils/defaults/defaults.go 91.30% <100.00%> (+2.59%) ⬆️
rollout/trafficrouting/istio/controller.go 43.41% <0.00%> (-2.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5a933d...14f8ffa. Read the comment docs.

@jessesuen jessesuen changed the title test: fix broken assumption of scaledown on abort in e2e test fix: zero-value abortScaleDownDelay was not honored with setCanaryScale Jul 28, 2021
@jessesuen jessesuen force-pushed the fix-e2e-breakage branch 2 times, most recently from 3f07cc9 to 7c66320 Compare July 28, 2021 00:48
@jessesuen
Copy link
Member Author

Still trying to fix tests.

Signed-off-by: Jesse Suen <jesse_suen@intuit.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 29, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
2.1% 2.1% Duplication

@@ -53,7 +53,7 @@ func (c *rolloutContext) addScaleDownDelay(rs *appsv1.ReplicaSet, scaleDownDelay
}
return nil
}
deadline := metav1.Now().Add(scaleDownDelaySeconds * time.Second).UTC().Format(time.RFC3339)
deadline := metav1.Now().Add(scaleDownDelaySeconds).UTC().Format(time.RFC3339)
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed confusing method behavior where duration was expected to be supplied in nanoseconds.

Copy link
Member Author

Choose a reason for hiding this comment

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

All callers of this method were supplying scaleDownDelaySeconds in nanosecond duration. I also changed the callers to simply supply proper durations.

} else {
abortScaleDownDelaySeconds := time.Duration(defaults.GetAbortScaleDownDelaySecondsOrDefault(c.rollout))
err = c.addScaleDownDelay(c.newRS, abortScaleDownDelaySeconds)
} else if abortScaleDownDelaySeconds != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this condition check required as it is verified in shouldDelayScaleDownOnAbort

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right that it's not required. But I was trying to be defensive here in case there was a bug or change in behavior to shouldDelayScaleDownOnAbort().

Copy link
Contributor

@khhirani khhirani left a comment

Choose a reason for hiding this comment

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

LGTM

@jessesuen jessesuen merged commit 08ccedc into argoproj:master Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants