Skip to content

Commit

Permalink
Avoid code smell
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Andersen <[email protected]>
  • Loading branch information
jandersen-plaid committed Nov 8, 2022
1 parent 4c69edd commit bbc818e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rollout/canary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func bumpVersion(rollout *v1alpha1.Rollout) *v1alpha1.Rollout {
}

func TestCanaryRollout(t *testing.T) {
newrsVal := "new-rs-xxx"
for _, tc := range []struct {
canaryReplicas int32
canaryAvailReplicas int32
Expand All @@ -75,7 +76,7 @@ func TestCanaryRollout(t *testing.T) {
{2, 2, true},
} {
namespace := "namespace"
selectorNewRSVal := "new-rs-xxx"
selectorNewRSVal := newrsVal
stableService := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: "stable",
Expand Down Expand Up @@ -141,7 +142,7 @@ func TestCanaryRollout(t *testing.T) {
if tc.shouldRouteTraffic {
trafficRouter.On("Type").Return("mock")
trafficRouter.On("RemoveManagedRoutes").Return(nil)
trafficRouter.On("UpdateHash", "new-rs-xxx", "").Return(nil)
trafficRouter.On("UpdateHash", newrsVal, "").Return(nil)
trafficRouter.On("SetWeight", int32(0)).Return(nil)
trafficRouter.On("VerifyWeight", int32(0)).Return(nil, nil)
}
Expand Down

0 comments on commit bbc818e

Please sign in to comment.