From 31816e603dc8da310f33f68fc33eeddd32688896 Mon Sep 17 00:00:00 2001 From: divyansh375 Date: Sun, 7 May 2023 15:24:26 +0530 Subject: [PATCH] fix: append weighted destination only when weight is mentioned Signed-off-by: divyansh375 --- rollout/trafficrouting_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rollout/trafficrouting_test.go b/rollout/trafficrouting_test.go index 7df0716695..16c4033eef 100644 --- a/rollout/trafficrouting_test.go +++ b/rollout/trafficrouting_test.go @@ -249,11 +249,11 @@ func TestRolloutWithExperimentStep(t *testing.T) { Replicas: pointer.Int32Ptr(1), Weight: pointer.Int32Ptr(5), }, - { - Name: "experiment-template-without-weight", - SpecRef: "stable", - Replicas: pointer.Int32Ptr(1), - }}, + { + Name: "experiment-template-without-weight", + SpecRef: "stable", + Replicas: pointer.Int32Ptr(1), + }}, }, }, } @@ -281,11 +281,11 @@ func TestRolloutWithExperimentStep(t *testing.T) { ServiceName: "experiment-service", PodTemplateHash: rs2PodHash, }, - { - Name: "experiment-template-without-weight", - ServiceName: "experiment-service-without-weight", - PodTemplateHash: rs2PodHash, - }} + { + Name: "experiment-template-without-weight", + ServiceName: "experiment-service-without-weight", + PodTemplateHash: rs2PodHash, + }} r2.Status.Canary.CurrentExperiment = ex.Name f.kubeobjects = append(f.kubeobjects, rs1, rs2, canarySvc, stableSvc) @@ -1054,4 +1054,4 @@ func TestDynamicScalingDecreaseWeightAccordingToStableAvailabilityWhenAbortedAnd f.fakeTrafficRouting.On("RemoveManagedRoutes", mock.Anything, mock.Anything).Return(nil) f.fakeTrafficRouting.On("VerifyWeight", mock.Anything).Return(pointer.BoolPtr(true), nil) f.run(getKey(r1, t)) -} \ No newline at end of file +}