diff --git a/README.md b/README.md index a643f5d643..417db21ab9 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Before you can build and run the NGINX Kubernetes Gateway, make sure you have th ``` 1. Build the image: - + ``` make PREFIX=myregistry.example.com/nginx-kubernetes-gateway container ``` @@ -44,7 +44,7 @@ Before you can build and run the NGINX Kubernetes Gateway, make sure you have th ## Deploy NGINX Kubernetes Gateway -You can deploy NGINX Kubernetes Gateway on an existing Kubernetes 1.16+ cluster. The following instructions walk through the steps for deploying on a [kind](https://kind.sigs.k8s.io/) cluster. +You can deploy NGINX Kubernetes Gateway on an existing Kubernetes 1.16+ cluster. The following instructions walk through the steps for deploying on a [kind](https://kind.sigs.k8s.io/) cluster. 1. Load the NGINX Kubernetes Gateway image onto your kind cluster: @@ -57,11 +57,11 @@ You can deploy NGINX Kubernetes Gateway on an existing Kubernetes 1.16+ cluster. 1. Install the Gateway CRDs: ``` - kubectl apply -k "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.4.2" + kubectl apply -k "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.5.0" ``` 1. Create the nginx-gateway namespace: - + ``` kubectl apply -f deploy/manifests/namespace.yaml ``` @@ -69,7 +69,7 @@ You can deploy NGINX Kubernetes Gateway on an existing Kubernetes 1.16+ cluster. 1. Create the njs-modules configmap: ``` - kubectl create configmap njs-modules --from-file=internal/nginx/modules/src/httpmatches.js -n nginx-gateway + kubectl create configmap njs-modules --from-file=internal/nginx/modules/src/httpmatches.js -n nginx-gateway ``` 1. Create the GatewayClass resource: @@ -84,7 +84,7 @@ You can deploy NGINX Kubernetes Gateway on an existing Kubernetes 1.16+ cluster. ``` kubectl apply -f deploy/manifests/nginx-gateway.yaml - ``` + ``` 1. Confirm the NGINX Kubernetes Gateway is running in `nginx-gateway` namespace: @@ -110,7 +110,7 @@ A `NodePort` service will randomly allocate one port on every node of the cluste ### Create a LoadBalancer Service -Create a service with type `LoadBalancer` using the appropriate manifest for your cloud provider. +Create a service with type `LoadBalancer` using the appropriate manifest for your cloud provider. - For GCP or Azure: @@ -119,13 +119,13 @@ Create a service with type `LoadBalancer` using the appropriate manifest for you ``` Lookup the public IP of the load balancer: - + ``` kubectl get svc nginx-gateway -n nginx-gateway - ``` - + ``` + Use the public IP of the load balancer to access NGINX Kubernetes Gateway. - + - For AWS: ``` @@ -136,8 +136,8 @@ Create a service with type `LoadBalancer` using the appropriate manifest for you ``` kubectl get svc nginx-gateway -n nginx-gateway - ``` - + ``` + In general, you should rely on the NLB DNS name, however for testing purposes you can resolve the DNS name to get the IP address of the load balancer: ``` diff --git a/deploy/manifests/gatewayclass.yaml b/deploy/manifests/gatewayclass.yaml index 36ca9e9bbb..aad4511d8b 100644 --- a/deploy/manifests/gatewayclass.yaml +++ b/deploy/manifests/gatewayclass.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: GatewayClass metadata: name: nginx diff --git a/design/archive/gateway-evaluation.md b/design/archive/gateway-evaluation.md index 40561eac5a..bfaf2ea708 100644 --- a/design/archive/gateway-evaluation.md +++ b/design/archive/gateway-evaluation.md @@ -33,7 +33,7 @@ The Gateway evaluation will employ each in the following manner: Gateway evaluation requires supplemental resources; other Core API resources are needed to complete traffic routing between an ingress point and the final backend Pod endpoints. Required supplemental resources are: * Services: The AppDev controls the resource lifecycle and is responsible for creating, updating, and deleting Service resources. Kubernetes Service resources describe a logical collection of like processes and act as a load balancing primitive. AppDevs create Service resources to describe their product subsystems, Services act as an abstraction for a set of real backend processes that can serve requests. -* Endpoints: Kubernetes controllers manage Endpoint resources, Endpoints provide the association between Service abstractions and real servers. Gateway evaluation will watch Endpoints to discover upstream addresses. When AppDevs create Service and HTTPRoute objects, Gateway evaluation uses references in the HTTPRoute (via a HTTPRouteRules and HTTPBackendRefs (see [HTTP Routing](https://gateway-api.sigs.k8s.io/v1alpha2/guides/http-routing/) for more detail)) to discover the Pod IP endpoints, i.e. Gateway evaluation uses Endpoints resources, referred to by HTTPRoutes, to link routing rules to upstream addresses. +* Endpoints: Kubernetes controllers manage Endpoint resources, Endpoints provide the association between Service abstractions and real servers. Gateway evaluation will watch Endpoints to discover upstream addresses. When AppDevs create Service and HTTPRoute objects, Gateway evaluation uses references in the HTTPRoute (via a HTTPRouteRules and HTTPBackendRefs (see [HTTP Routing](https://gateway-api.sigs.k8s.io/guides/http-routing/) for more detail)) to discover the Pod IP endpoints, i.e. Gateway evaluation uses Endpoints resources, referred to by HTTPRoutes, to link routing rules to upstream addresses. ### Goals - Vet a minimal feature set of Core resources for their applicability and conformance to NGINX configuration models. diff --git a/examples/advanced-routing/cafe-routes.yaml b/examples/advanced-routing/cafe-routes.yaml index 614f5fe1c4..06d0eaa547 100644 --- a/examples/advanced-routing/cafe-routes.yaml +++ b/examples/advanced-routing/cafe-routes.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: coffee @@ -33,7 +33,7 @@ spec: - name: coffee-v2-svc port: 80 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: tea diff --git a/examples/advanced-routing/gateway.yaml b/examples/advanced-routing/gateway.yaml index 5ce1a34b21..9fb0ebd1af 100644 --- a/examples/advanced-routing/gateway.yaml +++ b/examples/advanced-routing/gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway diff --git a/examples/cafe-example/cafe-routes.yaml b/examples/cafe-example/cafe-routes.yaml index b84c4ce6ab..70a21a64ed 100644 --- a/examples/cafe-example/cafe-routes.yaml +++ b/examples/cafe-example/cafe-routes.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: cafe @@ -13,7 +13,7 @@ spec: - name: main port: 80 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: coffee @@ -32,7 +32,7 @@ spec: - name: coffee port: 80 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: tea diff --git a/examples/cafe-example/gateway.yaml b/examples/cafe-example/gateway.yaml index 5ce1a34b21..9fb0ebd1af 100644 --- a/examples/cafe-example/gateway.yaml +++ b/examples/cafe-example/gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway diff --git a/examples/https-termination/README.md b/examples/https-termination/README.md index fc0270a42c..eafd4e0436 100644 --- a/examples/https-termination/README.md +++ b/examples/https-termination/README.md @@ -9,21 +9,21 @@ In this example we expand on the simple [cafe-example](../cafe-example) by addin 1. Follow the [installation instructions](https://github.com/nginxinc/nginx-kubernetes-gateway/blob/main/README.md#run-nginx-gateway) to deploy NGINX Gateway. 1. Save the public IP address of NGINX Kubernetes Gateway into a shell variable: - + ``` GW_IP=XXX.YYY.ZZZ.III ``` 1. Save the HTTPS port of NGINX Kubernetes Gateway: - + ``` GW_HTTPS_PORT=port ``` -## 2. Deploy the Cafe Application +## 2. Deploy the Cafe Application 1. Create the coffee and the tea deployments and services: - + ``` kubectl apply -f cafe.yaml ``` @@ -45,21 +45,21 @@ In this example we expand on the simple [cafe-example](../cafe-example) by addin ``` The TLS certificate and key in this secret are used to terminate the TLS connections for the cafe application. - **Important**: This certificate and key are for demo purposes only. - + **Important**: This certificate and key are for demo purposes only. + 1. Create the `Gateway` resource: ``` kubectl apply -f gateway.yaml ``` - This [gateway](./gateway.yaml) configures an `https` listener is to terminate TLS connections using the `cafe-secret` we created in the step 1. + This [gateway](./gateway.yaml) configures an `https` listener is to terminate TLS connections using the `cafe-secret` we created in the step 1. 1. Create the `HTTPRoute` resources: ``` kubectl apply -f cafe-routes.yaml ``` - To configure HTTPS termination for our cafe application, we will bind the `https` listener to our `HTTPRoutes` in [cafe-routes.yaml](./cafe-routes.yaml) using the [`parentRef`](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io%2fv1alpha2.ParentReference) field: + To configure HTTPS termination for our cafe application, we will bind the `https` listener to our `HTTPRoutes` in [cafe-routes.yaml](./cafe-routes.yaml) using the [`parentReference`](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.ParentReference) field: ```yaml parentRefs: diff --git a/examples/https-termination/cafe-routes.yaml b/examples/https-termination/cafe-routes.yaml index 33a87d375e..a91a469275 100644 --- a/examples/https-termination/cafe-routes.yaml +++ b/examples/https-termination/cafe-routes.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: coffee @@ -17,7 +17,7 @@ spec: - name: coffee port: 80 --- -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: name: tea diff --git a/examples/https-termination/gateway.yaml b/examples/https-termination/gateway.yaml index 13a00f8d4c..1a815686f3 100644 --- a/examples/https-termination/gateway.yaml +++ b/examples/https-termination/gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: gateway.networking.k8s.io/v1alpha2 +apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: name: gateway diff --git a/go.mod b/go.mod index 3f8d32607a..8272b509cb 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( k8s.io/code-generator v0.24.3 sigs.k8s.io/controller-runtime v0.12.3 sigs.k8s.io/controller-tools v0.9.2 - sigs.k8s.io/gateway-api v0.4.2 + sigs.k8s.io/gateway-api v0.5.0 ) require ( diff --git a/go.sum b/go.sum index b26d0b58aa..11788d64eb 100644 --- a/go.sum +++ b/go.sum @@ -37,16 +37,12 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -58,7 +54,6 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -80,8 +75,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= @@ -98,23 +91,18 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -123,10 +111,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= @@ -139,8 +125,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -168,30 +152,22 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/flect v0.2.3/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= github.com/gobuffalo/flect v0.2.5 h1:H6vvsv2an0lalEaCDRThvtBfmg44W/QHXBCYUXf/6S4= github.com/gobuffalo/flect v0.2.5/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -202,7 +178,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -253,7 +228,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -275,26 +249,18 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -311,7 +277,6 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -332,7 +297,6 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -354,26 +318,20 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= @@ -390,7 +348,6 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -410,10 +367,7 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= @@ -422,11 +376,8 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042 github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= @@ -434,7 +385,6 @@ github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeR github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -468,7 +418,6 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -496,26 +445,17 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -524,10 +464,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -536,10 +474,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= @@ -569,7 +504,6 @@ go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -583,7 +517,6 @@ go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= @@ -592,12 +525,10 @@ golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -632,7 +563,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -656,7 +586,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -679,12 +608,10 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -704,7 +631,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -733,10 +659,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -762,7 +686,6 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -779,7 +702,6 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -793,9 +715,7 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -808,12 +728,10 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -829,7 +747,6 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -906,7 +823,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -950,7 +866,6 @@ google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201102152239-715cce707fb0/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1005,13 +920,11 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1041,79 +954,49 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= -k8s.io/api v0.22.1/go.mod h1:bh13rkTp3F1XEaLGykbyRD2QaTTzPm0e/BMd8ptFONY= k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= -k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apiextensions-apiserver v0.24.2 h1:/4NEQHKlEz1MlaK/wHT5KMKC9UKYz6NZz6JE6ov4G6k= k8s.io/apiextensions-apiserver v0.24.2/go.mod h1:e5t2GMFVngUEHUd0wuCJzw8YDwZoqZfJiGOW6mm2hLQ= -k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.24.2/go.mod h1:pSuKzr3zV+L+MWqsEo0kHHYwCo77AT5qXbFXP2jbvFI= -k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= -k8s.io/client-go v0.22.1/go.mod h1:BquC5A4UOo4qVDUtoc04/+Nxp1MeHcVc1HJm1KmG8kk= k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= -k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= -k8s.io/code-generator v0.22.0/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/code-generator v0.24.3 h1:itd1V1ZAYKM+WT+qQDlFKhU1D/Ff5HcEFL/icfClnZA= k8s.io/code-generator v0.24.3/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= -k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= k8s.io/component-base v0.24.2 h1:kwpQdoSfbcH+8MPN4tALtajLDfSfYxBDYlXobNWI6OU= k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHzPMyB0t8BaFeBYI= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.10.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea h1:3QOH5+2fGsY8e1qf+GIFpg+zw/JGNrgyZRQR7/m6uWg= k8s.io/kube-openapi v0.0.0-20220803164354-a70c9af30aea/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -sigs.k8s.io/controller-tools v0.6.2/go.mod h1:oaeGpjXn6+ZSEIQkUe/+3I40PNiDYp9aeawbt3xTgJ8= sigs.k8s.io/controller-tools v0.9.2 h1:AkTE3QAdz9LS4iD3EJvHyYxBkg/g9fTbgiYsrcsFCcM= sigs.k8s.io/controller-tools v0.9.2/go.mod h1:NUkn8FTV3Sad3wWpSK7dt/145qfuQ8CKJV6j4jHC5rM= -sigs.k8s.io/gateway-api v0.4.2 h1:+tas04TAoqvApJ9wzQx5PdqlwzdorcanQbm+6o6ccKI= -sigs.k8s.io/gateway-api v0.4.2/go.mod h1:r3eiNP+0el+NTLwaTfOrCNXy8TukC+dIM3ggc+fbNWk= +sigs.k8s.io/gateway-api v0.5.0 h1:ze+k9fJqvmL8s1t3e4q1ST8RnN+f09dEv+gfacahlAE= +sigs.k8s.io/gateway-api v0.5.0/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/internal/events/event.go b/internal/events/event.go index 59646066cc..5851835c5b 100644 --- a/internal/events/event.go +++ b/internal/events/event.go @@ -15,6 +15,6 @@ type UpsertEvent struct { type DeleteEvent struct { // NamespacedName is the namespace & name of the deleted resource. NamespacedName types.NamespacedName - // Type is the resource type. For example, if the event is for *v1alpha2.HTTPRoute, pass &v1alpha2.HTTPRoute{} as Type. + // Type is the resource type. For example, if the event is for *v1beta1.HTTPRoute, pass &v1beta1.HTTPRoute{} as Type. Type client.Object } diff --git a/internal/events/loop.go b/internal/events/loop.go index a5c9711ae5..33c5531f0a 100644 --- a/internal/events/loop.go +++ b/internal/events/loop.go @@ -6,7 +6,7 @@ import ( "github.com/go-logr/logr" apiv1 "k8s.io/api/core/v1" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/nginx/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/nginx/file" @@ -125,11 +125,11 @@ func (el *EventLoop) updateNginx(ctx context.Context, conf state.Configuration) func (el *EventLoop) propagateUpsert(e *UpsertEvent) { switch r := e.Resource.(type) { - case *v1alpha2.GatewayClass: + case *v1beta1.GatewayClass: el.cfg.Processor.CaptureUpsertChange(r) - case *v1alpha2.Gateway: + case *v1beta1.Gateway: el.cfg.Processor.CaptureUpsertChange(r) - case *v1alpha2.HTTPRoute: + case *v1beta1.HTTPRoute: el.cfg.Processor.CaptureUpsertChange(r) case *apiv1.Service: // FIXME(pleshakov): make sure the affected hosts are updated @@ -144,11 +144,11 @@ func (el *EventLoop) propagateUpsert(e *UpsertEvent) { func (el *EventLoop) propagateDelete(e *DeleteEvent) { switch e.Type.(type) { - case *v1alpha2.GatewayClass: + case *v1beta1.GatewayClass: el.cfg.Processor.CaptureDeleteChange(e.Type, e.NamespacedName) - case *v1alpha2.Gateway: + case *v1beta1.Gateway: el.cfg.Processor.CaptureDeleteChange(e.Type, e.NamespacedName) - case *v1alpha2.HTTPRoute: + case *v1beta1.HTTPRoute: el.cfg.Processor.CaptureDeleteChange(e.Type, e.NamespacedName) case *apiv1.Service: // FIXME(pleshakov): make sure the affected hosts are updated diff --git a/internal/events/loop_test.go b/internal/events/loop_test.go index 120c07b20f..f020889d19 100644 --- a/internal/events/loop_test.go +++ b/internal/events/loop_test.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/log/zap" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" "github.com/nginxinc/nginx-kubernetes-gateway/internal/nginx/config" @@ -126,9 +126,9 @@ var _ = Describe("EventLoop", func() { _, statuses := fakeStatusUpdater.UpdateArgsForCall(0) Expect(statuses).Should(Equal(fakeStatuses)) }, - Entry("HTTPRoute", &events.UpsertEvent{Resource: &v1alpha2.HTTPRoute{}}), - Entry("Gateway", &events.UpsertEvent{Resource: &v1alpha2.Gateway{}}), - Entry("GatewayClass", &events.UpsertEvent{Resource: &v1alpha2.GatewayClass{}}), + Entry("HTTPRoute", &events.UpsertEvent{Resource: &v1beta1.HTTPRoute{}}), + Entry("Gateway", &events.UpsertEvent{Resource: &v1beta1.Gateway{}}), + Entry("GatewayClass", &events.UpsertEvent{Resource: &v1beta1.GatewayClass{}}), ) DescribeTable("Delete events", @@ -156,9 +156,9 @@ var _ = Describe("EventLoop", func() { Eventually(fakeNginxRuntimeMgr.ReloadCallCount).Should(Equal(1)) }, - Entry("HTTPRoute", &events.DeleteEvent{Type: &v1alpha2.HTTPRoute{}, NamespacedName: types.NamespacedName{Namespace: "test", Name: "route"}}), - Entry("Gateway", &events.DeleteEvent{Type: &v1alpha2.Gateway{}, NamespacedName: types.NamespacedName{Namespace: "test", Name: "gateway"}}), - Entry("GatewayClass", &events.DeleteEvent{Type: &v1alpha2.GatewayClass{}, NamespacedName: types.NamespacedName{Name: "class"}}), + Entry("HTTPRoute", &events.DeleteEvent{Type: &v1beta1.HTTPRoute{}, NamespacedName: types.NamespacedName{Namespace: "test", Name: "route"}}), + Entry("Gateway", &events.DeleteEvent{Type: &v1beta1.Gateway{}, NamespacedName: types.NamespacedName{Namespace: "test", Name: "gateway"}}), + Entry("GatewayClass", &events.DeleteEvent{Type: &v1beta1.GatewayClass{}, NamespacedName: types.NamespacedName{Name: "class"}}), ) }) diff --git a/internal/helpers/helpers.go b/internal/helpers/helpers.go index eafcdf68b1..054968a3b9 100644 --- a/internal/helpers/helpers.go +++ b/internal/helpers/helpers.go @@ -2,7 +2,7 @@ package helpers import ( "github.com/google/go-cmp/cmp" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) // Diff prints the diff between two structs. @@ -28,21 +28,21 @@ func GetInt32Pointer(i int32) *int32 { } // GetHTTPMethodPointer takes an HTTPMethod and returns a pointer to it. Useful in unit tests when initializing structs. -func GetHTTPMethodPointer(m v1alpha2.HTTPMethod) *v1alpha2.HTTPMethod { +func GetHTTPMethodPointer(m v1beta1.HTTPMethod) *v1beta1.HTTPMethod { return &m } // GetHeaderMatchTypePointer takes an HeaderMatchType and returns a pointer to it. Useful in unit tests when initializing structs. -func GetHeaderMatchTypePointer(t v1alpha2.HeaderMatchType) *v1alpha2.HeaderMatchType { +func GetHeaderMatchTypePointer(t v1beta1.HeaderMatchType) *v1beta1.HeaderMatchType { return &t } // GetQueryParamMatchTypePointer takes an QueryParamMatchType and returns a pointer to it. Useful in unit tests when initializing structs. -func GetQueryParamMatchTypePointer(t v1alpha2.QueryParamMatchType) *v1alpha2.QueryParamMatchType { +func GetQueryParamMatchTypePointer(t v1beta1.QueryParamMatchType) *v1beta1.QueryParamMatchType { return &t } // GetTLSModePointer takes a TLSModeType and returns a pointer to it. Useful in unit tests when initializing structs. -func GetTLSModePointer(t v1alpha2.TLSModeType) *v1alpha2.TLSModeType { +func GetTLSModePointer(t v1beta1.TLSModeType) *v1beta1.TLSModeType { return &t } diff --git a/internal/implementations/gateway/gateway.go b/internal/implementations/gateway/gateway.go index 8be7991c8b..67c4afffca 100644 --- a/internal/implementations/gateway/gateway.go +++ b/internal/implementations/gateway/gateway.go @@ -3,7 +3,7 @@ package implementation import ( "github.com/go-logr/logr" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" @@ -25,7 +25,7 @@ func NewGatewayImplementation(conf config.Config, eventCh chan<- interface{}) sd // FIXME(pleshakov) All Implementations (Gateway, HTTPRoute, ...) look similar. Consider writing a general-purpose // component to implement all implementations. This will avoid the duplication code and tests. -func (impl *gatewayImplementation) Upsert(gw *v1alpha2.Gateway) { +func (impl *gatewayImplementation) Upsert(gw *v1beta1.Gateway) { impl.logger.Info("Gateway was upserted", "namespace", gw.Namespace, "name", gw.Name, @@ -44,6 +44,6 @@ func (impl *gatewayImplementation) Remove(nsname types.NamespacedName) { impl.eventCh <- &events.DeleteEvent{ NamespacedName: nsname, - Type: &v1alpha2.Gateway{}, + Type: &v1beta1.Gateway{}, } } diff --git a/internal/implementations/gateway/gateway_test.go b/internal/implementations/gateway/gateway_test.go index ddfeb33b39..2d68694913 100644 --- a/internal/implementations/gateway/gateway_test.go +++ b/internal/implementations/gateway/gateway_test.go @@ -6,7 +6,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/log/zap" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" @@ -30,7 +30,7 @@ var _ = Describe("GatewayImplementation", func() { Describe("Implementation processes Gateways", func() { It("should process upsert", func() { - gc := &v1alpha2.Gateway{ + gc := &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test-add", Name: "gateway", @@ -54,7 +54,7 @@ var _ = Describe("GatewayImplementation", func() { Eventually(eventCh).Should(Receive(Equal( &events.DeleteEvent{ NamespacedName: nsname, - Type: &v1alpha2.Gateway{}, + Type: &v1beta1.Gateway{}, }))) }) }) diff --git a/internal/implementations/gatewayclass/gatewayclass.go b/internal/implementations/gatewayclass/gatewayclass.go index 4bec0f11f7..3bf254ba02 100644 --- a/internal/implementations/gatewayclass/gatewayclass.go +++ b/internal/implementations/gatewayclass/gatewayclass.go @@ -5,7 +5,7 @@ import ( "github.com/go-logr/logr" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" @@ -26,7 +26,7 @@ func NewGatewayClassImplementation(conf config.Config, eventCh chan<- interface{ } } -func (impl *gatewayClassImplementation) Upsert(gc *v1alpha2.GatewayClass) { +func (impl *gatewayClassImplementation) Upsert(gc *v1beta1.GatewayClass) { if gc.Name != impl.gatewayClassName { msg := fmt.Sprintf("GatewayClass was upserted but ignored because this controller only supports the GatewayClass %s", impl.gatewayClassName) impl.logger.Info(msg, @@ -59,6 +59,6 @@ func (impl *gatewayClassImplementation) Remove(nsname types.NamespacedName) { impl.eventCh <- &events.DeleteEvent{ NamespacedName: nsname, - Type: &v1alpha2.GatewayClass{}, + Type: &v1beta1.GatewayClass{}, } } diff --git a/internal/implementations/gatewayclass/gatewayclass_test.go b/internal/implementations/gatewayclass/gatewayclass_test.go index 32c515256f..1253783968 100644 --- a/internal/implementations/gatewayclass/gatewayclass_test.go +++ b/internal/implementations/gatewayclass/gatewayclass_test.go @@ -6,7 +6,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/log/zap" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" @@ -36,7 +36,7 @@ var _ = Describe("GatewayClassImplementation", func() { Describe("Implementation processes GatewayClass", func() { It("should process upsert", func() { - gc := &v1alpha2.GatewayClass{ + gc := &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{ Name: className, }, @@ -59,14 +59,14 @@ var _ = Describe("GatewayClassImplementation", func() { Eventually(eventCh).Should(Receive(Equal( &events.DeleteEvent{ NamespacedName: nsname, - Type: &v1alpha2.GatewayClass{}, + Type: &v1beta1.GatewayClass{}, }))) }) }) Describe("Implementation ignores unrelated GatewayClass", func() { It("should ignore upsert", func() { - gc := &v1alpha2.GatewayClass{ + gc := &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{ Name: unrelatedClassName, }, diff --git a/internal/implementations/httproute/httproute.go b/internal/implementations/httproute/httproute.go index 27d10a7699..825d1df477 100644 --- a/internal/implementations/httproute/httproute.go +++ b/internal/implementations/httproute/httproute.go @@ -3,7 +3,7 @@ package implementation import ( "github.com/go-logr/logr" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" @@ -31,7 +31,7 @@ func (impl *httpRouteImplementation) ControllerName() string { return impl.conf.GatewayCtlrName } -func (impl *httpRouteImplementation) Upsert(hr *v1alpha2.HTTPRoute) { +func (impl *httpRouteImplementation) Upsert(hr *v1beta1.HTTPRoute) { impl.Logger().Info("HTTPRoute was upserted", "namespace", hr.Namespace, "name", hr.Name, ) @@ -48,6 +48,6 @@ func (impl *httpRouteImplementation) Remove(nsname types.NamespacedName) { impl.eventCh <- &events.DeleteEvent{ NamespacedName: nsname, - Type: &v1alpha2.HTTPRoute{}, + Type: &v1beta1.HTTPRoute{}, } } diff --git a/internal/manager/manager.go b/internal/manager/manager.go index 22d2603e11..4178523ac6 100644 --- a/internal/manager/manager.go +++ b/internal/manager/manager.go @@ -8,7 +8,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" ctlr "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/manager" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/config" "github.com/nginxinc/nginx-kubernetes-gateway/internal/events" @@ -37,7 +37,7 @@ var scheme = runtime.NewScheme() func init() { // FIXME(pleshakov): handle errors returned by the calls bellow - _ = gatewayv1alpha2.AddToScheme(scheme) + _ = gatewayv1beta1.AddToScheme(scheme) _ = apiv1.AddToScheme(scheme) } diff --git a/internal/nginx/config/generator.go b/internal/nginx/config/generator.go index 800a0ed134..7130886a9e 100644 --- a/internal/nginx/config/generator.go +++ b/internal/nginx/config/generator.go @@ -7,7 +7,7 @@ import ( "strings" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) @@ -102,7 +102,6 @@ func generate(virtualServer state.VirtualServer, serviceStore state.ServiceStore for ruleIdx, r := range rule.MatchRules { address, err := getBackendAddress(r.Source.Spec.Rules[r.RuleIdx].BackendRefs, r.Source.Namespace, serviceStore) - if err != nil { warnings.AddWarning(r.Source, err.Error()) } @@ -125,7 +124,6 @@ func generate(virtualServer state.VirtualServer, serviceStore state.ServiceStore if len(matches) > 0 { b, err := json.Marshal(matches) - if err != nil { // panic is safe here because we should never fail to marshal the match unless we constructed it incorrectly. panic(fmt.Errorf("could not marshal http match: %w", err)) @@ -153,7 +151,7 @@ func generateProxyPass(address string) string { } func getBackendAddress( - refs []v1alpha2.HTTPBackendRef, + refs []v1beta1.HTTPBackendRef, parentNS string, serviceStore state.ServiceStore, ) (string, error) { @@ -205,7 +203,7 @@ type httpMatch struct { // Any represents a match with no match conditions. Any bool `json:"any,omitempty"` // Method is the HTTPMethod of the HTTPRouteMatch. - Method v1alpha2.HTTPMethod `json:"method,omitempty"` + Method v1beta1.HTTPMethod `json:"method,omitempty"` // Headers is a list of HTTPHeaders name value pairs with the format "{name}:{value}". Headers []string `json:"headers,omitempty"` // QueryParams is a list of HTTPQueryParams name value pairs with the format "{name}={value}". @@ -214,7 +212,7 @@ type httpMatch struct { RedirectPath string `json:"redirectPath,omitempty"` } -func createHTTPMatch(match v1alpha2.HTTPRouteMatch, redirectPath string) httpMatch { +func createHTTPMatch(match v1beta1.HTTPRouteMatch, redirectPath string) httpMatch { hm := httpMatch{ RedirectPath: redirectPath, } @@ -234,7 +232,7 @@ func createHTTPMatch(match v1alpha2.HTTPRouteMatch, redirectPath string) httpMat // FIXME(kate-osborn): For now we only support type "Exact". for _, h := range match.Headers { - if *h.Type == v1alpha2.HeaderMatchExact { + if *h.Type == v1beta1.HeaderMatchExact { // duplicate header names are not permitted by the spec // only configure the first entry for every header name (case-insensitive) lowerName := strings.ToLower(string(h.Name)) @@ -252,7 +250,7 @@ func createHTTPMatch(match v1alpha2.HTTPRouteMatch, redirectPath string) httpMat // FIXME(kate-osborn): For now we only support type "Exact". for _, p := range match.QueryParams { - if *p.Type == v1alpha2.QueryParamMatchExact { + if *p.Type == v1beta1.QueryParamMatchExact { params = append(params, createQueryParamKeyValString(p)) } } @@ -264,17 +262,17 @@ func createHTTPMatch(match v1alpha2.HTTPRouteMatch, redirectPath string) httpMat // The name and values are delimited by "=". A name and value can always be recovered using strings.SplitN(arg,"=", 2). // Query Parameters are case-sensitive so case is preserved. -func createQueryParamKeyValString(p v1alpha2.HTTPQueryParamMatch) string { +func createQueryParamKeyValString(p v1beta1.HTTPQueryParamMatch) string { return p.Name + "=" + p.Value } // The name and values are delimited by ":". A name and value can always be recovered using strings.Split(arg, ":"). // Header names are case-insensitive while header values are case-sensitive (e.g. foo:bar == FOO:bar, but foo:bar != foo:BAR). // We preserve the case of the name here because NGINX allows us to lookup the header names in a case-insensitive manner. -func createHeaderKeyValString(h v1alpha2.HTTPHeaderMatch) string { +func createHeaderKeyValString(h v1beta1.HTTPHeaderMatch) string { return string(h.Name) + ":" + h.Value } -func isPathOnlyMatch(match v1alpha2.HTTPRouteMatch) bool { +func isPathOnlyMatch(match v1beta1.HTTPRouteMatch) bool { return match.Method == nil && match.Headers == nil && match.QueryParams == nil } diff --git a/internal/nginx/config/generator_test.go b/internal/nginx/config/generator_test.go index ae6543d758..1f4d93ed19 100644 --- a/internal/nginx/config/generator_test.go +++ b/internal/nginx/config/generator_test.go @@ -9,7 +9,7 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" @@ -106,80 +106,80 @@ func TestGenerateForHost(t *testing.T) { } func TestGenerate(t *testing.T) { - hr := &v1alpha2.HTTPRoute{ + hr := &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "route1", }, - Spec: v1alpha2.HTTPRouteSpec{ - Hostnames: []v1alpha2.Hostname{ + Spec: v1beta1.HTTPRouteSpec{ + Hostnames: []v1beta1.Hostname{ "cafe.example.com", }, - Rules: []v1alpha2.HTTPRouteRule{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/"), }, - Method: helpers.GetHTTPMethodPointer(v1alpha2.HTTPMethodPost), + Method: helpers.GetHTTPMethodPointer(v1beta1.HTTPMethodPost), }, { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/"), }, - Method: helpers.GetHTTPMethodPointer(v1alpha2.HTTPMethodPatch), + Method: helpers.GetHTTPMethodPointer(v1beta1.HTTPMethodPatch), }, { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/"), // should generate an "any" httpmatch since other matches exists for / }, }, }, - BackendRefs: []v1alpha2.HTTPBackendRef{ + BackendRefs: []v1beta1.HTTPBackendRef{ { - BackendRef: v1alpha2.BackendRef{ - BackendObjectReference: v1alpha2.BackendObjectReference{ + BackendRef: v1beta1.BackendRef{ + BackendObjectReference: v1beta1.BackendObjectReference{ Name: "service1", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), - Port: (*v1alpha2.PortNumber)(helpers.GetInt32Pointer(80)), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), + Port: (*v1beta1.PortNumber)(helpers.GetInt32Pointer(80)), }, }, }, }, }, { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/test"), }, - Method: helpers.GetHTTPMethodPointer(v1alpha2.HTTPMethodGet), - Headers: []v1alpha2.HTTPHeaderMatch{ + Method: helpers.GetHTTPMethodPointer(v1beta1.HTTPMethodGet), + Headers: []v1beta1.HTTPHeaderMatch{ { - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "Version", Value: "V1", }, { - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "test", Value: "foo", }, { - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "my-header", Value: "my-value", }, }, - QueryParams: []v1alpha2.HTTPQueryParamMatch{ + QueryParams: []v1beta1.HTTPQueryParamMatch{ { - Type: helpers.GetQueryParamMatchTypePointer(v1alpha2.QueryParamMatchExact), + Type: helpers.GetQueryParamMatchTypePointer(v1beta1.QueryParamMatchExact), Name: "GrEat", // query names and values should not be normalized to lowercase Value: "EXAMPLE", }, { - Type: helpers.GetQueryParamMatchTypePointer(v1alpha2.QueryParamMatchExact), + Type: helpers.GetQueryParamMatchTypePointer(v1beta1.QueryParamMatchExact), Name: "test", Value: "foo=bar", }, @@ -189,20 +189,20 @@ func TestGenerate(t *testing.T) { BackendRefs: nil, // no backend refs will cause warnings }, { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path-only"), }, }, }, - BackendRefs: []v1alpha2.HTTPBackendRef{ + BackendRefs: []v1beta1.HTTPBackendRef{ { - BackendRef: v1alpha2.BackendRef{ - BackendObjectReference: v1alpha2.BackendObjectReference{ + BackendRef: v1beta1.BackendRef{ + BackendObjectReference: v1beta1.BackendObjectReference{ Name: "service2", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), - Port: (*v1alpha2.PortNumber)(helpers.GetInt32Pointer(80)), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), + Port: (*v1beta1.PortNumber)(helpers.GetInt32Pointer(80)), }, }, }, @@ -275,13 +275,13 @@ func TestGenerate(t *testing.T) { } slashMatches := []httpMatch{ - {Method: v1alpha2.HTTPMethodPost, RedirectPath: "/_route0"}, - {Method: v1alpha2.HTTPMethodPatch, RedirectPath: "/_route1"}, + {Method: v1beta1.HTTPMethodPost, RedirectPath: "/_route0"}, + {Method: v1beta1.HTTPMethodPatch, RedirectPath: "/_route1"}, {Any: true, RedirectPath: "/_route2"}, } testMatches := []httpMatch{ { - Method: v1alpha2.HTTPMethodGet, + Method: v1beta1.HTTPMethodGet, Headers: []string{"Version:V1", "test:foo", "my-header:my-value"}, QueryParams: []string{"GrEat=EXAMPLE", "test=foo=bar"}, RedirectPath: "/test_route0", @@ -384,28 +384,28 @@ func TestGenerateProxyPass(t *testing.T) { } func TestGetBackendAddress(t *testing.T) { - getNormalRefs := func() []v1alpha2.HTTPBackendRef { - return []v1alpha2.HTTPBackendRef{ + getNormalRefs := func() []v1beta1.HTTPBackendRef { + return []v1beta1.HTTPBackendRef{ { - BackendRef: v1alpha2.BackendRef{ - BackendObjectReference: v1alpha2.BackendObjectReference{ - Group: (*v1alpha2.Group)(helpers.GetStringPointer("networking.k8s.io")), - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Service")), + BackendRef: v1beta1.BackendRef{ + BackendObjectReference: v1beta1.BackendObjectReference{ + Group: (*v1beta1.Group)(helpers.GetStringPointer("networking.k8s.io")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Service")), Name: "service1", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), - Port: (*v1alpha2.PortNumber)(helpers.GetInt32Pointer(80)), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), + Port: (*v1beta1.PortNumber)(helpers.GetInt32Pointer(80)), }, }, }, } } - getModifiedRefs := func(mod func([]v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef { + getModifiedRefs := func(mod func([]v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef { return mod(getNormalRefs()) } tests := []struct { - refs []v1alpha2.HTTPBackendRef + refs []v1beta1.HTTPBackendRef parentNS string storeAddress string storeErr error @@ -428,7 +428,7 @@ func TestGetBackendAddress(t *testing.T) { }, { refs: getModifiedRefs( - func(refs []v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef { + func(refs []v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef { refs[0].BackendRef.Namespace = nil return refs }, @@ -444,7 +444,7 @@ func TestGetBackendAddress(t *testing.T) { }, { refs: getModifiedRefs( - func(refs []v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef { + func(refs []v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef { refs[0].BackendRef.Group = nil refs[0].BackendRef.Kind = nil return refs @@ -461,7 +461,7 @@ func TestGetBackendAddress(t *testing.T) { }, { refs: getModifiedRefs( - func(refs []v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef { + func(refs []v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef { secondRef := refs[0].DeepCopy() secondRef.Name = "service2" return append(refs, *secondRef) @@ -478,8 +478,8 @@ func TestGetBackendAddress(t *testing.T) { }, { refs: getModifiedRefs( - func(refs []v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef { - refs[0].BackendRef.Kind = (*v1alpha2.Kind)(helpers.GetStringPointer("NotService")) + func(refs []v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef { + refs[0].BackendRef.Kind = (*v1beta1.Kind)(helpers.GetStringPointer("NotService")) return refs }, ), @@ -505,7 +505,7 @@ func TestGetBackendAddress(t *testing.T) { }, { refs: getModifiedRefs( - func(refs []v1alpha2.HTTPBackendRef) []v1alpha2.HTTPBackendRef { + func(refs []v1beta1.HTTPBackendRef) []v1beta1.HTTPBackendRef { refs[0].BackendRef.Port = nil return refs }, @@ -608,7 +608,7 @@ func TestCreateArgKeyValString(t *testing.T) { expected := "key=value" result := createQueryParamKeyValString( - v1alpha2.HTTPQueryParamMatch{ + v1beta1.HTTPQueryParamMatch{ Name: "key", Value: "value", }, @@ -620,7 +620,7 @@ func TestCreateArgKeyValString(t *testing.T) { expected = "KeY=vaLUe==" result = createQueryParamKeyValString( - v1alpha2.HTTPQueryParamMatch{ + v1beta1.HTTPQueryParamMatch{ Name: "KeY", Value: "vaLUe==", }, @@ -634,7 +634,7 @@ func TestCreateHeaderKeyValString(t *testing.T) { expected := "kEy:vALUe" result := createHeaderKeyValString( - v1alpha2.HTTPHeaderMatch{ + v1beta1.HTTPHeaderMatch{ Name: "kEy", Value: "vALUe", }, @@ -647,13 +647,13 @@ func TestCreateHeaderKeyValString(t *testing.T) { func TestMatchLocationNeeded(t *testing.T) { tests := []struct { - match v1alpha2.HTTPRouteMatch + match v1beta1.HTTPRouteMatch expected bool msg string }{ { - match: v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + match: v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, }, @@ -661,21 +661,21 @@ func TestMatchLocationNeeded(t *testing.T) { msg: "path only match", }, { - match: v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + match: v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, - Method: helpers.GetHTTPMethodPointer(v1alpha2.HTTPMethodGet), + Method: helpers.GetHTTPMethodPointer(v1beta1.HTTPMethodGet), }, expected: false, msg: "method defined in match", }, { - match: v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + match: v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, - Headers: []v1alpha2.HTTPHeaderMatch{ + Headers: []v1beta1.HTTPHeaderMatch{ { Name: "header", Value: "val", @@ -686,12 +686,11 @@ func TestMatchLocationNeeded(t *testing.T) { msg: "headers defined in match", }, { - match: v1alpha2.HTTPRouteMatch{ - - Path: &v1alpha2.HTTPPathMatch{ + match: v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, - QueryParams: []v1alpha2.HTTPQueryParamMatch{ + QueryParams: []v1beta1.HTTPQueryParamMatch{ { Name: "arg", Value: "val", @@ -715,60 +714,60 @@ func TestMatchLocationNeeded(t *testing.T) { func TestCreateHTTPMatch(t *testing.T) { testPath := "/internal_loc" - testPathMatch := v1alpha2.HTTPPathMatch{Value: helpers.GetStringPointer("/")} - testMethodMatch := helpers.GetHTTPMethodPointer(v1alpha2.HTTPMethodPut) - testHeaderMatches := []v1alpha2.HTTPHeaderMatch{ + testPathMatch := v1beta1.HTTPPathMatch{Value: helpers.GetStringPointer("/")} + testMethodMatch := helpers.GetHTTPMethodPointer(v1beta1.HTTPMethodPut) + testHeaderMatches := []v1beta1.HTTPHeaderMatch{ { - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "header-1", Value: "val-1", }, { - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "header-2", Value: "val-2", }, { // regex type is not supported. This should not be added to the httpMatch headers. - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchRegularExpression), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchRegularExpression), Name: "ignore-this-header", Value: "val", }, { - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "header-3", Value: "val-3", }, } - testDuplicateHeaders := make([]v1alpha2.HTTPHeaderMatch, 0, 5) - duplicateHeaderMatch := v1alpha2.HTTPHeaderMatch{ - Type: helpers.GetHeaderMatchTypePointer(v1alpha2.HeaderMatchExact), + testDuplicateHeaders := make([]v1beta1.HTTPHeaderMatch, 0, 5) + duplicateHeaderMatch := v1beta1.HTTPHeaderMatch{ + Type: helpers.GetHeaderMatchTypePointer(v1beta1.HeaderMatchExact), Name: "HEADER-2", // header names are case-insensitive Value: "val-2", } testDuplicateHeaders = append(testDuplicateHeaders, testHeaderMatches...) testDuplicateHeaders = append(testDuplicateHeaders, duplicateHeaderMatch) - testQueryParamMatches := []v1alpha2.HTTPQueryParamMatch{ + testQueryParamMatches := []v1beta1.HTTPQueryParamMatch{ { - Type: helpers.GetQueryParamMatchTypePointer(v1alpha2.QueryParamMatchExact), + Type: helpers.GetQueryParamMatchTypePointer(v1beta1.QueryParamMatchExact), Name: "arg1", Value: "val1", }, { - Type: helpers.GetQueryParamMatchTypePointer(v1alpha2.QueryParamMatchExact), + Type: helpers.GetQueryParamMatchTypePointer(v1beta1.QueryParamMatchExact), Name: "arg2", Value: "val2=another-val", }, { // regex type is not supported. This should not be added to the httpMatch args - Type: helpers.GetQueryParamMatchTypePointer(v1alpha2.QueryParamMatchRegularExpression), + Type: helpers.GetQueryParamMatchTypePointer(v1beta1.QueryParamMatchRegularExpression), Name: "ignore-this-arg", Value: "val", }, { - Type: helpers.GetQueryParamMatchTypePointer(v1alpha2.QueryParamMatchExact), + Type: helpers.GetQueryParamMatchTypePointer(v1beta1.QueryParamMatchExact), Name: "arg3", Value: "==val3", }, @@ -778,12 +777,12 @@ func TestCreateHTTPMatch(t *testing.T) { expectedArgs := []string{"arg1=val1", "arg2=val2=another-val", "arg3===val3"} tests := []struct { - match v1alpha2.HTTPRouteMatch + match v1beta1.HTTPRouteMatch expected httpMatch msg string }{ { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Path: &testPathMatch, }, expected: httpMatch{ @@ -793,7 +792,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "path only match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Path: &testPathMatch, // A path match with a method should not set the Any field to true Method: testMethodMatch, }, @@ -804,7 +803,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "method only match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Headers: testHeaderMatches, }, expected: httpMatch{ @@ -814,7 +813,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "headers only match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ QueryParams: testQueryParamMatches, }, expected: httpMatch{ @@ -824,7 +823,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "query params only match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Method: testMethodMatch, QueryParams: testQueryParamMatches, }, @@ -836,7 +835,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "method and query params match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Method: testMethodMatch, Headers: testHeaderMatches, }, @@ -848,7 +847,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "method and headers match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ QueryParams: testQueryParamMatches, Headers: testHeaderMatches, }, @@ -860,7 +859,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "query params and headers match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Headers: testHeaderMatches, QueryParams: testQueryParamMatches, Method: testMethodMatch, @@ -874,7 +873,7 @@ func TestCreateHTTPMatch(t *testing.T) { msg: "method, headers, and query params match", }, { - match: v1alpha2.HTTPRouteMatch{ + match: v1beta1.HTTPRouteMatch{ Headers: testDuplicateHeaders, }, expected: httpMatch{ diff --git a/internal/nginx/config/warnings_test.go b/internal/nginx/config/warnings_test.go index 7cacc4fffa..c04fdc5c48 100644 --- a/internal/nginx/config/warnings_test.go +++ b/internal/nginx/config/warnings_test.go @@ -4,12 +4,12 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) func TestAddWarningf(t *testing.T) { warnings := newWarnings() - obj := &v1alpha2.HTTPRoute{} + obj := &v1beta1.HTTPRoute{} expected := Warnings{ obj: []string{ @@ -28,7 +28,7 @@ func TestAddWarningf(t *testing.T) { func TestAddWarning(t *testing.T) { warnings := newWarnings() - obj := &v1alpha2.HTTPRoute{} + obj := &v1beta1.HTTPRoute{} expected := Warnings{ obj: []string{ @@ -46,9 +46,9 @@ func TestAddWarning(t *testing.T) { } func TestAdd(t *testing.T) { - obj1 := &v1alpha2.HTTPRoute{} - obj2 := &v1alpha2.HTTPRoute{} - obj3 := &v1alpha2.HTTPRoute{} + obj1 := &v1beta1.HTTPRoute{} + obj2 := &v1beta1.HTTPRoute{} + obj3 := &v1beta1.HTTPRoute{} tests := []struct { warnings Warnings diff --git a/internal/state/change_processor.go b/internal/state/change_processor.go index 150647ece6..a266260be6 100644 --- a/internal/state/change_processor.go +++ b/internal/state/change_processor.go @@ -6,7 +6,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) //go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . ChangeProcessor @@ -70,7 +70,7 @@ func (c *ChangeProcessorImpl) CaptureUpsertChange(obj client.Object) { c.changed = true switch o := obj.(type) { - case *v1alpha2.GatewayClass: + case *v1beta1.GatewayClass: if o.Name != c.cfg.GatewayClassName { panic(fmt.Errorf("gatewayclass resource must be %s, got %s", c.cfg.GatewayClassName, o.Name)) } @@ -79,14 +79,14 @@ func (c *ChangeProcessorImpl) CaptureUpsertChange(obj client.Object) { c.changed = false } c.store.gc = o - case *v1alpha2.Gateway: + case *v1beta1.Gateway: // if the resource spec hasn't changed (its generation is the same), ignore the upsert prev, exist := c.store.gateways[getNamespacedName(obj)] if exist && o.Generation == prev.Generation { c.changed = false } c.store.gateways[getNamespacedName(obj)] = o - case *v1alpha2.HTTPRoute: + case *v1beta1.HTTPRoute: // if the resource spec hasn't changed (its generation is the same), ignore the upsert prev, exist := c.store.httpRoutes[getNamespacedName(obj)] if exist && o.Generation == prev.Generation { @@ -105,14 +105,14 @@ func (c *ChangeProcessorImpl) CaptureDeleteChange(resourceType client.Object, ns c.changed = true switch resourceType.(type) { - case *v1alpha2.GatewayClass: + case *v1beta1.GatewayClass: if nsname.Name != c.cfg.GatewayClassName { panic(fmt.Errorf("gatewayclass resource must be %s, got %s", c.cfg.GatewayClassName, nsname.Name)) } c.store.gc = nil - case *v1alpha2.Gateway: + case *v1beta1.Gateway: delete(c.store.gateways, nsname) - case *v1alpha2.HTTPRoute: + case *v1beta1.HTTPRoute: delete(c.store.httpRoutes, nsname) default: panic(fmt.Errorf("ChangeProcessor doesn't support %T", resourceType)) diff --git a/internal/state/change_processor_test.go b/internal/state/change_processor_test.go index bd64f31813..de2d757a28 100644 --- a/internal/state/change_processor_test.go +++ b/internal/state/change_processor_test.go @@ -7,6 +7,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" @@ -23,20 +24,20 @@ var _ = Describe("ChangeProcessor", func() { ) var ( - gc, gcUpdated *v1alpha2.GatewayClass - hr1, hr1Updated, hr2 *v1alpha2.HTTPRoute - gw1, gw1Updated, gw2 *v1alpha2.Gateway + gc, gcUpdated *v1beta1.GatewayClass + hr1, hr1Updated, hr2 *v1beta1.HTTPRoute + gw1, gw1Updated, gw2 *v1beta1.Gateway processor state.ChangeProcessor fakeSecretMemoryMgr *statefakes.FakeSecretDiskMemoryManager ) BeforeEach(OncePerOrdered, func() { - gc = &v1alpha2.GatewayClass{ + gc = &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{ Name: gcName, Generation: 1, }, - Spec: v1alpha2.GatewayClassSpec{ + Spec: v1beta1.GatewayClassSpec{ ControllerName: controllerName, }, } @@ -44,35 +45,35 @@ var _ = Describe("ChangeProcessor", func() { gcUpdated = gc.DeepCopy() gcUpdated.Generation++ - createRoute := func(name string, gateway string, hostname string) *v1alpha2.HTTPRoute { - return &v1alpha2.HTTPRoute{ + createRoute := func(name string, gateway string, hostname string) *v1beta1.HTTPRoute { + return &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: name, }, - Spec: v1alpha2.HTTPRouteSpec{ - CommonRouteSpec: v1alpha2.CommonRouteSpec{ - ParentRefs: []v1alpha2.ParentRef{ + Spec: v1beta1.HTTPRouteSpec{ + CommonRouteSpec: v1beta1.CommonRouteSpec{ + ParentRefs: []v1beta1.ParentReference{ { - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), - Name: v1alpha2.ObjectName(gateway), - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-80-1")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), + Name: v1beta1.ObjectName(gateway), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-80-1")), }, { - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), - Name: v1alpha2.ObjectName(gateway), - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-443-1")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), + Name: v1beta1.ObjectName(gateway), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-443-1")), }, }, }, - Hostnames: []v1alpha2.Hostname{ - v1alpha2.Hostname(hostname), + Hostnames: []v1beta1.Hostname{ + v1beta1.Hostname(hostname), }, - Rules: []v1alpha2.HTTPRouteRule{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/"), }, }, @@ -90,34 +91,34 @@ var _ = Describe("ChangeProcessor", func() { hr2 = createRoute("hr-2", "gateway-2", "bar.example.com") - createGateway := func(name string) *v1alpha2.Gateway { - return &v1alpha2.Gateway{ + createGateway := func(name string) *v1beta1.Gateway { + return &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: name, Generation: 1, }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ { Name: "listener-80-1", Hostname: nil, Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, }, { Name: "listener-443-1", Hostname: nil, Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{ + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{ { - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), }, }, }, @@ -741,7 +742,7 @@ var _ = Describe("ChangeProcessor", func() { }) It("should return updated configuration and statuses after deleting the first Gateway", func() { - processor.CaptureDeleteChange(&v1alpha2.Gateway{}, types.NamespacedName{Namespace: "test", Name: "gateway-1"}) + processor.CaptureDeleteChange(&v1beta1.Gateway{}, types.NamespacedName{Namespace: "test", Name: "gateway-1"}) expectedConf := state.Configuration{ HTTPServers: []state.VirtualServer{ @@ -820,7 +821,7 @@ var _ = Describe("ChangeProcessor", func() { }) It("should return configuration with default ssl server and updated statuses after deleting the second HTTPRoute", func() { - processor.CaptureDeleteChange(&v1alpha2.HTTPRoute{}, types.NamespacedName{Namespace: "test", Name: "hr-2"}) + processor.CaptureDeleteChange(&v1beta1.HTTPRoute{}, types.NamespacedName{Namespace: "test", Name: "hr-2"}) expectedConf := state.Configuration{ HTTPServers: []state.VirtualServer{}, @@ -860,7 +861,7 @@ var _ = Describe("ChangeProcessor", func() { }) It("should return empty configuration and updated statuses after deleting the GatewayClass", func() { - processor.CaptureDeleteChange(&v1alpha2.GatewayClass{}, types.NamespacedName{Name: gcName}) + processor.CaptureDeleteChange(&v1beta1.GatewayClass{}, types.NamespacedName{Name: gcName}) expectedConf := state.Configuration{} expectedStatuses := state.Statuses{ @@ -888,7 +889,7 @@ var _ = Describe("ChangeProcessor", func() { }) It("should return empty configuration and empty statuses after deleting the second Gateway", func() { - processor.CaptureDeleteChange(&v1alpha2.Gateway{}, types.NamespacedName{Namespace: "test", Name: "gateway-2"}) + processor.CaptureDeleteChange(&v1beta1.Gateway{}, types.NamespacedName{Namespace: "test", Name: "gateway-2"}) expectedConf := state.Configuration{} expectedStatuses := state.Statuses{ @@ -903,7 +904,7 @@ var _ = Describe("ChangeProcessor", func() { }) It("should return empty configuration and statuses after deleting the first HTTPRoute", func() { - processor.CaptureDeleteChange(&v1alpha2.HTTPRoute{}, types.NamespacedName{Namespace: "test", Name: "hr-1"}) + processor.CaptureDeleteChange(&v1beta1.HTTPRoute{}, types.NamespacedName{Namespace: "test", Name: "hr-1"}) expectedConf := state.Configuration{} expectedStatuses := state.Statuses{ @@ -941,7 +942,7 @@ var _ = Describe("ChangeProcessor", func() { Expect(process).Should(Panic()) }, Entry("an unsupported resource", &v1alpha2.TCPRoute{ObjectMeta: metav1.ObjectMeta{Namespace: "test", Name: "tcp"}}), - Entry("a wrong gatewayclass", &v1alpha2.GatewayClass{ObjectMeta: metav1.ObjectMeta{Name: "wrong-class"}})) + Entry("a wrong gatewayclass", &v1beta1.GatewayClass{ObjectMeta: metav1.ObjectMeta{Name: "wrong-class"}})) DescribeTable("CaptureDeleteChange must panic", func(resourceType client.Object, nsname types.NamespacedName) { @@ -951,6 +952,6 @@ var _ = Describe("ChangeProcessor", func() { Expect(process).Should(Panic()) }, Entry("an unsupported resource", &v1alpha2.TCPRoute{}, types.NamespacedName{Namespace: "test", Name: "tcp"}), - Entry("a wrong gatewayclass", &v1alpha2.GatewayClass{}, types.NamespacedName{Name: "wrong-class"})) + Entry("a wrong gatewayclass", &v1beta1.GatewayClass{}, types.NamespacedName{Name: "wrong-class"})) }) }) diff --git a/internal/state/configuration.go b/internal/state/configuration.go index 47cb2e8ec6..a65888ae17 100644 --- a/internal/state/configuration.go +++ b/internal/state/configuration.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) const wildcardHostname = "~^" @@ -53,11 +53,11 @@ type MatchRule struct { // RuleIdx is the index of the corresponding rule in the HTTPRoute. RuleIdx int // Source is the corresponding HTTPRoute resource. - Source *v1alpha2.HTTPRoute + Source *v1beta1.HTTPRoute } // GetMatch returns the HTTPRouteMatch of the Route . -func (r *MatchRule) GetMatch() v1alpha2.HTTPRouteMatch { +func (r *MatchRule) GetMatch() v1beta1.HTTPRouteMatch { return r.Source.Spec.Rules[r.RuleIdx].Matches[r.MatchIdx] } @@ -91,16 +91,16 @@ type configBuilder struct { func newConfigBuilder() *configBuilder { return &configBuilder{ - http: newVirtualServerBuilder(v1alpha2.HTTPProtocolType), - ssl: newVirtualServerBuilder(v1alpha2.HTTPSProtocolType), + http: newVirtualServerBuilder(v1beta1.HTTPProtocolType), + ssl: newVirtualServerBuilder(v1beta1.HTTPSProtocolType), } } func (b *configBuilder) upsertListener(l *listener) { switch l.Source.Protocol { - case v1alpha2.HTTPProtocolType: + case v1beta1.HTTPProtocolType: b.http.upsertListener(l) - case v1alpha2.HTTPSProtocolType: + case v1beta1.HTTPSProtocolType: b.ssl.upsertListener(l) default: panic(fmt.Sprintf("listener protocol %s not supported", l.Source.Protocol)) @@ -115,13 +115,13 @@ func (b *configBuilder) build() Configuration { } type virtualServerBuilder struct { - protocolType v1alpha2.ProtocolType + protocolType v1beta1.ProtocolType rulesPerHost map[string]map[string]PathRule listenersForHost map[string]*listener listeners []*listener } -func newVirtualServerBuilder(protocolType v1alpha2.ProtocolType) *virtualServerBuilder { +func newVirtualServerBuilder(protocolType v1beta1.ProtocolType) *virtualServerBuilder { return &virtualServerBuilder{ protocolType: protocolType, rulesPerHost: make(map[string]map[string]PathRule), @@ -131,8 +131,7 @@ func newVirtualServerBuilder(protocolType v1alpha2.ProtocolType) *virtualServerB } func (b *virtualServerBuilder) upsertListener(l *listener) { - - if b.protocolType == v1alpha2.HTTPSProtocolType { + if b.protocolType == v1beta1.HTTPSProtocolType { b.listeners = append(b.listeners, l) } @@ -155,7 +154,6 @@ func (b *virtualServerBuilder) upsertListener(l *listener) { for i, rule := range r.Source.Spec.Rules { for _, h := range hostnames { - for j, m := range rule.Matches { path := getPath(m.Path) @@ -178,7 +176,6 @@ func (b *virtualServerBuilder) upsertListener(l *listener) { } func (b *virtualServerBuilder) build() []VirtualServer { - servers := make([]VirtualServer, 0, len(b.rulesPerHost)+len(b.listeners)) for h, rules := range b.rulesPerHost { @@ -229,7 +226,7 @@ func (b *virtualServerBuilder) build() []VirtualServer { return servers } -func getListenerHostname(h *v1alpha2.Hostname) string { +func getListenerHostname(h *v1beta1.Hostname) string { name := getHostname(h) if name == "" { return wildcardHostname @@ -238,7 +235,7 @@ func getListenerHostname(h *v1alpha2.Hostname) string { return name } -func getPath(path *v1alpha2.HTTPPathMatch) string { +func getPath(path *v1beta1.HTTPPathMatch) string { if path == nil || path.Value == nil || *path.Value == "" { return "/" } diff --git a/internal/state/configuration_test.go b/internal/state/configuration_test.go index cd412ac472..95b158847d 100644 --- a/internal/state/configuration_test.go +++ b/internal/state/configuration_test.go @@ -6,42 +6,42 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" ) func TestBuildConfiguration(t *testing.T) { - createRoute := func(name string, hostname string, listenerName string, paths ...string) *v1alpha2.HTTPRoute { - rules := make([]v1alpha2.HTTPRouteRule, 0, len(paths)) + createRoute := func(name string, hostname string, listenerName string, paths ...string) *v1beta1.HTTPRoute { + rules := make([]v1beta1.HTTPRouteRule, 0, len(paths)) for _, p := range paths { - rules = append(rules, v1alpha2.HTTPRouteRule{ - Matches: []v1alpha2.HTTPRouteMatch{ + rules = append(rules, v1beta1.HTTPRouteRule{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer(p), }, }, }, }) } - return &v1alpha2.HTTPRoute{ + return &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: name, }, - Spec: v1alpha2.HTTPRouteSpec{ - CommonRouteSpec: v1alpha2.CommonRouteSpec{ - ParentRefs: []v1alpha2.ParentRef{ + Spec: v1beta1.HTTPRouteSpec{ + CommonRouteSpec: v1beta1.CommonRouteSpec{ + ParentRefs: []v1beta1.ParentReference{ { - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer(listenerName)), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer(listenerName)), }, }, }, - Hostnames: []v1alpha2.Hostname{ - v1alpha2.Hostname(hostname), + Hostnames: []v1beta1.Hostname{ + v1beta1.Hostname(hostname), }, Rules: rules, }, @@ -138,53 +138,53 @@ func TestBuildConfiguration(t *testing.T) { InvalidSectionNameRefs: map[string]struct{}{}, } - listener80 := v1alpha2.Listener{ + listener80 := v1beta1.Listener{ Name: "listener-80-1", Hostname: nil, Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, } - listener443 := v1alpha2.Listener{ + listener443 := v1beta1.Listener{ Name: "listener-443-1", Hostname: nil, Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{ + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{ { - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), }, }, }, } - hostname := v1alpha2.Hostname("example.com") + hostname := v1beta1.Hostname("example.com") - listener443WithHostname := v1alpha2.Listener{ + listener443WithHostname := v1beta1.Listener{ Name: "listener-443-with-hostname", Hostname: &hostname, Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{ + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{ { - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), }, }, }, } - invalidListener := v1alpha2.Listener{ + invalidListener := v1beta1.Listener{ Name: "invalid-listener", Hostname: nil, Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, TLS: nil, // missing TLS config } @@ -199,11 +199,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{}, }, Routes: map[types.NamespacedName]*route{}, @@ -217,11 +217,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-80-1": { Source: listener80, @@ -242,11 +242,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-443-1": { Source: listener443, // nil hostname @@ -284,11 +284,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "invalid-listener": { Source: invalidListener, @@ -319,11 +319,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-80-1": { Source: listener80, @@ -384,11 +384,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-443-1": { Source: listener443, @@ -490,11 +490,11 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-80-1": { Source: listener80, @@ -626,12 +626,12 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: false, ErrorMsg: "error", }, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-80-1": { Source: listener80, @@ -656,7 +656,7 @@ func TestBuildConfiguration(t *testing.T) { graph: &graph{ GatewayClass: nil, Gateway: &gateway{ - Source: &v1alpha2.Gateway{}, + Source: &v1beta1.Gateway{}, Listeners: map[string]*listener{ "listener-80-1": { Source: listener80, @@ -680,7 +680,7 @@ func TestBuildConfiguration(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{}, + Source: &v1beta1.GatewayClass{}, Valid: true, }, Gateway: nil, @@ -701,12 +701,12 @@ func TestBuildConfiguration(t *testing.T) { func TestGetPath(t *testing.T) { tests := []struct { - path *v1alpha2.HTTPPathMatch + path *v1beta1.HTTPPathMatch expected string msg string }{ { - path: &v1alpha2.HTTPPathMatch{Value: helpers.GetStringPointer("/abc")}, + path: &v1beta1.HTTPPathMatch{Value: helpers.GetStringPointer("/abc")}, expected: "/abc", msg: "normal case", }, @@ -716,12 +716,12 @@ func TestGetPath(t *testing.T) { msg: "nil path", }, { - path: &v1alpha2.HTTPPathMatch{Value: nil}, + path: &v1beta1.HTTPPathMatch{Value: nil}, expected: "/", msg: "nil value", }, { - path: &v1alpha2.HTTPPathMatch{Value: helpers.GetStringPointer("")}, + path: &v1beta1.HTTPPathMatch{Value: helpers.GetStringPointer("")}, expected: "/", msg: "empty value", }, @@ -736,32 +736,32 @@ func TestGetPath(t *testing.T) { } func TestMatchRuleGetMatch(t *testing.T) { - var hr = &v1alpha2.HTTPRoute{ - Spec: v1alpha2.HTTPRouteSpec{ - Rules: []v1alpha2.HTTPRouteRule{ + hr := &v1beta1.HTTPRoute{ + Spec: v1beta1.HTTPRouteSpec{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path-1"), }, }, { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path-2"), }, }, }, }, { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path-3"), }, }, { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path-4"), }, }, @@ -802,11 +802,11 @@ func TestMatchRuleGetMatch(t *testing.T) { } func TestGetListenerHostname(t *testing.T) { - var emptyHostname v1alpha2.Hostname - var hostname v1alpha2.Hostname = "example.com" + var emptyHostname v1beta1.Hostname + var hostname v1beta1.Hostname = "example.com" tests := []struct { - hostname *v1alpha2.Hostname + hostname *v1beta1.Hostname expected string msg string }{ diff --git a/internal/state/graph.go b/internal/state/graph.go index 80525cc53f..481b2eab8e 100644 --- a/internal/state/graph.go +++ b/internal/state/graph.go @@ -5,13 +5,13 @@ import ( "sort" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) // gateway represents the winning Gateway resource. type gateway struct { // Source is the corresponding Gateway resource. - Source *v1alpha2.Gateway + Source *v1beta1.Gateway // Listeners include the listeners of the Gateway. Listeners map[string]*listener } @@ -21,7 +21,7 @@ type route struct { // Source is the source resource of the route. // FIXME(pleshakov) // For now, we assume that the source is only HTTPRoute. Later we can support more types - TLSRoute, TCPRoute and UDPRoute. - Source *v1alpha2.HTTPRoute + Source *v1beta1.HTTPRoute // ValidSectionNameRefs includes the sectionNames from the parentRefs of the HTTPRoute that are valid -- i.e. // the Gateway resource has a corresponding valid listener. @@ -33,7 +33,7 @@ type route struct { // gatewayClass represents the GatewayClass resource. type gatewayClass struct { // Source is the source resource. - Source *v1alpha2.GatewayClass + Source *v1beta1.GatewayClass // Valid shows whether the GatewayClass is valid. Valid bool // ErrorMsg explains the error when the resource is not valid. @@ -49,7 +49,7 @@ type graph struct { // IgnoredGateways holds the ignored Gateway resources, which belong to the NGINX Gateway (based on the // GatewayClassName field of the resource) but ignored. It doesn't hold the Gateway resources that do not belong to // the NGINX Gateway. - IgnoredGateways map[types.NamespacedName]*v1alpha2.Gateway + IgnoredGateways map[types.NamespacedName]*v1beta1.Gateway // Routes holds route resources. Routes map[types.NamespacedName]*route } @@ -94,8 +94,8 @@ func buildGraph( // processGateways determines which Gateway resource the NGINX Gateway will use (the winner) and which Gateway(s) will // be ignored. Note that the function will not take into the account any unrelated Gateway resources - the ones with the // different GatewayClassName field. -func processGateways(gws map[types.NamespacedName]*v1alpha2.Gateway, gcName string) (winner *v1alpha2.Gateway, ignoredGateways map[types.NamespacedName]*v1alpha2.Gateway) { - referencedGws := make([]*v1alpha2.Gateway, 0, len(gws)) +func processGateways(gws map[types.NamespacedName]*v1beta1.Gateway, gcName string) (winner *v1beta1.Gateway, ignoredGateways map[types.NamespacedName]*v1beta1.Gateway) { + referencedGws := make([]*v1beta1.Gateway, 0, len(gws)) for _, gw := range gws { if string(gw.Spec.GatewayClassName) != gcName { @@ -113,7 +113,7 @@ func processGateways(gws map[types.NamespacedName]*v1alpha2.Gateway, gcName stri return lessObjectMeta(&referencedGws[i].ObjectMeta, &referencedGws[j].ObjectMeta) }) - ignoredGws := make(map[types.NamespacedName]*v1alpha2.Gateway) + ignoredGws := make(map[types.NamespacedName]*v1beta1.Gateway) for _, gw := range referencedGws[1:] { ignoredGws[getNamespacedName(gw)] = gw @@ -122,7 +122,7 @@ func processGateways(gws map[types.NamespacedName]*v1alpha2.Gateway, gcName stri return referencedGws[0], ignoredGws } -func buildGatewayClass(gc *v1alpha2.GatewayClass, controllerName string) *gatewayClass { +func buildGatewayClass(gc *v1beta1.GatewayClass, controllerName string) *gatewayClass { if gc == nil { return nil } @@ -141,7 +141,7 @@ func buildGatewayClass(gc *v1alpha2.GatewayClass, controllerName string) *gatewa } } -func buildListeners(gw *v1alpha2.Gateway, gcName string, secretMemoryMgr SecretDiskMemoryManager) map[string]*listener { +func buildListeners(gw *v1beta1.Gateway, gcName string, secretMemoryMgr SecretDiskMemoryManager) map[string]*listener { listeners := make(map[string]*listener) if gw == nil || string(gw.Spec.GatewayClassName) != gcName { @@ -164,9 +164,9 @@ func buildListeners(gw *v1alpha2.Gateway, gcName string, secretMemoryMgr SecretD // (2) HTTPRoute will be processed but not bound. // (3) HTTPRoute will be processed and bound to a listener. func bindHTTPRouteToListeners( - ghr *v1alpha2.HTTPRoute, - gw *v1alpha2.Gateway, - ignoredGws map[types.NamespacedName]*v1alpha2.Gateway, + ghr *v1beta1.HTTPRoute, + gw *v1beta1.Gateway, + ignoredGws map[types.NamespacedName]*v1beta1.Gateway, listeners map[string]*listener, ) (ignored bool, r *route) { if len(ghr.Spec.ParentRefs) == 0 { @@ -263,10 +263,10 @@ func bindHTTPRouteToListeners( return false, r } -func findAcceptedHostnames(listenerHostname *v1alpha2.Hostname, routeHostnames []v1alpha2.Hostname) []string { +func findAcceptedHostnames(listenerHostname *v1beta1.Hostname, routeHostnames []v1beta1.Hostname) []string { hostname := getHostname(listenerHostname) - match := func(h v1alpha2.Hostname) bool { + match := func(h v1beta1.Hostname) bool { if hostname == "" { return true } @@ -284,14 +284,14 @@ func findAcceptedHostnames(listenerHostname *v1alpha2.Hostname, routeHostnames [ return result } -func getHostname(h *v1alpha2.Hostname) string { +func getHostname(h *v1beta1.Hostname) string { if h == nil { return "" } return string(*h) } -func validateGatewayClass(gc *v1alpha2.GatewayClass, controllerName string) error { +func validateGatewayClass(gc *v1beta1.GatewayClass, controllerName string) error { if string(gc.Spec.ControllerName) != controllerName { return fmt.Errorf("Spec.ControllerName must be %s got %s", controllerName, gc.Spec.ControllerName) } diff --git a/internal/state/graph_test.go b/internal/state/graph_test.go index 5790bc6cbf..ca44ab4f11 100644 --- a/internal/state/graph_test.go +++ b/internal/state/graph_test.go @@ -8,7 +8,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" ) @@ -81,30 +81,30 @@ func TestBuildGraph(t *testing.T) { controllerName = "my.controller" ) - createRoute := func(name string, gatewayName string, listenerName string) *v1alpha2.HTTPRoute { - return &v1alpha2.HTTPRoute{ + createRoute := func(name string, gatewayName string, listenerName string) *v1beta1.HTTPRoute { + return &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: name, }, - Spec: v1alpha2.HTTPRouteSpec{ - CommonRouteSpec: v1alpha2.CommonRouteSpec{ - ParentRefs: []v1alpha2.ParentRef{ + Spec: v1beta1.HTTPRouteSpec{ + CommonRouteSpec: v1beta1.CommonRouteSpec{ + ParentRefs: []v1beta1.ParentReference{ { - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), - Name: v1alpha2.ObjectName(gatewayName), - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer(listenerName)), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), + Name: v1beta1.ObjectName(gatewayName), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer(listenerName)), }, }, }, - Hostnames: []v1alpha2.Hostname{ + Hostnames: []v1beta1.Hostname{ "foo.example.com", }, - Rules: []v1alpha2.HTTPRouteRule{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ { - Path: &v1alpha2.HTTPPathMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/"), }, }, @@ -119,37 +119,37 @@ func TestBuildGraph(t *testing.T) { hr2 := createRoute("hr-2", "wrong-gateway", "listener-80-1") hr3 := createRoute("hr-3", "gateway-1", "listener-443-1") // https listener; should not conflict with hr1 - createGateway := func(name string) *v1alpha2.Gateway { - return &v1alpha2.Gateway{ + createGateway := func(name string) *v1beta1.Gateway { + return &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: name, }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ { Name: "listener-80-1", Hostname: nil, Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, }, { Name: "listener-443-1", Hostname: nil, Port: 443, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{ + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{ { - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), }, }, }, - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, }, }, }, @@ -160,16 +160,16 @@ func TestBuildGraph(t *testing.T) { gw2 := createGateway("gateway-2") store := &store{ - gc: &v1alpha2.GatewayClass{ - Spec: v1alpha2.GatewayClassSpec{ + gc: &v1beta1.GatewayClass{ + Spec: v1beta1.GatewayClassSpec{ ControllerName: controllerName, }, }, - gateways: map[types.NamespacedName]*v1alpha2.Gateway{ + gateways: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "gateway-1"}: gw1, {Namespace: "test", Name: "gateway-2"}: gw2, }, - httpRoutes: map[types.NamespacedName]*v1alpha2.HTTPRoute{ + httpRoutes: map[types.NamespacedName]*v1beta1.HTTPRoute{ {Namespace: "test", Name: "hr-1"}: hr1, {Namespace: "test", Name: "hr-2"}: hr2, {Namespace: "test", Name: "hr-3"}: hr3, @@ -223,7 +223,7 @@ func TestBuildGraph(t *testing.T) { }, }, }, - IgnoredGateways: map[types.NamespacedName]*v1alpha2.Gateway{ + IgnoredGateways: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "gateway-2"}: gw2, }, Routes: map[types.NamespacedName]*route{ @@ -247,29 +247,29 @@ func TestBuildGraph(t *testing.T) { func TestProcessGateways(t *testing.T) { const gcName = "test-gc" - winner := &v1alpha2.Gateway{ + winner := &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "gateway-1", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, }, } - loser := &v1alpha2.Gateway{ + loser := &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "gateway-2", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, }, } tests := []struct { - gws map[types.NamespacedName]*v1alpha2.Gateway - expectedWinner *v1alpha2.Gateway - expectedIgnoredGws map[types.NamespacedName]*v1alpha2.Gateway + gws map[types.NamespacedName]*v1beta1.Gateway + expectedWinner *v1beta1.Gateway + expectedIgnoredGws map[types.NamespacedName]*v1beta1.Gateway msg string }{ { @@ -279,9 +279,9 @@ func TestProcessGateways(t *testing.T) { msg: "no gateways", }, { - gws: map[types.NamespacedName]*v1alpha2.Gateway{ + gws: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "some-gateway"}: { - Spec: v1alpha2.GatewaySpec{GatewayClassName: "some-class"}, + Spec: v1beta1.GatewaySpec{GatewayClassName: "some-class"}, }, }, expectedWinner: nil, @@ -289,20 +289,20 @@ func TestProcessGateways(t *testing.T) { msg: "unrelated gateway", }, { - gws: map[types.NamespacedName]*v1alpha2.Gateway{ + gws: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "gateway"}: winner, }, expectedWinner: winner, - expectedIgnoredGws: map[types.NamespacedName]*v1alpha2.Gateway{}, + expectedIgnoredGws: map[types.NamespacedName]*v1beta1.Gateway{}, msg: "one gateway", }, { - gws: map[types.NamespacedName]*v1alpha2.Gateway{ + gws: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "gateway-1"}: winner, {Namespace: "test", Name: "gateway-2"}: loser, }, expectedWinner: winner, - expectedIgnoredGws: map[types.NamespacedName]*v1alpha2.Gateway{ + expectedIgnoredGws: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "gateway-2"}: loser, }, msg: "multiple gateways", @@ -324,19 +324,19 @@ func TestProcessGateways(t *testing.T) { func TestBuildGatewayClass(t *testing.T) { const controllerName = "my.controller" - validGC := &v1alpha2.GatewayClass{ - Spec: v1alpha2.GatewayClassSpec{ + validGC := &v1beta1.GatewayClass{ + Spec: v1beta1.GatewayClassSpec{ ControllerName: "my.controller", }, } - invalidGC := &v1alpha2.GatewayClass{ - Spec: v1alpha2.GatewayClassSpec{ + invalidGC := &v1beta1.GatewayClass{ + Spec: v1beta1.GatewayClassSpec{ ControllerName: "wrong.controller", }, } tests := []struct { - gc *v1alpha2.GatewayClass + gc *v1beta1.GatewayClass expected *gatewayClass msg string }{ @@ -376,105 +376,105 @@ func TestBuildGatewayClass(t *testing.T) { func TestBuildListeners(t *testing.T) { const gcName = "my-gateway-class" - listener801 := v1alpha2.Listener{ + listener801 := v1beta1.Listener{ Name: "listener-80-1", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, } - listener802 := v1alpha2.Listener{ + listener802 := v1beta1.Listener{ Name: "listener-80-2", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("bar.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("bar.example.com")), Port: 80, - Protocol: v1alpha2.TCPProtocolType, // invalid protocol + Protocol: v1beta1.TCPProtocolType, // invalid protocol } - listener803 := v1alpha2.Listener{ + listener803 := v1beta1.Listener{ Name: "listener-80-3", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("bar.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("bar.example.com")), Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, } - listener804 := v1alpha2.Listener{ + listener804 := v1beta1.Listener{ Name: "listener-80-4", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, } - gatewayTLSConfig := &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{ + gatewayTLSConfig := &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{ { - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), }, }, } - tlsConfigInvalidSecret := &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{ + tlsConfigInvalidSecret := &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{ { - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "does-not-exist", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), }, }, } // https listeners - listener4431 := v1alpha2.Listener{ + listener4431 := v1beta1.Listener{ Name: "listener-443-1", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), Port: 443, TLS: gatewayTLSConfig, - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, } - listener4432 := v1alpha2.Listener{ + listener4432 := v1beta1.Listener{ Name: "listener-443-2", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("bar.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("bar.example.com")), Port: 443, TLS: gatewayTLSConfig, - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, } - listener4433 := v1alpha2.Listener{ + listener4433 := v1beta1.Listener{ Name: "listener-443-3", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), Port: 443, TLS: gatewayTLSConfig, - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, } - listener4434 := v1alpha2.Listener{ + listener4434 := v1beta1.Listener{ Name: "listener-443-4", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), Port: 443, TLS: nil, // invalid https listener; missing tls config - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, } - listener4435 := v1alpha2.Listener{ + listener4435 := v1beta1.Listener{ Name: "listener-443-5", - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), Port: 443, TLS: tlsConfigInvalidSecret, // invalid https listener; secret does not exist - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, } tests := []struct { - gateway *v1alpha2.Gateway + gateway *v1beta1.Gateway expected map[string]*listener msg string }{ { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener801, }, }, - Status: v1alpha2.GatewayStatus{}, + Status: v1beta1.GatewayStatus{}, }, expected: map[string]*listener{ "listener-80-1": { @@ -487,13 +487,13 @@ func TestBuildListeners(t *testing.T) { msg: "valid http listener", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener4431, }, }, @@ -510,13 +510,13 @@ func TestBuildListeners(t *testing.T) { msg: "valid https listener", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener802, }, }, @@ -532,13 +532,13 @@ func TestBuildListeners(t *testing.T) { msg: "invalid listener protocol", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener4434, }, }, @@ -554,13 +554,13 @@ func TestBuildListeners(t *testing.T) { msg: "invalid https listener (tls config missing)", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener4435, }, }, @@ -576,13 +576,13 @@ func TestBuildListeners(t *testing.T) { msg: "invalid https listener (secret does not exist)", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener801, listener803, listener4431, listener4432, }, @@ -619,13 +619,13 @@ func TestBuildListeners(t *testing.T) { msg: "multiple valid http/https listeners", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: gcName, - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener801, listener804, listener4431, listener4433, }, @@ -667,13 +667,13 @@ func TestBuildListeners(t *testing.T) { msg: "no gateway", }, { - gateway: &v1alpha2.Gateway{ + gateway: &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", }, - Spec: v1alpha2.GatewaySpec{ + Spec: v1beta1.GatewaySpec{ GatewayClassName: "wrong-class", - Listeners: []v1alpha2.Listener{ + Listeners: []v1beta1.Listener{ listener801, listener804, }, }, @@ -699,62 +699,62 @@ func TestBuildListeners(t *testing.T) { } func TestBindRouteToListeners(t *testing.T) { - createRoute := func(hostname string, parentRefs ...v1alpha2.ParentRef) *v1alpha2.HTTPRoute { - return &v1alpha2.HTTPRoute{ + createRoute := func(hostname string, parentRefs ...v1beta1.ParentReference) *v1beta1.HTTPRoute { + return &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "hr-1", }, - Spec: v1alpha2.HTTPRouteSpec{ - CommonRouteSpec: v1alpha2.CommonRouteSpec{ + Spec: v1beta1.HTTPRouteSpec{ + CommonRouteSpec: v1beta1.CommonRouteSpec{ ParentRefs: parentRefs, }, - Hostnames: []v1alpha2.Hostname{ - v1alpha2.Hostname(hostname), + Hostnames: []v1beta1.Hostname{ + v1beta1.Hostname(hostname), }, }, } } - hrNonExistingSectionName := createRoute("foo.example.com", v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + hrNonExistingSectionName := createRoute("foo.example.com", v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-80-2")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-80-2")), }) - hrEmptySectionName := createRoute("foo.example.com", v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + hrEmptySectionName := createRoute("foo.example.com", v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", }) - hrIgnoredGateway := createRoute("foo.example.com", v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + hrIgnoredGateway := createRoute("foo.example.com", v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "ignored-gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-80-1")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-80-1")), }) - hrFoo := createRoute("foo.example.com", v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + hrFoo := createRoute("foo.example.com", v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-80-1")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-80-1")), }) - hrFooImplicitNamespace := createRoute("foo.example.com", v1alpha2.ParentRef{ + hrFooImplicitNamespace := createRoute("foo.example.com", v1beta1.ParentReference{ Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-80-1")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-80-1")), }) - hrBar := createRoute("bar.example.com", v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + hrBar := createRoute("bar.example.com", v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-80-1")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-80-1")), }) // we create a new listener each time because the function under test can modify it createListener := func() *listener { return &listener{ - Source: v1alpha2.Listener{ - Hostname: (*v1alpha2.Hostname)(helpers.GetStringPointer("foo.example.com")), + Source: v1beta1.Listener{ + Hostname: (*v1beta1.Hostname)(helpers.GetStringPointer("foo.example.com")), }, Valid: true, Routes: map[types.NamespacedName]*route{}, @@ -768,7 +768,7 @@ func TestBindRouteToListeners(t *testing.T) { return l } - gw := &v1alpha2.Gateway{ + gw := &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "gateway", @@ -776,9 +776,9 @@ func TestBindRouteToListeners(t *testing.T) { } tests := []struct { - httpRoute *v1alpha2.HTTPRoute - gw *v1alpha2.Gateway - ignoredGws map[types.NamespacedName]*v1alpha2.Gateway + httpRoute *v1beta1.HTTPRoute + gw *v1beta1.Gateway + ignoredGws map[types.NamespacedName]*v1beta1.Gateway listeners map[string]*listener expectedIgnored bool expectedRoute *route @@ -800,10 +800,10 @@ func TestBindRouteToListeners(t *testing.T) { msg: "HTTPRoute without parent refs", }, { - httpRoute: createRoute("foo.example.com", v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + httpRoute: createRoute("foo.example.com", v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "some-gateway", // wrong gateway - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("listener-1")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("listener-1")), }), gw: gw, ignoredGws: nil, @@ -940,7 +940,7 @@ func TestBindRouteToListeners(t *testing.T) { { httpRoute: hrIgnoredGateway, gw: gw, - ignoredGws: map[types.NamespacedName]*v1alpha2.Gateway{ + ignoredGws: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "ignored-gateway"}: {}, }, listeners: map[string]*listener{ @@ -986,13 +986,13 @@ func TestBindRouteToListeners(t *testing.T) { } func TestFindAcceptedHostnames(t *testing.T) { - var listenerHostnameFoo v1alpha2.Hostname = "foo.example.com" - var listenerHostnameCafe v1alpha2.Hostname = "cafe.example.com" - routeHostnames := []v1alpha2.Hostname{"foo.example.com", "bar.example.com"} + var listenerHostnameFoo v1beta1.Hostname = "foo.example.com" + var listenerHostnameCafe v1beta1.Hostname = "cafe.example.com" + routeHostnames := []v1beta1.Hostname{"foo.example.com", "bar.example.com"} tests := []struct { - listenerHostname *v1alpha2.Hostname - routeHostnames []v1alpha2.Hostname + listenerHostname *v1beta1.Hostname + routeHostnames []v1beta1.Hostname expected []string msg string }{ @@ -1022,15 +1022,14 @@ func TestFindAcceptedHostnames(t *testing.T) { t.Errorf("findAcceptedHostnames() %q mismatch (-want +got):\n%s", test.msg, diff) } } - } func TestGetHostname(t *testing.T) { - var emptyHostname v1alpha2.Hostname - var hostname v1alpha2.Hostname = "example.com" + var emptyHostname v1beta1.Hostname + var hostname v1beta1.Hostname = "example.com" tests := []struct { - h *v1alpha2.Hostname + h *v1beta1.Hostname expected string msg string }{ @@ -1060,8 +1059,8 @@ func TestGetHostname(t *testing.T) { } func TestValidateGatewayClass(t *testing.T) { - gc := &v1alpha2.GatewayClass{ - Spec: v1alpha2.GatewayClassSpec{ + gc := &v1beta1.GatewayClass{ + Spec: v1beta1.GatewayClassSpec{ ControllerName: "test.controller", }, } diff --git a/internal/state/helpers_test.go b/internal/state/helpers_test.go index 2cc2c7e6ec..13140ffec7 100644 --- a/internal/state/helpers_test.go +++ b/internal/state/helpers_test.go @@ -5,11 +5,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) func TestGetNamespacedName(t *testing.T) { - obj := &v1alpha2.HTTPRoute{ObjectMeta: metav1.ObjectMeta{Namespace: "test", Name: "hr-1"}} + obj := &v1beta1.HTTPRoute{ObjectMeta: metav1.ObjectMeta{Namespace: "test", Name: "hr-1"}} expected := types.NamespacedName{Namespace: "test", Name: "hr-1"} diff --git a/internal/state/listener.go b/internal/state/listener.go index 38a6501921..f7764e09e9 100644 --- a/internal/state/listener.go +++ b/internal/state/listener.go @@ -2,14 +2,14 @@ package state import ( "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) // listener represents a listener of the Gateway resource. // FIXME(pleshakov) For now, we only support HTTP and HTTPS listeners. type listener struct { // Source holds the source of the listener from the Gateway resource. - Source v1alpha2.Listener + Source v1beta1.Listener // Valid shows whether the listener is valid. Valid bool // SecretPath is the path to the secret on disk. @@ -22,7 +22,7 @@ type listener struct { } type listenerConfigurator interface { - configure(listener v1alpha2.Listener) *listener + configure(listener v1beta1.Listener) *listener } type listenerConfiguratorFactory struct { @@ -30,18 +30,18 @@ type listenerConfiguratorFactory struct { http *httpListenerConfigurator } -func (f *listenerConfiguratorFactory) getConfiguratorForListener(l v1alpha2.Listener) listenerConfigurator { +func (f *listenerConfiguratorFactory) getConfiguratorForListener(l v1beta1.Listener) listenerConfigurator { switch l.Protocol { - case v1alpha2.HTTPProtocolType: + case v1beta1.HTTPProtocolType: return f.http - case v1alpha2.HTTPSProtocolType: + case v1beta1.HTTPSProtocolType: return f.https default: return newInvalidProtocolListenerConfigurator() } } -func newListenerConfiguratorFactory(gw *v1alpha2.Gateway, secretMemoryMgr SecretDiskMemoryManager) *listenerConfiguratorFactory { +func newListenerConfiguratorFactory(gw *v1beta1.Gateway, secretMemoryMgr SecretDiskMemoryManager) *listenerConfiguratorFactory { return &listenerConfiguratorFactory{ https: newHTTPSListenerConfigurator(gw, secretMemoryMgr), http: newHTTPListenerConfigurator(), @@ -49,12 +49,12 @@ func newListenerConfiguratorFactory(gw *v1alpha2.Gateway, secretMemoryMgr Secret } type httpsListenerConfigurator struct { - gateway *v1alpha2.Gateway + gateway *v1beta1.Gateway secretMemoryMgr SecretDiskMemoryManager usedHostnames map[string]*listener } -func newHTTPSListenerConfigurator(gateway *v1alpha2.Gateway, secretMemoryMgr SecretDiskMemoryManager) *httpsListenerConfigurator { +func newHTTPSListenerConfigurator(gateway *v1beta1.Gateway, secretMemoryMgr SecretDiskMemoryManager) *httpsListenerConfigurator { return &httpsListenerConfigurator{ gateway: gateway, secretMemoryMgr: secretMemoryMgr, @@ -62,7 +62,7 @@ func newHTTPSListenerConfigurator(gateway *v1alpha2.Gateway, secretMemoryMgr Sec } } -func (c *httpsListenerConfigurator) configure(gl v1alpha2.Listener) *listener { +func (c *httpsListenerConfigurator) configure(gl v1beta1.Listener) *listener { var path string var err error @@ -110,7 +110,7 @@ func newHTTPListenerConfigurator() *httpListenerConfigurator { } } -func (c *httpListenerConfigurator) configure(gl v1alpha2.Listener) *listener { +func (c *httpListenerConfigurator) configure(gl v1beta1.Listener) *listener { valid := validateHTTPListener(gl) h := getHostname(gl.Hostname) @@ -138,7 +138,7 @@ func newInvalidProtocolListenerConfigurator() *invalidProtocolListenerConfigurat return &invalidProtocolListenerConfigurator{} } -func (c *invalidProtocolListenerConfigurator) configure(gl v1alpha2.Listener) *listener { +func (c *invalidProtocolListenerConfigurator) configure(gl v1beta1.Listener) *listener { return &listener{ Source: gl, Valid: false, @@ -147,16 +147,16 @@ func (c *invalidProtocolListenerConfigurator) configure(gl v1alpha2.Listener) *l } } -func validateHTTPListener(listener v1alpha2.Listener) bool { +func validateHTTPListener(listener v1beta1.Listener) bool { // FIXME(pleshakov): For now we require that all HTTP listeners bind to port 80 return listener.Port == 80 } -func validateHTTPSListener(listener v1alpha2.Listener, gwNsname string) bool { +func validateHTTPSListener(listener v1beta1.Listener, gwNsname string) bool { // FIXME(kate-osborn): // 1. For now we require that all HTTPS listeners bind to port 443 // 2. Only TLSModeTerminate is supported. - if listener.Port != 443 || listener.TLS == nil || *listener.TLS.Mode != v1alpha2.TLSModeTerminate || len(listener.TLS.CertificateRefs) == 0 { + if listener.Port != 443 || listener.TLS == nil || *listener.TLS.Mode != v1beta1.TLSModeTerminate || len(listener.TLS.CertificateRefs) == 0 { return false } diff --git a/internal/state/listener_test.go b/internal/state/listener_test.go index f2f57a9b5c..4b55174e9b 100644 --- a/internal/state/listener_test.go +++ b/internal/state/listener_test.go @@ -3,29 +3,29 @@ package state import ( "testing" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" ) func TestValidateHTTPListener(t *testing.T) { tests := []struct { - l v1alpha2.Listener + l v1beta1.Listener expected bool msg string }{ { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 80, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, }, expected: true, msg: "valid", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 81, - Protocol: v1alpha2.HTTPProtocolType, + Protocol: v1beta1.HTTPProtocolType, }, expected: false, msg: "invalid port", @@ -43,104 +43,104 @@ func TestValidateHTTPListener(t *testing.T) { func TestValidateHTTPSListener(t *testing.T) { gwNs := "gateway-ns" - validSecretRef := &v1alpha2.SecretObjectReference{ - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + validSecretRef := &v1beta1.SecretObjectReference{ + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer(gwNs)), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer(gwNs)), } - invalidSecretRefType := &v1alpha2.SecretObjectReference{ - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("ConfigMap")), + invalidSecretRefType := &v1beta1.SecretObjectReference{ + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("ConfigMap")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer(gwNs)), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer(gwNs)), } - invalidSecretRefTNamespace := &v1alpha2.SecretObjectReference{ - Kind: (*v1alpha2.Kind)(helpers.GetStringPointer("Secret")), + invalidSecretRefTNamespace := &v1beta1.SecretObjectReference{ + Kind: (*v1beta1.Kind)(helpers.GetStringPointer("Secret")), Name: "secret", - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("diff-ns")), + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("diff-ns")), } tests := []struct { - l v1alpha2.Listener + l v1beta1.Listener expected bool msg string }{ { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{validSecretRef}, + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{*validSecretRef}, }, }, expected: true, msg: "valid", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 80, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{validSecretRef}, + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{*validSecretRef}, }, }, expected: false, msg: "invalid port", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), }, }, expected: false, msg: "invalid - no cert ref", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModePassthrough), - CertificateRefs: []*v1alpha2.SecretObjectReference{validSecretRef}, + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModePassthrough), + CertificateRefs: []v1beta1.SecretObjectReference{*validSecretRef}, }, }, expected: false, msg: "invalid tls mode", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{invalidSecretRefType}, + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{*invalidSecretRefType}, }, }, expected: false, msg: "invalid cert ref kind", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, - TLS: &v1alpha2.GatewayTLSConfig{ - Mode: helpers.GetTLSModePointer(v1alpha2.TLSModeTerminate), - CertificateRefs: []*v1alpha2.SecretObjectReference{invalidSecretRefTNamespace}, + Protocol: v1beta1.HTTPSProtocolType, + TLS: &v1beta1.GatewayTLSConfig{ + Mode: helpers.GetTLSModePointer(v1beta1.TLSModeTerminate), + CertificateRefs: []v1beta1.SecretObjectReference{*invalidSecretRefTNamespace}, }, }, expected: false, msg: "invalid cert ref namespace", }, { - l: v1alpha2.Listener{ + l: v1beta1.Listener{ Port: 443, - Protocol: v1alpha2.HTTPSProtocolType, + Protocol: v1beta1.HTTPSProtocolType, }, expected: false, msg: "invalid - no tls config", diff --git a/internal/state/sort_test.go b/internal/state/sort_test.go index c11b9c919c..8d44df22a0 100644 --- a/internal/state/sort_test.go +++ b/internal/state/sort_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" ) @@ -17,16 +17,16 @@ func TestSort(t *testing.T) { later := metav1.NewTime(earlier.Add(1 * time.Second)) // matches - pathOnlyMatch := v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + pathOnlyMatch := v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), // path match only (low priority) }, } - twoHeaderMatch := v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + twoHeaderMatch := v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, - Headers: []v1alpha2.HTTPHeaderMatch{ + Headers: []v1beta1.HTTPHeaderMatch{ { Name: "header1", Value: "value1", @@ -37,11 +37,11 @@ func TestSort(t *testing.T) { }, }, } - threeHeaderMatch := v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + threeHeaderMatch := v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, - Headers: []v1alpha2.HTTPHeaderMatch{ + Headers: []v1beta1.HTTPHeaderMatch{ { Name: "header1", Value: "value1", @@ -56,11 +56,11 @@ func TestSort(t *testing.T) { }, }, } - twoHeaderOneParamMatch := v1alpha2.HTTPRouteMatch{ - Path: &v1alpha2.HTTPPathMatch{ + twoHeaderOneParamMatch := v1beta1.HTTPRouteMatch{ + Path: &v1beta1.HTTPPathMatch{ Value: helpers.GetStringPointer("/path"), }, - Headers: []v1alpha2.HTTPHeaderMatch{ + Headers: []v1beta1.HTTPHeaderMatch{ { Name: "header1", Value: "value1", @@ -70,7 +70,7 @@ func TestSort(t *testing.T) { Value: "value2", }, }, - QueryParams: []v1alpha2.HTTPQueryParamMatch{ + QueryParams: []v1beta1.HTTPQueryParamMatch{ { Name: "key1", Value: "value1", @@ -78,22 +78,22 @@ func TestSort(t *testing.T) { }, } - hr1 := v1alpha2.HTTPRoute{ + hr1 := v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Name: "hr1", Namespace: "test", CreationTimestamp: earlier, }, - Spec: v1alpha2.HTTPRouteSpec{ - Rules: []v1alpha2.HTTPRouteRule{ + Spec: v1beta1.HTTPRouteSpec{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{pathOnlyMatch}, + Matches: []v1beta1.HTTPRouteMatch{pathOnlyMatch}, }, { - Matches: []v1alpha2.HTTPRouteMatch{twoHeaderMatch}, + Matches: []v1beta1.HTTPRouteMatch{twoHeaderMatch}, }, { - Matches: []v1alpha2.HTTPRouteMatch{ + Matches: []v1beta1.HTTPRouteMatch{ twoHeaderOneParamMatch, // tie decided on params threeHeaderMatch, // tie decided on headers }, @@ -102,31 +102,31 @@ func TestSort(t *testing.T) { }, } - hr2 := v1alpha2.HTTPRoute{ + hr2 := v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Name: "hr2", Namespace: "test", CreationTimestamp: later, }, - Spec: v1alpha2.HTTPRouteSpec{ - Rules: []v1alpha2.HTTPRouteRule{ + Spec: v1beta1.HTTPRouteSpec{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{twoHeaderMatch}, // tie decided on creation timestamp + Matches: []v1beta1.HTTPRouteMatch{twoHeaderMatch}, // tie decided on creation timestamp }, }, }, } - hr3 := v1alpha2.HTTPRoute{ + hr3 := v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Name: "hr3", Namespace: "a-test", // tie decided by namespace name CreationTimestamp: later, }, - Spec: v1alpha2.HTTPRouteSpec{ - Rules: []v1alpha2.HTTPRouteRule{ + Spec: v1beta1.HTTPRouteSpec{ + Rules: []v1beta1.HTTPRouteRule{ { - Matches: []v1alpha2.HTTPRouteMatch{twoHeaderMatch}, + Matches: []v1beta1.HTTPRouteMatch{twoHeaderMatch}, }, }, }, diff --git a/internal/state/statuses_test.go b/internal/state/statuses_test.go index 828714d98a..dcfe474483 100644 --- a/internal/state/statuses_test.go +++ b/internal/state/statuses_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) func TestBuildStatuses(t *testing.T) { @@ -14,7 +14,8 @@ func TestBuildStatuses(t *testing.T) { "listener-80-1": { Valid: true, Routes: map[types.NamespacedName]*route{ - {Namespace: "test", Name: "hr-1"}: {}}, + {Namespace: "test", Name: "hr-1"}: {}, + }, }, } @@ -38,14 +39,14 @@ func TestBuildStatuses(t *testing.T) { }, } - gw := &v1alpha2.Gateway{ + gw := &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "gateway", }, } - ignoredGw := &v1alpha2.Gateway{ + ignoredGw := &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "ignored-gateway", @@ -61,7 +62,7 @@ func TestBuildStatuses(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{ + Source: &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{Generation: 1}, }, Valid: true, @@ -70,7 +71,7 @@ func TestBuildStatuses(t *testing.T) { Source: gw, Listeners: listeners, }, - IgnoredGateways: map[types.NamespacedName]*v1alpha2.Gateway{ + IgnoredGateways: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "ignored-gateway"}: ignoredGw, }, Routes: routes, @@ -114,7 +115,7 @@ func TestBuildStatuses(t *testing.T) { Source: gw, Listeners: listeners, }, - IgnoredGateways: map[types.NamespacedName]*v1alpha2.Gateway{ + IgnoredGateways: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "ignored-gateway"}: ignoredGw, }, Routes: routes, @@ -151,7 +152,7 @@ func TestBuildStatuses(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{ + Source: &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{Generation: 1}, }, Valid: false, @@ -161,7 +162,7 @@ func TestBuildStatuses(t *testing.T) { Source: gw, Listeners: listeners, }, - IgnoredGateways: map[types.NamespacedName]*v1alpha2.Gateway{ + IgnoredGateways: map[types.NamespacedName]*v1beta1.Gateway{ {Namespace: "test", Name: "ignored-gateway"}: ignoredGw, }, Routes: routes, @@ -202,7 +203,7 @@ func TestBuildStatuses(t *testing.T) { { graph: &graph{ GatewayClass: &gatewayClass{ - Source: &v1alpha2.GatewayClass{ + Source: &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{Generation: 1}, }, Valid: true, diff --git a/internal/state/store.go b/internal/state/store.go index 2b0b920d5c..c70e1c9b6a 100644 --- a/internal/state/store.go +++ b/internal/state/store.go @@ -2,19 +2,19 @@ package state import ( "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) // store contains the resources that represent the state of the Gateway. type store struct { - gc *v1alpha2.GatewayClass - gateways map[types.NamespacedName]*v1alpha2.Gateway - httpRoutes map[types.NamespacedName]*v1alpha2.HTTPRoute + gc *v1beta1.GatewayClass + gateways map[types.NamespacedName]*v1beta1.Gateway + httpRoutes map[types.NamespacedName]*v1beta1.HTTPRoute } func newStore() *store { return &store{ - gateways: make(map[types.NamespacedName]*v1alpha2.Gateway), - httpRoutes: make(map[types.NamespacedName]*v1alpha2.HTTPRoute), + gateways: make(map[types.NamespacedName]*v1beta1.Gateway), + httpRoutes: make(map[types.NamespacedName]*v1beta1.HTTPRoute), } } diff --git a/internal/status/gateway.go b/internal/status/gateway.go index f3b3d92e03..dc1f574efe 100644 --- a/internal/status/gateway.go +++ b/internal/status/gateway.go @@ -4,7 +4,7 @@ import ( "sort" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) @@ -13,7 +13,7 @@ const ( // GetawayReasonGatewayConflict indicates there are multiple Gateway resources for NGINX Gateway to choose from, // and NGINX Gateway ignored the resource in question and picked another Gateway as the winner. // NGINX Gateway will use this reason with GatewayConditionReady (false). - GetawayReasonGatewayConflict v1alpha2.GatewayConditionReason = "GatewayConflict" + GetawayReasonGatewayConflict v1beta1.GatewayConditionReason = "GatewayConflict" // GatewayMessageGatewayConflict is message that describes GetawayReasonGatewayConflict. GatewayMessageGatewayConflict = "The resource is ignored due to a conflicting Gateway resource" @@ -23,8 +23,8 @@ const ( // FIXME(pleshakov): Be compliant with in the Gateway API. // Currently, we only support simple valid/invalid status per each listener. // Extend support to cover more cases. -func prepareGatewayStatus(gatewayStatus state.GatewayStatus, transitionTime metav1.Time) v1alpha2.GatewayStatus { - listenerStatuses := make([]v1alpha2.ListenerStatus, 0, len(gatewayStatus.ListenerStatuses)) +func prepareGatewayStatus(gatewayStatus state.GatewayStatus, transitionTime metav1.Time) v1beta1.GatewayStatus { + listenerStatuses := make([]v1beta1.ListenerStatus, 0, len(gatewayStatus.ListenerStatuses)) // FIXME(pleshakov) Maintain the order from the Gateway resource names := make([]string, 0, len(gatewayStatus.ListenerStatuses)) @@ -38,19 +38,19 @@ func prepareGatewayStatus(gatewayStatus state.GatewayStatus, transitionTime meta var ( status metav1.ConditionStatus - reason v1alpha2.ListenerConditionReason + reason v1beta1.ListenerConditionReason ) if s.Valid { status = metav1.ConditionTrue - reason = v1alpha2.ListenerReasonReady + reason = v1beta1.ListenerReasonReady } else { status = metav1.ConditionFalse - reason = v1alpha2.ListenerReasonInvalid + reason = v1beta1.ListenerReasonInvalid } cond := metav1.Condition{ - Type: string(v1alpha2.ListenerConditionReady), + Type: string(v1beta1.ListenerConditionReady), Status: status, // FIXME(pleshakov) Set the observed generation to the last processed generation of the Gateway resource. ObservedGeneration: 123, @@ -59,9 +59,9 @@ func prepareGatewayStatus(gatewayStatus state.GatewayStatus, transitionTime meta Message: "", // FIXME(pleshakov) Come up with a good message } - listenerStatuses = append(listenerStatuses, v1alpha2.ListenerStatus{ - Name: v1alpha2.SectionName(name), - SupportedKinds: []v1alpha2.RouteGroupKind{ + listenerStatuses = append(listenerStatuses, v1beta1.ListenerStatus{ + Name: v1beta1.SectionName(name), + SupportedKinds: []v1beta1.RouteGroupKind{ { Kind: "HTTPRoute", // FIXME(pleshakov) Set it based on the listener }, @@ -71,7 +71,7 @@ func prepareGatewayStatus(gatewayStatus state.GatewayStatus, transitionTime meta }) } - return v1alpha2.GatewayStatus{ + return v1beta1.GatewayStatus{ Listeners: listenerStatuses, Conditions: nil, // FIXME(pleshakov) Create conditions for the Gateway resource. } @@ -79,11 +79,11 @@ func prepareGatewayStatus(gatewayStatus state.GatewayStatus, transitionTime meta // prepareIgnoredGatewayStatus prepares the status for an ignored Gateway resource. // TODO: is it reasonable to not set the listener statuses? -func prepareIgnoredGatewayStatus(status state.IgnoredGatewayStatus, transitionTime metav1.Time) v1alpha2.GatewayStatus { - return v1alpha2.GatewayStatus{ +func prepareIgnoredGatewayStatus(status state.IgnoredGatewayStatus, transitionTime metav1.Time) v1beta1.GatewayStatus { + return v1beta1.GatewayStatus{ Conditions: []metav1.Condition{ { - Type: string(v1alpha2.GatewayConditionReady), + Type: string(v1beta1.GatewayConditionReady), Status: metav1.ConditionFalse, ObservedGeneration: status.ObservedGeneration, LastTransitionTime: transitionTime, diff --git a/internal/status/gateway_test.go b/internal/status/gateway_test.go index b3bd7bd429..5c1163fd0a 100644 --- a/internal/status/gateway_test.go +++ b/internal/status/gateway_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) @@ -22,15 +22,16 @@ func TestPrepareGatewayStatus(t *testing.T) { Valid: false, AttachedRoutes: 1, }, - }} + }, + } transitionTime := metav1.NewTime(time.Now()) - expected := v1alpha2.GatewayStatus{ - Listeners: []v1alpha2.ListenerStatus{ + expected := v1beta1.GatewayStatus{ + Listeners: []v1beta1.ListenerStatus{ { Name: "invalid-listener", - SupportedKinds: []v1alpha2.RouteGroupKind{ + SupportedKinds: []v1beta1.RouteGroupKind{ { Kind: "HTTPRoute", }, @@ -38,17 +39,17 @@ func TestPrepareGatewayStatus(t *testing.T) { AttachedRoutes: 1, Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ListenerConditionReady), + Type: string(v1beta1.ListenerConditionReady), Status: metav1.ConditionFalse, ObservedGeneration: 123, LastTransitionTime: transitionTime, - Reason: string(v1alpha2.ListenerReasonInvalid), + Reason: string(v1beta1.ListenerReasonInvalid), }, }, }, { Name: "valid-listener", - SupportedKinds: []v1alpha2.RouteGroupKind{ + SupportedKinds: []v1beta1.RouteGroupKind{ { Kind: "HTTPRoute", }, @@ -56,11 +57,11 @@ func TestPrepareGatewayStatus(t *testing.T) { AttachedRoutes: 2, Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ListenerConditionReady), + Type: string(v1beta1.ListenerConditionReady), Status: metav1.ConditionTrue, ObservedGeneration: 123, LastTransitionTime: transitionTime, - Reason: string(v1alpha2.ListenerReasonReady), + Reason: string(v1beta1.ListenerReasonReady), }, }, }, @@ -80,10 +81,10 @@ func TestPrepareIgnoredGatewayStatus(t *testing.T) { transitionTime := metav1.NewTime(time.Now()) - expected := v1alpha2.GatewayStatus{ + expected := v1beta1.GatewayStatus{ Conditions: []metav1.Condition{ { - Type: string(v1alpha2.GatewayConditionReady), + Type: string(v1beta1.GatewayConditionReady), Status: metav1.ConditionFalse, ObservedGeneration: status.ObservedGeneration, LastTransitionTime: transitionTime, diff --git a/internal/status/gatewayclass.go b/internal/status/gatewayclass.go index c2e53afb63..1901198356 100644 --- a/internal/status/gatewayclass.go +++ b/internal/status/gatewayclass.go @@ -4,13 +4,13 @@ import ( "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) // prepareGatewayClassStatus prepares the status for the GatewayClass resource. -func prepareGatewayClassStatus(status state.GatewayClassStatus, transitionTime metav1.Time) v1alpha2.GatewayClassStatus { +func prepareGatewayClassStatus(status state.GatewayClassStatus, transitionTime metav1.Time) v1beta1.GatewayClassStatus { var ( condStatus metav1.ConditionStatus msg string @@ -25,15 +25,15 @@ func prepareGatewayClassStatus(status state.GatewayClassStatus, transitionTime m } cond := metav1.Condition{ - Type: string(v1alpha2.GatewayClassConditionStatusAccepted), + Type: string(v1beta1.GatewayClassConditionStatusAccepted), Status: condStatus, ObservedGeneration: status.ObservedGeneration, LastTransitionTime: transitionTime, - Reason: string(v1alpha2.GatewayClassReasonAccepted), + Reason: string(v1beta1.GatewayClassReasonAccepted), Message: msg, } - return v1alpha2.GatewayClassStatus{ + return v1beta1.GatewayClassStatus{ Conditions: []metav1.Condition{cond}, } } diff --git a/internal/status/gatewayclass_test.go b/internal/status/gatewayclass_test.go index 1f1e0eea67..5b810bc119 100644 --- a/internal/status/gatewayclass_test.go +++ b/internal/status/gatewayclass_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) @@ -16,7 +16,7 @@ func TestPrepareGatewayClassStatus(t *testing.T) { tests := []struct { status state.GatewayClassStatus - expected v1alpha2.GatewayClassStatus + expected v1beta1.GatewayClassStatus msg string }{ { @@ -24,14 +24,14 @@ func TestPrepareGatewayClassStatus(t *testing.T) { Valid: true, ObservedGeneration: 1, }, - expected: v1alpha2.GatewayClassStatus{ + expected: v1beta1.GatewayClassStatus{ Conditions: []metav1.Condition{ { - Type: string(v1alpha2.GatewayClassConditionStatusAccepted), + Type: string(v1beta1.GatewayClassConditionStatusAccepted), Status: metav1.ConditionTrue, ObservedGeneration: 1, LastTransitionTime: transitionTime, - Reason: string(v1alpha2.GatewayClassReasonAccepted), + Reason: string(v1beta1.GatewayClassReasonAccepted), Message: "GatewayClass has been accepted", }, }, @@ -44,14 +44,14 @@ func TestPrepareGatewayClassStatus(t *testing.T) { ErrorMsg: "error", ObservedGeneration: 2, }, - expected: v1alpha2.GatewayClassStatus{ + expected: v1beta1.GatewayClassStatus{ Conditions: []metav1.Condition{ { - Type: string(v1alpha2.GatewayClassConditionStatusAccepted), + Type: string(v1beta1.GatewayClassConditionStatusAccepted), Status: metav1.ConditionFalse, ObservedGeneration: 2, LastTransitionTime: transitionTime, - Reason: string(v1alpha2.GatewayClassReasonAccepted), + Reason: string(v1beta1.GatewayClassReasonAccepted), Message: "GatewayClass has been rejected: error", }, }, diff --git a/internal/status/httproute.go b/internal/status/httproute.go index 94e4b7ed23..315d6ef09d 100644 --- a/internal/status/httproute.go +++ b/internal/status/httproute.go @@ -5,7 +5,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) @@ -19,8 +19,8 @@ func prepareHTTPRouteStatus( gwNsName types.NamespacedName, gatewayCtlrName string, transitionTime metav1.Time, -) v1alpha2.HTTPRouteStatus { - parents := make([]v1alpha2.RouteParentStatus, 0, len(status.ParentStatuses)) +) v1beta1.HTTPRouteStatus { + parents := make([]v1beta1.RouteParentStatus, 0, len(status.ParentStatuses)) // FIXME(pleshakov) Maintain the order from the HTTPRoute resource names := make([]string, 0, len(status.ParentStatuses)) @@ -47,16 +47,16 @@ func prepareHTTPRouteStatus( sectionName := name - p := v1alpha2.RouteParentStatus{ - ParentRef: v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(&gwNsName.Namespace), - Name: v1alpha2.ObjectName(gwNsName.Name), - SectionName: (*v1alpha2.SectionName)(§ionName), + p := v1beta1.RouteParentStatus{ + ParentRef: v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(&gwNsName.Namespace), + Name: v1beta1.ObjectName(gwNsName.Name), + SectionName: (*v1beta1.SectionName)(§ionName), }, - ControllerName: v1alpha2.GatewayController(gatewayCtlrName), + ControllerName: v1beta1.GatewayController(gatewayCtlrName), Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ConditionRouteAccepted), + Type: string(v1beta1.RouteConditionAccepted), Status: status, // FIXME(pleshakov) Set the observed generation to the last processed generation of the HTTPRoute resource. ObservedGeneration: 123, @@ -69,8 +69,8 @@ func prepareHTTPRouteStatus( parents = append(parents, p) } - return v1alpha2.HTTPRouteStatus{ - RouteStatus: v1alpha2.RouteStatus{ + return v1beta1.HTTPRouteStatus{ + RouteStatus: v1beta1.RouteStatus{ Parents: parents, }, } diff --git a/internal/status/httproute_test.go b/internal/status/httproute_test.go index ad9513a3ec..1ae1a0e6fb 100644 --- a/internal/status/httproute_test.go +++ b/internal/status/httproute_test.go @@ -7,7 +7,7 @@ import ( "github.com/google/go-cmp/cmp" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" @@ -30,19 +30,19 @@ func TestPrepareHTTPRouteStatus(t *testing.T) { transitionTime := metav1.NewTime(time.Now()) - expected := v1alpha2.HTTPRouteStatus{ - RouteStatus: v1alpha2.RouteStatus{ - Parents: []v1alpha2.RouteParentStatus{ + expected := v1beta1.HTTPRouteStatus{ + RouteStatus: v1beta1.RouteStatus{ + Parents: []v1beta1.RouteParentStatus{ { - ParentRef: v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + ParentRef: v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("attached")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("attached")), }, - ControllerName: v1alpha2.GatewayController(gatewayCtlrName), + ControllerName: v1beta1.GatewayController(gatewayCtlrName), Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ConditionRouteAccepted), + Type: string(v1beta1.RouteConditionAccepted), Status: metav1.ConditionTrue, ObservedGeneration: 123, LastTransitionTime: transitionTime, @@ -51,15 +51,15 @@ func TestPrepareHTTPRouteStatus(t *testing.T) { }, }, { - ParentRef: v1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + ParentRef: v1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("not-attached")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("not-attached")), }, - ControllerName: v1alpha2.GatewayController(gatewayCtlrName), + ControllerName: v1beta1.GatewayController(gatewayCtlrName), Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ConditionRouteAccepted), + Type: string(v1beta1.RouteConditionAccepted), Status: metav1.ConditionFalse, ObservedGeneration: 123, LastTransitionTime: transitionTime, diff --git a/internal/status/updater.go b/internal/status/updater.go index 7ad2e536b9..d276ae1ebb 100644 --- a/internal/status/updater.go +++ b/internal/status/updater.go @@ -7,7 +7,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" ) @@ -87,15 +87,15 @@ func (upd *updaterImpl) Update(ctx context.Context, statuses state.Statuses) { // FIXME(pleshakov) Skip the status update (API call) if the status hasn't changed. if statuses.GatewayClassStatus != nil { - upd.update(ctx, types.NamespacedName{Name: upd.cfg.GatewayClassName}, &v1alpha2.GatewayClass{}, func(object client.Object) { - gc := object.(*v1alpha2.GatewayClass) + upd.update(ctx, types.NamespacedName{Name: upd.cfg.GatewayClassName}, &v1beta1.GatewayClass{}, func(object client.Object) { + gc := object.(*v1beta1.GatewayClass) gc.Status = prepareGatewayClassStatus(*statuses.GatewayClassStatus, upd.cfg.Clock.Now()) }) } if statuses.GatewayStatus != nil { - upd.update(ctx, statuses.GatewayStatus.NsName, &v1alpha2.Gateway{}, func(object client.Object) { - gw := object.(*v1alpha2.Gateway) + upd.update(ctx, statuses.GatewayStatus.NsName, &v1beta1.Gateway{}, func(object client.Object) { + gw := object.(*v1beta1.Gateway) gw.Status = prepareGatewayStatus(*statuses.GatewayStatus, upd.cfg.Clock.Now()) }) } @@ -107,8 +107,8 @@ func (upd *updaterImpl) Update(ctx context.Context, statuses state.Statuses) { default: } - upd.update(ctx, nsname, &v1alpha2.Gateway{}, func(object client.Object) { - gw := object.(*v1alpha2.Gateway) + upd.update(ctx, nsname, &v1beta1.Gateway{}, func(object client.Object) { + gw := object.(*v1beta1.Gateway) gw.Status = prepareIgnoredGatewayStatus(gs, upd.cfg.Clock.Now()) }) } @@ -120,8 +120,8 @@ func (upd *updaterImpl) Update(ctx context.Context, statuses state.Statuses) { default: } - upd.update(ctx, nsname, &v1alpha2.HTTPRoute{}, func(object client.Object) { - hr := object.(*v1alpha2.HTTPRoute) + upd.update(ctx, nsname, &v1beta1.HTTPRoute{}, func(object client.Object) { + hr := object.(*v1beta1.HTTPRoute) // statuses.GatewayStatus is never nil when len(statuses.HTTPRouteStatuses) > 0 hr.Status = prepareHTTPRouteStatus(rs, statuses.GatewayStatus.NsName, upd.cfg.GatewayCtlrName, upd.cfg.Clock.Now()) }) diff --git a/internal/status/updater_test.go b/internal/status/updater_test.go index dec47c99a5..f70c4e809c 100644 --- a/internal/status/updater_test.go +++ b/internal/status/updater_test.go @@ -12,8 +12,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/log/zap" - "sigs.k8s.io/gateway-api/apis/v1alpha2" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" + gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" "github.com/nginxinc/nginx-kubernetes-gateway/internal/helpers" "github.com/nginxinc/nginx-kubernetes-gateway/internal/state" @@ -34,7 +34,7 @@ var _ = Describe("Updater", func() { BeforeEach(OncePerOrdered, func() { scheme := runtime.NewScheme() - Expect(gatewayv1alpha2.AddToScheme(scheme)).Should(Succeed()) + Expect(gatewayv1beta1.AddToScheme(scheme)).Should(Succeed()) client = fake.NewClientBuilder(). WithScheme(scheme). @@ -60,9 +60,9 @@ var _ = Describe("Updater", func() { Describe("Process status updates", Ordered, func() { var ( - gc *v1alpha2.GatewayClass - gw, ignoredGw *v1alpha2.Gateway - hr *v1alpha2.HTTPRoute + gc *v1beta1.GatewayClass + gw, ignoredGw *v1beta1.Gateway + hr *v1beta1.HTTPRoute createStatuses = func(valid bool, generation int64) state.Statuses { var gcErrorMsg string @@ -102,19 +102,19 @@ var _ = Describe("Updater", func() { } } - createExpectedGc = func(status metav1.ConditionStatus, generation int64, reason string, msg string) *v1alpha2.GatewayClass { - return &v1alpha2.GatewayClass{ + createExpectedGc = func(status metav1.ConditionStatus, generation int64, reason string, msg string) *v1beta1.GatewayClass { + return &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{ Name: gcName, }, TypeMeta: metav1.TypeMeta{ Kind: "GatewayClass", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, - Status: v1alpha2.GatewayClassStatus{ + Status: v1beta1.GatewayClassStatus{ Conditions: []metav1.Condition{ { - Type: string(v1alpha2.GatewayClassConditionStatusAccepted), + Type: string(v1beta1.GatewayClassConditionStatusAccepted), Status: status, ObservedGeneration: generation, LastTransitionTime: fakeClockTime, @@ -126,21 +126,21 @@ var _ = Describe("Updater", func() { } } - createExpectedGw = func(status metav1.ConditionStatus, reason string) *v1alpha2.Gateway { - return &v1alpha2.Gateway{ + createExpectedGw = func(status metav1.ConditionStatus, reason string) *v1beta1.Gateway { + return &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "gateway", }, TypeMeta: metav1.TypeMeta{ Kind: "Gateway", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, - Status: v1alpha2.GatewayStatus{ - Listeners: []gatewayv1alpha2.ListenerStatus{ + Status: v1beta1.GatewayStatus{ + Listeners: []gatewayv1beta1.ListenerStatus{ { Name: "http", - SupportedKinds: []v1alpha2.RouteGroupKind{ + SupportedKinds: []v1beta1.RouteGroupKind{ { Kind: "HTTPRoute", }, @@ -148,7 +148,7 @@ var _ = Describe("Updater", func() { AttachedRoutes: 1, Conditions: []metav1.Condition{ { - Type: string(v1alpha2.ListenerConditionReady), + Type: string(v1beta1.ListenerConditionReady), Status: status, ObservedGeneration: 123, LastTransitionTime: fakeClockTime, @@ -161,20 +161,20 @@ var _ = Describe("Updater", func() { } } - createExpectedIgnoredGw = func() *v1alpha2.Gateway { - return &v1alpha2.Gateway{ + createExpectedIgnoredGw = func() *v1beta1.Gateway { + return &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "ignored-gateway", }, TypeMeta: metav1.TypeMeta{ Kind: "Gateway", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, - Status: v1alpha2.GatewayStatus{ + Status: v1beta1.GatewayStatus{ Conditions: []metav1.Condition{ { - Type: string(v1alpha2.GatewayConditionReady), + Type: string(v1beta1.GatewayConditionReady), Status: metav1.ConditionFalse, ObservedGeneration: 1, LastTransitionTime: fakeClockTime, @@ -186,29 +186,29 @@ var _ = Describe("Updater", func() { } } - createExpectedHR = func() *v1alpha2.HTTPRoute { - return &v1alpha2.HTTPRoute{ + createExpectedHR = func() *v1beta1.HTTPRoute { + return &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "route1", }, TypeMeta: metav1.TypeMeta{ Kind: "HTTPRoute", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, - Status: gatewayv1alpha2.HTTPRouteStatus{ - RouteStatus: gatewayv1alpha2.RouteStatus{ - Parents: []gatewayv1alpha2.RouteParentStatus{ + Status: gatewayv1beta1.HTTPRouteStatus{ + RouteStatus: gatewayv1beta1.RouteStatus{ + Parents: []gatewayv1beta1.RouteParentStatus{ { - ControllerName: gatewayv1alpha2.GatewayController(gatewayCtrlName), - ParentRef: gatewayv1alpha2.ParentRef{ - Namespace: (*v1alpha2.Namespace)(helpers.GetStringPointer("test")), + ControllerName: gatewayv1beta1.GatewayController(gatewayCtrlName), + ParentRef: gatewayv1beta1.ParentReference{ + Namespace: (*v1beta1.Namespace)(helpers.GetStringPointer("test")), Name: "gateway", - SectionName: (*v1alpha2.SectionName)(helpers.GetStringPointer("http")), + SectionName: (*v1beta1.SectionName)(helpers.GetStringPointer("http")), }, Conditions: []metav1.Condition{ { - Type: string(gatewayv1alpha2.ConditionRouteAccepted), + Type: string(gatewayv1beta1.RouteConditionAccepted), Status: metav1.ConditionTrue, ObservedGeneration: 123, LastTransitionTime: fakeClockTime, @@ -224,43 +224,43 @@ var _ = Describe("Updater", func() { ) BeforeAll(func() { - gc = &v1alpha2.GatewayClass{ + gc = &v1beta1.GatewayClass{ ObjectMeta: metav1.ObjectMeta{ Name: gcName, }, TypeMeta: metav1.TypeMeta{ Kind: "GatewayClass", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, } - gw = &v1alpha2.Gateway{ + gw = &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "gateway", }, TypeMeta: metav1.TypeMeta{ Kind: "Gateway", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, } - ignoredGw = &v1alpha2.Gateway{ + ignoredGw = &v1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "ignored-gateway", }, TypeMeta: metav1.TypeMeta{ Kind: "Gateway", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, } - hr = &v1alpha2.HTTPRoute{ + hr = &v1beta1.HTTPRoute{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "route1", }, TypeMeta: metav1.TypeMeta{ Kind: "HTTPRoute", - APIVersion: "gateway.networking.k8s.io/v1alpha2", + APIVersion: "gateway.networking.k8s.io/v1beta1", }, } }) @@ -277,8 +277,8 @@ var _ = Describe("Updater", func() { }) It("should have the updated status of GatewayClass in the API server", func() { - latestGc := &v1alpha2.GatewayClass{} - expectedGc := createExpectedGc(metav1.ConditionTrue, 1, string(v1alpha2.GatewayClassConditionStatusAccepted), "GatewayClass has been accepted") + latestGc := &v1beta1.GatewayClass{} + expectedGc := createExpectedGc(metav1.ConditionTrue, 1, string(v1beta1.GatewayClassConditionStatusAccepted), "GatewayClass has been accepted") err := client.Get(context.Background(), types.NamespacedName{Name: gcName}, latestGc) Expect(err).Should(Not(HaveOccurred())) @@ -289,8 +289,8 @@ var _ = Describe("Updater", func() { }) It("should have the updated status of Gateway in the API server", func() { - latestGw := &v1alpha2.Gateway{} - expectedGw := createExpectedGw(metav1.ConditionTrue, string(v1alpha2.ListenerReasonReady)) + latestGw := &v1beta1.Gateway{} + expectedGw := createExpectedGw(metav1.ConditionTrue, string(v1beta1.ListenerReasonReady)) err := client.Get(context.Background(), types.NamespacedName{Namespace: "test", Name: "gateway"}, latestGw) Expect(err).Should(Not(HaveOccurred())) @@ -301,7 +301,7 @@ var _ = Describe("Updater", func() { }) It("should have the updated status of ignored Gateway in the API server", func() { - latestGw := &v1alpha2.Gateway{} + latestGw := &v1beta1.Gateway{} expectedGw := createExpectedIgnoredGw() err := client.Get(context.Background(), types.NamespacedName{Namespace: "test", Name: "ignored-gateway"}, latestGw) @@ -313,7 +313,7 @@ var _ = Describe("Updater", func() { }) It("should have the updated status of HTTPRoute in the API server", func() { - latestHR := &v1alpha2.HTTPRoute{} + latestHR := &v1beta1.HTTPRoute{} expectedHR := createExpectedHR() err := client.Get(context.Background(), types.NamespacedName{Namespace: "test", Name: "route1"}, latestHR) @@ -332,8 +332,8 @@ var _ = Describe("Updater", func() { When("updating with canceled context", func() { It("should have the updated status of GatewayClass in the API server", func() { - latestGc := &v1alpha2.GatewayClass{} - expectedGc := createExpectedGc(metav1.ConditionFalse, 2, string(v1alpha2.GatewayClassConditionStatusAccepted), "GatewayClass has been rejected: error") + latestGc := &v1beta1.GatewayClass{} + expectedGc := createExpectedGc(metav1.ConditionFalse, 2, string(v1beta1.GatewayClassConditionStatusAccepted), "GatewayClass has been rejected: error") err := client.Get(context.Background(), types.NamespacedName{Name: gcName}, latestGc) Expect(err).Should(Not(HaveOccurred())) @@ -344,8 +344,8 @@ var _ = Describe("Updater", func() { }) It("should have the updated status of Gateway in the API server", func() { - latestGw := &v1alpha2.Gateway{} - expectedGw := createExpectedGw(metav1.ConditionFalse, string(v1alpha2.ListenerReasonInvalid)) + latestGw := &v1beta1.Gateway{} + expectedGw := createExpectedGw(metav1.ConditionFalse, string(v1beta1.ListenerReasonInvalid)) err := client.Get(context.Background(), types.NamespacedName{Namespace: "test", Name: "gateway"}, latestGw) Expect(err).Should(Not(HaveOccurred())) @@ -356,7 +356,7 @@ var _ = Describe("Updater", func() { }) It("should not have the updated status of ignored Gateway in the API server", func() { - latestGw := &v1alpha2.Gateway{} + latestGw := &v1beta1.Gateway{} expectedGw := createExpectedIgnoredGw() err := client.Get(context.Background(), types.NamespacedName{Namespace: "test", Name: "ignored-gateway"}, latestGw) @@ -369,7 +369,7 @@ var _ = Describe("Updater", func() { }) It("should not have the updated status of HTTPRoute in the API server", func() { - latestHR := &v1alpha2.HTTPRoute{} + latestHR := &v1beta1.HTTPRoute{} expectedHR := createExpectedHR() err := client.Get(context.Background(), types.NamespacedName{Namespace: "test", Name: "route1"}, latestHR) diff --git a/pkg/sdk/gateway_controller.go b/pkg/sdk/gateway_controller.go index e18ad483b3..a6c21f11dc 100644 --- a/pkg/sdk/gateway_controller.go +++ b/pkg/sdk/gateway_controller.go @@ -10,7 +10,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) type gatewayReconciler struct { @@ -27,7 +27,7 @@ func RegisterGatewayController(mgr manager.Manager, impl GatewayImpl) error { } return ctlr.NewControllerManagedBy(mgr). - For(&v1alpha2.Gateway{}). + For(&v1beta1.Gateway{}). Complete(r) } @@ -36,7 +36,7 @@ func (r *gatewayReconciler) Reconcile(ctx context.Context, req reconcile.Request log.V(3).Info("Reconciling Gateway") found := true - var gw v1alpha2.Gateway + var gw v1beta1.Gateway err := r.Get(ctx, req.NamespacedName, &gw) if err != nil { if !apierrors.IsNotFound(err) { diff --git a/pkg/sdk/gatewayclass_controller.go b/pkg/sdk/gatewayclass_controller.go index 5098c5f59b..d4a211c04e 100644 --- a/pkg/sdk/gatewayclass_controller.go +++ b/pkg/sdk/gatewayclass_controller.go @@ -9,7 +9,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) type gatewayClassReconciler struct { @@ -26,7 +26,7 @@ func RegisterGatewayClassController(mgr manager.Manager, impl GatewayClassImpl) } return ctrl.NewControllerManagedBy(mgr). - For(&v1alpha2.GatewayClass{}). + For(&v1beta1.GatewayClass{}). Complete(r) } @@ -34,7 +34,7 @@ func (r *gatewayClassReconciler) Reconcile(ctx context.Context, req reconcile.Re log := log.FromContext(ctx).WithValues("gatewayclass", req.Name) log.V(3).Info("Reconciling GatewayClass") - var gc v1alpha2.GatewayClass + var gc v1beta1.GatewayClass found := true err := r.Get(ctx, req.NamespacedName, &gc) diff --git a/pkg/sdk/httproute_controller.go b/pkg/sdk/httproute_controller.go index 5b4577ca36..d5b6dc2587 100644 --- a/pkg/sdk/httproute_controller.go +++ b/pkg/sdk/httproute_controller.go @@ -10,7 +10,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" ) type httpRouteReconciler struct { @@ -28,7 +28,7 @@ func RegisterHTTPRouteController(mgr manager.Manager, impl HTTPRouteImpl) error } return ctlr.NewControllerManagedBy(mgr). - For(&v1alpha2.HTTPRoute{}). + For(&v1beta1.HTTPRoute{}). Complete(r) } @@ -38,7 +38,7 @@ func (r *httpRouteReconciler) Reconcile(ctx context.Context, req reconcile.Reque log.V(3).Info("Reconciling HTTPRoute") found := true - var hr v1alpha2.HTTPRoute + var hr v1beta1.HTTPRoute err := r.Get(ctx, req.NamespacedName, &hr) if err != nil { if !apierrors.IsNotFound(err) { diff --git a/pkg/sdk/interfaces.go b/pkg/sdk/interfaces.go index 4cc83b5c42..7df8965fc7 100644 --- a/pkg/sdk/interfaces.go +++ b/pkg/sdk/interfaces.go @@ -3,18 +3,18 @@ package sdk import ( apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/gateway-api/apis/v1alpha2" + "sigs.k8s.io/gateway-api/apis/v1beta1" nginxgwv1alpha1 "github.com/nginxinc/nginx-kubernetes-gateway/pkg/apis/gateway/v1alpha1" ) type GatewayClassImpl interface { - Upsert(gc *v1alpha2.GatewayClass) + Upsert(gc *v1beta1.GatewayClass) Remove(nsname types.NamespacedName) } type GatewayImpl interface { - Upsert(*v1alpha2.Gateway) + Upsert(*v1beta1.Gateway) Remove(types.NamespacedName) } @@ -24,7 +24,7 @@ type GatewayConfigImpl interface { } type HTTPRouteImpl interface { - Upsert(config *v1alpha2.HTTPRoute) + Upsert(config *v1beta1.HTTPRoute) // FIXME(pleshakov): change other interfaces to use types.NamespacedName Remove(types.NamespacedName) }