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: verify the weight of the alb at the end of the rollout #3627

Merged
merged 8 commits into from
Jun 12, 2024

Conversation

zachaller
Copy link
Collaborator

@zachaller zachaller commented Jun 11, 2024

At the end of the rollout when we auto set the weight to the max (100%) etc. we should verify the weight. If we don't this can actually cause issues even with target group verification at the end of the rollout. The reason is the ALB controller can be slow to update for many reasons, which means we can actually verify target groups successfully and start tearing down old pods before we have shifted the weight over to the new service.

Copy link
Contributor

github-actions bot commented Jun 11, 2024

Go Published Test Results

2 163 tests   2 163 ✅  2m 54s ⏱️
  119 suites      0 💤
    1 files        0 ❌

Results for commit 68c6f6f.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.26%. Comparing base (32d50b7) to head (68c6f6f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3627   +/-   ##
=======================================
  Coverage   80.26%   80.26%           
=======================================
  Files         156      156           
  Lines       17969    17970    +1     
=======================================
+ Hits        14423    14424    +1     
  Misses       2634     2634           
  Partials      912      912           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Jun 11, 2024

E2E Tests Published Test Results

  4 files    4 suites   3h 29m 12s ⏱️
110 tests  95 ✅  6 💤  9 ❌
454 runs  417 ✅ 24 💤 13 ❌

For more details on these failures, see this check.

Results for commit 68c6f6f.

♻️ This comment has been updated with latest results.

Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Signed-off-by: Zach Aller <[email protected]>
Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

Please check my comment.

// At the end of the rollout we need to verify the weight is correct, and return an error if not because we don't want the rest of the
// reconcile process to continue. We don't need to do this if we are in the middle of the rollout because the rest of the reconcile
// process won't scale down the old replicasets yet due to being in the middle of some steps.
if *weightVerified == false && desiredWeight == weightutil.MaxTrafficWeight(c.rollout) && len(c.rollout.Spec.Strategy.Canary.Steps) >= int(*c.rollout.Status.CurrentStepIndex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We already know that *weightVerified is false given the if condition above. I think it is safe to remove this condition.

Copy link

sonarcloud bot commented Jun 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
9.6% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

LGTM

@zachaller zachaller merged commit e20bcde into argoproj:master Jun 12, 2024
23 checks passed
zachaller added a commit that referenced this pull request Jun 13, 2024
* fix: verify the weight of the alb at the end of the rollout when we auto set max weight

Signed-off-by: Zach Aller <[email protected]>

* add unit test

Signed-off-by: Zach Aller <[email protected]>

* refactor add unit test

Signed-off-by: Zach Aller <[email protected]>

* Trigger Build

Signed-off-by: Zach Aller <[email protected]>

* Trigger Build

Signed-off-by: Zach Aller <[email protected]>

* block reconcile

Signed-off-by: Zach Aller <[email protected]>

* add tests

Signed-off-by: Zach Aller <[email protected]>

* rename test and cleanup un-need logic check

Signed-off-by: Zach Aller <[email protected]>

---------

Signed-off-by: Zach Aller <[email protected]>
zachaller added a commit that referenced this pull request Jun 13, 2024
* fix: verify the weight of the alb at the end of the rollout when we auto set max weight

Signed-off-by: Zach Aller <[email protected]>

* add unit test

Signed-off-by: Zach Aller <[email protected]>

* refactor add unit test

Signed-off-by: Zach Aller <[email protected]>

* Trigger Build

Signed-off-by: Zach Aller <[email protected]>

* Trigger Build

Signed-off-by: Zach Aller <[email protected]>

* block reconcile

Signed-off-by: Zach Aller <[email protected]>

* add tests

Signed-off-by: Zach Aller <[email protected]>

* rename test and cleanup un-need logic check

Signed-off-by: Zach Aller <[email protected]>

---------

Signed-off-by: Zach Aller <[email protected]>
@zachaller zachaller added the cherry-pick-completed Used once we have cherry picked the PR to all requested releases label Jun 13, 2024
anandf added a commit to anandf/argo-rollouts that referenced this pull request Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/release-1.6 cherry-pick/release-1.7 cherry-pick-completed Used once we have cherry picked the PR to all requested releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants