diff --git a/pkg/router/ingress_test.go b/pkg/router/ingress_test.go index 81d24d27e..f327406ac 100644 --- a/pkg/router/ingress_test.go +++ b/pkg/router/ingress_test.go @@ -42,13 +42,15 @@ func TestIngressRouter_Reconcile(t *testing.T) { require.NoError(t, err) canaryAn := "custom.ingress.kubernetes.io/canary" + canaryWeightAn := "custom.ingress.kubernetes.io/canary-weight" canaryName := fmt.Sprintf("%s-canary", mocks.ingressCanary.Spec.IngressRef.Name) inCanary, err := router.kubeClient.NetworkingV1beta1().Ingresses("default").Get(context.TODO(), canaryName, metav1.GetOptions{}) require.NoError(t, err) // test initialisation - assert.Equal(t, "false", inCanary.Annotations[canaryAn]) + assert.Equal(t, "true", inCanary.Annotations[canaryAn]) + assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn]) } func TestIngressRouter_GetSetRoutes(t *testing.T) { @@ -94,7 +96,8 @@ func TestIngressRouter_GetSetRoutes(t *testing.T) { require.NoError(t, err) // test promotion - assert.Equal(t, "false", inCanary.Annotations[canaryAn]) + assert.Equal(t, "true", inCanary.Annotations[canaryAn]) + assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn]) } func TestIngressRouter_ABTest(t *testing.T) {