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

add ListenerConditionAccepted, update docs from "Detached" #1446

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions apis/v1alpha2/gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Listener = v1beta1.Listener
// ProtocolType defines the application protocol accepted by a Listener.
// Implementations are not required to accept all the defined protocols.
// If an implementation does not support a specified protocol, it
// should raise a "Detached" condition for the affected Listener with
// should set the "Accepted" condition to "False" for the affected Listener with
// a reason of "UnsupportedProtocol".
//
// Core ProtocolType values are listed in the table below.
Expand Down Expand Up @@ -337,45 +337,54 @@ const (
// if it specifies an unsupported requirement, or prerequisite
// resources are not available.
//
// Possible reasons for this condition to be true are:
// Possible reasons for this condition to be True are:
//
// * "PortUnavailable"
// * "UnsupportedProtocol"
// * "UnsupportedAddress"
// * "Accepted"
//
// Possible reasons for this condition to be False are:
//
// * "Attached"
// * "PortUnavailable"
// * "UnsupportedProtocol"
// * "UnsupportedAddress"
//
// Controllers may raise this condition with other reasons,
// but should prefer to use the reasons listed above to improve
// interoperability.
ListenerConditionAccepted ListenerConditionType = "Accepted"
Copy link
Contributor

Choose a reason for hiding this comment

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

The docs here (L330) are wrong now, the polarity should be inverted


// Deprecated: use "Accepted" instead.
ListenerConditionDetached ListenerConditionType = "Detached"

// This reason is used with the "Detached" condition when the Listener
// This reason is used with the "Accepted" condition when the condition is
// True.
ListenerReasonAccepted ListenerConditionReason = "Accepted"

// This reason is used with the "Detached" condition when the condition is
// False.
//
// Deprecated: use the "Accepted" condition with reason "Accepted" instead.
ListenerReasonAttached ListenerConditionReason = "Attached"

// This reason is used with the "Accepted" condition when the Listener
// requests a port that cannot be used on the Gateway. This reason could be
// used in a number of instances, including:
//
// * The port is already in use.
// * The port is not supported by the implementation.
ListenerReasonPortUnavailable ListenerConditionReason = "PortUnavailable"

// This reason is used with the "Detached" condition when the
// This reason is used with the "Accepted" condition when the
// Listener could not be attached to be Gateway because its
// protocol type is not supported.
ListenerReasonUnsupportedProtocol ListenerConditionReason = "UnsupportedProtocol"

// This reason is used with the "Detached" condition when the Listener could
// This reason is used with the "Accepted" condition when the Listener could
// not be attached to the Gateway because the requested address is not
// supported. This reason could be used in a number of instances, including:
//
// * The address is already in use.
// * The type of address is not supported by the implementation.
ListenerReasonUnsupportedAddress ListenerConditionReason = "UnsupportedAddress"

// This reason is used with the "Detached" condition when the condition is
// False.
ListenerReasonAttached ListenerConditionReason = "Attached"
)

const (
Expand Down
10 changes: 6 additions & 4 deletions apis/v1alpha2/grpcroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,17 @@ import (
//
// Implementations supporting `GRPCRoute` with the `HTTPS` `ProtocolType` MUST
// accept HTTP/2 connections without an initial upgrade from HTTP/1.1, i.e. via
// ALPN. If the implementation does not support this, then it MUST raise a "Detached"
// condition for the affected listener with a reason of "UnsupportedProtocol".
// ALPN. If the implementation does not support this, then it MUST set the "Accepted"
// condition to "False" for the affected listener with a reason of
// "UnsupportedProtocol".
// Note that a compliant implementation MAY also accept HTTP/2 connections with an
// upgrade from HTTP/1.
//
// Implementations supporting `GRPCRoute` with the `HTTP` `ProtocolType` MUST
// support cleartext HTTP/2 without an initial upgrade from HTTP/1.1. If the
// implementation does not support this, then it MUST raise a "Detached"
// condition for the affected listener with a reason of "UnsupportedProtocol".
// implementation does not support this, then it MUST set the "Accepted"
// condition to "False" for the affected listener with a reason of
// "UnsupportedProtocol".
// Note that a compliant implementation MAY also accept HTTP/2 connections with an
// upgrade from HTTP/1.
//
Expand Down
35 changes: 22 additions & 13 deletions apis/v1beta1/gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ type Listener struct {
// ProtocolType defines the application protocol accepted by a Listener.
// Implementations are not required to accept all the defined protocols.
// If an implementation does not support a specified protocol, it
// should raise a "Detached" condition for the affected Listener with
// should set the "Accepted" condition for the affected Listener with
// a reason of "UnsupportedProtocol".
//
// Core ProtocolType values are listed in the table below.
Expand Down Expand Up @@ -681,45 +681,54 @@ const (
// if it specifies an unsupported requirement, or prerequisite
// resources are not available.
//
// Possible reasons for this condition to be true are:
// Possible reasons for this condition to be True are:
//
// * "PortUnavailable"
// * "UnsupportedProtocol"
// * "UnsupportedAddress"
// * "Accepted"
//
// Possible reasons for this condition to be False are:
//
// * "Attached"
// * "PortUnavailable"
// * "UnsupportedProtocol"
// * "UnsupportedAddress"
//
// Controllers may raise this condition with other reasons,
// but should prefer to use the reasons listed above to improve
// interoperability.
ListenerConditionAccepted ListenerConditionType = "Accepted"

// Deprecated: use "Accepted" instead.
ListenerConditionDetached ListenerConditionType = "Detached"

// This reason is used with the "Detached" condition when the Listener
// This reason is used with the "Accepted" condition when the condition is
// True.
ListenerReasonAccepted ListenerConditionReason = "Accepted"

// This reason is used with the "Detached" condition when the condition is
// False.
//
// Deprecated: use the "Accepted" condition with reason "Accepted" instead.
ListenerReasonAttached ListenerConditionReason = "Attached"

// This reason is used with the "Accepted" condition when the Listener
// requests a port that cannot be used on the Gateway. This reason could be
// used in a number of instances, including:
//
// * The port is already in use.
// * The port is not supported by the implementation.
ListenerReasonPortUnavailable ListenerConditionReason = "PortUnavailable"

// This reason is used with the "Detached" condition when the
// This reason is used with the "Accepted" condition when the
// Listener could not be attached to be Gateway because its
// protocol type is not supported.
ListenerReasonUnsupportedProtocol ListenerConditionReason = "UnsupportedProtocol"

// This reason is used with the "Detached" condition when the Listener could
// This reason is used with the "Accepted" condition when the Listener could
// not be attached to the Gateway because the requested address is not
// supported. This reason could be used in a number of instances, including:
//
// * The address is already in use.
// * The type of address is not supported by the implementation.
ListenerReasonUnsupportedAddress ListenerConditionReason = "UnsupportedAddress"

// This reason is used with the "Detached" condition when the condition is
// False.
ListenerReasonAttached ListenerConditionReason = "Attached"
)

const (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.