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

v1.1.0 GRPCRoute v1alpha2 mistakenly changes status to not be a subresource #3411

Open
kflynn opened this issue Oct 25, 2024 · 1 comment
Open
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@kflynn
Copy link
Contributor

kflynn commented Oct 25, 2024

What happened:

Commit 7aeddcf appears to intend to make GRPCRoute v1alpha2 a type alias for GRPCRoute v1. This makes sense; it's part of promoting GRPCRoute to GA. All well and good.

However, 7aeddcf also drops the kubebuilder comments that would (among other things) make GRPCRoute's status a subresource. This appears to be an error (look at apis/v1beta1/httproute_types.go, which is the same kind of type alias, but preserves the kubebuilder comments).

The end result is that GRPCRoute v1alpha2's status is no longer a subresource, which means that it's no longer possible to PATCH the status, which prevents any implementation using GRPCRoute v1alpha2 from working.

As it happens, Linkerd is a lovely reproducer for this:

  • install GRPCRoute v1.1.0 experimental
  • linkerd install --crds --set enableHttpRoutes=false | kubectl apply -f -
  • linkerd install --set enableHttpRoutes=false | kubectl apply -f -
  • linkerd check

Install an application, then apply a GRPCRoute with a parentRef pointing to a Service. You'll find that your GRPCRoute never gets a status stanza at all, and you'll see errors logged from the Linkerd destination controller's policy container because the API server returns a 404 when it tries to patch your GRPCRoute's status.

This diff:

diff --git a/apis/v1alpha2/grpcroute_types.go b/apis/v1alpha2/grpcroute_types.go
index 0b0bb4e8..a3cf590c 100644
--- a/apis/v1alpha2/grpcroute_types.go
+++ b/apis/v1alpha2/grpcroute_types.go
@@ -24,6 +24,10 @@ import (

 // +genclient
 // +kubebuilder:object:root=true
+// +kubebuilder:resource:categories=gateway-api
+// +kubebuilder:subresource:status
+// +kubebuilder:printcolumn:name="Hostnames",type=string,JSONPath=`.spec.hostnames`
+// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
 // +kubebuilder:deprecatedversion:warning="The v1alpha2 version of GRPCRoute has been deprecated and will be removed in a future release of the API. Please upgrade to v1."
 type GRPCRoute v1.GRPCRoute

seems to do the right thing: if you apply that and run make codegen then the diffs in config/crd look reasonable -- and, perhaps more importantly, if one applies the experimental channel CRDs for v1.1.0, then applies the generated config/crd/gateway.networking.k8s.io_grpcroutes.yaml, then installs Linkerd as above, everything works.

I'll open a PR shortly.

@kflynn kflynn added the kind/bug Categorizes issue or PR as related to a bug. label Oct 25, 2024
@shaneutt
Copy link
Member

shaneutt commented Oct 25, 2024

Thanks for identifying this problem and working on a fix Flynn! 🙇

/triage accepted
/priority critical-urgent
/assign @kflynn

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. labels Oct 25, 2024
@shaneutt shaneutt added this to the v1.1.1 milestone Oct 25, 2024
kflynn added a commit to kflynn/gateway-api that referenced this issue Oct 25, 2024
…the same as v1.

Fixes kubernetes-sigs#3411.

Signed-off-by: Flynn <emissary@flynn.kodachi.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. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: In Progress
Development

No branches or pull requests

3 participants