Skip to content

Commit

Permalink
merge conflict broke tests
Browse files Browse the repository at this point in the history
Signed-off-by: Travis Perdue <travis.perdue@rallyhealth.com>
  • Loading branch information
Travis Perdue committed Sep 28, 2022
1 parent 53b33e5 commit 5f00761
Showing 1 changed file with 8 additions and 40 deletions.
48 changes: 8 additions & 40 deletions ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ func TestSkipIngressWithNoClass(t *testing.T) {
assert.Len(t, enqueuedObjects, 0)
}

func TestSyncIngressReferencedByRolloutMultiIngress(t *testing.T) {
func TestSkipIngressWithNoClassMultiIngress(t *testing.T) {
ings := []*extensionsv1beta1.Ingress{
newNginxIngress("test-stable-ingress", 80, "stable-service"),
newNginxIngress("test-stable-ingress-additional", 80, "stable-service"),
newNginxIngressWithAnnotation("test-stable-ingress", 80, "stable-service"),
newNginxIngressWithAnnotation("test-stable-ingress-additional", 80, "stable-service"),
}
for _, i := range ings {
i.Annotations = nil
}

rollout := &v1alpha1.Rollout{
Expand All @@ -290,53 +293,18 @@ func TestSyncIngressReferencedByRolloutMultiIngress(t *testing.T) {

ctrl, kubeclient, enqueuedObjects := newFakeIngressControllerMultiIngress(t, ings, rollout)

err := ctrl.syncIngress("default/test-stable-ingress")
assert.NoError(t, err)
actions := kubeclient.Actions()
assert.Len(t, actions, 0)
assert.Equal(t, 1, enqueuedObjects["default/rollout"])
}

func TestSkipIngressWithNoAnnotations(t *testing.T) {
ing := newNginxIngress("test-stable-ingress", 80, "stable-service")
ing.Annotations = nil
rollout := &v1alpha1.Rollout{
ObjectMeta: metav1.ObjectMeta{
Name: "rollout",
Namespace: metav1.NamespaceDefault,
},
Spec: v1alpha1.RolloutSpec{
Strategy: v1alpha1.RolloutStrategy{
Canary: &v1alpha1.CanaryStrategy{
StableService: "stable-service",
CanaryService: "canary-service",
TrafficRouting: &v1alpha1.RolloutTrafficRouting{
Nginx: &v1alpha1.NginxTrafficRouting{
StableIngress: "test-stable-ingress",
},
},
},
},
},
}

ctrl, kubeclient, enqueuedObjects := newFakeIngressController(t, ing, rollout)

err := ctrl.syncIngress("default/test-stable-ingress")
assert.NoError(t, err)
actions := kubeclient.Actions()
assert.Len(t, actions, 0)
assert.Len(t, enqueuedObjects, 0)
}

func TestSkipIngressWithNoAnnotationsMultiIngress(t *testing.T) {
func TestSyncIngressReferencedByRolloutMultiIngress(t *testing.T) {
ings := []*extensionsv1beta1.Ingress{
newNginxIngress("test-stable-ingress", 80, "stable-service"),
newNginxIngress("test-stable-ingress-additional", 80, "stable-service"),
}
for _, i := range ings {
i.Annotations = nil
}

rollout := &v1alpha1.Rollout{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -365,5 +333,5 @@ func TestSkipIngressWithNoAnnotationsMultiIngress(t *testing.T) {
assert.NoError(t, err)
actions := kubeclient.Actions()
assert.Len(t, actions, 0)
assert.Len(t, enqueuedObjects, 0)
assert.Equal(t, 1, enqueuedObjects["default/rollout"])
}

0 comments on commit 5f00761

Please sign in to comment.