From 39b0fca63fc5879f20f354d1992d252653b9504a Mon Sep 17 00:00:00 2001 From: zachaller Date: Mon, 28 Mar 2022 09:02:11 -0500 Subject: [PATCH 01/10] fix: Use actual weight from status field on rollout object This fixes #1812 by pulling the actual weight from the status field instead of the SetWeight. Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/rollout_info.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/kubectl-argo-rollouts/info/rollout_info.go b/pkg/kubectl-argo-rollouts/info/rollout_info.go index f50e778ed5..90f5b13ec6 100644 --- a/pkg/kubectl-argo-rollouts/info/rollout_info.go +++ b/pkg/kubectl-argo-rollouts/info/rollout_info.go @@ -65,7 +65,11 @@ func NewRolloutInfo( } } } else { - roInfo.ActualWeight = roInfo.SetWeight + if ro.Status.Canary.Weights != nil { + roInfo.ActualWeight = fmt.Sprintf("%d", ro.Status.Canary.Weights.Canary.Weight) + } else { + roInfo.ActualWeight = "n/a" + } } } } else if ro.Spec.Strategy.BlueGreen != nil { From 94ccef683ddf1699b9d34b6c9d836929e2249e2e Mon Sep 17 00:00:00 2001 From: zachaller Date: Wed, 30 Mar 2022 21:52:22 -0500 Subject: [PATCH 02/10] Per feedback setting to actual weight to roInfo.SetWeight when not availabe in status Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/rollout_info.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubectl-argo-rollouts/info/rollout_info.go b/pkg/kubectl-argo-rollouts/info/rollout_info.go index 90f5b13ec6..98bfffb89c 100644 --- a/pkg/kubectl-argo-rollouts/info/rollout_info.go +++ b/pkg/kubectl-argo-rollouts/info/rollout_info.go @@ -68,7 +68,7 @@ func NewRolloutInfo( if ro.Status.Canary.Weights != nil { roInfo.ActualWeight = fmt.Sprintf("%d", ro.Status.Canary.Weights.Canary.Weight) } else { - roInfo.ActualWeight = "n/a" + roInfo.ActualWeight = roInfo.SetWeight } } } From 9c655e867f21d7435b7ce47a75eef1888c6a56e1 Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 09:18:03 -0500 Subject: [PATCH 03/10] fix: add test cases Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/info_test.go | 12 +++ .../info/testdata/canary/canary-rollout5.yaml | 96 +++++++++++++++++++ .../info/testdata/canary/canary-rollout6.yaml | 87 +++++++++++++++++ 3 files changed, 195 insertions(+) create mode 100644 pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml create mode 100644 pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml diff --git a/pkg/kubectl-argo-rollouts/info/info_test.go b/pkg/kubectl-argo-rollouts/info/info_test.go index 33515e9ad4..c6f84e5187 100644 --- a/pkg/kubectl-argo-rollouts/info/info_test.go +++ b/pkg/kubectl-argo-rollouts/info/info_test.go @@ -1,6 +1,7 @@ package info import ( + "strconv" "testing" "time" @@ -35,6 +36,17 @@ func TestCanaryRolloutInfo(t *testing.T) { Tags: []string{InfoTagStable}, }, }) + + roInfo = NewRolloutInfo(rolloutObjs.Rollouts[4], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) + actualWeightString := roInfo.ActualWeight + actualWeightStringInt32, err := strconv.ParseInt(actualWeightString, 10, 32) + if err != nil { + t.Error(err) + } + assert.Equal(t, rolloutObjs.Rollouts[4].Status.Canary.Weights.Canary.Weight, int32(actualWeightStringInt32)) + + roInfo = NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) + assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) } func TestPingPongCanaryRolloutInfo(t *testing.T) { diff --git a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml new file mode 100644 index 0000000000..158bda3bf4 --- /dev/null +++ b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml @@ -0,0 +1,96 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Rollout +metadata: + annotations: + rollout.argoproj.io/revision: "31" + creationTimestamp: "2019-10-25T06:07:18Z" + generation: 429 + labels: + app: canary-demo + app.kubernetes.io/instance: jesse-test + name: canary-demo + namespace: jesse-test + resourceVersion: "28253567" + selfLink: /apis/argoproj.io/v1alpha1/namespaces/jesse-test/rollouts/canary-demo + uid: b350ba76-f6ed-11e9-a15b-42010aa80033 +spec: + progressDeadlineSeconds: 30 + replicas: 5 + revisionHistoryLimit: 3 + selector: + matchLabels: + app: canary-demo + strategy: + canary: + canaryService: canary-demo-preview + stableService: canary-demo-stable + trafficRouting: + smi: + rootService: root-svc # optional + trafficSplitName: rollout-example-traffic-split # optional + steps: + - setWeight: 20 + - pause: {} + - setWeight: 40 + - pause: + duration: 10s + - setWeight: 60 + - pause: + duration: 10s + - setWeight: 80 + - pause: + duration: 10s + template: + metadata: + creationTimestamp: null + labels: + app: canary-demo + spec: + containers: + - image: argoproj/rollouts-demo:does-not-exist + imagePullPolicy: Always + name: canary-demo + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 5m + memory: 32Mi +status: + HPAReplicas: 6 + availableReplicas: 5 + blueGreen: {} + canary: + weights: + canary: + podTemplateHash: 868d98998a + serviceName: canary-demo + weight: 20 + stable: + podTemplateHash: 877894d5b + serviceName: canary-demo + weight: 60 + stableRS: 877894d5b + conditions: + - lastTransitionTime: "2019-10-25T06:07:29Z" + lastUpdateTime: "2019-10-25T06:07:29Z" + message: Rollout has minimum availability + reason: AvailableReason + status: "True" + type: Available + - lastTransitionTime: "2019-10-28T04:52:55Z" + lastUpdateTime: "2019-10-28T04:52:55Z" + message: ReplicaSet "canary-demo-65fb5ffc84" has timed out progressing. + reason: ProgressDeadlineExceeded + status: "False" + type: Progressing + currentPodHash: 65fb5ffc84 + currentStepHash: f64cdc9d + currentStepIndex: 0 + observedGeneration: "429" + readyReplicas: 5 + replicas: 6 + selector: app=canary-demo + updatedReplicas: 1 diff --git a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml new file mode 100644 index 0000000000..82e483c222 --- /dev/null +++ b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml @@ -0,0 +1,87 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Rollout +metadata: + annotations: + rollout.argoproj.io/revision: "31" + creationTimestamp: "2019-10-25T06:07:18Z" + generation: 429 + labels: + app: canary-demo + app.kubernetes.io/instance: jesse-test + name: canary-demo + namespace: jesse-test + resourceVersion: "28253567" + selfLink: /apis/argoproj.io/v1alpha1/namespaces/jesse-test/rollouts/canary-demo + uid: b350ba76-f6ed-11e9-a15b-42010aa80033 +spec: + progressDeadlineSeconds: 30 + replicas: 5 + revisionHistoryLimit: 3 + selector: + matchLabels: + app: canary-demo + strategy: + canary: + canaryService: canary-demo-preview + stableService: canary-demo-stable + trafficRouting: + smi: + rootService: root-svc # optional + trafficSplitName: rollout-example-traffic-split # optional + steps: + - setWeight: 20 + - pause: {} + - setWeight: 40 + - pause: + duration: 10s + - setWeight: 60 + - pause: + duration: 10s + - setWeight: 80 + - pause: + duration: 10s + template: + metadata: + creationTimestamp: null + labels: + app: canary-demo + spec: + containers: + - image: argoproj/rollouts-demo:does-not-exist + imagePullPolicy: Always + name: canary-demo + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 5m + memory: 32Mi +status: + HPAReplicas: 6 + availableReplicas: 5 + blueGreen: {} + canary: {} + stableRS: 877894d5b + conditions: + - lastTransitionTime: "2019-10-25T06:07:29Z" + lastUpdateTime: "2019-10-25T06:07:29Z" + message: Rollout has minimum availability + reason: AvailableReason + status: "True" + type: Available + - lastTransitionTime: "2019-10-28T04:52:55Z" + lastUpdateTime: "2019-10-28T04:52:55Z" + message: ReplicaSet "canary-demo-65fb5ffc84" has timed out progressing. + reason: ProgressDeadlineExceeded + status: "False" + type: Progressing + currentPodHash: 65fb5ffc84 + currentStepHash: f64cdc9d + currentStepIndex: 0 + observedGeneration: "429" + readyReplicas: 5 + replicas: 6 + selector: app=canary-demo + updatedReplicas: 1 From 37a33fa1bd916754ba4b15ecaa1c08219de8f21d Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 09:22:50 -0500 Subject: [PATCH 04/10] fix: move to own test Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/info_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/kubectl-argo-rollouts/info/info_test.go b/pkg/kubectl-argo-rollouts/info/info_test.go index c6f84e5187..8a166f1fca 100644 --- a/pkg/kubectl-argo-rollouts/info/info_test.go +++ b/pkg/kubectl-argo-rollouts/info/info_test.go @@ -49,6 +49,20 @@ func TestCanaryRolloutInfo(t *testing.T) { assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) } +func TestCanaryRolloutInfoWeights(t *testing.T) { + rolloutObjs := testdata.NewCanaryRollout() + roInfo := NewRolloutInfo(rolloutObjs.Rollouts[4], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) + actualWeightString := roInfo.ActualWeight + actualWeightStringInt32, err := strconv.ParseInt(actualWeightString, 10, 32) + if err != nil { + t.Error(err) + } + assert.Equal(t, rolloutObjs.Rollouts[4].Status.Canary.Weights.Canary.Weight, int32(actualWeightStringInt32)) + + roInfo = NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) + assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) +} + func TestPingPongCanaryRolloutInfo(t *testing.T) { rolloutObjs := testdata.NewCanaryRollout() roInfo := NewRolloutInfo(rolloutObjs.Rollouts[3], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) From d6df60a743f669a526076181732505ac4e4b554b Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 10:11:09 -0500 Subject: [PATCH 05/10] fix: have unique names Signed-off-by: zachaller --- .../info/testdata/canary/canary-rollout5.yaml | 6 +++--- .../info/testdata/canary/canary-rollout6.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml index 158bda3bf4..83ddc7369f 100644 --- a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml +++ b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml @@ -6,12 +6,12 @@ metadata: creationTimestamp: "2019-10-25T06:07:18Z" generation: 429 labels: - app: canary-demo + app: canary-demo-weights app.kubernetes.io/instance: jesse-test - name: canary-demo + name: canary-demo-weights namespace: jesse-test resourceVersion: "28253567" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/jesse-test/rollouts/canary-demo + selfLink: /apis/argoproj.io/v1alpha1/namespaces/jesse-test/rollouts/canary-demo-weights uid: b350ba76-f6ed-11e9-a15b-42010aa80033 spec: progressDeadlineSeconds: 30 diff --git a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml index 82e483c222..3a84edb4cd 100644 --- a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml +++ b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml @@ -6,12 +6,12 @@ metadata: creationTimestamp: "2019-10-25T06:07:18Z" generation: 429 labels: - app: canary-demo + app: canary-demo-weights-na app.kubernetes.io/instance: jesse-test - name: canary-demo + name: canary-demo-weights-na namespace: jesse-test resourceVersion: "28253567" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/jesse-test/rollouts/canary-demo + selfLink: /apis/argoproj.io/v1alpha1/namespaces/jesse-test/rollouts/canary-demo-weights-na uid: b350ba76-f6ed-11e9-a15b-42010aa80033 spec: progressDeadlineSeconds: 30 From 16e59f51e48bcf286fde40e476695214ff47a452 Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 10:12:32 -0500 Subject: [PATCH 06/10] fix: correct all names in resources Signed-off-by: zachaller --- .../info/testdata/canary/canary-rollout5.yaml | 6 +++--- .../info/testdata/canary/canary-rollout6.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml index 83ddc7369f..2ea2c4436a 100644 --- a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml +++ b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout5.yaml @@ -19,7 +19,7 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - app: canary-demo + app: canary-demo-weights strategy: canary: canaryService: canary-demo-preview @@ -44,7 +44,7 @@ spec: metadata: creationTimestamp: null labels: - app: canary-demo + app: canary-demo-weights spec: containers: - image: argoproj/rollouts-demo:does-not-exist @@ -92,5 +92,5 @@ status: observedGeneration: "429" readyReplicas: 5 replicas: 6 - selector: app=canary-demo + selector: app=canary-demo-weights updatedReplicas: 1 diff --git a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml index 3a84edb4cd..54edf27937 100644 --- a/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml +++ b/pkg/kubectl-argo-rollouts/info/testdata/canary/canary-rollout6.yaml @@ -19,7 +19,7 @@ spec: revisionHistoryLimit: 3 selector: matchLabels: - app: canary-demo + app: canary-demo-weights-na strategy: canary: canaryService: canary-demo-preview @@ -44,7 +44,7 @@ spec: metadata: creationTimestamp: null labels: - app: canary-demo + app: canary-demo-weights-na spec: containers: - image: argoproj/rollouts-demo:does-not-exist @@ -83,5 +83,5 @@ status: observedGeneration: "429" readyReplicas: 5 replicas: 6 - selector: app=canary-demo + selector: app=canary-demo-weights-na updatedReplicas: 1 From daac8a05a6af14ebde9a0c53755469a1ca1f76e3 Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 10:49:06 -0500 Subject: [PATCH 07/10] fix: cleanup copy duplicate test from when I created TestCanaryRolloutInfoWeights Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/info_test.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/kubectl-argo-rollouts/info/info_test.go b/pkg/kubectl-argo-rollouts/info/info_test.go index 8a166f1fca..22e6461adb 100644 --- a/pkg/kubectl-argo-rollouts/info/info_test.go +++ b/pkg/kubectl-argo-rollouts/info/info_test.go @@ -36,17 +36,6 @@ func TestCanaryRolloutInfo(t *testing.T) { Tags: []string{InfoTagStable}, }, }) - - roInfo = NewRolloutInfo(rolloutObjs.Rollouts[4], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) - actualWeightString := roInfo.ActualWeight - actualWeightStringInt32, err := strconv.ParseInt(actualWeightString, 10, 32) - if err != nil { - t.Error(err) - } - assert.Equal(t, rolloutObjs.Rollouts[4].Status.Canary.Weights.Canary.Weight, int32(actualWeightStringInt32)) - - roInfo = NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) - assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) } func TestCanaryRolloutInfoWeights(t *testing.T) { From 72b65f588741bb8bb3222e1d580b8e67c8bb78eb Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 10:50:40 -0500 Subject: [PATCH 08/10] fix: add comment and cleanup code Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/info_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kubectl-argo-rollouts/info/info_test.go b/pkg/kubectl-argo-rollouts/info/info_test.go index 22e6461adb..a5da2ea8b7 100644 --- a/pkg/kubectl-argo-rollouts/info/info_test.go +++ b/pkg/kubectl-argo-rollouts/info/info_test.go @@ -48,6 +48,7 @@ func TestCanaryRolloutInfoWeights(t *testing.T) { } assert.Equal(t, rolloutObjs.Rollouts[4].Status.Canary.Weights.Canary.Weight, int32(actualWeightStringInt32)) + //This test has a no canary weight object in the status field so we fall back to using SetWeight value roInfo = NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) } From 93c20ebb7e8e03e9e9b2efdd1cfeb1a310abd275 Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 12:45:43 -0500 Subject: [PATCH 09/10] fix: nest testing to provide more detail information around tests Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/info_test.go | 29 ++++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pkg/kubectl-argo-rollouts/info/info_test.go b/pkg/kubectl-argo-rollouts/info/info_test.go index a5da2ea8b7..94b842e639 100644 --- a/pkg/kubectl-argo-rollouts/info/info_test.go +++ b/pkg/kubectl-argo-rollouts/info/info_test.go @@ -40,17 +40,26 @@ func TestCanaryRolloutInfo(t *testing.T) { func TestCanaryRolloutInfoWeights(t *testing.T) { rolloutObjs := testdata.NewCanaryRollout() - roInfo := NewRolloutInfo(rolloutObjs.Rollouts[4], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) - actualWeightString := roInfo.ActualWeight - actualWeightStringInt32, err := strconv.ParseInt(actualWeightString, 10, 32) - if err != nil { - t.Error(err) - } - assert.Equal(t, rolloutObjs.Rollouts[4].Status.Canary.Weights.Canary.Weight, int32(actualWeightStringInt32)) - //This test has a no canary weight object in the status field so we fall back to using SetWeight value - roInfo = NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) - assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) + t.Run("TestActualWeightWithExistingWeight", func(t *testing.T) { + t.Run("will test that actual weight for info object is set from rollout status", func(t *testing.T) { + roInfo := NewRolloutInfo(rolloutObjs.Rollouts[4], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) + actualWeightString := roInfo.ActualWeight + actualWeightStringInt32, err := strconv.ParseInt(actualWeightString, 10, 32) + if err != nil { + t.Error(err) + } + assert.Equal(t, rolloutObjs.Rollouts[4].Status.Canary.Weights.Canary.Weight, int32(actualWeightStringInt32)) + }) + }) + + t.Run("TestActualWeightWithoutExistingWeight", func(t *testing.T) { + t.Run("will test that actual weight is set to SetWeight when status field dose not exist", func(t *testing.T) { + //This test has a no canary weight object in the status field so we fall back to using SetWeight value + roInfo := NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) + assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight) + }) + }) } func TestPingPongCanaryRolloutInfo(t *testing.T) { From c8095b893d4bfca55aa344bf28a650fb7283bf05 Mon Sep 17 00:00:00 2001 From: zachaller Date: Thu, 31 Mar 2022 12:56:13 -0500 Subject: [PATCH 10/10] fix: spelling Signed-off-by: zachaller --- pkg/kubectl-argo-rollouts/info/info_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubectl-argo-rollouts/info/info_test.go b/pkg/kubectl-argo-rollouts/info/info_test.go index 94b842e639..d7bbe161fd 100644 --- a/pkg/kubectl-argo-rollouts/info/info_test.go +++ b/pkg/kubectl-argo-rollouts/info/info_test.go @@ -54,7 +54,7 @@ func TestCanaryRolloutInfoWeights(t *testing.T) { }) t.Run("TestActualWeightWithoutExistingWeight", func(t *testing.T) { - t.Run("will test that actual weight is set to SetWeight when status field dose not exist", func(t *testing.T) { + t.Run("will test that actual weight is set to SetWeight when status field does not exist", func(t *testing.T) { //This test has a no canary weight object in the status field so we fall back to using SetWeight value roInfo := NewRolloutInfo(rolloutObjs.Rollouts[5], rolloutObjs.ReplicaSets, rolloutObjs.Pods, rolloutObjs.Experiments, rolloutObjs.AnalysisRuns, nil) assert.Equal(t, roInfo.SetWeight, roInfo.ActualWeight)