Skip to content

Commit

Permalink
updated status policy
Browse files Browse the repository at this point in the history
  • Loading branch information
soneillf5 committed Jul 20, 2021
1 parent 3f4ff1f commit dfad485
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/k8s/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func NewLoadBalancerController(input NewLoadBalancerControllerInput) *LoadBalanc
policyLister: lbc.policyLister,
keyFunc: keyFunc,
confClient: input.ConfClient,
hasCorrectIngressClass: lbc.HasCorrectIngressClass,
}

lbc.configuration = NewConfiguration(
Expand Down
6 changes: 6 additions & 0 deletions internal/k8s/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type statusUpdater struct {
transportServerLister cache.Store
policyLister cache.Store
confClient k8s_nginx.Interface
hasCorrectIngressClass func(interface{}) bool
}

func (su *statusUpdater) UpdateExternalEndpointsForResources(resource []Resource) error {
Expand Down Expand Up @@ -638,6 +639,11 @@ func (su *statusUpdater) UpdatePolicyStatus(pol *v1.Policy, state string, reason
return nil
}

if !su.hasCorrectIngressClass(polLatest) {
glog.V(3).Infof("ignoring policy with incorrect ingress class")
return nil
}

polCopy := polLatest.(*v1.Policy)

if !hasPolicyStatusChanged(polCopy, state, reason, message) {
Expand Down

0 comments on commit dfad485

Please sign in to comment.