What happened:
According to the API reference, Pending is the default Reason for the status condition Accepted of a new GatewayClass. However, in the actual code, the default reason is inconsistently set to two different values:
// +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", message: "Waiting for controller", reason: "Waiting", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
// +kubebuilder:default={{type: "Accepted", status: "Unknown", message: "Waiting for controller", reason: "Pending", lastTransitionTime: "1970-01-01T00:00:00Z"}}
During the creation of a resource, the status is typically absent. As a result, the reason for the status condition Accepted is still set to the deprecated value Waiting.
What you expected to happen:
Regardless of how a GatewayClass is created, the reason for the status condition Accepted should always be set to Pending.
How to reproduce it (as minimally and precisely as possible):
Apply the following manifest and verify its status:
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: foo
spec:
controllerName: foo.com/bar
Anything else we need to know?:
N/A
What happened:
According to the API reference,
Pendingis the default Reason for the status conditionAcceptedof a new GatewayClass. However, in the actual code, the default reason is inconsistently set to two different values:During the creation of a resource, the status is typically absent. As a result, the reason for the status condition
Acceptedis still set to the deprecated valueWaiting.What you expected to happen:
Regardless of how a GatewayClass is created, the reason for the status condition
Acceptedshould always be set toPending.How to reproduce it (as minimally and precisely as possible):
Apply the following manifest and verify its status:
Anything else we need to know?:
N/A