Skip to content

Commit

Permalink
Merge pull request #879 from gcs278/ingressclass-fix-spurious-updates
Browse files Browse the repository at this point in the history
OCPBUGS-6701: Avoid spurious updates for scope in IngressClass
  • Loading branch information
openshift-merge-robot committed Feb 1, 2023
2 parents e24a381 + 739e3ed commit e84f7f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/operator/controller/ingressclass/ingressclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func desiredIngressClass(haveIngressController bool, ingressControllerName strin
}

name := controller.IngressClassName(ingressControllerName)
scope := networkingv1.IngressClassParametersReferenceScopeCluster
class := &networkingv1.IngressClass{
ObjectMeta: metav1.ObjectMeta{
Name: name.Name,
Expand All @@ -88,6 +89,7 @@ func desiredIngressClass(haveIngressController bool, ingressControllerName strin
APIGroup: &operatorv1.GroupName,
Kind: "IngressController",
Name: ingressControllerName,
Scope: &scope,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/controller/ingressclass/ingressclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
// TestDesiredIngressClass verifies that desiredIngressClass behaves as
// expected.
func TestDesiredIngressClass(t *testing.T) {
scope := "Cluster"
makeIngressClass := func(icName string, annotateAsDefault bool) *networkingv1.IngressClass {
apiGroup := "operator.openshift.io"
name := "openshift-" + icName
Expand All @@ -27,6 +28,7 @@ func TestDesiredIngressClass(t *testing.T) {
APIGroup: &apiGroup,
Kind: "IngressController",
Name: icName,
Scope: &scope,
},
},
}
Expand Down

0 comments on commit e84f7f6

Please sign in to comment.