-
Notifications
You must be signed in to change notification settings - Fork 8
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
rename TargetRefWithSectionName, add PolicyTargetReference #536
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 |
---|---|---|
|
@@ -162,14 +162,28 @@ message ObjectSelector { | |
} | ||
} | ||
|
||
// TargetRef identifies Gateway API objects to apply a direct policy to. | ||
// PolicyTargetReference identifies Gateway API objects to directly apply policy to. | ||
// This is a copy of the upstream K8s Gateway API `targetRef` API. | ||
// See the following for more information: | ||
// * https://gateway-api.sigs.k8s.io/geps/gep-713/ | ||
// * https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1alpha2.PolicyTargetReference | ||
// * https://github.com/kubernetes-sigs/gateway-api/blob/b4f0307cc9269e73187300e72979e7e111ab74ab/apis/v1alpha2/policy_types.go#L34-L56 | ||
message PolicyTargetReference { | ||
string group = 1; | ||
string kind = 2; | ||
string name = 3; | ||
|
||
// Optional, if unspecified, the local namespace of the policy is inferred. | ||
google.protobuf.StringValue namespace = 4; | ||
} | ||
|
||
// PolicyTargetReferenceWithSectionName identifies Gateway API objects, and optionally a specific section of those objects, to directly apply policy to. | ||
// This is a copy of the upstream K8s Gateway API `targetRef` API. | ||
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 comment is out of date, should be PolicyTargetReferenceWithSectionName API? 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. the intent was the call out the generic |
||
// Note that we are only using the upstream `PolicyTargetReferenceWithSectionName` type as currently our policies will distinguish between sections. | ||
// See the following for more information: | ||
// * https://gateway-api.sigs.k8s.io/geps/gep-713/ | ||
// * https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1alpha2.PolicyTargetReferenceWithSectionName | ||
// * https://github.com/kubernetes-sigs/gateway-api/blob/444631bfe06f3bcca5d0eadf1857eac1d369421d/apis/v1alpha2/policy_types.go#L58-L83 | ||
message TargetRefWithSectionName { | ||
// * https://github.com/kubernetes-sigs/gateway-api/blob/b4f0307cc9269e73187300e72979e7e111ab74ab/apis/v1alpha2/policy_types.go#L58-L83 | ||
message PolicyTargetReferenceWithSectionName { | ||
string group = 1; | ||
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. should the fields in here be updated to mirror what's in https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1alpha2.PolicyTargetReferenceWithSectionName? 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. Yeah, can the PolicyTargetReference be inlined here like upstream is doing? https://github.com/kubernetes-sigs/gateway-api/blob/b4f0307cc9269e73187300e72979e7e111ab74ab/apis/v1alpha2/policy_types.go#L68 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. you can not have anonymous nested objects in proto (as opposed to go struct) |
||
string kind = 2; | ||
string name = 3; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
changelog: | ||
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. nit: since this is breaking, you could move to v0.37.0 and use type BREAKING_CHANGE 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. the goal was to fix this before it became a breaking change as no one has consumed this message yet (see PR description for references to edge & GME) that being said, it is technically a break from a semver perspective, so I'm not sure the best approach |
||
- type: NEW_FEATURE | ||
issueLink: https://github.com/solo-io/skv2/issues/529 | ||
description: rename TargetRefWithSectionName, add PolicyTargetReference |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is out of date, should be PolicyTargetReference API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think the link is out of date, is it this one? https://github.com/kubernetes-sigs/gateway-api/blob/b4f0307cc9269e73187300e72979e7e111ab74ab/apis/v1alpha2/policy_types.go#L39
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the intent was the call out the generic targetRef concept not the specific message it is using. will update though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@npolshakova that link is the same as the one in the comment?
https://github.com/kubernetes-sigs/gateway-api/blob/b4f0307cc9269e73187300e72979e7e111ab74ab/apis/v1alpha2/policy_types.go#L34-L56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That link works- I must have miscopied it when trying to find it!