Skip to content

[dev-gwapi-0.6] replace Gateway/Listener Ready conditions with Programmed#4849

Merged
skriss merged 1 commit intoprojectcontour:dev-gwapi-0.6from
skriss:pr-gwapi-programmed
Nov 18, 2022
Merged

[dev-gwapi-0.6] replace Gateway/Listener Ready conditions with Programmed#4849
skriss merged 1 commit intoprojectcontour:dev-gwapi-0.6from
skriss:pr-gwapi-programmed

Conversation

@skriss
Copy link
Copy Markdown
Member

@skriss skriss commented Nov 15, 2022

Replaces the "Ready" condition used for Gateways
and Listeners with "Programmed".

Updates #4848.

Signed-off-by: Steve Kriss krisss@vmware.com

Replaces the "Ready" condition used for Gateways
and Listeners with "Programmed".

Updates projectcontour#4848.

Signed-off-by: Steve Kriss <krisss@vmware.com>
Copy link
Copy Markdown
Member Author

@skriss skriss left a comment

Choose a reason for hiding this comment

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

This was mostly straightforward, but there are a couple questionable combos of Condition type + reason that need to be resolved.

if !isAddressAssigned(p.source.gateway.Spec.Addresses, p.source.gateway.Status.Addresses) {
gatewayNotReadyCondition = &metav1.Condition{
Type: string(gatewayapi_v1beta1.GatewayConditionReady),
// TODO(sk) resolve condition type-reason mismatch
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The "AddressNotAssigned" reason did not move over to the "Programmed" condition, it's still documented as being for the "Ready" condition (ref. https://github.com/kubernetes-sigs/gateway-api/blob/eb822e981bd8f7b4f52e89cafbe2d0397b5f01fb/apis/v1beta1/gateway_types.go#L643-L648), so need to figure out what to do here. It would be a little odd to set "Ready: false" for this scenario, but never set "Ready: true" (since we're not currently able to meet the requirements for the "Ready: true" condition).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm feeling like this is probably fine as-is for now since it's not breaking any conformance tests, but possibly something to follow up on down the road.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hm yeah this one is a little weird, I could go either way on whether it belongs with the Programmed or Ready condition, but seems find to leave as you have it here until an upstream issue/conformance test changes things

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍 yeah agree this one could potentially go either way. I'll raise an issue upstream for it.

gwAccessor.AddCondition(gatewayapi_v1beta1.GatewayConditionReady, metav1.ConditionFalse, gatewayapi_v1beta1.GatewayReasonListenersNotValid, "Listeners are not valid")
if !allListenersProgrammed {
// If we have invalid listeners, set Programmed=false.
// TODO(sk) resolve condition type-reason mismatch
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Similarly here, the "ListenersNotValid" reason did not move over to the "Programmed" condition (ref. https://github.com/kubernetes-sigs/gateway-api/blob/eb822e981bd8f7b4f52e89cafbe2d0397b5f01fb/apis/v1beta1/gateway_types.go#L634-L637), so need to decide what to do here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm feeling like this is probably fine as-is for now since it's not breaking any conformance tests, but possibly something to follow up on down the road.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah the wording on that Reason makes it sounds like it should be used with the Programmed Condition

one or more Listeners have an invalid or unsupported configuration and cannot be configured on the Gateway.

good for us to keep now and open an upstream issue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed. Will raise an upstream issue.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 15, 2022

Codecov Report

Merging #4849 (d830bcc) into dev-gwapi-0.6 (ec6bb08) will increase coverage by 0.04%.
The diff coverage is 97.67%.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           dev-gwapi-0.6    #4849      +/-   ##
=================================================
+ Coverage          76.30%   76.34%   +0.04%     
=================================================
  Files                139      139              
  Lines              16688    16680       -8     
=================================================
+ Hits               12734    12735       +1     
+ Misses              3703     3694       -9     
  Partials             251      251              
Impacted Files Coverage Δ
internal/status/gatewaystatus.go 72.93% <ø> (+5.10%) ⬆️
internal/dag/gatewayapi_processor.go 96.61% <97.61%> (+<0.01%) ⬆️
internal/gatewayapi/listeners.go 100.00% <100.00%> (ø)
internal/sorter/sorter.go 98.46% <0.00%> (-0.52%) ⬇️

@skriss skriss marked this pull request as ready for review November 17, 2022 15:22
@skriss skriss requested a review from a team as a code owner November 17, 2022 15:22
@skriss skriss requested review from stevesloka and sunjayBhatia and removed request for a team November 17, 2022 15:22
@skriss skriss merged commit 3097f7f into projectcontour:dev-gwapi-0.6 Nov 18, 2022
sunjayBhatia pushed a commit to sunjayBhatia/contour that referenced this pull request Dec 14, 2022
…tour#4849)

Replaces the "Ready" condition used for Gateways
and Listeners with "Programmed".

Updates projectcontour#4848.

Signed-off-by: Steve Kriss <krisss@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>
@skriss skriss deleted the pr-gwapi-programmed branch January 31, 2023 19:19
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>
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.

2 participants