Skip to content

Commit 63b9c38

Browse files
committed
update tests
1 parent b42669f commit 63b9c38

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

internal/controller/core/flagd/resources/ingress_test.go

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ func TestFlagdIngress_getIngress(t *testing.T) {
164164
},
165165
},
166166
}, ingressResult.(*networkingv1.Ingress).Spec)
167-
168167
}
169168

170169
func strPtr(s string) *string {
@@ -182,7 +181,7 @@ func Test_areIngressesEqual(t *testing.T) {
182181
want bool
183182
}{
184183
{
185-
name: "has changed",
184+
name: "has spec changes",
186185
args: args{
187186
old: &networkingv1.Ingress{
188187
Spec: networkingv1.IngressSpec{
@@ -197,6 +196,27 @@ func Test_areIngressesEqual(t *testing.T) {
197196
},
198197
want: false,
199198
},
199+
{
200+
name: "has annotation changes",
201+
args: args{
202+
old: &networkingv1.Ingress{
203+
ObjectMeta: metav1.ObjectMeta{
204+
Annotations: map[string]string{
205+
"foo": "bar",
206+
},
207+
},
208+
Spec: networkingv1.IngressSpec{
209+
IngressClassName: strPtr("nginx"),
210+
},
211+
},
212+
new: &networkingv1.Ingress{
213+
Spec: networkingv1.IngressSpec{
214+
IngressClassName: strPtr("nginx"),
215+
},
216+
},
217+
},
218+
want: false,
219+
},
200220
{
201221
name: "has not changed",
202222
args: args{
@@ -240,7 +260,6 @@ func Test_areIngressesEqual(t *testing.T) {
240260
}
241261
for _, tt := range tests {
242262
t.Run(tt.name, func(t *testing.T) {
243-
244263
i := &FlagdIngress{}
245264
got := i.AreObjectsEqual(tt.args.old, tt.args.new)
246265

0 commit comments

Comments
 (0)