Skip to content
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

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

lgadban
Copy link
Contributor

@lgadban lgadban commented Mar 8, 2024

renaming message field but not used in the most recent LTS releases:
https://github.com/solo-io/gloo-mesh-enterprise/blob/v2.5.x/go.mod#L95
https://github.com/solo-io/gloo/blob/v1.16.x/go.mod#L56
BOT NOTES:
resolves #529

@solo-changelog-bot
Copy link

Issues linked to changelog:
#529

@lgadban lgadban requested a review from Sodman March 8, 2024 20:22
Copy link
Member

@Sodman Sodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

// * 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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)
have you seen a way to accomplish this?

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.
Copy link
Contributor

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 PolicyTargetReferenceWithSectionName API?

Copy link
Contributor Author

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.
I can update this though

@@ -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.
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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!

@@ -0,0 +1,4 @@
changelog:
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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)
the versioning is a bit flimsy in this repo (e.g. there is currently not a v0.36.x brach) so it seemed easiest to just break it now while there are no consumers.

that being said, it is technically a break from a semver perspective, so I'm not sure the best approach

@soloio-bulldozer soloio-bulldozer bot merged commit aaa4fae into main Mar 8, 2024
3 checks passed
@soloio-bulldozer soloio-bulldozer bot deleted the add-target-ref-2 branch March 8, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need Gateway API TargetRef object
4 participants