Skip to content

Commit

Permalink
apis: add GatewayClassConditionReason Unsupported (#3048)
Browse files Browse the repository at this point in the history
* apis: add GatewayClassConditionReason Invalid

Clarify description for when GatewayClassConditionReason
InvalidParameters should be preferred.

* doc: clarify expected behavior for bad reference in GatewayClass ParametersRef

* docs: GatewayClass SHOULD be rejected with InvalidParameters reason

* apis: switch from Invalid reason to Unsupported

* fixup codegen and yamllint

---------

Co-authored-by: Mike Morris <1149913+mikemorris@users.noreply.github.com>
  • Loading branch information
mikemorris and mikemorris authored May 10, 2024
1 parent a5b8cff commit 22c1c0e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
19 changes: 14 additions & 5 deletions apis/v1/gatewayclass_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ type GatewayClassSpec struct {
// or an implementation-specific custom resource. The resource can be
// cluster-scoped or namespace-scoped.
//
// If the referent cannot be found, the GatewayClass's "InvalidParameters"
// status condition will be true.
// If the referent cannot be found, refers to an unsupported kind, or when
// the data within that resource is malformed, the GatewayClass SHOULD be
// rejected with the "Accepted" status condition set to "False" and an
// "InvalidParameters" reason.
//
// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
// the merging behavior is implementation specific.
Expand Down Expand Up @@ -162,6 +164,7 @@ const (
// Possible reasons for this condition to be False are:
//
// * "InvalidParameters"
// * "Unsupported"
// * "UnsupportedVersion"
//
// Possible reasons for this condition to be Unknown are:
Expand All @@ -176,9 +179,10 @@ const (
// true.
GatewayClassReasonAccepted GatewayClassConditionReason = "Accepted"

// This reason is used with the "Accepted" condition when the
// GatewayClass was not accepted because the parametersRef field
// was invalid, with more detail in the message.
// This reason is used with the "Accepted" condition when the GatewayClass
// was not accepted because the parametersRef field refers to a nonexistent
// or unsupported resource or kind, or when the data within that resource is
// malformed.
GatewayClassReasonInvalidParameters GatewayClassConditionReason = "InvalidParameters"

// This reason is used with the "Accepted" condition when the
Expand All @@ -187,6 +191,11 @@ const (
// GatewayClass.
GatewayClassReasonPending GatewayClassConditionReason = "Pending"

// This reason is used with the "Accepted" condition when the GatewayClass
// was not accepted because the implementation does not support a
// user-defined GatewayClass.
GatewayClassReasonUnsupported GatewayClassConditionReason = "Unsupported"

// Deprecated: Use "Pending" instead.
GatewayClassReasonWaiting GatewayClassConditionReason = "Waiting"
)
Expand Down

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

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

2 changes: 1 addition & 1 deletion pkg/generated/openapi/zz_generated.openapi.go

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

0 comments on commit 22c1c0e

Please sign in to comment.