kubernetes-sigs / gateway-api

Repository for the next iteration of composite service (e.g. Ingress) and load balancing APIs.
https://gateway-api.sigs.k8s.io
Apache License 2.0
1.67k stars 438 forks source link

The v1alpha2 version is missing in the backendtlspolicy CRD. #3086

Closed tao12345666333 closed 1 month ago

tao12345666333 commented 1 month ago

What happened:

When I upgraded my CRDs to v1.1, I encountered the following error.

(⎈|steep-abyss:default)➜  ~ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/experimental-install.yaml                                
customresourcedefinition.apiextensions.k8s.io/backendtlspolicies.gateway.networking.k8s.io created                                                                            
customresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io created                                                                                
customresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io created                                                                                      
customresourcedefinition.apiextensions.k8s.io/grpcroutes.gateway.networking.k8s.io created                                                                                    
customresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io created                                                                                    
customresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io created                                                                               
customresourcedefinition.apiextensions.k8s.io/tcproutes.gateway.networking.k8s.io created                                                                                     
customresourcedefinition.apiextensions.k8s.io/tlsroutes.gateway.networking.k8s.io created                                                                                     
customresourcedefinition.apiextensions.k8s.io/udproutes.gateway.networking.k8s.io created                                                                                     
(⎈|steep-abyss:default)➜  ~ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml 
customresourcedefinition.apiextensions.k8s.io/backendlbpolicies.gateway.networking.k8s.io created
customresourcedefinition.apiextensions.k8s.io/gatewayclasses.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/gateways.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/grpcroutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/httproutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/referencegrants.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/tcproutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/tlsroutes.gateway.networking.k8s.io configured
customresourcedefinition.apiextensions.k8s.io/udproutes.gateway.networking.k8s.io configured
The CustomResourceDefinition "backendtlspolicies.gateway.networking.k8s.io" is invalid: status.storedVersions[0]: Invalid value: "v1alpha2": must appear in spec.versions

What you expected to happen:

no error

How to reproduce it (as minimally and precisely as possible):

kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/experimental-install.yaml  

# Then install v1.1 CRDs

kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/experimental-install.yaml  

Anything else we need to know?:

robscott commented 1 month ago

Thanks for reporting this, I definitely get that this behavior is confusing. This is actually intentional though - we made breaking changes (field renames) to BackendTLSPolicy in v1.1. That resulted in us bumping the version to v1alpha3, and dropping v1alpha2 since we do not want to maintain a conversion webhook. I added more information about this transition in https://github.com/kubernetes-sigs/gateway-api/pull/3084.

tao12345666333 commented 1 month ago

Thank you @robscott

Now that I understand the background. Do we need to include a note in the upgrade guide about how to fix this error?

robscott commented 1 month ago

That's a good idea, open to any suggestions for how to improve what we have there!