-
Notifications
You must be signed in to change notification settings - Fork 749
fix: remove cross ns policy attachment status #8901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,16 +295,14 @@ func (t *Translator) ProcessBackendTrafficPolicies( | |
| // Process the policies targeting Routes | ||
| for i, currPolicy := range backendTrafficPolicies { | ||
| policyName := utils.NamespacedName(currPolicy) | ||
| allowed, denied := resolvePolicyTargetsFromSelectors( | ||
| currPolicy.Spec.TargetSelectors, | ||
| targetRefs := resolvePolicyTargets( | ||
| currPolicy.Spec.PolicyTargetReferences, | ||
| routes, | ||
| resources.ReferenceGrants, | ||
| egv1a1.GroupName, | ||
| egv1a1.KindBackendTrafficPolicy, | ||
| currPolicy.Namespace, | ||
| t.GetNamespace) | ||
|
Comment on lines
+298
to
305
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This change stops tracking denied selector matches, so a policy whose cross-namespace Useful? React with 👍 / 👎.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. non blocking - will a ReferenceGrant, not trigger a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the cross-namespace policy attachment feature does not change the pre-existing status behavior here. The same behavior already existed for selector targets before cross-namespace attachment, and this feature just makes a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A ReferenceGrant will trigger a Reconcile, but stale status won't get updated for non-matching/missing ReferenceGrant due to #8927 . |
||
| plainTargetRefs := resolvePolicyTargetsFromReferences(currPolicy.Spec.PolicyTargetReferences, currPolicy.Namespace) | ||
| targetRefs := composePolicyTargetRefs(allowed, plainTargetRefs) | ||
| for _, currTarget := range targetRefs { | ||
| if isRoute(currTarget) { | ||
| policy, found := handledPolicies[policyName] | ||
|
|
@@ -318,15 +316,6 @@ func (t *Translator) ProcessBackendTrafficPolicies( | |
| routeMap, gatewayRouteMap, gatewayPolicyMerged, gatewayPolicyMap, policy, currTarget) | ||
| } | ||
| } | ||
| if len(denied) > 0 { | ||
| policy, found := handledPolicies[policyName] | ||
| if !found { | ||
| policy = policyCopies[i] | ||
| handledPolicies[policyName] = policy | ||
| res = append(res, policy) | ||
| } | ||
| setPolicyTargetRefNotPermittedStatus(&policy.Status, denied, t.GatewayControllerName, policy.Generation) | ||
| } | ||
| } | ||
|
|
||
| // Process the policies targeting Listeners | ||
|
|
@@ -351,16 +340,14 @@ func (t *Translator) ProcessBackendTrafficPolicies( | |
| // Process the policies targeting Gateways | ||
| for i, currPolicy := range backendTrafficPolicies { | ||
| policyName := utils.NamespacedName(currPolicy) | ||
| allowed, denied := resolvePolicyTargetsFromSelectors( | ||
| currPolicy.Spec.TargetSelectors, | ||
| targetRefs := resolvePolicyTargets( | ||
| currPolicy.Spec.PolicyTargetReferences, | ||
| gateways, | ||
| resources.ReferenceGrants, | ||
| egv1a1.GroupName, | ||
| egv1a1.KindBackendTrafficPolicy, | ||
| currPolicy.Namespace, | ||
| t.GetNamespace) | ||
| plainTargetRefs := resolvePolicyTargetsFromReferences(currPolicy.Spec.PolicyTargetReferences, currPolicy.Namespace) | ||
| targetRefs := composePolicyTargetRefs(allowed, plainTargetRefs) | ||
| for _, currTarget := range targetRefs { | ||
| if isGateway(currTarget) { | ||
| policy, found := handledPolicies[policyName] | ||
|
|
@@ -373,15 +360,6 @@ func (t *Translator) ProcessBackendTrafficPolicies( | |
| gatewayMap, gatewayRouteMap, gatewayPolicyMerged, policy, currTarget) | ||
| } | ||
| } | ||
| if len(denied) > 0 { | ||
| policy, found := handledPolicies[policyName] | ||
| if !found { | ||
| policy = policyCopies[i] | ||
| handledPolicies[policyName] = policy | ||
| res = append(res, policy) | ||
| } | ||
| setPolicyTargetRefNotPermittedStatus(&policy.Status, denied, t.GatewayControllerName, policy.Generation) | ||
| } | ||
| } | ||
|
|
||
| for _, policy := range res { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.