-
Notifications
You must be signed in to change notification settings - Fork 597
Description
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.