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

Inconsistent Default Reason for GatewayClass Status Condition Accepted #3225

Closed
snorwin opened this issue Jul 29, 2024 · 1 comment · Fixed by #3257
Closed

Inconsistent Default Reason for GatewayClass Status Condition Accepted #3225

snorwin opened this issue Jul 29, 2024 · 1 comment · Fixed by #3257
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@snorwin
Copy link
Contributor

snorwin commented Jul 29, 2024

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

@snorwin snorwin added the kind/bug Categorizes issue or PR as related to a bug. label Jul 29, 2024
@youngnick
Copy link
Contributor

Thanks for this @snorwin, agreed, the reasons should be the same there.

So this just needs a PR to change the Reason field in the two lines mentioned above to the same value (Pending).

/help-wanted

snorwin added a commit to snorwin/gateway-api that referenced this issue Aug 9, 2024
…sigs#3225)

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
k8s-ci-robot pushed a commit that referenced this issue Aug 10, 2024
Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants