diff --git a/changelogs/unreleased/4846-Vishal-Chdhry-small.md b/changelogs/unreleased/4846-Vishal-Chdhry-small.md new file mode 100644 index 00000000000..82c6afcc3e0 --- /dev/null +++ b/changelogs/unreleased/4846-Vishal-Chdhry-small.md @@ -0,0 +1 @@ +Fixed bug where ExtensionServices were being updated continuously by Contour \ No newline at end of file diff --git a/internal/contour/handler.go b/internal/contour/handler.go index 7a4383987bd..6e815511509 100644 --- a/internal/contour/handler.go +++ b/internal/contour/handler.go @@ -23,6 +23,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" contour_api_v1 "github.com/projectcontour/contour/apis/projectcontour/v1" + contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1" "github.com/projectcontour/contour/internal/dag" "github.com/projectcontour/contour/internal/k8s" "github.com/sirupsen/logrus" @@ -190,6 +191,7 @@ func (e *EventHandler) onUpdate(op interface{}) bool { case opUpdate: if cmp.Equal(op.oldObj, op.newObj, cmpopts.IgnoreFields(contour_api_v1.HTTPProxy{}, "Status"), + cmpopts.IgnoreFields(contour_api_v1alpha1.ExtensionService{}, "Status"), cmpopts.IgnoreFields(gatewayapi_v1beta1.GatewayClass{}, "Status"), cmpopts.IgnoreFields(gatewayapi_v1beta1.Gateway{}, "Status"), cmpopts.IgnoreFields(gatewayapi_v1beta1.HTTPRoute{}, "Status"), diff --git a/internal/k8s/helpers.go b/internal/k8s/helpers.go index 8393252eada..0fb657bbb52 100644 --- a/internal/k8s/helpers.go +++ b/internal/k8s/helpers.go @@ -17,6 +17,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" contour_api_v1 "github.com/projectcontour/contour/apis/projectcontour/v1" + contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1" networking_v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gatewayapi_v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" @@ -44,6 +45,13 @@ func isStatusEqual(objA, objB interface{}) bool { return true } } + case *contour_api_v1alpha1.ExtensionService: + if b, ok := objB.(*contour_api_v1alpha1.ExtensionService); ok { + if cmp.Equal(a.Status, b.Status, + cmpopts.IgnoreFields(contour_api_v1.Condition{}, "LastTransitionTime")) { + return true + } + } case *gatewayapi_v1beta1.GatewayClass: if b, ok := objB.(*gatewayapi_v1beta1.GatewayClass); ok { if cmp.Equal(a.Status, b.Status,