Use generics for Gateway API pointer helpers#4905
Merged
sunjayBhatia merged 4 commits intoprojectcontour:dev-gwapi-0.6from Dec 13, 2022
Merged
Use generics for Gateway API pointer helpers#4905sunjayBhatia merged 4 commits intoprojectcontour:dev-gwapi-0.6from
sunjayBhatia merged 4 commits intoprojectcontour:dev-gwapi-0.6from
Conversation
Can get rid of our existing gatewayapi package helpers for getting pointers to gateway api types based on primitive types Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Also found some more instances of v1alpha2 package being used where we should switch to v1beta1 Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev-gwapi-0.6 #4905 +/- ##
=================================================
- Coverage 76.35% 76.28% -0.08%
=================================================
Files 139 140 +1
Lines 16680 16642 -38
=================================================
- Hits 12736 12695 -41
- Misses 3693 3696 +3
Partials 251 251
|
skriss
reviewed
Dec 12, 2022
skriss
requested changes
Dec 12, 2022
Member
skriss
left a comment
There was a problem hiding this comment.
One nit, otherwise LGTM, nice cleanup! As discussed, after this goes in we can also look to get rid of our dependency on k8s.io/utils/pointer.
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
skriss
approved these changes
Dec 12, 2022
sunjayBhatia
added a commit
to sunjayBhatia/contour
that referenced
this pull request
Dec 14, 2022
Can get rid of our existing gatewayapi package helpers for getting pointers to gateway api types based on primitive types Also found some more instances of v1alpha2 package being used where we should switch to v1beta1 Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
sunjayBhatia
added a commit
that referenced
this pull request
Dec 14, 2022
* drop support for ReferencePolicy (#4830) Drops support for ReferencePolicy which has been replaced by ReferenceGrant in Gateway API. * update to latest Gateway API commit (#4839) - Update to v1beta1 ReferenceGrant - HTTPRequestHeaderFilter -> HTTPHeaderFilter - GatewayConditionScheduled -> GatewayConditionAccepted - ListenerConditionDetached -> ListenerConditionAccepted * updates for SupportedFeatures changes (#4844) * replace Gateway/Listener Ready conditions with Programmed (#4849) Replaces the "Ready" condition used for Gateways and Listeners with "Programmed". * update to Gateway API v0.6.0-rc1 (#4891) * Use generics for Gateway API pointer helpers (#4905) Can get rid of our existing gatewayapi package helpers for getting pointers to gateway api types based on primitive types Also found some more instances of v1alpha2 package being used where we should switch to v1beta1 Fixes #4555 Fixes #4699 Fixes #4848 Signed-off-by: Steve Kriss <krisss@vmware.com> Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com> Co-authored-by: Steve Kriss <krisss@vmware.com>
yangyy93
pushed a commit
to projectsesame/contour
that referenced
this pull request
Feb 16, 2023
* drop support for ReferencePolicy (projectcontour#4830) Drops support for ReferencePolicy which has been replaced by ReferenceGrant in Gateway API. * update to latest Gateway API commit (projectcontour#4839) - Update to v1beta1 ReferenceGrant - HTTPRequestHeaderFilter -> HTTPHeaderFilter - GatewayConditionScheduled -> GatewayConditionAccepted - ListenerConditionDetached -> ListenerConditionAccepted * updates for SupportedFeatures changes (projectcontour#4844) * replace Gateway/Listener Ready conditions with Programmed (projectcontour#4849) Replaces the "Ready" condition used for Gateways and Listeners with "Programmed". * update to Gateway API v0.6.0-rc1 (projectcontour#4891) * Use generics for Gateway API pointer helpers (projectcontour#4905) Can get rid of our existing gatewayapi package helpers for getting pointers to gateway api types based on primitive types Also found some more instances of v1alpha2 package being used where we should switch to v1beta1 Fixes projectcontour#4555 Fixes projectcontour#4699 Fixes projectcontour#4848 Signed-off-by: Steve Kriss <krisss@vmware.com> Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com> Co-authored-by: Steve Kriss <krisss@vmware.com> Signed-off-by: yy <yang.yang@daocloud.io>
yangyy93
pushed a commit
to projectsesame/contour
that referenced
this pull request
Feb 16, 2023
* drop support for ReferencePolicy (projectcontour#4830) Drops support for ReferencePolicy which has been replaced by ReferenceGrant in Gateway API. * update to latest Gateway API commit (projectcontour#4839) - Update to v1beta1 ReferenceGrant - HTTPRequestHeaderFilter -> HTTPHeaderFilter - GatewayConditionScheduled -> GatewayConditionAccepted - ListenerConditionDetached -> ListenerConditionAccepted * updates for SupportedFeatures changes (projectcontour#4844) * replace Gateway/Listener Ready conditions with Programmed (projectcontour#4849) Replaces the "Ready" condition used for Gateways and Listeners with "Programmed". * update to Gateway API v0.6.0-rc1 (projectcontour#4891) * Use generics for Gateway API pointer helpers (projectcontour#4905) Can get rid of our existing gatewayapi package helpers for getting pointers to gateway api types based on primitive types Also found some more instances of v1alpha2 package being used where we should switch to v1beta1 Fixes projectcontour#4555 Fixes projectcontour#4699 Fixes projectcontour#4848 Signed-off-by: Steve Kriss <krisss@vmware.com> Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com> Co-authored-by: Steve Kriss <krisss@vmware.com> Signed-off-by: yy <yang.yang@daocloud.io>
vmw-yingy
pushed a commit
to vmw-yingy/contour
that referenced
this pull request
Feb 28, 2023
* drop support for ReferencePolicy (projectcontour#4830) Drops support for ReferencePolicy which has been replaced by ReferenceGrant in Gateway API. * update to latest Gateway API commit (projectcontour#4839) - Update to v1beta1 ReferenceGrant - HTTPRequestHeaderFilter -> HTTPHeaderFilter - GatewayConditionScheduled -> GatewayConditionAccepted - ListenerConditionDetached -> ListenerConditionAccepted * updates for SupportedFeatures changes (projectcontour#4844) * replace Gateway/Listener Ready conditions with Programmed (projectcontour#4849) Replaces the "Ready" condition used for Gateways and Listeners with "Programmed". * update to Gateway API v0.6.0-rc1 (projectcontour#4891) * Use generics for Gateway API pointer helpers (projectcontour#4905) Can get rid of our existing gatewayapi package helpers for getting pointers to gateway api types based on primitive types Also found some more instances of v1alpha2 package being used where we should switch to v1beta1 Fixes projectcontour#4555 Fixes projectcontour#4699 Fixes projectcontour#4848 Signed-off-by: Steve Kriss <krisss@vmware.com> Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com> Co-authored-by: Steve Kriss <krisss@vmware.com>
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.
The
internal/gatewayapipackage has a lot of helper functions to get pointers to Gateway API types that are based on primitives.We can use a generic helper function to implement this instead:
e.g.
ref.To(<some primitive value>)This came from the fact that Gateway API 0.6.0 review is considering removing the helpers added to the API, see: https://github.com/kubernetes-sigs/gateway-api/pull/1538/files/a5c0a509d597cc9a99e91f4629257105ad536877#r1026842150
We never started using them, but we can just get rid of the code we had in favor of a generics approach
The first commit shows a smaller example set of removals, the second finishes it up