Skip to content

Commit

Permalink
Fix: ExtensionServices are updated continuously by contour (#4846)
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Choudhary <contactvishaltech@gmail.com>
  • Loading branch information
vishal-chdhry authored Nov 17, 2022
1 parent eaa3e58 commit ccb79f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/4846-Vishal-Chdhry-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed bug where ExtensionServices were being updated continuously by Contour
2 changes: 2 additions & 0 deletions internal/contour/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"),
Expand Down
8 changes: 8 additions & 0 deletions internal/k8s/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ccb79f8

Please sign in to comment.