Skip to content

Commit

Permalink
Test of ensure of ingress annotations to avoid loop of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Jan 18, 2024
1 parent d5c73bf commit cfbf014
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/nginx_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,9 @@ func TestNginxReconciler_reconcileIngress(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{
Name: "my-nginx-1",
Namespace: "default",
Annotations: map[string]string{
"cloudprovider.ingress/status": "this annotation created by ingress controller",
},
},
Spec: networkingv1.IngressSpec{
DefaultBackend: &networkingv1.IngressBackend{
Expand Down Expand Up @@ -766,7 +769,10 @@ func TestNginxReconciler_reconcileIngress(t *testing.T) {
err := c.Get(context.TODO(), types.NamespacedName{Name: "my-nginx-1", Namespace: "default"}, &got)
require.NoError(t, err)

assert.Equal(t, map[string]string{"custom.nginx.tsuru.io/foo": "bar"}, got.Annotations)
assert.Equal(t, map[string]string{
"cloudprovider.ingress/status": "this annotation created by ingress controller",
"custom.nginx.tsuru.io/foo": "bar",
}, got.Annotations)
assert.Equal(t, map[string]string{
"nginx.tsuru.io/app": "nginx",
"nginx.tsuru.io/resource-name": "my-nginx-1",
Expand Down

0 comments on commit cfbf014

Please sign in to comment.