diff --git a/CHANGELOG.md b/CHANGELOG.md index edb53e7ccc..dd44482298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,6 +155,9 @@ Adding a new version? You'll need three changes: - Bump version of gateway API to `1.0.0-rc1` and support `Gateway`, `GatewayClass` and `HTTPRoute` in API version `gateway.networking.k8s.io/v1`. [#4893](https://github.com/Kong/kubernetes-ingress-controller/pull/4893) +- Update `Gateway`s, `GatewayClass`es and `HTTPRoute`s in examples to API + version `gateway.networking.k8s.io/v1`. +[#4935](https://github.com/Kong/kubernetes-ingress-controller/pull/4935) ### Added @@ -398,7 +401,7 @@ Adding a new version? You'll need three changes: [#4458](https://github.com/Kong/kubernetes-ingress-controller/pull/4458) [gojson]: https://github.com/goccy/go-json -[httproute-specification]: https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRoute +[httproute-specification]: https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.HTTPRoute [grpcroute-specification]: https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1alpha2.GRPCRouteRule ## [2.10.5] diff --git a/examples/gateway-grpcroute.yaml b/examples/gateway-grpcroute.yaml index 38808351c4..870fe63dfa 100644 --- a/examples/gateway-grpcroute.yaml +++ b/examples/gateway-grpcroute.yaml @@ -45,7 +45,7 @@ data: tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JRzJBZ0VBTUJBR0J5cUdTTTQ5QWdFR0JTdUJCQUFpQklHZU1JR2JBZ0VCQkRERFJuZGdQWVphb25WdXFIaXUKNXV1WVdJK0ExNkJZTG9VQm5ZMC85Qkw5VTBzNDdHN0xDL2IwNXdFLzdVUEpFQktoWkFOaUFBUkI1eC9PekdZLwpBTFRxNDJ6ZVRLSXNOdnB1dWVBemhtMFplREJ3WVBmM2R4dGlacTZkOEU5RzNHcUh2cEVwMUwzRE9yaXI2Z0h4CjAreEFxQUUyR1VsT3Y2SVVmME9MdHNGa1Z4aXJINUtjMVJkblIwTTBGdGJpczlWTWtkQzkyaWM9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K type: kubernetes.io/tls --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: kong @@ -54,7 +54,7 @@ metadata: spec: controllerName: konghq.com/kic-gateway-controller --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: kong diff --git a/examples/gateway-httproute.yaml b/examples/gateway-httproute.yaml index 3a335c73b6..2f774b7f43 100644 --- a/examples/gateway-httproute.yaml +++ b/examples/gateway-httproute.yaml @@ -74,7 +74,7 @@ spec: app: nginx type: ClusterIP --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: kong @@ -83,7 +83,7 @@ metadata: spec: controllerName: konghq.com/kic-gateway-controller --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: kong @@ -94,7 +94,7 @@ spec: protocol: HTTP port: 80 --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: httproute-testing diff --git a/examples/gateway-referencegrant-httproute.yaml b/examples/gateway-referencegrant-httproute.yaml index 1baf524f10..6f3c56c1ef 100644 --- a/examples/gateway-referencegrant-httproute.yaml +++ b/examples/gateway-referencegrant-httproute.yaml @@ -59,7 +59,7 @@ spec: - group: "" kind: Service --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: kong @@ -68,7 +68,7 @@ metadata: spec: controllerName: konghq.com/kic-gateway-controller --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: kong @@ -80,7 +80,7 @@ spec: protocol: HTTP port: 80 --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: httproute-testing diff --git a/examples/gateway-tcproute.yaml b/examples/gateway-tcproute.yaml index 64f3faece1..8a882abafe 100644 --- a/examples/gateway-tcproute.yaml +++ b/examples/gateway-tcproute.yaml @@ -39,7 +39,7 @@ spec: app: tcpecho type: ClusterIP --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: kong @@ -48,7 +48,7 @@ metadata: spec: controllerName: konghq.com/kic-gateway-controller --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: kong diff --git a/examples/gateway-tlsroute.yaml b/examples/gateway-tlsroute.yaml index 70379449a5..80536854cc 100644 --- a/examples/gateway-tlsroute.yaml +++ b/examples/gateway-tlsroute.yaml @@ -63,7 +63,7 @@ data: tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBNllBQmR1TDJJak9NN1l5T2xkNGNuVXgyUElNNzlNZHVHMEQ1N0NxdjMyV0ZVMnF4ClcyM0VkMTZXNkYydjhJSkl2bEtzQ3dZSit0bHVGSExLeEU2TmZGa3NHTjhsOHkyM3pwTzBvZm1wRDJVSFliWDgKcGR5enoyeXFuMFlHc05raFNoZmJsTGl0Nm9mYzZsSGYzaURxMkVTNlQ1QURualdHb0R5Q3Q5YVhvUXRRR0FVVwo1MVJxckpJTzNSMFBOUjFoM0toU21RaGh2ZHZwbTRoWFAwazNML2xGTFJDR0Y2Q1dVbWdyRzFaM0pRN0FsUmFWCk1kVzh3N3hvZTN2YlZvV2xTQjI2clpCQVcxZFhTaG10TTQ3L1lyb0E1bmdBdUlCU3J2ZXdsQjI2L2dVN1BFZlYKYkNydmpKdVhjR1JQdjdZMGt3a3BzdFh5TklYQWlxRENqTW94NFFJRE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1ZycEwyd2pOZEhQcHFuMzRWZgpReW9TSTlVeDYxVVp5ekUvY3gzQXJ5V1hPbDdiWldFNmZxaWliRU5mcTUybXJtd3I2Qi80bVRnWm04SlJjVTByCjVOVkhMblh1OWtCcE9NWmpwTmpDOUlFQ2dZRUF4MU4yZUgvK1Fub01PWVZKZ1ZnUkZXWkMzbENNeU1kMmZjanMKUmMzY3FMUjVQS1BuQTdzamVGTGQ0cG5kMVJIakZBQWU1dmZZTll6ZEZwanY0bEp1bDZoRjMrQTZTZ01uWk1rbAppZVlCa01QQ3JtaUZnbDMxQk5SeE0xNmp4MWYrY002TmpaRGQyQzBsL2UxRXRqUGhBbEVpM0tHY2NaQ3Y5NS9JCi8wczRHNWtDZ1lBdy9sa3dxTTg0Z3lwRjhWS0tydnVRa0NGbnhIa0tmRjBid0hJUHFBOTJoSzNTTVVocjd2MncKc0hURTJVeHE2ZUtEa01NUmdkZEYxSlBJQ2poZjR0cHYzSStVTlUxTUxDbFEwbVdLTUN4WXFBQ0JHcmx2Nit0bQpFTEJDaXFjL29CSnJXY3Fvc1NraFcxQjdEVWNYemtQUGVqR09RSUUrZ08yMkVxSW80QWhySUE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= type: kubernetes.io/tls --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: kong @@ -72,7 +72,7 @@ metadata: spec: controllerName: konghq.com/kic-gateway-controller --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: kong diff --git a/examples/gateway-udproute.yaml b/examples/gateway-udproute.yaml index 53609744d1..1919351245 100644 --- a/examples/gateway-udproute.yaml +++ b/examples/gateway-udproute.yaml @@ -79,7 +79,7 @@ spec: app: coredns type: ClusterIP --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: kong @@ -88,7 +88,7 @@ metadata: spec: controllerName: konghq.com/kic-gateway-controller --- -apiVersion: gateway.networking.k8s.io/v1beta1 +apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: kong diff --git a/internal/controllers/gateway/httproute_controller.go b/internal/controllers/gateway/httproute_controller.go index d5914e4af4..af1d9074f6 100644 --- a/internal/controllers/gateway/httproute_controller.go +++ b/internal/controllers/gateway/httproute_controller.go @@ -410,7 +410,7 @@ func (r *HTTPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( // if there is no matched hosts in listeners for the httproute, the httproute should not be accepted // and have an "Accepted" condition with status false. - // https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRoute + // https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.HTTPRoute filteredHTTPRoute, err := filterHostnames(gateways, httproute.DeepCopy()) // perform operations on the kong store only if the route is in accepted status and there is hostname matching if isRouteAccepted(gateways) && err == nil { diff --git a/internal/dataplane/parser/translators/httproute_atc.go b/internal/dataplane/parser/translators/httproute_atc.go index e02cbfb53b..aba0fcbb7a 100644 --- a/internal/dataplane/parser/translators/httproute_atc.go +++ b/internal/dataplane/parser/translators/httproute_atc.go @@ -167,7 +167,7 @@ func pathMatcherFromHTTPPathMatch(pathMatch *gatewayapi.HTTPPathMatch) atc.Match return atc.NewPredicateHTTPPath(atc.OpPrefixMatch, "/") } // if path ends with /, we should remove the trailing / because it should be ignored: - // https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.PathMatchType + // https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.PathMatchType path = strings.TrimSuffix(path, "/") return atc.Or( atc.NewPredicateHTTPPath(atc.OpEqual, path), diff --git a/internal/util/k8s_test.go b/internal/util/k8s_test.go index 4bebc8cd3d..9a4393192b 100644 --- a/internal/util/k8s_test.go +++ b/internal/util/k8s_test.go @@ -255,7 +255,7 @@ func TestGenerateTagsForObject(t *testing.T) { lo.ToPtr(K8sKindTagPrefix + "HTTPRoute"), lo.ToPtr(K8sUIDTagPrefix + "buryani"), lo.ToPtr(K8sGroupTagPrefix + "gateway.networking.k8s.io"), - lo.ToPtr(K8sVersionTagPrefix + "v1beta1"), + lo.ToPtr(K8sVersionTagPrefix + "v1"), lo.ToPtr("temir-jol"), lo.ToPtr("snaryad-soqqısı"), } @@ -264,7 +264,7 @@ func TestGenerateTagsForObject(t *testing.T) { // Relevant kubernetes issue: https://github.com/kubernetes/kubernetes/issues/80609 testObj := &gatewayapi.HTTPRoute{ TypeMeta: metav1.TypeMeta{ - APIVersion: "gateway.networking.k8s.io/v1beta1", + APIVersion: "gateway.networking.k8s.io/v1", Kind: "HTTPRoute", }, ObjectMeta: metav1.ObjectMeta{