-
Notifications
You must be signed in to change notification settings - Fork 486
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
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 |
---|---|---|
|
@@ -270,28 +270,22 @@ type GatewayStatus struct { | |
type GatewayConditionType string | ||
|
||
const ( | ||
// ConditionNoSuchGatewayClass indicates that the specified GatewayClass | ||
// does not exist. | ||
ConditionNoSuchGatewayClass GatewayConditionType = "NoSuchGatewayClass" | ||
// ConditionGatewayNotScheduled indicates that the Gateway has not been | ||
// scheduled. | ||
ConditionGatewayNotScheduled GatewayConditionType = "GatewayNotScheduled" | ||
// ConditionListenersNotReady indicates that at least one of the specified | ||
// listeners is not ready. If this condition has a status of True, a more | ||
// detailed ListenerCondition should be present in the corresponding | ||
// ListenerStatus. | ||
ConditionListenersNotReady GatewayConditionType = "ListenersNotReady" | ||
// ConditionInvalidListeners indicates that at least one of the specified | ||
// listeners is invalid. If this condition has a status of True, a more | ||
// detailed ListenerCondition should be present in the corresponding | ||
// ListenerStatus. | ||
ConditionInvalidListeners GatewayConditionType = "InvalidListeners" | ||
// ConditionRoutesNotReady indicates that at least one of the specified | ||
// routes is not ready. | ||
ConditionRoutesNotReady GatewayConditionType = "RoutesNotReady" | ||
// ConditionInvalidRoutes indicates that at least one of the specified | ||
// routes is invalid. | ||
ConditionInvalidRoutes GatewayConditionType = "InvalidRoutes" | ||
// 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 commentThe 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? 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.
@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? |
||
// ConditionListenersReady indicates that all of the specified listeners | ||
// are ready. If this condition has a status of False, a more detailed | ||
// ListenerCondition should be present in the corresponding ListenerStatus. | ||
ConditionListenersReady GatewayConditionType = "ListenersReady" | ||
// ConditionListenersValid indicates that all of the specified listeners | ||
// 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 commentThe 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 commentThe 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 commentThe 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?) |
||
ConditionRoutesReady GatewayConditionType = "RoutesReady" | ||
// ConditionRoutesValid indicates that all of the specified routes are valid. | ||
ConditionRoutesValid GatewayConditionType = "RoutesValid" | ||
) | ||
|
||
// GatewayCondition is an error status for a given route. | ||
|
@@ -326,15 +320,14 @@ type ListenerStatus struct { | |
type ListenerConditionType string | ||
|
||
const ( | ||
// ConditionInvalidListener is a generic condition that is a catch all for | ||
// unsupported configurations that do not match a more specific condition. | ||
// Implementors should try to use a more specific condition instead of this | ||
// one to give users and automation more information. | ||
ConditionInvalidListener ListenerConditionType = "InvalidListener" | ||
// ConditionListenerNotReady indicates the listener is not ready. | ||
ConditionListenerNotReady ListenerConditionType = "ListenerNotReady" | ||
// ConditionInvalidAddress indicates the Address is invalid. | ||
ConditionInvalidAddress ListenerConditionType = "InvalidAddress" | ||
// ConditionListenerValid is a generic condition that is a catch all for | ||
// supported configurations. Implementors should try to use a more specific | ||
// condition instead of this one to give users and automation more information. | ||
ConditionListenerValid ListenerConditionType = "ListenerValid" | ||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. Can we clarify that these will always overlap: Valid implies Ready? |
||
) | ||
|
||
// ListenerCondition is an error status for a given listener. | ||
|
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 theGatewayClass
referenced ingateway.spec.class
exists, unless I'm missing your point.