From 68c6f6fa35e028cc839ea31bc9709c18c8f13393 Mon Sep 17 00:00:00 2001 From: Zach Aller Date: Wed, 12 Jun 2024 11:24:57 -0500 Subject: [PATCH] rename test and cleanup un-need logic check Signed-off-by: Zach Aller --- rollout/trafficrouting.go | 2 +- rollout/trafficrouting_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rollout/trafficrouting.go b/rollout/trafficrouting.go index fd0c91decc..e992277a57 100644 --- a/rollout/trafficrouting.go +++ b/rollout/trafficrouting.go @@ -291,7 +291,7 @@ func (c *rolloutContext) reconcileTrafficRouting() error { // 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) { + if desiredWeight == weightutil.MaxTrafficWeight(c.rollout) && len(c.rollout.Spec.Strategy.Canary.Steps) >= int(*c.rollout.Status.CurrentStepIndex) { return fmt.Errorf("end of rollout, desired weight %d not yet verified", desiredWeight) } } diff --git a/rollout/trafficrouting_test.go b/rollout/trafficrouting_test.go index 3c5eda4205..f358a18f64 100644 --- a/rollout/trafficrouting_test.go +++ b/rollout/trafficrouting_test.go @@ -130,7 +130,7 @@ func TestReconcileTrafficRoutingVerifyWeightFalse(t *testing.T) { assert.True(t, enqueued) } -func TestReconcileTrafficRoutingVerifyWeightDesiredWeight100(t *testing.T) { +func TestReconcileTrafficRoutingVerifyWeightEndOfRollout(t *testing.T) { f := newFixture(t) defer f.Close()