policy attachment: allow targetRefs#3159
Merged
istio-testing merged 4 commits intoistio:masterfrom Apr 12, 2024
Merged
Conversation
Based on kubernetes-sigs/gateway-api#2966. Note that we do not HAVE to follow the GatewayAPI here; we can make our own decision. There is, however, a general desire to allow multiple for ergonomics. In this proposal, I hide `targetRef`, but the API will remain + be implemented forever. Implementation cost here is near zero, as we can easily translate it to a single `targetRefs`; we just hide from docs to push users toward the new ones.
Member
Author
mikemorris
approved these changes
Apr 12, 2024
Member
mikemorris
left a comment
There was a problem hiding this comment.
LGTM, is there any need to update the note below which is present on most of these fields to account for a singular targetRet in Istio 1.21?
// NOTE: If you are using the `targetRefs` field in a multi-revision environment with Istio versions prior to 1.20,
// it is highly recommended that you pin the authorization policy to a revision running 1.20+ via the istio.io/rev label.
// This is to prevent proxies connected to older istiod control planes (that don't know about the targetRef field)
// from misinterpreting the policy as namespace-wide during the upgrade process.
Member
Author
Yeah I think so (plus I think I botched some of the docs in the process of copy pasting so I'll clean up generally) |
stevenctl
approved these changes
Apr 12, 2024
howardjohn
added a commit
to howardjohn/api
that referenced
this pull request
Apr 12, 2024
This is the only API we have a `selector` without `targetRef`. The motivation at the time was that waypoints don't official support EnvoyFilter, and targetRef was primarily for waypoints. However, targetRef can be used with all Kubernetes Gateway, including for ingress, where EnvoyFilter is supported. Also, long term it will support waypoint as well I assume; the earlier we add the field the less migration pain there is. This PR goes directly to `targetRefs` in line with istio#3159.
istio-testing
pushed a commit
that referenced
this pull request
Apr 12, 2024
This is the only API we have a `selector` without `targetRef`. The motivation at the time was that waypoints don't official support EnvoyFilter, and targetRef was primarily for waypoints. However, targetRef can be used with all Kubernetes Gateway, including for ingress, where EnvoyFilter is supported. Also, long term it will support waypoint as well I assume; the earlier we add the field the less migration pain there is. This PR goes directly to `targetRefs` in line with #3159.
ericvn
reviewed
Apr 12, 2024
ericvn
left a comment
There was a problem hiding this comment.
Nit on consistency with highlighting fields and including the.
| // | ||
| // If not set, the policy is applied as defined by the selector. | ||
| // At most one of the selector and targetRef can be set. | ||
| // At most one of the selector and targetRefs can be set. |
There was a problem hiding this comment.
Suggested change
| // At most one of the selector and targetRefs can be set. | |
| // At most one of the `selector` and `targetRefs` can be set. |
ericvn
approved these changes
Apr 12, 2024
Contributor
|
|
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on kubernetes-sigs/gateway-api#2966. Note
that we do not HAVE to follow the GatewayAPI here; we can make our own
decision. There is, however, a general desire to allow multiple for
ergonomics.
In this proposal, I hide
targetRef, but the API will remain + beimplemented forever. Implementation cost here is near zero, as we can
easily translate it to a single
targetRefs; we just hide from docs topush users toward the new ones.