-
Notifications
You must be signed in to change notification settings - Fork 485
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
Reverses Gateway Condition Polarity #104
Conversation
@danehans: GitHub didn't allow me to request PR reviews from the following users: ironcladlou, Miciah. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: danehans The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thanks for this PR! Some of these are pretty trick to turn into positive conditions. As an example, all of the conditions covering multiple objects become more complicated when they are positive. InvalidListeners
indicated that at least one listener was invalid. ValidListeners
as proposed would indicate if at least one listener was valid, but does not properly indicate if any listeners are invalid. We can change this to indicate that all listeners are valid, but it's not as clear from the condition name that that's what that means.
api/v1alpha1/gateway_types.go
Outdated
// routes is invalid. | ||
ConditionInvalidRoutes GatewayConditionType = "InvalidRoutes" | ||
ConditionValidListeners GatewayConditionType = "ValidListeners" | ||
// ConditionRoutesReady indicates that at least one of the specified routes |
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.
// ConditionRoutesReady indicates that at least one of the specified routes | |
// ConditionRoutesReady indicates that all of the specified routes |
api/v1alpha1/gateway_types.go
Outdated
// ConditionRoutesReady indicates that at least one of the specified routes | ||
// is ready. | ||
ConditionRoutesReady GatewayConditionType = "RoutesReady" | ||
// ConditionValidRoutes indicates that at least one of the specified |
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.
// ConditionValidRoutes indicates that at least one of the specified | |
// ConditionValidRoutes indicates that all of the specified |
api/v1alpha1/gateway_types.go
Outdated
// ConditionInvalidListeners indicates that at least one of the specified | ||
// listeners is invalid. If this condition has a status of True, a more | ||
ConditionListenersReady GatewayConditionType = "ListenersReady" | ||
// ConditionValidListeners indicates that at least one of the specified |
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.
// ConditionValidListeners indicates that at least one of the specified | |
// ConditionValidListeners indicates that all of the specified |
d93ead8
to
446d0a2
Compare
@danehans thanks for the work on this! I think this is a good translation of the existing conditions to a positive polarity. This PR looks good to me for what it aims to do, but I'd personally like to see more activity/confirmation on kubernetes/community#4521 before merging this just so we're sure that this is something the broader community will fully adopt. |
// routes is invalid. | ||
ConditionInvalidRoutes GatewayConditionType = "InvalidRoutes" | ||
// ConditionGatewayClassExists indicates that the specified GatewayClass exists. | ||
ConditionGatewayClassExists GatewayConditionType = "GatewayClassExists" |
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.
Can we start off with GatewayClassInvalid?
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.
@bowei GatewayClassInvalid
is a negative condition type. This PR aims to use positive conditions per kubernetes/community#4521. I can update "GatewayClassExists" to "GatewayClassValid" with the same meaning that the GatewayClass
referenced in gateway.spec.class
exists, unless I'm missing your point.
// ConditionGatewayClassExists indicates that the specified GatewayClass exists. | ||
ConditionGatewayClassExists GatewayConditionType = "GatewayClassExists" | ||
// ConditionGatewayScheduled indicates that the Gateway has been scheduled. | ||
ConditionGatewayScheduled GatewayConditionType = "GatewayScheduled" |
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.
You have to be more specific here. "Scheduled" means what for the end user?
For stuff that is informational, e.g. automation cannot act on it, has no semantic API meaning, it's worth thinking about whether it requires its own constant or just put the information into the human readable form.
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.
You have to be more specific here. "Scheduled" means what for the end user?
@bowei I tried to make minimal changes to the docs to support the intent of this PR, which is to reverse the polarity of the existing conditions. This was an existing condition. Do you prefer I make changes to the previously created condition types in this PR or have this PR strictly focus on reversing the polarity?
// are valid. If this condition has a status of False, a more detailed | ||
// ListenerCondition should be present in the corresponding ListenerStatus. | ||
ConditionListenersValid GatewayConditionType = "ListenersValid" | ||
// ConditionRoutesReady indicates that all of the specified routes are ready. |
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.
Can we combine routes ready with routes valid? (can you give a good example why we want to distinguish these two states)
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.
@bowei this comes from https://kubernetes.slack.com/archives/CR0H13KGA/p1584484692070800. A valid route means the config has passed validation. A ready route means some type of readiness probe has passed. I'm not opposed to sticking with valid listener/route now to simplify the conditions until a concrete use case is presented for adding a route ready state status condition. cc: @robscott
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.
My comments here are mostly around making the comments more descriptive. (e.g. can you take your responses and put them in the comments, so when people read it, they know exactly what the conditions mean?)
// ConditionListenerReady indicates the listener is ready to receive traffic. | ||
ConditionListenerReady ListenerConditionType = "ListenerReady" | ||
// ConditionValidAddress indicates the listener Address is valid. | ||
ConditionValidAddress ListenerConditionType = "ValidAddress" |
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.
Can we clarify that these will always overlap:
Valid implies Ready?
Or Valid && Ready == can serve traffic?
/hold until kubernetes/community#4521 merges. |
@danehans: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@robscott and @bowei PTAL at these comments from @jpeach:
Should I update this PR and pursue reversing polarity of the conditions? |
@danehans: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'd suggest we sit tight for a bit longer and wait for the converged condition type in kubernetes/enhancements#1624 to land. That doesn't address polarity, which I don't think will be resolved in the near term. Practically, the only general purpose package I know of to expose status through Conditions is status, https://github.com/kubernetes-sigs/cli-utils/tree/master/pkg/kstatus I'd like it if we followed their recommendations, so our conditions work out of the box. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/cc @jpeach |
@robscott: GitHub didn't allow me to request PR reviews from the following users: jpeach. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
👍 I'm fine with that as well. Feel free to reopen in the future if we want to revisit any part of this. /close |
@robscott: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
The official guidance is being updated for conditions to reflect a positive polarity. This PR iterates on #47 to update the
Gateway
condition types accordingly./assign @robscott
/cc @bowei @ironcladlou @Miciah