@@ -211,7 +211,7 @@ func (k *IngressService) Ensure(ctx context.Context, id router.InstanceID, o rou
211
211
return err
212
212
}
213
213
} else if ingressHasChanges (span , existingIngress , ingress ) {
214
- err = k .mergeIngresses (ctx , ingress , existingIngress , id , ingressClient , span )
214
+ err = k .mergeIngressAndUpdate (ctx , ingress , existingIngress , id , ingressClient , span )
215
215
if err != nil {
216
216
setSpanError (span , err )
217
217
return err
@@ -266,8 +266,9 @@ func (k *IngressService) Ensure(ctx context.Context, id router.InstanceID, o rou
266
266
return nil
267
267
}
268
268
269
- func (k * IngressService ) mergeIngresses (ctx context.Context , ingress * networkingV1.Ingress , existingIngress * networkingV1.Ingress , id router.InstanceID , ingressClient networkingTypedV1.IngressInterface , span opentracing.Span ) error {
269
+ func (k * IngressService ) mergeIngressAndUpdate (ctx context.Context , ingress * networkingV1.Ingress , existingIngress * networkingV1.Ingress , id router.InstanceID , ingressClient networkingTypedV1.IngressInterface , span opentracing.Span ) error {
270
270
ingress .ObjectMeta .ResourceVersion = existingIngress .ObjectMeta .ResourceVersion
271
+ ingress .ObjectMeta .UID = existingIngress .ObjectMeta .UID
271
272
if existingIngress .Spec .DefaultBackend != nil {
272
273
ingress .Spec .DefaultBackend = existingIngress .Spec .DefaultBackend
273
274
}
@@ -409,7 +410,7 @@ func (k *IngressService) ensureCNameBackend(ctx context.Context, opts ensureCNam
409
410
}
410
411
411
412
if ingressHasChanges (span , existingIngress , ingress ) {
412
- err = k .mergeIngresses (ctx , ingress , existingIngress , opts .id , ingressClient , span )
413
+ err = k .mergeIngressAndUpdate (ctx , ingress , existingIngress , opts .id , ingressClient , span )
413
414
if err != nil {
414
415
return err
415
416
}
@@ -990,6 +991,14 @@ func ingressHasChanges(span opentracing.Span, existing *networkingV1.Ingress, in
990
991
return true
991
992
}
992
993
994
+ if ! reflect .DeepEqual (existing .OwnerReferences , ing .OwnerReferences ) {
995
+ span .LogKV (
996
+ "message" , "ingress has changed the ownerReferences" ,
997
+ "ingress" , existing .Name ,
998
+ )
999
+ return true
1000
+ }
1001
+
993
1002
if existing .Annotations [AnnotationsCNames ] != ing .Annotations [AnnotationsCNames ] {
994
1003
return true
995
1004
}
0 commit comments