diff --git a/README.md b/README.md index 2b2bfad2..ffa60669 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Docker Hub](https://img.shields.io/badge/dockerhub-images-important.svg?logo=docker)](https://hub.docker.com/u/kurtosistech) +[![Docker Hub](https://img.shields.io/badge/dockerhub-images-important.svg?logo=docker)](https://hub.docker.com/u/kurtosistech) + # Kardinal ## What is Kardinal? @@ -8,17 +9,19 @@ Kardinal is an open-source framework for creating extremely lightweight ephemera In Kardinal, an environment is called a "[flow](https://kardinal.dev/docs/concepts/flows)" because it represents a path that a request takes through the cluster. Versions of services that are under development are deployed on-demand, and then shared across all development work that depends on that version. Read more about Kardinal in our [docs](https://kardinal.dev/docs). ### Why choose Kardinal? + - **Ephemeral Environments**: Spin up a new environment exactly when you need it, and just as quickly spin it down when you’re done. - **Minimal Resource Usage**: Only deploy the services you’re actively working on. Kardinal takes care of the rest, so you don’t waste resources. - **Flexible Environment Types**: Whether you need to test a single service or an entire application, Kardinal has you covered: - - Single-Service Flows: Perfect for when you’re tweaking just one service. - - Multi-Service Flows: Ideal for when your feature involves multiple services. - - State-Isolated Flows: Great for features that need their own isolated databases or caches. - - Full Application Flows: For those times when you need end-to-end testing with full isolation. + - Single-Service Flows: Perfect for when you’re tweaking just one service. + - Multi-Service Flows: Ideal for when your feature involves multiple services. + - State-Isolated Flows: Great for features that need their own isolated databases or caches. + - Full Application Flows: For those times when you need end-to-end testing with full isolation. - **Cost Savings**: Kardinal can help you save big by avoiding unnecessary resource duplication. It’s a game-changer for teams looking to cut costs. Check out [this calculator](https://kardinal.dev/calculator) to run your own calculations. - **Open Source**: Kardinal is open source, so use it however fits best within your workflows ### Want a demo? + Sign-up for a free demo of Kardinal below 👇 [![Get a demo](https://img.shields.io/badge/Get_a_demo-FC7444?style=for-the-badge)](https://calendly.com/d/cqhd-tgj-vmc/45-minute-meeting?month=2024-09) @@ -26,19 +29,25 @@ Sign-up for a free demo of Kardinal below 👇 ## Installation ### **Step 1: Install Kardinal** + To install Kardinal, run the following command: + ``` curl get.kardinal.dev -sL | sh ``` + ### **Step 2: Set up a development Kubernetes cluster** All you need is a Kubernetes cluster with Istio enabled, and kubectl installed on your machine, pointing to your cluster. If you need help with this, read more [here](https://kardinal.dev/docs/getting-started/install) ### **Step 3: Deploy the Kardinal Manager to your cluster** + Make sure that kubectl is pointing to your cluster, and then run the following command: + ``` kardinal manager deploy kloud-kontrol ``` + Once installed check out our docs on [creating your first flow](https://kardinal.dev/docs/getting-started/own-app). ## Try it out in a Playground @@ -133,6 +142,10 @@ Is it possible to develop your app with Kardinal + [Tilt](https://tilt.dev/). He - [Tilt](https://docs.tilt.dev/install.html) - Local K8s cluster, it could be [Minikube](https://minikube.sigs.k8s.io/docs/start) or [Docker desktop](https://docs.docker.com/desktop/kubernetes/) for instance - [Istio](https://istio.io/latest/docs/setup/install/istioctl/#install-istio-using-the-default-profile) +- Gateway API + - ```bash + kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.1.0" | kubectl apply -f -; + ``` ### Deploy your application: @@ -149,7 +162,7 @@ kardinal_topology_yaml_str = str(kardinal_topology_yaml) if kardinal_topology_yaml_str != '': k8s_yaml(kardinal_topology_yaml, allow_duplicates = True) - + local_resource( name='ingress-gateway-port-forward', serve_cmd=['kubectl', 'port-forward', 'service/istio-ingressgateway', '80:80', '-n', 'istio-system'] @@ -175,7 +188,7 @@ kardinal_topology_yaml_str = str(kardinal_topology_yaml) if kardinal_topology_yaml_str != '': k8s_yaml(kardinal_topology_yaml, allow_duplicates = True) - + local_resource( name='ingress-gateway-port-forward', serve_cmd=['kubectl', 'port-forward', 'service/istio-ingressgateway', '80:80', '-n', 'istio-system'] @@ -209,7 +222,7 @@ kardinal_topology_yaml_str = str(kardinal_topology_yaml) if kardinal_topology_yaml_str != '': k8s_yaml(kardinal_topology_yaml, allow_duplicates = True) - + local_resource( name='ingress-gateway-port-forward', serve_cmd=['kubectl', 'port-forward', 'service/istio-ingressgateway', '80:80', '-n', 'istio-system'] @@ -241,6 +254,7 @@ The `delete-namespaces` flag is used to remove the application’s namespace, it ### More configuration examples: For additional examples of configuring Kardinal with Tilt, refer to the [Tiltfile in the Kardinal Boutique demo app](https://github.com/kurtosis-tech/new-obd/blob/main/Tiltfile). + ## Develop with Kardinal + Telepresence @@ -266,7 +280,7 @@ Example: 1. Install Telepresence manager with Istio integration in your cluster (make sure that you have selected the targe cluster with kubectl before running it) ```shell -telepresence helm install --set trafficManager.serviceMesh.type=istio +telepresence helm install --set trafficManager.serviceMesh.type=istio ``` 2. Create a dev flow with `Kardinal`. ```shell diff --git a/ci/obd-demo.yaml b/ci/obd-demo.yaml index ad689f0d..e1b766d7 100644 --- a/ci/obd-demo.yaml +++ b/ci/obd-demo.yaml @@ -159,24 +159,7 @@ spec: protocol: TCP appProtocol: HTTP targetPort: 8080 ---- -apiVersion: v1 -kind: Service -metadata: - name: frontend-external - annotations: - kardinal.dev.service/ingress: "true" - kardinal.dev.service/host: "prod.app.localhost" -spec: - type: LoadBalancer - selector: - app: frontend - ports: - - name: http - port: 80 - targetPort: 8080 - protocol: TCP - appProtocol: HTTP + --- apiVersion: apps/v1 kind: Deployment @@ -328,3 +311,24 @@ spec: targetPort: 8070 protocol: TCP appProtocol: HTTP + +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + kardinal.dev.service/ingress: "true" + name: ingress +spec: + rules: + - host: prod.app.localhost + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: frontend + port: + number: 80 diff --git a/go.work.sum b/go.work.sum index ba829680..144f21cd 100644 --- a/go.work.sum +++ b/go.work.sum @@ -17,6 +17,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/RaveNoX/go-jsoncommentstrip v1.0.0 h1:t527LHHE3HmiHrq74QMpNPZpGCIJzTx+apLkMKt4HC0= github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 h1:KkH3I3sJuOLP3TjA/dfr4NAY8bghDwnXiU7cTKxQqo0= github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06/go.mod h1:7erjKLwalezA0k99cWs5L11HWOAPNjdUZ6RxH1BXbbM= +github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 h1:+XfOU14S4bGuwyvCijJwhhBIjYN+YXS18jrCY2EzJaY= +github.com/ahmetb/gen-crd-api-reference-docs v0.3.0/go.mod h1:TdjdkYhlOifCQWPs1UdTma97kQQMozf5h26hTuG70u8= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= @@ -38,6 +40,14 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWs github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= @@ -52,7 +62,15 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= +github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= @@ -60,10 +78,15 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= +github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -71,9 +94,15 @@ github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386 h1:EcQR3gusLHN github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= @@ -83,8 +112,10 @@ github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d h1:uGg2frlt3IcT7kbV6LEp5ONv4vmoO2FW4qSO+my/aoM= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -110,13 +141,23 @@ github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/knz/go-libedit v1.10.1 h1:0pHpWtx9vcvC0xGZqEQlQdfSQs7WRlAjuPvk3fOZDCo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqACtjw= github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= github.com/microcosm-cc/bluemonday v1.0.25 h1:4NEwSfiJ+Wva0VxN5B8OwMicaJvD8r9tlJWm9rtloEg= github.com/microcosm-cc/bluemonday v1.0.25/go.mod h1:ZIOjCQp1OrzBBPIJmfX4qDYFuhU02nx4bn030ixfHLE= +github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= +github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -126,14 +167,22 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/segmentio/conf v1.2.0 h1:5OT9+6OyVHLsFLsiJa/2KlqiA1m7mpdUBlkB/qYTMts= github.com/segmentio/conf v1.2.0/go.mod h1:Y3B9O/PqqWqjyxyWWseyj/quPEtMu1zDp/kVbSWWaB0= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad h1:fiWzISvDn0Csy5H0iwgAuJGQTUpVfEMJJd4nRFXogbc= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tdewolff/minify/v2 v2.12.9 h1:dvn5MtmuQ/DFMwqf5j8QhEVpPX6fi3WGImhv8RUB4zA= github.com/tdewolff/minify/v2 v2.12.9/go.mod h1:qOqdlDfL+7v0/fyymB+OP497nIxJYSvX4MQWA8OoiXU= github.com/tdewolff/parse/v2 v2.6.8 h1:mhNZXYCx//xG7Yq2e/kVLNZw4YfYmeHbhx+Zc0OvFMA= @@ -149,40 +198,85 @@ github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcY github.com/yosssi/ace v0.0.5 h1:tUkIP/BLdKqrlrPwcmH0shwEEhTRHoGnc1wFIWmaBUA= github.com/yosssi/ace v0.0.5/go.mod h1:ALfIzm2vT7t5ZE7uoIZqF3TQ7SAOyupFZnkrF5id+K0= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI= google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= +k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= +k8s.io/code-generator v0.30.0 h1:3VUVqHvWFSVSm9kqL/G6kD4ZwNdHF6J/jPyo3Jgjy3k= +k8s.io/code-generator v0.30.0/go.mod h1:mBMZhfRR4IunJUh2+7LVmdcWwpouCH5+LNPkZ3t/v7Q= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= +k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= +k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nullprogram.com/x/optparse v1.0.0 h1:xGFgVi5ZaWOnYdac2foDT3vg0ZZC9ErXFV57mr4OHrI= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= +sigs.k8s.io/controller-runtime v0.18.0 h1:Z7jKuX784TQSUL1TIyeuF7j8KXZ4RtSX0YgtjKcSTME= +sigs.k8s.io/controller-runtime v0.18.0/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= +sigs.k8s.io/controller-tools v0.15.0 h1:4dxdABXGDhIa68Fiwaif0vcu32xfwmgQ+w8p+5CxoAI= +sigs.k8s.io/controller-tools v0.15.0/go.mod h1:8zUSS2T8Hx0APCNRhJWbS3CAQEbIxLa07khzh7pZmXM= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/kardinal-cli/cmd/root.go b/kardinal-cli/cmd/root.go index fbb28c2f..f046623a 100644 --- a/kardinal-cli/cmd/root.go +++ b/kardinal-cli/cmd/root.go @@ -37,6 +37,8 @@ import ( k8snet "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" + gateway "sigs.k8s.io/gateway-api/apis/v1" + gatewayscheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) const ( @@ -116,7 +118,7 @@ var deployCmd = &cobra.Command{ Short: "Deploy services", Args: cobra.ExactArgs(0), Run: func(cmd *cobra.Command, args []string) { - serviceConfigs, ingressConfigs, namespace, err := parseKubernetesManifestFile(kubernetesManifestFile) + serviceConfigs, ingressConfigs, gatewayConfigs, routeConfigs, namespace, err := parseKubernetesManifestFile(kubernetesManifestFile) if err != nil { log.Fatalf("Error loading k8s manifest file: %v", err) } @@ -125,7 +127,7 @@ var deployCmd = &cobra.Command{ log.Fatal("Error getting or creating user tenant UUID", err) } - deploy(tenantUuid.String(), serviceConfigs, ingressConfigs, namespace) + deploy(tenantUuid.String(), serviceConfigs, ingressConfigs, gatewayConfigs, routeConfigs, namespace) }, } @@ -141,7 +143,7 @@ var templateCreateCmd = &cobra.Command{ // A valid template only modifies services // A valid template has metadata.name // A valid template modifies at least one service - serviceConfigs, _, _, err := parseKubernetesManifestFile(templateYamlFile) + serviceConfigs, _, _, _, _, err := parseKubernetesManifestFile(templateYamlFile) if err != nil { log.Fatalf("Error loading template file: %v", err) } @@ -303,9 +305,15 @@ var telepresenceInterceptCmd = &cobra.Command{ } // is Traffic-manager installed - kubernetesClt, err := kubernetes.CreateKubernetesClient() + k8sConfig, err := kubernetes.GetConfig() if err != nil { log.Fatalf("An error occurred while creating the Kubernetes client: %s", err) + return + } + kubernetesClt, err := kubernetes.CreateKubernetesClient(k8sConfig) + if err != nil { + log.Fatalf("An error occurred while creating the Kubernetes client: %s", err) + return } trafficManagerDeploymentLabels := map[string]string{ @@ -551,26 +559,20 @@ var gatewayCmd = &cobra.Command{ log.Fatalf("List flow response is empty") } - var host string - - hostFlowIdMap := make(map[string]string) + hostFlowIdMap := make([]api_types.IngressAccessEntry, 0) for _, flow := range *resp.JSON200 { if slices.Contains(flowIds, flow.FlowId) { flowId := flow.FlowId - if len(flow.FlowUrls) > 0 { - host = flow.FlowUrls[0] - if host == "" { - log.Fatalf("Couldn't find flow with id '%s'", flowId) - } - hostFlowIdMap[host] = flowId + if len(flow.AccessEntry) > 0 { + hostFlowIdMap = append(hostFlowIdMap, flow.AccessEntry...) } else { log.Fatalf("Flow '%s' has no hosts", flowId) } } } - if err := deployment.StartGateway(ctx, hostFlowIdMap); err != nil { + if err := deployment.StartGateway(hostFlowIdMap); err != nil { log.Fatalf("An error occurred while creating a gateway: %v", err) } }, @@ -677,17 +679,22 @@ func parsePairs(pairs []string) map[string]string { return pairsMap } -func parseKubernetesManifestFile(kubernetesManifestFile string) ([]api_types.ServiceConfig, []api_types.IngressConfig, string, error) { +func parseKubernetesManifestFile(kubernetesManifestFile string) ([]api_types.ServiceConfig, []api_types.IngressConfig, []api_types.GatewayConfig, []api_types.RouteConfig, string, error) { fileBytes, err := loadKubernetesManifestFile(kubernetesManifestFile) if err != nil { log.Fatalf("Error loading kubernetest manifest file: %v", err) - return nil, nil, "", err + return nil, nil, nil, nil, "", err } manifest := string(fileBytes) var namespace string serviceConfigs := map[string]*api_types.ServiceConfig{} ingressConfigs := map[string]*api_types.IngressConfig{} + gatewayConfigs := map[string]*api_types.GatewayConfig{} + routeConfigs := map[string]*api_types.RouteConfig{} + + // Register the gateway scheme to parse the Gateway CRD + gatewayscheme.AddToScheme(scheme.Scheme) decode := scheme.Codecs.UniversalDeserializer().Decode for _, spec := range strings.Split(manifest, "---") { if len(spec) == 0 { @@ -695,7 +702,7 @@ func parseKubernetesManifestFile(kubernetesManifestFile string) ([]api_types.Ser } obj, _, err := decode([]byte(spec), nil, nil) if err != nil { - return nil, nil, "", stacktrace.Propagate(err, "An error occurred parsing the spec: %s", spec) + return nil, nil, nil, nil, "", stacktrace.Propagate(err, "An error occurred parsing the spec: %s", spec) } switch obj := obj.(type) { case *corev1.Service: @@ -728,8 +735,16 @@ func parseKubernetesManifestFile(kubernetesManifestFile string) ([]api_types.Ser namespaceObj := obj namespaceName := getObjectName(namespaceObj.GetObjectMeta().(*metav1.ObjectMeta)) namespace = namespaceName + case *gateway.Gateway: + gatewayObj := obj + gatewayName := getObjectName(gatewayObj.GetObjectMeta().(*metav1.ObjectMeta)) + gatewayConfigs[gatewayName] = &api_types.GatewayConfig{Gateway: *gatewayObj} + case *gateway.HTTPRoute: + routeObj := obj + routeName := getObjectName(routeObj.GetObjectMeta().(*metav1.ObjectMeta)) + routeConfigs[routeName] = &api_types.RouteConfig{HttpRoute: *routeObj} default: - return nil, nil, "", stacktrace.NewError("An error occurred parsing the manifest because of an unsupported kubernetes type") + return nil, nil, nil, nil, "", stacktrace.NewError("An error occurred parsing the manifest because of an unsupported kubernetes type") } } @@ -743,7 +758,17 @@ func parseKubernetesManifestFile(kubernetesManifestFile string) ([]api_types.Ser finalIngressConfigs = append(finalIngressConfigs, *ingressConfig) } - return finalServiceConfigs, finalIngressConfigs, namespace, nil + finalGatewayConfigs := []api_types.GatewayConfig{} + for _, gatewayConfig := range gatewayConfigs { + finalGatewayConfigs = append(finalGatewayConfigs, *gatewayConfig) + } + + finalRouteConfigs := []api_types.RouteConfig{} + for _, routeConfig := range routeConfigs { + finalRouteConfigs = append(finalRouteConfigs, *routeConfig) + } + + return finalServiceConfigs, finalIngressConfigs, finalGatewayConfigs, finalRouteConfigs, namespace, nil } func parseTemplateArgs(filepathOrJson string) (map[string]interface{}, error) { @@ -846,8 +871,8 @@ func createDevFlow(tenantUuid api_types.Uuid, pairsMap map[string]string, templa if resp.StatusCode() == 200 { fmt.Printf("Flow \"%s\" created. Access it on:\n", resp.JSON200.FlowId) - for _, url := range resp.JSON200.FlowUrls { - fmt.Printf("🌐 http://%s\n", url) + for _, entry := range resp.JSON200.AccessEntry { + fmt.Printf("🌐 http://%s\n", entry.Hostname) } return } @@ -862,12 +887,21 @@ func createDevFlow(tenantUuid api_types.Uuid, pairsMap map[string]string, templa os.Exit(1) } -func deploy(tenantUuid api_types.Uuid, serviceConfigs []api_types.ServiceConfig, ingressConfigs []api_types.IngressConfig, namespace string) { +func deploy( + tenantUuid api_types.Uuid, + serviceConfigs []api_types.ServiceConfig, + ingressConfigs []api_types.IngressConfig, + gatewayConfigs []api_types.GatewayConfig, + routeConfigs []api_types.RouteConfig, + namespace string, +) { ctx := context.Background() body := api_types.PostTenantUuidDeployJSONRequestBody{ ServiceConfigs: &serviceConfigs, IngressConfigs: &ingressConfigs, + GatewayConfigs: &gatewayConfigs, + RouteConfigs: &routeConfigs, Namespace: &namespace, } client := getKontrolServiceClient() @@ -885,8 +919,8 @@ func deploy(tenantUuid api_types.Uuid, serviceConfigs []api_types.ServiceConfig, if resp.StatusCode() == 200 { fmt.Printf("Flow \"%s\" created. Access it on:\n", resp.JSON200.FlowId) - for _, url := range resp.JSON200.FlowUrls { - fmt.Printf("🌐 http://%s\n", url) + for _, entry := range resp.JSON200.AccessEntry { + fmt.Printf("🌐 http://%s\n", entry.Hostname) } fmt.Printf("View and manage flows:\n⚙️ %s\n", trafficConfigurationURL) return diff --git a/kardinal-cli/cmd/table_printer.go b/kardinal-cli/cmd/table_printer.go index 209dbdf6..47c971b1 100644 --- a/kardinal-cli/cmd/table_printer.go +++ b/kardinal-cli/cmd/table_printer.go @@ -39,7 +39,9 @@ func printFlowTable(flows []api_types.Flow) { } return []string{ flow.FlowId, - strings.Join(lo.Map(flow.FlowUrls, func(item string, _ int) string { return fmt.Sprintf("http://%s", item) }), ", "), + strings.Join(lo.Map( + flow.AccessEntry, + func(item api_types.IngressAccessEntry, _ int) string { return fmt.Sprintf("http://%s", item.Hostname) }), ", "), baselineStr, } }) diff --git a/kardinal-cli/deployment/deployment.go b/kardinal-cli/deployment/deployment.go index 08063a23..cbe839f9 100644 --- a/kardinal-cli/deployment/deployment.go +++ b/kardinal-cli/deployment/deployment.go @@ -3,6 +3,9 @@ package deployment import ( "bytes" "context" + "fmt" + "io" + "net/http" "text/template" "kardinal.cli/kubernetes" @@ -10,6 +13,7 @@ import ( "kardinal.cli/kontrol" "github.com/kurtosis-tech/stacktrace" + "github.com/sirupsen/logrus" "kardinal.cli/consts" ) @@ -17,6 +21,7 @@ const ( kardinalNamespace = "default" kardinalManagerDeploymentTmplName = "kardinal-manager-deployment" kardinalTraceRouterManifestTmplName = "kardinal-trace-router-manifest" + gatewayAPIInstallYamlURL = "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml" kardinalManagerAuthTmpl = ` apiVersion: v1 @@ -196,7 +201,11 @@ type templateData struct { } func DeployKardinalManagerInCluster(ctx context.Context, clusterResourcesURL string, kontrolLocation string) error { - kubernetesClientObj, err := kubernetes.CreateKubernetesClient() + k8sConfig, err := kubernetes.GetConfig() + if err != nil { + return stacktrace.Propagate(err, "An error occurred while creating the Kubernetes client") + } + kubernetesClientObj, err := kubernetes.CreateKubernetesClient(k8sConfig) if err != nil { return stacktrace.Propagate(err, "An error occurred while creating the Kubernetes client") } @@ -236,11 +245,44 @@ func DeployKardinalManagerInCluster(ctx context.Context, clusterResourcesURL str return stacktrace.Propagate(err, "An error occurred while applying the kardinal-manager deployment") } + if err := installGatewayAPI(ctx, kubernetesClientObj); err != nil { + return stacktrace.Propagate(err, "An error occurred while installing the Gateway API") + } + + return nil +} + +func installGatewayAPI(ctx context.Context, kubernetesClientObj *kubernetes.KubernetesClient) error { + resp, err := http.Get(gatewayAPIInstallYamlURL) + if err != nil { + return stacktrace.Propagate(err, "An error occurred while downloading the gateway API YAML") + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return stacktrace.NewError("Failed to download file, status code: %d", resp.StatusCode) + } + + var buf bytes.Buffer + + _, err = io.Copy(&buf, resp.Body) + if err != nil { + return stacktrace.Propagate(err, "An error occurred while reading the response body") + } + + logrus.Info("ℹ️ Installing the Gateway API (https://gateway-api.sigs.k8s.io/) in the cluster.") + if err := kubernetesClientObj.ApplyYamlFileContentInNamespace(ctx, kardinalNamespace, buf.Bytes()); err != nil { + return stacktrace.Propagate(err, "An error occurred while applying the gateway API YAML") + } return nil } func RemoveKardinalManagerFromCluster(ctx context.Context) error { - kubernetesClientObj, err := kubernetes.CreateKubernetesClient() + k8sConfig, err := kubernetes.GetConfig() + if err != nil { + return stacktrace.Propagate(err, "An error occurred while creating the Kubernetes client") + } + kubernetesClientObj, err := kubernetes.CreateKubernetesClient(k8sConfig) if err != nil { return stacktrace.Propagate(err, "An error occurred while creating the Kubernetes client") } @@ -252,6 +294,7 @@ func RemoveKardinalManagerFromCluster(ctx context.Context) error { if err = kubernetesClientObj.RemoveNamespaceResourcesByLabels(ctx, kardinalNamespace, labels); err != nil { return stacktrace.Propagate(err, "An error occurred while removing the kardinal-manager from the cluster using labels '%+v'", labels) } + fmt.Printf("⚠️ If you also want to unistall the Gateway API, run the following command:\nkubectl delete -f %s\n\n", gatewayAPIInstallYamlURL) return nil } diff --git a/kardinal-cli/deployment/gateway.go b/kardinal-cli/deployment/gateway.go index cf63f713..de1fe79f 100644 --- a/kardinal-cli/deployment/gateway.go +++ b/kardinal-cli/deployment/gateway.go @@ -2,11 +2,9 @@ package deployment import ( "context" - "encoding/json" "fmt" "hash/fnv" "io" - kubernetes_pack "kardinal.cli/kubernetes" "net/http" "net/http/httputil" "net/url" @@ -17,6 +15,7 @@ import ( "syscall" "time" + api_types "github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api/api/golang/types" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -24,13 +23,13 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" + gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" + + cli_k8s "kardinal.cli/kubernetes" ) const ( - namespace = "istio-system" - service = "istio-ingressgateway" - localPortForIstio = 61000 - istioGatewayPodPort = 8080 + localPortStartRange = 61000 proxyPortRangeStart = 59000 proxyPortRangeEnd = 60000 maxRetries = 10 @@ -66,81 +65,66 @@ func findAvailablePortInRange(host string, portsInUse *[]int) (int, error) { return port, nil } -func StartGateway(ctx context.Context, hostFlowIdMap map[string]string) error { - client, err := kubernetes_pack.CreateKubernetesClient() +func StartGateway(hostFlowIdMap []api_types.IngressAccessEntry) error { + k8sConfig, err := cli_k8s.GetConfig() if err != nil { return fmt.Errorf("an error occurred while creating a kubernetes client:\n %v", err) } - - // TODO move these values to a shared library between Kardinal Manager, Kontrol and Kardinal CLI - kardinalLabelKey := "kardinal.dev" - enabledKardinal := "enabled" - - namespaceLabels := map[string]string{ - kardinalLabelKey: enabledKardinal, - } - - namespaceList, err := client.GetNamespacesByLabels(ctx, namespaceLabels) + client, err := cli_k8s.CreateKubernetesClient(k8sConfig) if err != nil { - return fmt.Errorf("failed to list namespaces from Kubernetes: %v", err) - } - if len(namespaceList.Items) == 0 { - return fmt.Errorf("cannot start gateway because no Kardinal namespace was found") + return fmt.Errorf("an error occurred while creating a kubernetes client:\n %v", err) } - if len(namespaceList.Items) > 1 { - return fmt.Errorf("cannot start gateway because more than one Kardinal namespace was found") + gatewayClient, err := cli_k8s.CreateGatewayApiClient(k8sConfig) + if err != nil { + return fmt.Errorf("an error occurred while creating a kubernetes client:\n %v", err) } - baselineNamespace := namespaceList.Items[0] - for host, flowId := range hostFlowIdMap { + servers := make([]*http.Server, 0) + ports := make([]int, 0) + stopChan := make(chan struct{}, 1) + + for entryIx, entry := range hostFlowIdMap { + + localPort := int32(localPortStartRange + entryIx) + host := entry.Hostname + logrus.Printf("Starting gateway for host: %s", host) - // Check for pods in the baseline namespace - err = assertBaselineNamespaceReady(client.GetClientSet(), flowId, baselineNamespace.Name) + err = assertBaselineNamespaceReady(client.GetClientSet(), entry.FlowId, entry.FlowNamespace) if err != nil { return fmt.Errorf("failed to assert that baseline namespace is ready: %v", err) } - // Check for the Envoy filter before proceeding - err = checkGatewayEnvoyFilter(client.GetClientSet(), host) + // Find a pod for the service + pod, port, namespace, err := findPodForService(client.GetClientSet(), gatewayClient, entry) if err != nil { - return err + logrus.Errorf("failed to find pod for service: %v", err) + continue } - } - // Find a pod for the service - pod, err := findPodForService(client.GetClientSet()) - if err != nil { - return fmt.Errorf("failed to find pod for service: %v", err) - } - - // Start port forwarding - stopChan := make(chan struct{}, 1) - readyChan := make(chan struct{}) - go func() { - for { - err := portForwardPod(client.GetConfig(), pod, stopChan, readyChan) - if err != nil { - logrus.Printf("Port forwarding failed: %v. Retrying in 5 seconds...", err) - time.Sleep(5 * time.Second) - continue + // Start port forwarding + readyChan := make(chan struct{}) + go func() { + for { + err := portForwardPod(client.GetConfig(), namespace, pod, port, stopChan, readyChan, localPort) + if err != nil { + logrus.Printf("Port forwarding failed: %v. Retrying in 5 seconds...", err) + time.Sleep(5 * time.Second) + continue + } + break } - break - } - }() + }() - // Wait for port forwarding to be ready - <-readyChan + // Wait for port forwarding to be ready + <-readyChan - servers := make([]*http.Server, 0) - ports := make([]int, 0) - for host := range hostFlowIdMap { availablePort, err := findAvailablePortInRange(host, &ports) if err != nil { return fmt.Errorf("failed to find an available port: %v", err) } // Start proxy server on the available port - proxy := createProxy(host) + proxy := createProxy(host, localPort) server := &http.Server{ Addr: fmt.Sprintf(":%d", availablePort), Handler: proxy, @@ -156,6 +140,10 @@ func StartGateway(ctx context.Context, hostFlowIdMap map[string]string) error { fmt.Printf("\n🔗 Proxy server for host %s started on: http://localhost:%d\n", host, availablePort) } + if len(servers) == 0 { + return fmt.Errorf("no gateway servers started") + } + sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) <-sigChan @@ -175,7 +163,6 @@ func StartGateway(ctx context.Context, hostFlowIdMap map[string]string) error { // TODO move to the kubernetes package func assertBaselineNamespaceReady(client *kubernetes.Clientset, flowId string, baselineNamespace string) error { - for retry := 0; retry < maxRetries; retry++ { pods, err := client.CoreV1().Pods(baselineNamespace).List(context.Background(), metav1.ListOptions{}) if err != nil { @@ -239,76 +226,59 @@ func isPodReady(pod *corev1.Pod) bool { return true } -// TODO move to the kubernetes package -func findPodForService(client *kubernetes.Clientset) (string, error) { - svc, err := client.CoreV1().Services(namespace).Get(context.Background(), service, metav1.GetOptions{}) - if err != nil { - return "", fmt.Errorf("error getting service: %v", err) - } - +func findPodForService(client *kubernetes.Clientset, gwClient *gatewayclientset.Clientset, accessEntry api_types.IngressAccessEntry) (string, int32, string, error) { var labelSelectors []string - for key, value := range svc.Spec.Selector { - labelSelectors = append(labelSelectors, fmt.Sprintf("%s=%s", key, value)) - } - selector := strings.Join(labelSelectors, ",") - - pods, err := client.CoreV1().Pods(namespace).List(context.Background(), metav1.ListOptions{LabelSelector: selector}) - if err != nil { - return "", fmt.Errorf("error listing pods: %v", err) - } - - if len(pods.Items) == 0 { - return "", fmt.Errorf("no pods found for service %s", service) - } - - podName := pods.Items[0].Name - return podName, nil -} - -// TODO move to the kubernetes package -func checkGatewayEnvoyFilter(client *kubernetes.Clientset, host string) error { - for retry := 0; retry < maxRetries; retry++ { - envoyFilterRaw, err := client.RESTClient(). - Get(). - AbsPath("/apis/networking.istio.io/v1alpha3/namespaces/istio-system/envoyfilters/kardinal-gateway-tracing"). - Do(context.Background()). - Raw() + var port int32 + var namespace string + if accessEntry.Type == "ingress" { + ingress, err := client.NetworkingV1().Ingresses(accessEntry.Namespace).Get(context.Background(), accessEntry.Service, metav1.GetOptions{}) if err != nil { - logrus.Printf("Error getting Envoy filter (attempt %d/%d): %v", retry+1, maxRetries, err) - time.Sleep(retryInterval) - continue + return "", -1, "", fmt.Errorf("error getting ingress: %v", err) } - var envoyFilter map[string]interface{} - err = json.Unmarshal(envoyFilterRaw, &envoyFilter) + ingressClassName := "nginx" + if ingress.Spec.IngressClassName != nil { + ingressClassName = *ingress.Spec.IngressClassName + } + ingressClass, err := client.NetworkingV1().IngressClasses().Get(context.Background(), ingressClassName, metav1.GetOptions{}) if err != nil { - logrus.Printf("Error unmarshaling Envoy filter (attempt %d/%d): %v", retry+1, maxRetries, err) - time.Sleep(retryInterval) - continue + return "", -1, "", fmt.Errorf("error getting ingress class: %v", err) } - luaCode, ok := envoyFilter["spec"].(map[string]interface{})["configPatches"].([]interface{})[0].(map[string]interface{})["patch"].(map[string]interface{})["value"].(map[string]interface{})["typed_config"].(map[string]interface{})["inlineCode"].(string) - if !ok { - logrus.Printf("Error getting Lua code from Envoy filter (attempt %d/%d)", retry+1, maxRetries) - time.Sleep(retryInterval) - continue + for key, value := range ingressClass.Labels { + labelSelectors = append(labelSelectors, fmt.Sprintf("%s=%s", key, value)) } + namespace = ingressClass.Labels["app.kubernetes.io/instance"] + port = 80 - if !strings.Contains(luaCode, host) { - logrus.Printf("Envoy filter 'kardinal-gateway-tracing' does not contain the expected host string: %s (attempt %d/%d)", host, retry+1, maxRetries) - time.Sleep(retryInterval) - continue + } else if accessEntry.Type == "gateway" { + gw, err := gwClient.GatewayV1().Gateways(accessEntry.Namespace).Get(context.Background(), accessEntry.Service, metav1.GetOptions{}) + if err != nil { + return "", -1, "", fmt.Errorf("error getting gateway: %v", err) } + port = int32(gw.Spec.Listeners[0].Port) + labelSelectors = append(labelSelectors, fmt.Sprintf("gateway.networking.k8s.io/gateway-name=%s", accessEntry.Service)) + namespace = accessEntry.Namespace - logrus.Printf("Envoy filter 'kardinal-gateway-tracing' found and contains the expected host string: %s", host) - return nil + } else { + return "", -1, "", fmt.Errorf("unkown access type: %s", accessEntry.Type) } - return fmt.Errorf("failed to find Envoy filter 'kardinal-gateway-tracing' containing the expected host string after %d attempts", maxRetries) + selector := strings.Join(labelSelectors, ",") + pods, err := client.CoreV1().Pods(namespace).List(context.Background(), metav1.ListOptions{LabelSelector: selector}) + if err != nil { + return "", -1, "", fmt.Errorf("error listing pods: %v", err) + } + + if len(pods.Items) == 0 { + return "", -1, "", fmt.Errorf("no pods found for service %s", accessEntry.Service) + } + + podName := pods.Items[0].Name + return podName, port, namespace, nil } -// TODO move to the kubernetes package -func portForwardPod(config *rest.Config, podName string, stopChan <-chan struct{}, readyChan chan struct{}) error { +func portForwardPod(config *rest.Config, namespace string, podName string, port int32, stopChan <-chan struct{}, readyChan chan struct{}, localPort int32) error { roundTripper, upgrader, err := spdy.RoundTripperFor(config) if err != nil { return fmt.Errorf("failed to create round tripper: %v", err) @@ -324,7 +294,7 @@ func portForwardPod(config *rest.Config, podName string, stopChan <-chan struct{ dialer := spdy.NewDialer(upgrader, &http.Client{Transport: roundTripper}, http.MethodPost, serverURL) - ports := []string{fmt.Sprintf("%d:%d", localPortForIstio, istioGatewayPodPort)} + ports := []string{fmt.Sprintf("%d:%d", localPort, port)} forwarder, err := portforward.New(dialer, ports, stopChan, readyChan, io.Discard, os.Stderr) if err != nil { return fmt.Errorf("failed to create port forwarder: %v", err) @@ -333,8 +303,8 @@ func portForwardPod(config *rest.Config, podName string, stopChan <-chan struct{ return forwarder.ForwardPorts() } -func createProxy(host string) *httputil.ReverseProxy { - target, _ := url.Parse(fmt.Sprintf("http://localhost:%d", localPortForIstio)) +func createProxy(host string, localPort int32) *httputil.ReverseProxy { + target, _ := url.Parse(fmt.Sprintf("http://localhost:%d", localPort)) proxy := httputil.NewSingleHostReverseProxy(target) originalDirector := proxy.Director diff --git a/kardinal-cli/go.mod b/kardinal-cli/go.mod index 8d5ac098..23021808 100644 --- a/kardinal-cli/go.mod +++ b/kardinal-cli/go.mod @@ -8,7 +8,7 @@ replace github.com/kurtosis-tech/kardinal/libs/cli-kontrol-api => ../libs/cli-ko require ( github.com/adrg/xdg v0.4.0 - github.com/google/uuid v1.5.0 + github.com/google/uuid v1.6.0 github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 github.com/samber/lo v1.46.0 github.com/segmentio/analytics-go/v3 v3.3.0 @@ -16,22 +16,23 @@ require ( k8s.io/api v0.30.2 k8s.io/apimachinery v0.30.2 k8s.io/client-go v0.30.2 + sigs.k8s.io/gateway-api v1.1.0 ) require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.8 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -43,20 +44,19 @@ require ( github.com/oapi-codegen/runtime v1.1.1 // indirect github.com/segmentio/backo-go v1.0.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect + golang.org/x/oauth2 v0.19.0 // indirect golang.org/x/term v0.20.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect - google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect + k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) require ( diff --git a/kardinal-cli/go.sum b/kardinal-cli/go.sum index 9d891121..de2a305e 100644 --- a/kardinal-cli/go.sum +++ b/kardinal-cli/go.sum @@ -9,29 +9,25 @@ github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvF github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= +github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= +github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= -github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -42,13 +38,13 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -60,11 +56,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -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/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= @@ -109,13 +102,8 @@ 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/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -126,14 +114,13 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh 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/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= +golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -147,7 +134,6 @@ golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= @@ -163,8 +149,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -186,13 +170,15 @@ k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 h1:Q8Z7VlGhcJgBHJHYugJ/K/7iB8a2eSxCyxdVjJp+lLY= +k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 h1:ao5hUqGhsqdm+bYbjH/pRkCs0unBGe9UyDahzs9zQzQ= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= +sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/kardinal-cli/gomod2nix.toml b/kardinal-cli/gomod2nix.toml index 990f7cd9..90f17b8a 100644 --- a/kardinal-cli/gomod2nix.toml +++ b/kardinal-cli/gomod2nix.toml @@ -34,6 +34,9 @@ schema = 3 [mod."github.com/adrg/xdg"] version = "v0.4.0" hash = "sha256-zGjkdUQmrVqD6rMO9oDY+TeJCpuqnHyvkPCaXDlac/U=" + [mod."github.com/ahmetb/gen-crd-api-reference-docs"] + version = "v0.3.0" + hash = "sha256-9W0jxXQn3E5bJ24SURs2tO1odSep/mIp0OIpjKCDM18=" [mod."github.com/andybalholm/brotli"] version = "v1.0.5" hash = "sha256-/qS8wU8yZQJ+uTOg66rEl9s7spxq9VIXF5L1BcaEClc=" @@ -98,11 +101,17 @@ schema = 3 version = "v0.0.0-20200823014737-9f7001d12a5f" hash = "sha256-n/7xo5CQqo4yLaWMSzSN1Muk/oqK6O5dgDOFWapeDUI=" [mod."github.com/emicklei/go-restful/v3"] - version = "v3.11.0" - hash = "sha256-Kp5ndPvj1PhK0nscM1pNNK2Q4ahUuLED/baEgL9pKNo=" + version = "v3.12.0" + hash = "sha256-w9mYeZiOWYEd5NLkOHYbaElfcbNurV6trMtbv2KPvL0=" [mod."github.com/evanphx/json-patch"] - version = "v5.6.0+incompatible" - hash = "sha256-F4hI+H6oWFCKa47+x74M4fqcwDtv3wXOLGVxqDn0F5c=" + version = "v5.7.0+incompatible" + hash = "sha256-6aTV41slcMtqRp2PdL4CKTDPUMoIXNP/tOgduzgGMCU=" + [mod."github.com/evanphx/json-patch/v5"] + version = "v5.9.0" + hash = "sha256-KG3giQTztHy6SX0wF2/Htje4MPs+1oEzfWhKDE0xl4U=" + [mod."github.com/fatih/color"] + version = "v1.16.0" + hash = "sha256-Aq/SM28aPJVzvapllQ64R/DM4aZ5CHPewcm/AUJPyJQ=" [mod."github.com/fatih/structs"] version = "v1.1.0" hash = "sha256-OCmubTLF1anwNnkvFZDYHnF6hFlX0WDoe/9+dDlaMPM=" @@ -131,14 +140,14 @@ schema = 3 version = "v1.4.1" hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY=" [mod."github.com/go-openapi/jsonpointer"] - version = "v0.20.2" - hash = "sha256-z9IZxP+JvJ1WvrHE7qbAZQqJ3XMx1uD0S611shTMna8=" + version = "v0.21.0" + hash = "sha256-bB8XTzo4hzXemi8Ey3tIXia3mfn38bvwIzKYLJYC650=" [mod."github.com/go-openapi/jsonreference"] - version = "v0.20.2" - hash = "sha256-klWZKK7LZqSg3HMIrSkjh/NwaZTr+8kTW2ok2+JlioE=" + version = "v0.21.0" + hash = "sha256-lkFb/kP0qt8L1jsLYLt+jXTY6jSk5SYJbfgAKKVlQYQ=" [mod."github.com/go-openapi/swag"] - version = "v0.22.8" - hash = "sha256-YMJpCbWT9ABlCmuLjxQRwhddlYYqDBWcyDIdnV8bAMc=" + version = "v0.23.0" + hash = "sha256-D5CzsSQ3SYJLwXT6BDahnG66LI8du59Dy1mY4KutA7A=" [mod."github.com/go-playground/locales"] version = "v0.14.1" hash = "sha256-BMJGAexq96waZn60DJXZfByRHb8zA/JP/i6f/YrW9oQ=" @@ -154,6 +163,9 @@ schema = 3 [mod."github.com/go-test/deep"] version = "v1.0.8" hash = "sha256-AKOpW32qcq1BTVEPC6MshiFA3ROucnmlJMIfvwYXvNY=" + [mod."github.com/gobuffalo/flect"] + version = "v1.0.2" + hash = "sha256-r0UXCY4OI/VIawB38WmZ4nAe/4qKsyqT5LD+UVhOylw=" [mod."github.com/goccy/go-json"] version = "v0.10.2" hash = "sha256-6fMD2/Rku8HT0zDdeA23pX0YxbohiIOC8OJNYbylJTQ=" @@ -209,8 +221,8 @@ schema = 3 version = "v1.8.1" hash = "sha256-nDABvAhlYgxUW2N/brrep7NkQXoSGcHhA+XI4+tK0F0=" [mod."github.com/gorilla/websocket"] - version = "v1.5.0" - hash = "sha256-EYVgkSEMo4HaVrsWKqnsYRp8SSS8gNf7t+Elva02Ofc=" + version = "v1.5.1" + hash = "sha256-eHZ/U+eeE5tSgWc1jEDuBwtTRbXKP9fqP9zfW4Zw8T0=" [mod."github.com/gregjones/httpcache"] version = "v0.0.0-20180305231024-9cad4c3443a7" hash = "sha256-2ngFfFuSm8YSTNZWGQuN5yTpsXlwY2R8aaIzjDnjTXI=" @@ -304,6 +316,9 @@ schema = 3 [mod."github.com/microcosm-cc/bluemonday"] version = "v1.0.25" hash = "sha256-/crG5s6cDrJ55nkDBwugLUpY7U+vQuHpCkKm7nnN8Zc=" + [mod."github.com/miekg/dns"] + version = "v1.1.58" + hash = "sha256-UGvyC1Abh2S5VaAUCV9AUuDMrCvpiWQy/UnYM9DfIB8=" [mod."github.com/moby/spdystream"] version = "v0.2.0" hash = "sha256-Feme5UoWuBCvnLPKw1ozKkF3SM7PAjjPFQZ3TJhghR0=" @@ -446,8 +461,8 @@ schema = 3 version = "v0.23.0" hash = "sha256-6hZjb/OazWFBef0C/aH63l49YQnzCh2vpIduzyfSSG8=" [mod."golang.org/x/exp"] - version = "v0.0.0-20220303212507-bbda1eaf7a17" - hash = "sha256-E8mRbh+ptVwyqnxBfYEtJ8pGqjWUvxUxVsz9vXxDIo4=" + version = "v0.0.0-20240416160154-fe59bbe5cc7f" + hash = "sha256-168CD9hlLJaQ7stQk/ztlP3zgaWXUMbIHa38gAeRRs4=" [mod."golang.org/x/mod"] version = "v0.17.0" hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" @@ -455,8 +470,8 @@ schema = 3 version = "v0.25.0" hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54=" [mod."golang.org/x/oauth2"] - version = "v0.16.0" - hash = "sha256-fJfS9dKaq82WaYSVWHMnxNLWH8+L4aip/C1AfJi4FFI=" + version = "v0.19.0" + hash = "sha256-IYdkq8R8BXnwoBt/ZLAMJr0DkLZDMVkjeBJNQ/Z9Bes=" [mod."golang.org/x/sync"] version = "v0.7.0" hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" @@ -485,8 +500,8 @@ schema = 3 version = "v0.126.0" hash = "sha256-G/J0Aba+S35gE7VevU2WrrbwQRsJCSj14DVSLTqz0vE=" [mod."google.golang.org/appengine"] - version = "v1.6.8" - hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" + version = "v1.6.7" + hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4=" [mod."google.golang.org/genproto"] version = "v0.0.0-20230530153820-e85fd2cbaebc" hash = "sha256-xuUQD0+WiF+LGKhQCCwaA5WKlZz6EG9WhClfEonHedk=" @@ -497,8 +512,11 @@ schema = 3 version = "v0.0.0-20240314234333-6e1732d8331c" hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" + [mod."google.golang.org/grpc/cmd/protoc-gen-go-grpc"] + version = "v1.3.0" + hash = "sha256-6M1gOZMu3hN08M/giGcVv4ic5ChGcUfKLUlUtZxvF7E=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" @@ -526,24 +544,45 @@ schema = 3 [mod."k8s.io/api"] version = "v0.30.2" hash = "sha256-sq8jdb0wnAIhTO/hactsJ34mRuUgEuUNOrKaQasbHpQ=" + [mod."k8s.io/apiextensions-apiserver"] + version = "v0.30.0" + hash = "sha256-1/T2iSEHRGZttj9pgl5VpQ3yAx7+GRMi7g9kLeaRvMM=" [mod."k8s.io/apimachinery"] version = "v0.30.2" hash = "sha256-EBWG9PlSfRwMed/u6oF8ME8n44/U5HGBCacH+Mns2UI=" [mod."k8s.io/client-go"] version = "v0.30.2" hash = "sha256-KwgEXnowk01jImaHhOStbVWc3dDVZKF2nVvfsJAvtgo=" + [mod."k8s.io/code-generator"] + version = "v0.30.0" + hash = "sha256-MCco4LG1k9A6tP/AHqAAZb0EyOG/IOhIC5R76J56cYs=" + [mod."k8s.io/gengo"] + version = "v0.0.0-20230829151522-9cce18d56c01" + hash = "sha256-JgsgX2R/iu1I96dQ45ZSe4AW1PIgEpArsF3Xa+yzTxI=" [mod."k8s.io/gengo/v2"] version = "v2.0.0-20240228010128-51d4e06bde70" hash = "sha256-igAJQwUliynE2iDbBYc2HONd744+r7o3mQtFyYDYLb4=" + [mod."k8s.io/klog"] + version = "v0.2.0" + hash = "sha256-YabDBrcEBN72ClwZ1bs9bA+2gjH9ZD7omGCjtWY/YUo=" [mod."k8s.io/klog/v2"] version = "v2.120.1" hash = "sha256-PU3q5ODCHEO8z//zUKsCq2tky6ZNx4xFl3nHSPJpuW8=" [mod."k8s.io/kube-openapi"] - version = "v0.0.0-20240228011516-70dd3763d340" - hash = "sha256-2BUbi2eNJFSTcmLyVYBYBe9Lhi0TVJoH2zVQlQ9eZIA=" + version = "v0.0.0-20240423202451-8948a665c108" + hash = "sha256-EXaKmh3z505YcvpGBCP+nwk6EIqH7H09kakalWKXLxk=" [mod."k8s.io/utils"] - version = "v0.0.0-20230726121419-3b25d923346b" - hash = "sha256-r8VhhAYGPouGGgXu02ymVwF6k+WmBc4ij0qynPRtXEE=" + version = "v0.0.0-20240423183400-0849a56e8f22" + hash = "sha256-4CiDxKJMHKJ173hu3KsVBD4XdAfGZRMiHIFeqW3AwYs=" + [mod."sigs.k8s.io/controller-runtime"] + version = "v0.18.0" + hash = "sha256-383Pun8npG9f4ITz3YGHunU48X6rvJtHd03EdNLjMhQ=" + [mod."sigs.k8s.io/controller-tools"] + version = "v0.15.0" + hash = "sha256-McJAHNx3tTjEww+/Sbz6vG5YR5z+WUovuzK2lH21Vnk=" + [mod."sigs.k8s.io/gateway-api"] + version = "v1.1.0" + hash = "sha256-v/Naf9D35XsQLieooRseVTfDQ7KwCqViX9mRviVeLDw=" [mod."sigs.k8s.io/json"] version = "v0.0.0-20221116044647-bc3834ca7abd" hash = "sha256-XDBMN2o450IHiAwEpBVsvo9e7tYZa+EXWrifUNTdNMU=" @@ -551,5 +590,5 @@ schema = 3 version = "v4.4.1" hash = "sha256-FcZHHZCKNNZW6/s1T1sKiS5Vj1TpHPmxVWr6YlL60xA=" [mod."sigs.k8s.io/yaml"] - version = "v1.3.0" - hash = "sha256-RVp8vca2wxg8pcBDYospG7Z1dujoH7zXNu2rgZ1kky0=" + version = "v1.4.0" + hash = "sha256-Hd/M0vIfIVobDd87eb58p1HyVOjYWNlGq2bRXfmtVno=" diff --git a/kardinal-cli/kubernetes/kubernetes_client.go b/kardinal-cli/kubernetes/kubernetes_client.go index b1d1bd7e..9c0058fc 100644 --- a/kardinal-cli/kubernetes/kubernetes_client.go +++ b/kardinal-cli/kubernetes/kubernetes_client.go @@ -4,9 +4,10 @@ import ( "bytes" "context" "errors" + "io" + "github.com/kurtosis-tech/stacktrace" "gopkg.in/yaml.v3" - "io" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,26 +26,26 @@ const ( deleteOptionsGracePeriodSeconds int64 = 0 ) -type kubernetesClient struct { +type KubernetesClient struct { config *rest.Config clientSet *kubernetes.Clientset dynamicClient *dynamic.DynamicClient discoveryMapper *restmapper.DeferredDiscoveryRESTMapper } -func newKubernetesClient(config *rest.Config, clientSet *kubernetes.Clientset, dynamicClient *dynamic.DynamicClient, discoveryMapper *restmapper.DeferredDiscoveryRESTMapper) *kubernetesClient { - return &kubernetesClient{config: config, clientSet: clientSet, dynamicClient: dynamicClient, discoveryMapper: discoveryMapper} +func newKubernetesClient(config *rest.Config, clientSet *kubernetes.Clientset, dynamicClient *dynamic.DynamicClient, discoveryMapper *restmapper.DeferredDiscoveryRESTMapper) *KubernetesClient { + return &KubernetesClient{config: config, clientSet: clientSet, dynamicClient: dynamicClient, discoveryMapper: discoveryMapper} } -func (client *kubernetesClient) GetClientSet() *kubernetes.Clientset { +func (client *KubernetesClient) GetClientSet() *kubernetes.Clientset { return client.clientSet } -func (client *kubernetesClient) GetConfig() *rest.Config { +func (client *KubernetesClient) GetConfig() *rest.Config { return client.config } -func (client *kubernetesClient) GetService(ctx context.Context, namespaceName string, name string) (*corev1.Service, error) { +func (client *KubernetesClient) GetService(ctx context.Context, namespaceName string, name string) (*corev1.Service, error) { serviceClient := client.clientSet.CoreV1().Services(namespaceName) serviceObj, err := serviceClient.Get(ctx, name, metav1.GetOptions{}) if err != nil { @@ -53,7 +54,7 @@ func (client *kubernetesClient) GetService(ctx context.Context, namespaceName st return serviceObj, nil } -func (client *kubernetesClient) GetDeploymentsByLabels(ctx context.Context, namespace string, labels map[string]string) (*appsv1.DeploymentList, error) { +func (client *KubernetesClient) GetDeploymentsByLabels(ctx context.Context, namespace string, labels map[string]string) (*appsv1.DeploymentList, error) { deploymentClient := client.clientSet.AppsV1().Deployments(namespace) opts := buildListOptionsFromLabels(labels) @@ -79,7 +80,7 @@ func (client *kubernetesClient) GetDeploymentsByLabels(ctx context.Context, name return &deploymentList, nil } -func (client *kubernetesClient) ApplyYamlFileContentInNamespace(ctx context.Context, namespace string, yamlFileContent []byte) error { +func (client *KubernetesClient) ApplyYamlFileContentInNamespace(ctx context.Context, namespace string, yamlFileContent []byte) error { yamlReader := bytes.NewReader(yamlFileContent) dec := yaml.NewDecoder(yamlReader) @@ -132,8 +133,7 @@ func (client *kubernetesClient) ApplyYamlFileContentInNamespace(ctx context.Cont } } -func (client *kubernetesClient) RemoveNamespaceResourcesByLabels(ctx context.Context, namespace string, labels map[string]string) error { - +func (client *KubernetesClient) RemoveNamespaceResourcesByLabels(ctx context.Context, namespace string, labels map[string]string) error { opts := buildListOptionsFromLabels(labels) deleteOptions := metav1.NewDeleteOptions(deleteOptionsGracePeriodSeconds) @@ -173,7 +173,7 @@ func (client *kubernetesClient) RemoveNamespaceResourcesByLabels(ctx context.Con return nil } -func (client *kubernetesClient) GetNamespacesByLabels(ctx context.Context, namespaceLabels map[string]string) (*corev1.NamespaceList, error) { +func (client *KubernetesClient) GetNamespacesByLabels(ctx context.Context, namespaceLabels map[string]string) (*corev1.NamespaceList, error) { namespaceClient := client.clientSet.CoreV1().Namespaces() listOptions := buildListOptionsFromLabels(namespaceLabels) diff --git a/kardinal-cli/kubernetes/kubernetes_client_factory.go b/kardinal-cli/kubernetes/kubernetes_client_factory.go index ec450348..4b45dbe0 100644 --- a/kardinal-cli/kubernetes/kubernetes_client_factory.go +++ b/kardinal-cli/kubernetes/kubernetes_client_factory.go @@ -1,6 +1,8 @@ package kubernetes import ( + "path/filepath" + "github.com/kurtosis-tech/stacktrace" "k8s.io/client-go/discovery/cached/memory" "k8s.io/client-go/dynamic" @@ -9,10 +11,10 @@ import ( "k8s.io/client-go/restmapper" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" - "path/filepath" + gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" ) -func CreateKubernetesClient() (*kubernetesClient, error) { +func GetConfig() (*rest.Config, error) { var config *rest.Config // Load in-cluster configuration @@ -27,6 +29,10 @@ func CreateKubernetesClient() (*kubernetesClient, error) { } } + return config, nil +} + +func CreateKubernetesClient(config *rest.Config) (*KubernetesClient, error) { clientSet, err := kubernetes.NewForConfig(config) if err != nil { return nil, stacktrace.Propagate(err, "An error occurred while creating kubernetes client using config '%+v'", config) @@ -44,3 +50,12 @@ func CreateKubernetesClient() (*kubernetesClient, error) { return kubernetesClientObj, nil } + +func CreateGatewayApiClient(k8sConfig *rest.Config) (*gatewayclientset.Clientset, error) { + gwc, err := gatewayclientset.NewForConfig(k8sConfig) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred creating IstIo client from k8s config: %v", k8sConfig) + } + + return gwc, nil +} diff --git a/kardinal-manager/dev-start-manager.sh b/kardinal-manager/dev-start-manager.sh new file mode 100755 index 00000000..acb78c4b --- /dev/null +++ b/kardinal-manager/dev-start-manager.sh @@ -0,0 +1,2 @@ +UUID=$(cat "$HOME/Library/Application Support/kardinal/fk-tenant-uuid") +KARDINAL_MANAGER_CLUSTER_CONFIG_ENDPOINT="http://localhost:8080/tenant/$UUID/cluster-resources" KARDINAL_MANAGER_FETCHER_JOB_DURATION_SECONDS=2 reflex -s -r '\.go$' -- go run kardinal-manager/main.go "$@" diff --git a/kardinal-manager/go.mod b/kardinal-manager/go.mod index 8aefdc52..4762c1a1 100644 --- a/kardinal-manager/go.mod +++ b/kardinal-manager/go.mod @@ -20,22 +20,24 @@ require ( istio.io/client-go v1.22.1 k8s.io/api v0.30.2 k8s.io/apimachinery v0.30.2 - k8s.io/client-go v0.29.0 + k8s.io/client-go v0.30.0 + sigs.k8s.io/gateway-api v1.1.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.8 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.1 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -56,25 +58,24 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect golang.org/x/crypto v0.23.0 // indirect - golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect + golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/oauth2 v0.19.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/term v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.21.0 // indirect - google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect + k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/kardinal-manager/go.sum b/kardinal-manager/go.sum index f39d74b2..f95822da 100644 --- a/kardinal-manager/go.sum +++ b/kardinal-manager/go.sum @@ -1,27 +1,24 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deepmap/oapi-codegen/v2 v2.2.1-0.20240604070534-2f0ff757704b h1:nSyP/gj8okzyHlWoaqOEtNgqxSrrhCmyTtw1t9kFly8= github.com/deepmap/oapi-codegen/v2 v2.2.1-0.20240604070534-2f0ff757704b/go.mod h1:L4zUv7ULYDtYSb/aYk/xO3OYcQU6BoU/0viULkbi2DE= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -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= +github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= +github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= +github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/getkin/kin-openapi v0.125.0 h1:jyQCyf2qXS1qvs2U00xQzkGCqYPhEhZDmSmVt65fXno= github.com/getkin/kin-openapi v0.125.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= -github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= @@ -30,24 +27,23 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= @@ -58,11 +54,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -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/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 h1:YQTATifMUwZEtZYb0LVA7DK2pj8s71iY8rzweuUQ5+g= @@ -112,13 +105,8 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= @@ -129,56 +117,42 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 h1:3MTrJm4PyNL9NBqvYDSj3DHl46qQakyfqfWo4jgfaEM= -golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= +golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= +golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -187,19 +161,14 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -222,17 +191,19 @@ k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.29.0 h1:KmlDtFcrdUzOYrBhXHgKw5ycWzc3ryPX5mQe0SkG3y8= -k8s.io/client-go v0.29.0/go.mod h1:yLkXH4HKMAywcrD82KMSmfYg2DlE8mepPR4JGSo5n38= +k8s.io/client-go v0.30.0 h1:sB1AGGlhY/o7KCyCEQ0bPWzYDL0pwOZO4vAtTSh/gJQ= +k8s.io/client-go v0.30.0/go.mod h1:g7li5O5256qe6TYdAMyX/otJqMhIiGgTapdLchhmOaY= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 h1:Q8Z7VlGhcJgBHJHYugJ/K/7iB8a2eSxCyxdVjJp+lLY= +k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 h1:ao5hUqGhsqdm+bYbjH/pRkCs0unBGe9UyDahzs9zQzQ= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= +sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/kardinal-manager/gomod2nix.toml b/kardinal-manager/gomod2nix.toml index 990f7cd9..90f17b8a 100644 --- a/kardinal-manager/gomod2nix.toml +++ b/kardinal-manager/gomod2nix.toml @@ -34,6 +34,9 @@ schema = 3 [mod."github.com/adrg/xdg"] version = "v0.4.0" hash = "sha256-zGjkdUQmrVqD6rMO9oDY+TeJCpuqnHyvkPCaXDlac/U=" + [mod."github.com/ahmetb/gen-crd-api-reference-docs"] + version = "v0.3.0" + hash = "sha256-9W0jxXQn3E5bJ24SURs2tO1odSep/mIp0OIpjKCDM18=" [mod."github.com/andybalholm/brotli"] version = "v1.0.5" hash = "sha256-/qS8wU8yZQJ+uTOg66rEl9s7spxq9VIXF5L1BcaEClc=" @@ -98,11 +101,17 @@ schema = 3 version = "v0.0.0-20200823014737-9f7001d12a5f" hash = "sha256-n/7xo5CQqo4yLaWMSzSN1Muk/oqK6O5dgDOFWapeDUI=" [mod."github.com/emicklei/go-restful/v3"] - version = "v3.11.0" - hash = "sha256-Kp5ndPvj1PhK0nscM1pNNK2Q4ahUuLED/baEgL9pKNo=" + version = "v3.12.0" + hash = "sha256-w9mYeZiOWYEd5NLkOHYbaElfcbNurV6trMtbv2KPvL0=" [mod."github.com/evanphx/json-patch"] - version = "v5.6.0+incompatible" - hash = "sha256-F4hI+H6oWFCKa47+x74M4fqcwDtv3wXOLGVxqDn0F5c=" + version = "v5.7.0+incompatible" + hash = "sha256-6aTV41slcMtqRp2PdL4CKTDPUMoIXNP/tOgduzgGMCU=" + [mod."github.com/evanphx/json-patch/v5"] + version = "v5.9.0" + hash = "sha256-KG3giQTztHy6SX0wF2/Htje4MPs+1oEzfWhKDE0xl4U=" + [mod."github.com/fatih/color"] + version = "v1.16.0" + hash = "sha256-Aq/SM28aPJVzvapllQ64R/DM4aZ5CHPewcm/AUJPyJQ=" [mod."github.com/fatih/structs"] version = "v1.1.0" hash = "sha256-OCmubTLF1anwNnkvFZDYHnF6hFlX0WDoe/9+dDlaMPM=" @@ -131,14 +140,14 @@ schema = 3 version = "v1.4.1" hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY=" [mod."github.com/go-openapi/jsonpointer"] - version = "v0.20.2" - hash = "sha256-z9IZxP+JvJ1WvrHE7qbAZQqJ3XMx1uD0S611shTMna8=" + version = "v0.21.0" + hash = "sha256-bB8XTzo4hzXemi8Ey3tIXia3mfn38bvwIzKYLJYC650=" [mod."github.com/go-openapi/jsonreference"] - version = "v0.20.2" - hash = "sha256-klWZKK7LZqSg3HMIrSkjh/NwaZTr+8kTW2ok2+JlioE=" + version = "v0.21.0" + hash = "sha256-lkFb/kP0qt8L1jsLYLt+jXTY6jSk5SYJbfgAKKVlQYQ=" [mod."github.com/go-openapi/swag"] - version = "v0.22.8" - hash = "sha256-YMJpCbWT9ABlCmuLjxQRwhddlYYqDBWcyDIdnV8bAMc=" + version = "v0.23.0" + hash = "sha256-D5CzsSQ3SYJLwXT6BDahnG66LI8du59Dy1mY4KutA7A=" [mod."github.com/go-playground/locales"] version = "v0.14.1" hash = "sha256-BMJGAexq96waZn60DJXZfByRHb8zA/JP/i6f/YrW9oQ=" @@ -154,6 +163,9 @@ schema = 3 [mod."github.com/go-test/deep"] version = "v1.0.8" hash = "sha256-AKOpW32qcq1BTVEPC6MshiFA3ROucnmlJMIfvwYXvNY=" + [mod."github.com/gobuffalo/flect"] + version = "v1.0.2" + hash = "sha256-r0UXCY4OI/VIawB38WmZ4nAe/4qKsyqT5LD+UVhOylw=" [mod."github.com/goccy/go-json"] version = "v0.10.2" hash = "sha256-6fMD2/Rku8HT0zDdeA23pX0YxbohiIOC8OJNYbylJTQ=" @@ -209,8 +221,8 @@ schema = 3 version = "v1.8.1" hash = "sha256-nDABvAhlYgxUW2N/brrep7NkQXoSGcHhA+XI4+tK0F0=" [mod."github.com/gorilla/websocket"] - version = "v1.5.0" - hash = "sha256-EYVgkSEMo4HaVrsWKqnsYRp8SSS8gNf7t+Elva02Ofc=" + version = "v1.5.1" + hash = "sha256-eHZ/U+eeE5tSgWc1jEDuBwtTRbXKP9fqP9zfW4Zw8T0=" [mod."github.com/gregjones/httpcache"] version = "v0.0.0-20180305231024-9cad4c3443a7" hash = "sha256-2ngFfFuSm8YSTNZWGQuN5yTpsXlwY2R8aaIzjDnjTXI=" @@ -304,6 +316,9 @@ schema = 3 [mod."github.com/microcosm-cc/bluemonday"] version = "v1.0.25" hash = "sha256-/crG5s6cDrJ55nkDBwugLUpY7U+vQuHpCkKm7nnN8Zc=" + [mod."github.com/miekg/dns"] + version = "v1.1.58" + hash = "sha256-UGvyC1Abh2S5VaAUCV9AUuDMrCvpiWQy/UnYM9DfIB8=" [mod."github.com/moby/spdystream"] version = "v0.2.0" hash = "sha256-Feme5UoWuBCvnLPKw1ozKkF3SM7PAjjPFQZ3TJhghR0=" @@ -446,8 +461,8 @@ schema = 3 version = "v0.23.0" hash = "sha256-6hZjb/OazWFBef0C/aH63l49YQnzCh2vpIduzyfSSG8=" [mod."golang.org/x/exp"] - version = "v0.0.0-20220303212507-bbda1eaf7a17" - hash = "sha256-E8mRbh+ptVwyqnxBfYEtJ8pGqjWUvxUxVsz9vXxDIo4=" + version = "v0.0.0-20240416160154-fe59bbe5cc7f" + hash = "sha256-168CD9hlLJaQ7stQk/ztlP3zgaWXUMbIHa38gAeRRs4=" [mod."golang.org/x/mod"] version = "v0.17.0" hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" @@ -455,8 +470,8 @@ schema = 3 version = "v0.25.0" hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54=" [mod."golang.org/x/oauth2"] - version = "v0.16.0" - hash = "sha256-fJfS9dKaq82WaYSVWHMnxNLWH8+L4aip/C1AfJi4FFI=" + version = "v0.19.0" + hash = "sha256-IYdkq8R8BXnwoBt/ZLAMJr0DkLZDMVkjeBJNQ/Z9Bes=" [mod."golang.org/x/sync"] version = "v0.7.0" hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" @@ -485,8 +500,8 @@ schema = 3 version = "v0.126.0" hash = "sha256-G/J0Aba+S35gE7VevU2WrrbwQRsJCSj14DVSLTqz0vE=" [mod."google.golang.org/appengine"] - version = "v1.6.8" - hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" + version = "v1.6.7" + hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4=" [mod."google.golang.org/genproto"] version = "v0.0.0-20230530153820-e85fd2cbaebc" hash = "sha256-xuUQD0+WiF+LGKhQCCwaA5WKlZz6EG9WhClfEonHedk=" @@ -497,8 +512,11 @@ schema = 3 version = "v0.0.0-20240314234333-6e1732d8331c" hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" + [mod."google.golang.org/grpc/cmd/protoc-gen-go-grpc"] + version = "v1.3.0" + hash = "sha256-6M1gOZMu3hN08M/giGcVv4ic5ChGcUfKLUlUtZxvF7E=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" @@ -526,24 +544,45 @@ schema = 3 [mod."k8s.io/api"] version = "v0.30.2" hash = "sha256-sq8jdb0wnAIhTO/hactsJ34mRuUgEuUNOrKaQasbHpQ=" + [mod."k8s.io/apiextensions-apiserver"] + version = "v0.30.0" + hash = "sha256-1/T2iSEHRGZttj9pgl5VpQ3yAx7+GRMi7g9kLeaRvMM=" [mod."k8s.io/apimachinery"] version = "v0.30.2" hash = "sha256-EBWG9PlSfRwMed/u6oF8ME8n44/U5HGBCacH+Mns2UI=" [mod."k8s.io/client-go"] version = "v0.30.2" hash = "sha256-KwgEXnowk01jImaHhOStbVWc3dDVZKF2nVvfsJAvtgo=" + [mod."k8s.io/code-generator"] + version = "v0.30.0" + hash = "sha256-MCco4LG1k9A6tP/AHqAAZb0EyOG/IOhIC5R76J56cYs=" + [mod."k8s.io/gengo"] + version = "v0.0.0-20230829151522-9cce18d56c01" + hash = "sha256-JgsgX2R/iu1I96dQ45ZSe4AW1PIgEpArsF3Xa+yzTxI=" [mod."k8s.io/gengo/v2"] version = "v2.0.0-20240228010128-51d4e06bde70" hash = "sha256-igAJQwUliynE2iDbBYc2HONd744+r7o3mQtFyYDYLb4=" + [mod."k8s.io/klog"] + version = "v0.2.0" + hash = "sha256-YabDBrcEBN72ClwZ1bs9bA+2gjH9ZD7omGCjtWY/YUo=" [mod."k8s.io/klog/v2"] version = "v2.120.1" hash = "sha256-PU3q5ODCHEO8z//zUKsCq2tky6ZNx4xFl3nHSPJpuW8=" [mod."k8s.io/kube-openapi"] - version = "v0.0.0-20240228011516-70dd3763d340" - hash = "sha256-2BUbi2eNJFSTcmLyVYBYBe9Lhi0TVJoH2zVQlQ9eZIA=" + version = "v0.0.0-20240423202451-8948a665c108" + hash = "sha256-EXaKmh3z505YcvpGBCP+nwk6EIqH7H09kakalWKXLxk=" [mod."k8s.io/utils"] - version = "v0.0.0-20230726121419-3b25d923346b" - hash = "sha256-r8VhhAYGPouGGgXu02ymVwF6k+WmBc4ij0qynPRtXEE=" + version = "v0.0.0-20240423183400-0849a56e8f22" + hash = "sha256-4CiDxKJMHKJ173hu3KsVBD4XdAfGZRMiHIFeqW3AwYs=" + [mod."sigs.k8s.io/controller-runtime"] + version = "v0.18.0" + hash = "sha256-383Pun8npG9f4ITz3YGHunU48X6rvJtHd03EdNLjMhQ=" + [mod."sigs.k8s.io/controller-tools"] + version = "v0.15.0" + hash = "sha256-McJAHNx3tTjEww+/Sbz6vG5YR5z+WUovuzK2lH21Vnk=" + [mod."sigs.k8s.io/gateway-api"] + version = "v1.1.0" + hash = "sha256-v/Naf9D35XsQLieooRseVTfDQ7KwCqViX9mRviVeLDw=" [mod."sigs.k8s.io/json"] version = "v0.0.0-20221116044647-bc3834ca7abd" hash = "sha256-XDBMN2o450IHiAwEpBVsvo9e7tYZa+EXWrifUNTdNMU=" @@ -551,5 +590,5 @@ schema = 3 version = "v4.4.1" hash = "sha256-FcZHHZCKNNZW6/s1T1sKiS5Vj1TpHPmxVWr6YlL60xA=" [mod."sigs.k8s.io/yaml"] - version = "v1.3.0" - hash = "sha256-RVp8vca2wxg8pcBDYospG7Z1dujoH7zXNu2rgZ1kky0=" + version = "v1.4.0" + hash = "sha256-Hd/M0vIfIVobDd87eb58p1HyVOjYWNlGq2bRXfmtVno=" diff --git a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go index e57a437e..ba5657d4 100644 --- a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go +++ b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager.go @@ -2,6 +2,9 @@ package cluster_manager import ( "context" + "encoding/json" + "strings" + "github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api/api/golang/types" "github.com/kurtosis-tech/stacktrace" "github.com/samber/lo" @@ -11,8 +14,11 @@ import ( securityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + net "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "kardinal.kontrol/kardinal-manager/topology" + gateway "sigs.k8s.io/gateway-api/apis/v1" + gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" ) const ( @@ -95,11 +101,11 @@ var ( type ClusterManager struct { kubernetesClient *kubernetesClient istioClient *istioClient + gatewayClient *gatewayclientset.Clientset } -// TODO could we explore merging this package with the kardinal-cli.kubernetes into a new library? -func NewClusterManager(kubernetesClient *kubernetesClient, istioClient *istioClient) *ClusterManager { - return &ClusterManager{kubernetesClient: kubernetesClient, istioClient: istioClient} +func NewClusterManager(kubernetesClient *kubernetesClient, istioClient *istioClient, gatewayClient *gatewayclientset.Clientset) *ClusterManager { + return &ClusterManager{kubernetesClient: kubernetesClient, istioClient: istioClient, gatewayClient: gatewayClient} } func (manager *ClusterManager) GetVirtualServices(ctx context.Context, namespace string) ([]*v1alpha3.VirtualService, error) { @@ -189,7 +195,6 @@ func (manager *ClusterManager) GetTopologyForNameSpace(namespace string) (map[st } func (manager *ClusterManager) ApplyClusterResources(ctx context.Context, clusterResources *types.ClusterResources) error { - if !isValid(clusterResources) { logrus.Debugf("the received cluster resources is not valid, nothing to apply.") return nil @@ -200,7 +205,8 @@ func (manager *ClusterManager) ApplyClusterResources(ctx context.Context, cluste lo.Uniq(lo.Map(*clusterResources.Deployments, func(item appsv1.Deployment, _ int) string { return item.Namespace })), lo.Uniq(lo.Map(*clusterResources.VirtualServices, func(item v1alpha3.VirtualService, _ int) string { return item.Namespace })), lo.Uniq(lo.Map(*clusterResources.DestinationRules, func(item v1alpha3.DestinationRule, _ int) string { return item.Namespace })), - {clusterResources.Gateway.Namespace}, + lo.Uniq(lo.Map(*clusterResources.Gateways, func(item gateway.Gateway, _ int) string { return item.Namespace })), + lo.Uniq(lo.Map(*clusterResources.HttpRoutes, func(item gateway.HTTPRoute, _ int) string { return item.Namespace })), } if clusterResources.EnvoyFilters != nil { @@ -213,7 +219,7 @@ func (manager *ClusterManager) ApplyClusterResources(ctx context.Context, cluste allNSs = append(allNSs, [][]string{authPoliciesNS}...) } - uniqueNamespaces := lo.Uniq(lo.Flatten(allNSs)) + uniqueNamespaces := lo.ReplaceAll(lo.Uniq(lo.Flatten(allNSs)), "", "default") for _, namespace := range uniqueNamespaces { if err := manager.ensureNamespace(ctx, namespace); err != nil { @@ -272,52 +278,35 @@ func (manager *ClusterManager) ApplyClusterResources(ctx context.Context, cluste } } - if err := manager.createOrUpdateGateway(ctx, clusterResources.Gateway); err != nil { - return stacktrace.Propagate(err, "An error occurred while creating or updating the cluster gateway") + for _, gateway := range *clusterResources.Gateways { + if err := manager.createOrUpdateGateway(ctx, &gateway); err != nil { + return stacktrace.Propagate(err, "An error occurred while creating or updating the cluster gateway") + } + } + + for _, httpRoute := range *clusterResources.HttpRoutes { + if err := manager.createOrUpdateHttpRoute(ctx, &httpRoute); err != nil { + return stacktrace.Propagate(err, "An error occurred while creating or updating the http route") + } + } + + for _, ingress := range *clusterResources.Ingresses { + if err := manager.createOrUpdateIngress(ctx, &ingress); err != nil { + return stacktrace.Propagate(err, "An error occurred while creating or updating the ingress") + } } return nil } func (manager *ClusterManager) CleanUpClusterResources(ctx context.Context, clusterResources *types.ClusterResources) error { - if !isValid(clusterResources) { logrus.Debugf("the received cluster resources is not valid, nothing to clean up.") return nil } - // Clean up services - servicesByNS := lo.GroupBy(*clusterResources.Services, func(item corev1.Service) string { - return item.Namespace - }) - if len(servicesByNS) == 0 { - // There are no resources to apply so we attempt to clear resources in the namespace set in the dummy gateway - // sent by the kontrol service. This happens when the tenant has no base cluster topology; no initial deploy - // or the topologies have been deleted. - servicesByNS[clusterResources.Gateway.GetNamespace()] = []corev1.Service{} - } - for namespace, services := range servicesByNS { - if err := manager.cleanUpServicesInNamespace(ctx, namespace, services); err != nil { - return stacktrace.Propagate(err, "An error occurred cleaning up services '%+v' in namespace '%s'", services, namespace) - } - } - - // Clean up deployments - deploymentsByNS := lo.GroupBy(*clusterResources.Deployments, func(item appsv1.Deployment) string { return item.Namespace }) - if len(deploymentsByNS) == 0 { - deploymentsByNS[clusterResources.Gateway.GetNamespace()] = []appsv1.Deployment{} - } - for namespace, deployments := range deploymentsByNS { - if err := manager.cleanUpDeploymentsInNamespace(ctx, namespace, deployments); err != nil { - return stacktrace.Propagate(err, "An error occurred cleaning up deployments '%+v' in namespace '%s'", deployments, namespace) - } - } - // Clean up virtual services virtualServicesByNS := lo.GroupBy(*clusterResources.VirtualServices, func(item v1alpha3.VirtualService) string { return item.Namespace }) - if len(virtualServicesByNS) == 0 { - virtualServicesByNS[clusterResources.Gateway.GetNamespace()] = []v1alpha3.VirtualService{} - } for namespace, virtualServices := range virtualServicesByNS { if err := manager.cleanUpVirtualServicesInNamespace(ctx, namespace, virtualServices); err != nil { return stacktrace.Propagate(err, "An error occurred cleaning up virtual services '%+v' in namespace '%s'", virtualServices, namespace) @@ -328,19 +317,36 @@ func (manager *ClusterManager) CleanUpClusterResources(ctx context.Context, clus destinationRulesByNS := lo.GroupBy(*clusterResources.DestinationRules, func(item v1alpha3.DestinationRule) string { return item.Namespace }) - if len(destinationRulesByNS) == 0 { - destinationRulesByNS[clusterResources.Gateway.GetNamespace()] = []v1alpha3.DestinationRule{} - } for namespace, destinationRules := range destinationRulesByNS { if err := manager.cleanUpDestinationRulesInNamespace(ctx, namespace, destinationRules); err != nil { return stacktrace.Propagate(err, "An error occurred cleaning up destination rules '%+v' in namespace '%s'", destinationRules, namespace) } } - // Clean up gateway - gatewaysByNs := map[string][]v1alpha3.Gateway{ - clusterResources.Gateway.GetNamespace(): {*clusterResources.Gateway}, + // Clean up Ingresses + ingressesByNs := lo.GroupBy(*clusterResources.Ingresses, func(item net.Ingress) string { + return item.Namespace + }) + for namespace, ingresses := range ingressesByNs { + if err := manager.cleanUpIngressesInNamespace(ctx, namespace, ingresses); err != nil { + return stacktrace.Propagate(err, "An error occurred cleaning up ingresses '%+v' in namespace '%s'", ingresses, namespace) + } } + + // Clean up http routes + routesByNs := lo.GroupBy(*clusterResources.HttpRoutes, func(item gateway.HTTPRoute) string { + return item.Namespace + }) + for namespace, routes := range routesByNs { + if err := manager.cleanUpHttpRoutesInNamespace(ctx, namespace, routes); err != nil { + return stacktrace.Propagate(err, "An error occurred cleaning up http routes '%+v' in namespace '%s'", routes, namespace) + } + } + + // Clean up gateway + gatewaysByNs := lo.GroupBy(*clusterResources.Gateways, func(item gateway.Gateway) string { + return item.Namespace + }) for namespace, gateways := range gatewaysByNs { if err := manager.cleanUpGatewaysInNamespace(ctx, namespace, gateways); err != nil { return stacktrace.Propagate(err, "An error occurred cleaning up gateways '%+v' in namespace '%s'", gateways, namespace) @@ -352,9 +358,6 @@ func (manager *ClusterManager) CleanUpClusterResources(ctx context.Context, clus envoyFiltersByNS := lo.GroupBy(*clusterResources.EnvoyFilters, func(item v1alpha3.EnvoyFilter) string { return item.Namespace }) - if len(envoyFiltersByNS) == 0 { - envoyFiltersByNS[clusterResources.Gateway.GetNamespace()] = []v1alpha3.EnvoyFilter{} - } for namespace, envoyFilters := range envoyFiltersByNS { if err := manager.cleanupEnvoyFiltersInNamespace(ctx, namespace, envoyFilters); err != nil { return stacktrace.Propagate(err, "An error occurred cleaning up envoy filters '%+v' in namespace '%s'", envoyFilters, namespace) @@ -362,14 +365,30 @@ func (manager *ClusterManager) CleanUpClusterResources(ctx context.Context, clus } } + // Clean up services + servicesByNS := lo.GroupBy(*clusterResources.Services, func(item corev1.Service) string { + return item.Namespace + }) + for namespace, services := range servicesByNS { + gateways := gatewaysByNs[namespace] + if err := manager.cleanUpServicesInNamespace(ctx, namespace, services, gateways); err != nil { + return stacktrace.Propagate(err, "An error occurred cleaning up services '%+v' in namespace '%s'", services, namespace) + } + } + + // Clean up deployments + deploymentsByNS := lo.GroupBy(*clusterResources.Deployments, func(item appsv1.Deployment) string { return item.Namespace }) + for namespace, deployments := range deploymentsByNS { + if err := manager.cleanUpDeploymentsInNamespace(ctx, namespace, deployments); err != nil { + return stacktrace.Propagate(err, "An error occurred cleaning up deployments '%+v' in namespace '%s'", deployments, namespace) + } + } + // Cleanup authorization policies if clusterResources.AuthorizationPolicies != nil { authorizationPoliciesByNS := lo.GroupBy(*clusterResources.AuthorizationPolicies, func(item securityv1beta1.AuthorizationPolicy) string { return item.Namespace }) - if len(authorizationPoliciesByNS) == 0 { - authorizationPoliciesByNS[clusterResources.Gateway.GetNamespace()] = []securityv1beta1.AuthorizationPolicy{} - } for namespace, authorizationPolicies := range authorizationPoliciesByNS { if err := manager.cleanupAuthorizationPoliciesInNamespace(ctx, namespace, authorizationPolicies); err != nil { return stacktrace.Propagate(err, "An error occurred cleaning up authorization policies '%+v' in namespace '%s'", authorizationPolicies, namespace) @@ -425,17 +444,17 @@ func (manager *ClusterManager) createOrUpdateService(ctx context.Context, servic serviceClient := manager.kubernetesClient.clientSet.CoreV1().Services(service.Namespace) existingService, err := serviceClient.Get(ctx, service.Name, metav1.GetOptions{}) if err != nil { - // Resource does not exist, create new one _, err = serviceClient.Create(ctx, service, globalCreateOptions) if err != nil { return stacktrace.Propagate(err, "Failed to create service: %s", service.GetName()) } } else { - // Update the resource version to the latest before updating - service.ResourceVersion = existingService.ResourceVersion - _, err = serviceClient.Update(ctx, service, globalUpdateOptions) - if err != nil { - return stacktrace.Propagate(err, "Failed to update service: %s", service.GetName()) + if !deepCheckEqual(existingService.Spec, service.Spec) { + service.ResourceVersion = existingService.ResourceVersion + _, err = serviceClient.Update(ctx, service, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update service: %s", service.GetName()) + } } } @@ -451,10 +470,12 @@ func (manager *ClusterManager) createOrUpdateDeployment(ctx context.Context, dep return stacktrace.Propagate(err, "Failed to create deployment: %s", deployment.GetName()) } } else { - updateDeploymentWithRelevantValuesFromCurrentDeployment(deployment, existingDeployment) - _, err = deploymentClient.Update(ctx, deployment, globalUpdateOptions) - if err != nil { - return stacktrace.Propagate(err, "Failed to update deployment: %s", deployment.GetName()) + if !deepCheckEqual(existingDeployment.Spec, deployment.Spec) { + updateDeploymentWithRelevantValuesFromCurrentDeployment(deployment, existingDeployment) + _, err = deploymentClient.Update(ctx, deployment, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update deployment: %s", deployment.GetName()) + } } } @@ -478,7 +499,6 @@ func updateDeploymentWithRelevantValuesFromCurrentDeployment(newDeployment *apps } func (manager *ClusterManager) createOrUpdateVirtualService(ctx context.Context, virtualService *v1alpha3.VirtualService) error { - virtServiceClient := manager.istioClient.clientSet.NetworkingV1alpha3().VirtualServices(virtualService.GetNamespace()) existingVirtService, err := virtServiceClient.Get(ctx, virtualService.Name, metav1.GetOptions{}) @@ -488,10 +508,12 @@ func (manager *ClusterManager) createOrUpdateVirtualService(ctx context.Context, return stacktrace.Propagate(err, "Failed to create virtual service: %s", virtualService.GetName()) } } else { - virtualService.ResourceVersion = existingVirtService.ResourceVersion - _, err = virtServiceClient.Update(ctx, virtualService, globalUpdateOptions) - if err != nil { - return stacktrace.Propagate(err, "Failed to update virtual service: %s", virtualService.GetName()) + if !deepCheckEqual(existingVirtService.Spec, virtualService.Spec) { + virtualService.ResourceVersion = existingVirtService.ResourceVersion + _, err = virtServiceClient.Update(ctx, virtualService, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update virtual service: %s", virtualService.GetName()) + } } } @@ -499,7 +521,6 @@ func (manager *ClusterManager) createOrUpdateVirtualService(ctx context.Context, } func (manager *ClusterManager) createOrUpdateDestinationRule(ctx context.Context, destinationRule *v1alpha3.DestinationRule) error { - destRuleClient := manager.istioClient.clientSet.NetworkingV1alpha3().DestinationRules(destinationRule.GetNamespace()) existingDestRule, err := destRuleClient.Get(ctx, destinationRule.Name, metav1.GetOptions{}) @@ -509,19 +530,20 @@ func (manager *ClusterManager) createOrUpdateDestinationRule(ctx context.Context return stacktrace.Propagate(err, "Failed to create destination rule: %s", destinationRule.GetName()) } } else { - destinationRule.ResourceVersion = existingDestRule.ResourceVersion - _, err = destRuleClient.Update(ctx, destinationRule, globalUpdateOptions) - if err != nil { - return stacktrace.Propagate(err, "Failed to update destination rule: %s", destinationRule.GetName()) + if !deepCheckEqual(existingDestRule.Spec, destinationRule.Spec) { + destinationRule.ResourceVersion = existingDestRule.ResourceVersion + _, err = destRuleClient.Update(ctx, destinationRule, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update destination rule: %s", destinationRule.GetName()) + } } } return nil } -func (manager *ClusterManager) createOrUpdateGateway(ctx context.Context, gateway *v1alpha3.Gateway) error { - - gatewayClient := manager.istioClient.clientSet.NetworkingV1alpha3().Gateways(gateway.GetNamespace()) +func (manager *ClusterManager) createOrUpdateGateway(ctx context.Context, gateway *gateway.Gateway) error { + gatewayClient := manager.gatewayClient.GatewayV1().Gateways(gateway.GetNamespace()) existingGateway, err := gatewayClient.Get(ctx, gateway.Name, metav1.GetOptions{}) if err != nil { _, err = gatewayClient.Create(ctx, gateway, globalCreateOptions) @@ -529,10 +551,54 @@ func (manager *ClusterManager) createOrUpdateGateway(ctx context.Context, gatewa return stacktrace.Propagate(err, "Failed to create gateway: %s", gateway.GetName()) } } else { - gateway.ResourceVersion = existingGateway.ResourceVersion - _, err = gatewayClient.Update(ctx, gateway, globalUpdateOptions) + if !deepCheckEqual(existingGateway.Spec, gateway.Spec) { + gateway.ResourceVersion = existingGateway.ResourceVersion + _, err = gatewayClient.Update(ctx, gateway, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update gateway: %s", gateway.GetName()) + } + } + } + + return nil +} + +func (manager *ClusterManager) createOrUpdateHttpRoute(ctx context.Context, route *gateway.HTTPRoute) error { + routeClient := manager.gatewayClient.GatewayV1().HTTPRoutes(route.GetNamespace()) + existingRoute, err := routeClient.Get(ctx, route.Name, metav1.GetOptions{}) + if err != nil { + _, err = routeClient.Create(ctx, route, globalCreateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to create route: %s", route.GetName()) + } + } else { + if !deepCheckEqual(existingRoute.Spec, route.Spec) { + route.ResourceVersion = existingRoute.ResourceVersion + _, err = routeClient.Update(ctx, route, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update route: %s", route.GetName()) + } + } + } + + return nil +} + +func (manager *ClusterManager) createOrUpdateIngress(ctx context.Context, ingress *net.Ingress) error { + routeClient := manager.kubernetesClient.clientSet.NetworkingV1().Ingresses(ingress.GetNamespace()) + existingRoute, err := routeClient.Get(ctx, ingress.Name, metav1.GetOptions{}) + if err != nil { + _, err = routeClient.Create(ctx, ingress, globalCreateOptions) if err != nil { - return stacktrace.Propagate(err, "Failed to update gateway: %s", gateway.GetName()) + return stacktrace.Propagate(err, "Failed to create ingress: %s", ingress.GetName()) + } + } else { + if !deepCheckEqual(existingRoute.Spec, ingress.Spec) { + ingress.ResourceVersion = existingRoute.ResourceVersion + _, err = routeClient.Update(ctx, ingress, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update ingress: %s", ingress.GetName()) + } } } @@ -548,10 +614,12 @@ func (manager *ClusterManager) createOrUpdateEnvoyFilter(ctx context.Context, fi return stacktrace.Propagate(err, "Failed to create envoy filter: %s", filter.GetName()) } } else { - filter.ResourceVersion = existingFilter.ResourceVersion - _, err = envoyFilterClient.Update(ctx, filter, globalUpdateOptions) - if err != nil { - return stacktrace.Propagate(err, "Failed to update filter: %s", filter.GetName()) + if !deepCheckEqual(existingFilter.Spec, filter.Spec) { + filter.ResourceVersion = existingFilter.ResourceVersion + _, err = envoyFilterClient.Update(ctx, filter, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update filter: %s", filter.GetName()) + } } } return nil @@ -566,24 +634,36 @@ func (manager *ClusterManager) createOrUpdateAuthorizationPolicies(ctx context.C return stacktrace.Propagate(err, "Failed to create policy: %s", policy.GetName()) } } else { - policy.ResourceVersion = existingPolicy.ResourceVersion - _, err = authorizationPolicyClient.Update(ctx, policy, globalUpdateOptions) - if err != nil { - return stacktrace.Propagate(err, "Failed to update policy: %s", policy.GetName()) + if !deepCheckEqual(existingPolicy.Spec, policy.Spec) { + policy.ResourceVersion = existingPolicy.ResourceVersion + _, err = authorizationPolicyClient.Update(ctx, policy, globalUpdateOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to update policy: %s", policy.GetName()) + } } } return nil } -func (manager *ClusterManager) cleanUpServicesInNamespace(ctx context.Context, namespace string, servicesToKeep []corev1.Service) error { +func (manager *ClusterManager) cleanUpServicesInNamespace(ctx context.Context, namespace string, servicesToKeep []corev1.Service, gateways []gateway.Gateway) error { serviceClient := manager.kubernetesClient.clientSet.CoreV1().Services(namespace) + gatewayNames := lo.Map(gateways, func(item gateway.Gateway, _ int) string { return item.Name }) allServices, err := serviceClient.List(ctx, globalListOptions) if err != nil { return stacktrace.Propagate(err, "Failed to list services in namespace %s", namespace) } - for _, service := range allServices.Items { + + allServicesSkippingGateways := lo.Filter(allServices.Items, func(item corev1.Service, _ int) bool { + _, found := lo.Find(gatewayNames, func(gatewayName string) bool { return strings.HasPrefix(item.Name, gatewayName) }) + if found { + logrus.Infof("Skipping deletion service %s because it seems a service from one of the gateways %v", item.Name, gatewayNames) + } + return !found + }) + for _, service := range allServicesSkippingGateways { _, exists := lo.Find(servicesToKeep, func(item corev1.Service) bool { return item.Name == service.Name }) if !exists { + logrus.Infof("Deleting service %s", service.Name) err = serviceClient.Delete(ctx, service.Name, globalDeleteOptions) if err != nil { return stacktrace.Propagate(err, "Failed to delete service %s", service.GetName()) @@ -612,7 +692,6 @@ func (manager *ClusterManager) cleanUpDeploymentsInNamespace(ctx context.Context } func (manager *ClusterManager) cleanUpVirtualServicesInNamespace(ctx context.Context, namespace string, virtualServicesToKeep []v1alpha3.VirtualService) error { - virtServiceClient := manager.istioClient.clientSet.NetworkingV1alpha3().VirtualServices(namespace) allVirtServices, err := virtServiceClient.List(ctx, globalListOptions) if err != nil { @@ -632,7 +711,6 @@ func (manager *ClusterManager) cleanUpVirtualServicesInNamespace(ctx context.Con } func (manager *ClusterManager) cleanUpDestinationRulesInNamespace(ctx context.Context, namespace string, destinationRulesToKeep []v1alpha3.DestinationRule) error { - destRuleClient := manager.istioClient.clientSet.NetworkingV1alpha3().DestinationRules(namespace) allDestRules, err := destRuleClient.List(ctx, globalListOptions) if err != nil { @@ -651,19 +729,56 @@ func (manager *ClusterManager) cleanUpDestinationRulesInNamespace(ctx context.Co return nil } -func (manager *ClusterManager) cleanUpGatewaysInNamespace(ctx context.Context, namespace string, gatewaysToKeep []v1alpha3.Gateway) error { - - gatewayClient := manager.istioClient.clientSet.NetworkingV1alpha3().Gateways(namespace) +func (manager *ClusterManager) cleanUpGatewaysInNamespace(ctx context.Context, namespace string, gatewaysToKeep []gateway.Gateway) error { + gatewayClient := manager.gatewayClient.GatewayV1().Gateways(namespace) allGateways, err := gatewayClient.List(ctx, globalListOptions) if err != nil { return stacktrace.Propagate(err, "Failed to list gateways in namespace %s", namespace) } - for _, gateway := range allGateways.Items { - _, exists := lo.Find(gatewaysToKeep, func(item v1alpha3.Gateway) bool { return item.Name == gateway.Name }) + for _, gatewayItem := range allGateways.Items { + _, exists := lo.Find(gatewaysToKeep, func(item gateway.Gateway) bool { return item.Name == gatewayItem.Name }) + if !exists { + err = gatewayClient.Delete(ctx, gatewayItem.Name, globalDeleteOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to delete gateway %s", gatewayItem.GetName()) + } + } + } + + return nil +} + +func (manager *ClusterManager) cleanUpIngressesInNamespace(ctx context.Context, namespace string, ingressesToKeep []net.Ingress) error { + ingressClient := manager.kubernetesClient.clientSet.NetworkingV1().Ingresses(namespace) + allingresss, err := ingressClient.List(ctx, globalListOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to list Ingress in namespace %s", namespace) + } + for _, ingressItem := range allingresss.Items { + _, exists := lo.Find(ingressesToKeep, func(item net.Ingress) bool { return item.Name == ingressItem.Name }) + if !exists { + err = ingressClient.Delete(ctx, ingressItem.Name, globalDeleteOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to delete gateway %s", ingressItem.GetName()) + } + } + } + + return nil +} + +func (manager *ClusterManager) cleanUpHttpRoutesInNamespace(ctx context.Context, namespace string, routesToKeep []gateway.HTTPRoute) error { + routeClient := manager.gatewayClient.GatewayV1().HTTPRoutes(namespace) + allRoutes, err := routeClient.List(ctx, globalListOptions) + if err != nil { + return stacktrace.Propagate(err, "Failed to list Routes in namespace %s", namespace) + } + for _, routeItem := range allRoutes.Items { + _, exists := lo.Find(routesToKeep, func(item gateway.HTTPRoute) bool { return item.Name == routeItem.Name }) if !exists { - err = gatewayClient.Delete(ctx, gateway.Name, globalDeleteOptions) + err = routeClient.Delete(ctx, routeItem.Name, globalDeleteOptions) if err != nil { - return stacktrace.Propagate(err, "Failed to delete gateway %s", gateway.GetName()) + return stacktrace.Propagate(err, "Failed to delete gateway %s", routeItem.GetName()) } } } @@ -717,7 +832,8 @@ func isValid(clusterResources *types.ClusterResources) bool { return false } - if clusterResources.Gateway == nil && + if clusterResources.Gateways == nil && + clusterResources.HttpRoutes == nil && clusterResources.Deployments == nil && clusterResources.DestinationRules == nil && clusterResources.Services == nil && @@ -728,3 +844,15 @@ func isValid(clusterResources *types.ClusterResources) bool { return true } + +func deepCheckEqual(a, b interface{}) bool { + aj, err := json.Marshal(a) + if err != nil { + return false + } + bj, err := json.Marshal(b) + if err != nil { + return false + } + return string(aj) == string(bj) +} diff --git a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_factory.go b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_factory.go index 546f8b50..c554b56b 100644 --- a/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_factory.go +++ b/kardinal-manager/kardinal-manager/cluster_manager/cluster_manager_factory.go @@ -1,6 +1,8 @@ package cluster_manager import ( + "path/filepath" + "github.com/kurtosis-tech/stacktrace" "istio.io/client-go/pkg/clientset/versioned" "k8s.io/client-go/discovery/cached/memory" @@ -11,7 +13,7 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" "kardinal.kontrol/kardinal-manager/topology" - "path/filepath" + gatewayclientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" ) func CreateClusterManager() (*ClusterManager, error) { @@ -25,7 +27,12 @@ func CreateClusterManager() (*ClusterManager, error) { return nil, stacktrace.Propagate(err, "An error occurred while creating the Istio client") } - return NewClusterManager(kubernetesClientObj, istioClientObj), nil + gatewayclient, err := createGatewayApiClient(kubernetesClientObj.config) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred while creating the Istio client") + } + + return NewClusterManager(kubernetesClientObj, istioClientObj, gatewayclient), nil } func createKubernetesClient() (*kubernetesClient, error) { @@ -71,3 +78,12 @@ func createIstioClient(k8sConfig *rest.Config) (*istioClient, error) { return istioClientObj, nil } + +func createGatewayApiClient(k8sConfig *rest.Config) (*gatewayclientset.Clientset, error) { + gwc, err := gatewayclientset.NewForConfig(k8sConfig) + if err != nil { + return nil, stacktrace.Propagate(err, "An error occurred creating IstIo client from k8s config: %v", k8sConfig) + } + + return gwc, nil +} diff --git a/kardinal-manager/kardinal-manager/fetcher/fetcher.go b/kardinal-manager/kardinal-manager/fetcher/fetcher.go index e9fcb1e3..7e7fda40 100644 --- a/kardinal-manager/kardinal-manager/fetcher/fetcher.go +++ b/kardinal-manager/kardinal-manager/fetcher/fetcher.go @@ -3,15 +3,16 @@ package fetcher import ( "context" "encoding/json" + "io" + "net/http" + "net/url" + "time" + "github.com/kurtosis-tech/kardinal/libs/manager-kontrol-api/api/golang/types" "github.com/kurtosis-tech/stacktrace" "github.com/sirupsen/logrus" - "io" "kardinal.kontrol/kardinal-manager/cluster_manager" "kardinal.kontrol/kardinal-manager/utils" - "net/http" - "net/url" - "time" ) const ( @@ -29,7 +30,6 @@ func NewFetcher(clusterManager *cluster_manager.ClusterManager, configEndpoint s } func (fetcher *fetcher) Run(ctx context.Context) error { - fetcherTickerDuration := defaultTickerDuration fetcherJobDurationSecondsEnVarValue, err := utils.GetIntFromEnvVar(fetcherJobDurationSecondsEnvVarKey, "fetcher job duration seconds") @@ -73,7 +73,6 @@ func (fetcher *fetcher) fetchAndApply(ctx context.Context) error { } func (fetcher *fetcher) getClusterResourcesFromCloud() (*types.ClusterResources, error) { - configEndpointURL, err := url.Parse(fetcher.configEndpoint) if err != nil { return nil, stacktrace.Propagate(err, "An error occurred parsing the config endpoint '%s'", fetcher.configEndpoint) diff --git a/libs/cli-kontrol-api/api/golang/server/server.gen.go b/libs/cli-kontrol-api/api/golang/server/server.gen.go index 2810ba00..ff52ee3c 100644 --- a/libs/cli-kontrol-api/api/golang/server/server.gen.go +++ b/libs/cli-kontrol-api/api/golang/server/server.gen.go @@ -960,33 +960,35 @@ func (sh *strictHandler) GetTenantUuidTopology(ctx echo.Context, uuid Uuid) erro // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/8xZX2/bOBL/KgTvHmUruesBB7+1SbNrNC2KjbPAoggKRhrLbCSSJSknRuDvviApUZJF", - "2fKmTf0mi8P5++OPM/IzTnghOAOmFZ49Y0EkKUCDtL+WOX+c0NQ8pqASSYWmnOEZvsr5I6IpME2XFCSO", - "MDWvBdErHGFGCsAzvzvCEr6XVEKKZ1qWEGGVrKAgRq3eCCOqtKQsw9tthDUUIicaJk7LrmXzFvEl0itA", - "tWjYfFfRcU6UZSjq29v5ZW1bguKlTAZs2/3HmNwaYSU4U2Az/15KLs1DwpkGps0jESKnCTHOxN+U8ei5", - "pVFILkBq6vZDvb8bgVWLrPFo14cIFyob2lKAUiQL7Nq2o/xS2b3zYvz+GyTaBRjQa6x+4vqKlyx9QbSh", - "Yv1RFQjNL0Ox1vWbuJXB3eFc7UTdVRYZf8akwBthXKOlzYERclHawC7yUmmQCy54zrNNoM5pVqVAQ2Ef", - "/i1hiWf4X3FzsONKY/w+zcAEX3lGpCQb85vx9Agtn3ga0LKTEqcyqhzsZyPC1pleQDm5h7xfj2vzGi0N", - "eFeAjNJpqKrVmextX6ygRVf1GfbZTz2lDGrWRGagx2p20mM076TNk0plL5Q4Q779xLW4uue8XStl3q1x", - "P8YdWFA1uScKcsqgJX/PeQ6E9Vxv6L4xN+T+jYCk48vOeS5IBpOcJ0Q7FoMnUojcWifJA7B0QmaG25UO", - "ogDkmibNDdLfXUuQgwXpurKjOxTebhLnLJOg1AVnS5oFQnXL5vFpkvGKjjAD/cjlA2XZ+nxaqcBRIzKh", - "heDS4rG6cto7cOTuoxl++L+aUh4TQeNGIF6f11dOK9DKSCimj4SyiooOxDFJ7Pp4MummJ8RNpAAlSAJB", - "yNblONbsjds3ZHYbSIKlvVFXzy2j38sOLdTEZQghSC+jaG9wd/gOW2yEZx+z1bAxKwtT7IxoeCSbBs9m", - "7UmDZCRvIaCxsAapKGeqb8WkBfnlaPwV8qfbc/AmsZRSXawuTXcD1ak1BrlxHqZGe74XJAsvqnfH8d/c", - "+NraFfK0C72erymInG+KqgtqcwIRYn0+vWzW9/KBlQ4SARFCOQpoyr9jKuES1ufTGw+OPYacbNCSWQqS", - "TYO6VrihZC3qFj+QpxYKA7Wryb9/WOq5IHhZ7jjaFq507nNzuKgdZ/stROtNYLoZDK6vyM5HmqOMruGg", - "mlb1/bH9qTA4cNQbWBzMdN1BdPNMZFYW9SxL0pSazJD8c0vITWL9a7vS+/WosXMceL4ORGPkKVtyC0Oq", - "bYdycT2PP3CmJc/R289z7KkXz/D59Gx6ZpzlAhgRFM/wf+0rl3QbdLwCkpsC9EZ2LpFbQ8kKkgeUOCs4", - "wlVja3Jk5y1Dlfg30L87VTuj6X/Ozo4a1QKjbtezmzJJQKllmaPakAnyf85O6Brx/sTVFGm1xhoYYTp+", - "NtP3NnbMYjHCVSDAz1zphd1xW9LU0arNZPMF5EvYfCMS20F/e+fqDkq/4+nmqOzsuyX7bVcge85xRJCQ", - "PEWc5RuUuD29DxDbF1Zyn692KAm6t0bmZkSJBKsXKU10qUyF35y9OVxh/3ngB0DCOBJbR2AsLkxcF27H", - "q2Oj38R8VRXtHSqFpcc2rY3Z2OHWUHvjtIz5tOFShghK6/qXirIM1b5FiAvHzfkGPVK9QgR1zJ8Cdq9O", - "CrfP1YC9ddyegwNxF7yX9n0Xvld1Y/pP4BsdlKvnfof0domenvrXkOcDG8EJ5NW6OnQDdhOpXkIBL8Du", - "qJHKgbjXYJ02IReE0SU4Fh74vEYVApYKTplGEnQpmUIkz20n9qG8B8lAg/Lf4/2wXF2CSFffThFliDNA", - "RZlrOvHitQdN6xHtg8HH2uHXQMLTZEOK/Md0Uz+3tBFWZVEQuTHUXyXepziFJWW2Ezc1IE3K/3r78bqd", - "d00y5fpmk24cYQ+PuwB26qtt5AFeePETPsR+3B1xkK+p0nYkqQPz0DezH0NVFn/FsfYuHdls+Rr9qo5r", - "TG2GW3Hf9DB4bE+Jr9fJNPjpe1evnQTxNwh57vxPe1Rz4+FSP3xy//T+nD6n+3/yuG7H5/wUuh3d+hdx", - "BF/W0r+GLvehfPdf0RDYm1t/yWVhrbxG0rfbvwMAAP//YPcjilIhAAA=", + "H4sIAAAAAAAC/8xaW2/buBL+KwTPeZSt5JwusPBbmzRt0LQIGmeBRREUjDSW2UikSlJOjMD/fcGbLhZl", + "y5smzZsizn0+zozGecQJL0rOgCmJZ4+4JIIUoECYvxY5v5/QVD+mIBNBS0U5wzN8lvN7RFNgii4oCBxh", + "ql+XRC1xhBkpAM9q7ggL+FlRASmeKVFBhGWyhIJosWpdalKpBGUZ3mwirKAoc6JgYqVsa9ZvEV8gtQTk", + "ScPqu4IOM6KqQl5fX5+fet0CJK9EMqDb8B+icqOJZcmZBBP590JwoR8SzhQwpR9JWeY0IdqY+IfUFj22", + "JJaClyAUtfzg+bseGLHIKI+2bYhwIbMhlgKkJFmAa9P28pvTe1OT8dsfkCjrYECu1vqFqzNesfQJ3oaS", + "9dUlCJ2fhnz1+ZvYk0HucKy2vO4Ki7Q9Y0JQK2FcoYWJgSayXhrHTvJKKhBzXvKcZ+tAntPMhUBBYR7+", + "K2CBZ/g/cXOxYycxfp9moJ13lhEhyFr/zXh6gJQvPA1I2QqJFRk5A/vRiLAxpudQTm4h7+fjQr9GCw3e", + "JSAtdBrKqruTPfb5Elrlyt/hOvppXVIGJSsiMlBjJVvqMZK3wlYXFacvFDhdfPuBI0kCUk6AKbEencpz", + "lgmQ8q3hfW9YA/BotYFeXKic3BIJOWXQOr/lPAfCeu41LaFj7pCXVyUkHV+2rn1BMpjkPCHKFjt4IEWZ", + "GwNIcgcsnZCZbgFSBcECYkWTptH0uT0F2Zu3rilbskPubcf4A1FwT9YnnC1o1nc1s8f68WGScVe1/Oup", + "48ZRczqhRcmFQaxrSllNZJrVDEuayendn3JKeewOJ6SkMSmpjFfHvi01XnoJIYcCUOp5sQtI5kxbKkuS", + "QJBkyaXyyeod7mZ1+Qie+Q6wO8MNdLcsbdnV6Gnb4zTsCNpQ1qk93s46A3XPxR1l2ep46kTsTn2bo8m/", + "S71OeUMQTLw3JOTDZ0KZ61N70DtJzPn4TtO9FIFb4+w6WHA37qGOuBNNglcKDlb6VXMNq/Ql41CxV5Zv", + "SPAmkDLTwUdNUdeM/qw6Hc73YN3bgp1yVAcf5A6PY/N1WTdSzaoHC1YV7ZrUvnvwoEAwkrfw2mhYgZCU", + "M9nXosOC6uNo/DT0l+XZOxSZ8uFmRBumm4HseInBEno+0Ip1D5qTbKBPvzusTZ9rW1tcIUvbiO5ZulSq", + "NARDTevjfH5pCZ65bTWWhJzo3p+eGymUOV8X7quk7Qcpy9Xx9LQ53+mGoQ7WXlKWzu5On2qrSriA1fH0", + "qkb4DkWWNqhJHwUj1FydlruhYM39J3cgTq2rNNCfw+3Xf6cHB4MtQ9vETuYuM4eT2jG2P9K33gS2DYPO", + "9QWZfYXiKKMr2Cumlf269jwrDPbUq+40szPSflTf+igRWVX43RJJU6ojQ/LLFpHdjPTnYyf3+0FroHHg", + "+T7gzcZMFAtuYEiV+RQ4uTiPP3GmBM/R28tzXPcPPMPH06PpkTaWl8BISfEM/9+8skE3TsdLILlOQG+F", + "xgWyZyhZQnKHEqsFR9h9aOoYmf2Hrvf4A6iPVtTWquh/R0cHrU4Cq6euZVeVmeEXVY68Iu3kH1ZPqBfW", + "9sRuq2OkxgoYYSp+rCqabmJbWQxGuAw4eMmlmhuO64qmtqyaSDYbyW9h9Q1JbBZvmxubd5DqHU/XB0Vn", + "V6vvT7qB6FnDEUGl4CniLF+jxPL0FoKbJ2Zyl61mSRA0b4V0e0eJACMXSUVUJXWG3xy92Z/hel33CyCh", + "DYmNITAWF9qvE8vx4tjoT2LfpSt7+1JhymO7rI1h7NTW0IxmpYxZNdqQIYJSn/9KUpYhb1uEeGlrc75G", + "91QtEUEd9a8Bu2evCrePbiOwsbU9BwviLnhPzfsufM/8dP1v4BvtpfOLCov0dooeHvptqK4HxoNXEFe7", + "MBjogN1AyqeUgCdgd9R3oQVxb8B63QW5IIwuwFbhgXU3lQhYWnLKFBKgKsEkInluJrFP1S0IBgpk/ftY", + "/cXvmiBS7rcMRBniDFBR5YpOanJvQTN6RLtg8Nkb/BJIeJisSZH/mmnqeVMbYVkVBRFrXfpd4OsQp7Cg", + "zEziOgekCfnfbz9ftOOuSCbt3KzDjSNcw+MmgB3f2kZe4HlN/oovcf25O+IiX1CpzCeJd6yGvv72Y8hF", + "8Xdc69qkA4etOke/a+Iak5vhUbweehjct78SX26SafDTt86fvYrC3yDksfN/EwcNNzVc/MMX+6PI88w5", + "3f/vGDft1DF/DdOOav2qP6JeeurfUy53oXz7vxRCYG+6/oKLwmh5iaBvNv8EAAD//9m+lUriJAAA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/libs/cli-kontrol-api/api/golang/types/types.gen.go b/libs/cli-kontrol-api/api/golang/types/types.gen.go index 1b1496d5..32604a68 100644 --- a/libs/cli-kontrol-api/api/golang/types/types.gen.go +++ b/libs/cli-kontrol-api/api/golang/types/types.gen.go @@ -7,6 +7,7 @@ import ( appv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" + gateway "sigs.k8s.io/gateway-api/apis/v1" ) // Defines values for NodeType. @@ -36,9 +37,9 @@ type Edge struct { // Flow defines model for Flow. type Flow struct { - FlowId string `json:"flow-id"` - FlowUrls []string `json:"flow-urls"` - IsBaseline *bool `json:"is-baseline,omitempty"` + AccessEntry []IngressAccessEntry `json:"access-entry"` + FlowId string `json:"flow-id"` + IsBaseline *bool `json:"is-baseline,omitempty"` } // FlowSpec defines model for FlowSpec. @@ -47,6 +48,21 @@ type FlowSpec = []struct { ServiceName string `json:"service-name"` } +// GatewayConfig defines model for GatewayConfig. +type GatewayConfig struct { + Gateway gateway.Gateway `json:"gateway"` +} + +// IngressAccessEntry defines model for IngressAccessEntry. +type IngressAccessEntry struct { + FlowId string `json:"flow-id"` + FlowNamespace string `json:"flow-namespace"` + Hostname string `json:"hostname"` + Namespace string `json:"namespace"` + Service string `json:"service"` + Type string `json:"type"` +} + // IngressConfig defines model for IngressConfig. type IngressConfig struct { Ingress networkingv1.Ingress `json:"ingress"` @@ -54,8 +70,10 @@ type IngressConfig struct { // MainClusterConfig defines model for MainClusterConfig. type MainClusterConfig struct { + GatewayConfigs *[]GatewayConfig `json:"gateway-configs,omitempty"` IngressConfigs *[]IngressConfig `json:"ingress-configs,omitempty"` Namespace *string `json:"namespace,omitempty"` + RouteConfigs *[]RouteConfig `json:"route-configs,omitempty"` ServiceConfigs *[]ServiceConfig `json:"service-configs,omitempty"` } @@ -84,6 +102,11 @@ type NodeVersion struct { IsBaseline bool `json:"isBaseline"` } +// RouteConfig defines model for RouteConfig. +type RouteConfig struct { + HttpRoute gateway.HTTPRoute `json:"httpRoute"` +} + // ServiceConfig defines model for ServiceConfig. type ServiceConfig struct { Deployment appv1.Deployment `json:"deployment"` diff --git a/libs/cli-kontrol-api/api/typescript/client/types.d.ts b/libs/cli-kontrol-api/api/typescript/client/types.d.ts index 5c74267b..f698dc27 100644 --- a/libs/cli-kontrol-api/api/typescript/client/types.d.ts +++ b/libs/cli-kontrol-api/api/typescript/client/types.d.ts @@ -221,13 +221,23 @@ export interface components { MainClusterConfig: { "service-configs"?: components["schemas"]["ServiceConfig"][]; "ingress-configs"?: components["schemas"]["IngressConfig"][]; + "gateway-configs"?: components["schemas"]["GatewayConfig"][]; + "route-configs"?: components["schemas"]["RouteConfig"][]; namespace?: string; }; Flow: { "flow-id": string; - "flow-urls": string[]; + "access-entry": components["schemas"]["IngressAccessEntry"][]; "is-baseline"?: boolean; }; + IngressAccessEntry: { + "flow-id": string; + "flow-namespace": string; + hostname: string; + service: string; + namespace: string; + type: string; + }; FlowSpec: { /** @example backend-a:latest */ "image-locator": string; @@ -290,6 +300,12 @@ export interface components { IngressConfig: { ingress: unknown; }; + GatewayConfig: { + gateway: unknown; + }; + RouteConfig: { + httpRoute: unknown; + }; }; responses: { /** @description Error */ diff --git a/libs/cli-kontrol-api/go.mod b/libs/cli-kontrol-api/go.mod index 7552e9fb..37c69ee4 100644 --- a/libs/cli-kontrol-api/go.mod +++ b/libs/cli-kontrol-api/go.mod @@ -10,16 +10,17 @@ require ( github.com/oapi-codegen/runtime v1.1.1 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.30.2 + sigs.k8s.io/gateway-api v1.1.0 ) require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/swag v0.22.8 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.5.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -31,7 +32,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect golang.org/x/crypto v0.23.0 // indirect @@ -42,7 +42,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apimachinery v0.30.2 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/libs/cli-kontrol-api/go.sum b/libs/cli-kontrol-api/go.sum index 931ab920..4f89d0be 100644 --- a/libs/cli-kontrol-api/go.sum +++ b/libs/cli-kontrol-api/go.sum @@ -9,10 +9,10 @@ github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= -github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -23,8 +23,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -131,11 +131,13 @@ k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 h1:ao5hUqGhsqdm+bYbjH/pRkCs0unBGe9UyDahzs9zQzQ= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= +sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/libs/cli-kontrol-api/gomod2nix.toml b/libs/cli-kontrol-api/gomod2nix.toml index 990f7cd9..90f17b8a 100644 --- a/libs/cli-kontrol-api/gomod2nix.toml +++ b/libs/cli-kontrol-api/gomod2nix.toml @@ -34,6 +34,9 @@ schema = 3 [mod."github.com/adrg/xdg"] version = "v0.4.0" hash = "sha256-zGjkdUQmrVqD6rMO9oDY+TeJCpuqnHyvkPCaXDlac/U=" + [mod."github.com/ahmetb/gen-crd-api-reference-docs"] + version = "v0.3.0" + hash = "sha256-9W0jxXQn3E5bJ24SURs2tO1odSep/mIp0OIpjKCDM18=" [mod."github.com/andybalholm/brotli"] version = "v1.0.5" hash = "sha256-/qS8wU8yZQJ+uTOg66rEl9s7spxq9VIXF5L1BcaEClc=" @@ -98,11 +101,17 @@ schema = 3 version = "v0.0.0-20200823014737-9f7001d12a5f" hash = "sha256-n/7xo5CQqo4yLaWMSzSN1Muk/oqK6O5dgDOFWapeDUI=" [mod."github.com/emicklei/go-restful/v3"] - version = "v3.11.0" - hash = "sha256-Kp5ndPvj1PhK0nscM1pNNK2Q4ahUuLED/baEgL9pKNo=" + version = "v3.12.0" + hash = "sha256-w9mYeZiOWYEd5NLkOHYbaElfcbNurV6trMtbv2KPvL0=" [mod."github.com/evanphx/json-patch"] - version = "v5.6.0+incompatible" - hash = "sha256-F4hI+H6oWFCKa47+x74M4fqcwDtv3wXOLGVxqDn0F5c=" + version = "v5.7.0+incompatible" + hash = "sha256-6aTV41slcMtqRp2PdL4CKTDPUMoIXNP/tOgduzgGMCU=" + [mod."github.com/evanphx/json-patch/v5"] + version = "v5.9.0" + hash = "sha256-KG3giQTztHy6SX0wF2/Htje4MPs+1oEzfWhKDE0xl4U=" + [mod."github.com/fatih/color"] + version = "v1.16.0" + hash = "sha256-Aq/SM28aPJVzvapllQ64R/DM4aZ5CHPewcm/AUJPyJQ=" [mod."github.com/fatih/structs"] version = "v1.1.0" hash = "sha256-OCmubTLF1anwNnkvFZDYHnF6hFlX0WDoe/9+dDlaMPM=" @@ -131,14 +140,14 @@ schema = 3 version = "v1.4.1" hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY=" [mod."github.com/go-openapi/jsonpointer"] - version = "v0.20.2" - hash = "sha256-z9IZxP+JvJ1WvrHE7qbAZQqJ3XMx1uD0S611shTMna8=" + version = "v0.21.0" + hash = "sha256-bB8XTzo4hzXemi8Ey3tIXia3mfn38bvwIzKYLJYC650=" [mod."github.com/go-openapi/jsonreference"] - version = "v0.20.2" - hash = "sha256-klWZKK7LZqSg3HMIrSkjh/NwaZTr+8kTW2ok2+JlioE=" + version = "v0.21.0" + hash = "sha256-lkFb/kP0qt8L1jsLYLt+jXTY6jSk5SYJbfgAKKVlQYQ=" [mod."github.com/go-openapi/swag"] - version = "v0.22.8" - hash = "sha256-YMJpCbWT9ABlCmuLjxQRwhddlYYqDBWcyDIdnV8bAMc=" + version = "v0.23.0" + hash = "sha256-D5CzsSQ3SYJLwXT6BDahnG66LI8du59Dy1mY4KutA7A=" [mod."github.com/go-playground/locales"] version = "v0.14.1" hash = "sha256-BMJGAexq96waZn60DJXZfByRHb8zA/JP/i6f/YrW9oQ=" @@ -154,6 +163,9 @@ schema = 3 [mod."github.com/go-test/deep"] version = "v1.0.8" hash = "sha256-AKOpW32qcq1BTVEPC6MshiFA3ROucnmlJMIfvwYXvNY=" + [mod."github.com/gobuffalo/flect"] + version = "v1.0.2" + hash = "sha256-r0UXCY4OI/VIawB38WmZ4nAe/4qKsyqT5LD+UVhOylw=" [mod."github.com/goccy/go-json"] version = "v0.10.2" hash = "sha256-6fMD2/Rku8HT0zDdeA23pX0YxbohiIOC8OJNYbylJTQ=" @@ -209,8 +221,8 @@ schema = 3 version = "v1.8.1" hash = "sha256-nDABvAhlYgxUW2N/brrep7NkQXoSGcHhA+XI4+tK0F0=" [mod."github.com/gorilla/websocket"] - version = "v1.5.0" - hash = "sha256-EYVgkSEMo4HaVrsWKqnsYRp8SSS8gNf7t+Elva02Ofc=" + version = "v1.5.1" + hash = "sha256-eHZ/U+eeE5tSgWc1jEDuBwtTRbXKP9fqP9zfW4Zw8T0=" [mod."github.com/gregjones/httpcache"] version = "v0.0.0-20180305231024-9cad4c3443a7" hash = "sha256-2ngFfFuSm8YSTNZWGQuN5yTpsXlwY2R8aaIzjDnjTXI=" @@ -304,6 +316,9 @@ schema = 3 [mod."github.com/microcosm-cc/bluemonday"] version = "v1.0.25" hash = "sha256-/crG5s6cDrJ55nkDBwugLUpY7U+vQuHpCkKm7nnN8Zc=" + [mod."github.com/miekg/dns"] + version = "v1.1.58" + hash = "sha256-UGvyC1Abh2S5VaAUCV9AUuDMrCvpiWQy/UnYM9DfIB8=" [mod."github.com/moby/spdystream"] version = "v0.2.0" hash = "sha256-Feme5UoWuBCvnLPKw1ozKkF3SM7PAjjPFQZ3TJhghR0=" @@ -446,8 +461,8 @@ schema = 3 version = "v0.23.0" hash = "sha256-6hZjb/OazWFBef0C/aH63l49YQnzCh2vpIduzyfSSG8=" [mod."golang.org/x/exp"] - version = "v0.0.0-20220303212507-bbda1eaf7a17" - hash = "sha256-E8mRbh+ptVwyqnxBfYEtJ8pGqjWUvxUxVsz9vXxDIo4=" + version = "v0.0.0-20240416160154-fe59bbe5cc7f" + hash = "sha256-168CD9hlLJaQ7stQk/ztlP3zgaWXUMbIHa38gAeRRs4=" [mod."golang.org/x/mod"] version = "v0.17.0" hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" @@ -455,8 +470,8 @@ schema = 3 version = "v0.25.0" hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54=" [mod."golang.org/x/oauth2"] - version = "v0.16.0" - hash = "sha256-fJfS9dKaq82WaYSVWHMnxNLWH8+L4aip/C1AfJi4FFI=" + version = "v0.19.0" + hash = "sha256-IYdkq8R8BXnwoBt/ZLAMJr0DkLZDMVkjeBJNQ/Z9Bes=" [mod."golang.org/x/sync"] version = "v0.7.0" hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" @@ -485,8 +500,8 @@ schema = 3 version = "v0.126.0" hash = "sha256-G/J0Aba+S35gE7VevU2WrrbwQRsJCSj14DVSLTqz0vE=" [mod."google.golang.org/appengine"] - version = "v1.6.8" - hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" + version = "v1.6.7" + hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4=" [mod."google.golang.org/genproto"] version = "v0.0.0-20230530153820-e85fd2cbaebc" hash = "sha256-xuUQD0+WiF+LGKhQCCwaA5WKlZz6EG9WhClfEonHedk=" @@ -497,8 +512,11 @@ schema = 3 version = "v0.0.0-20240314234333-6e1732d8331c" hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" + [mod."google.golang.org/grpc/cmd/protoc-gen-go-grpc"] + version = "v1.3.0" + hash = "sha256-6M1gOZMu3hN08M/giGcVv4ic5ChGcUfKLUlUtZxvF7E=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" @@ -526,24 +544,45 @@ schema = 3 [mod."k8s.io/api"] version = "v0.30.2" hash = "sha256-sq8jdb0wnAIhTO/hactsJ34mRuUgEuUNOrKaQasbHpQ=" + [mod."k8s.io/apiextensions-apiserver"] + version = "v0.30.0" + hash = "sha256-1/T2iSEHRGZttj9pgl5VpQ3yAx7+GRMi7g9kLeaRvMM=" [mod."k8s.io/apimachinery"] version = "v0.30.2" hash = "sha256-EBWG9PlSfRwMed/u6oF8ME8n44/U5HGBCacH+Mns2UI=" [mod."k8s.io/client-go"] version = "v0.30.2" hash = "sha256-KwgEXnowk01jImaHhOStbVWc3dDVZKF2nVvfsJAvtgo=" + [mod."k8s.io/code-generator"] + version = "v0.30.0" + hash = "sha256-MCco4LG1k9A6tP/AHqAAZb0EyOG/IOhIC5R76J56cYs=" + [mod."k8s.io/gengo"] + version = "v0.0.0-20230829151522-9cce18d56c01" + hash = "sha256-JgsgX2R/iu1I96dQ45ZSe4AW1PIgEpArsF3Xa+yzTxI=" [mod."k8s.io/gengo/v2"] version = "v2.0.0-20240228010128-51d4e06bde70" hash = "sha256-igAJQwUliynE2iDbBYc2HONd744+r7o3mQtFyYDYLb4=" + [mod."k8s.io/klog"] + version = "v0.2.0" + hash = "sha256-YabDBrcEBN72ClwZ1bs9bA+2gjH9ZD7omGCjtWY/YUo=" [mod."k8s.io/klog/v2"] version = "v2.120.1" hash = "sha256-PU3q5ODCHEO8z//zUKsCq2tky6ZNx4xFl3nHSPJpuW8=" [mod."k8s.io/kube-openapi"] - version = "v0.0.0-20240228011516-70dd3763d340" - hash = "sha256-2BUbi2eNJFSTcmLyVYBYBe9Lhi0TVJoH2zVQlQ9eZIA=" + version = "v0.0.0-20240423202451-8948a665c108" + hash = "sha256-EXaKmh3z505YcvpGBCP+nwk6EIqH7H09kakalWKXLxk=" [mod."k8s.io/utils"] - version = "v0.0.0-20230726121419-3b25d923346b" - hash = "sha256-r8VhhAYGPouGGgXu02ymVwF6k+WmBc4ij0qynPRtXEE=" + version = "v0.0.0-20240423183400-0849a56e8f22" + hash = "sha256-4CiDxKJMHKJ173hu3KsVBD4XdAfGZRMiHIFeqW3AwYs=" + [mod."sigs.k8s.io/controller-runtime"] + version = "v0.18.0" + hash = "sha256-383Pun8npG9f4ITz3YGHunU48X6rvJtHd03EdNLjMhQ=" + [mod."sigs.k8s.io/controller-tools"] + version = "v0.15.0" + hash = "sha256-McJAHNx3tTjEww+/Sbz6vG5YR5z+WUovuzK2lH21Vnk=" + [mod."sigs.k8s.io/gateway-api"] + version = "v1.1.0" + hash = "sha256-v/Naf9D35XsQLieooRseVTfDQ7KwCqViX9mRviVeLDw=" [mod."sigs.k8s.io/json"] version = "v0.0.0-20221116044647-bc3834ca7abd" hash = "sha256-XDBMN2o450IHiAwEpBVsvo9e7tYZa+EXWrifUNTdNMU=" @@ -551,5 +590,5 @@ schema = 3 version = "v4.4.1" hash = "sha256-FcZHHZCKNNZW6/s1T1sKiS5Vj1TpHPmxVWr6YlL60xA=" [mod."sigs.k8s.io/yaml"] - version = "v1.3.0" - hash = "sha256-RVp8vca2wxg8pcBDYospG7Z1dujoH7zXNu2rgZ1kky0=" + version = "v1.4.0" + hash = "sha256-Hd/M0vIfIVobDd87eb58p1HyVOjYWNlGq2bRXfmtVno=" diff --git a/libs/cli-kontrol-api/specs/api.yaml b/libs/cli-kontrol-api/specs/api.yaml index 7386f088..411a99cc 100644 --- a/libs/cli-kontrol-api/specs/api.yaml +++ b/libs/cli-kontrol-api/specs/api.yaml @@ -182,11 +182,11 @@ paths: parameters: - $ref: "#/components/parameters/uuid" responses: - '500': + "500": $ref: "#/components/responses/Error" - '404': + "404": $ref: "#/components/responses/NotFound" - '200': + "200": description: Successful response content: application/x-yaml: @@ -244,7 +244,6 @@ components: schema: type: string - template-name: name: template-name in: path @@ -265,6 +264,14 @@ components: type: array items: $ref: "#/components/schemas/IngressConfig" + gateway-configs: + type: array + items: + $ref: "#/components/schemas/GatewayConfig" + route-configs: + type: array + items: + $ref: "#/components/schemas/RouteConfig" namespace: type: string @@ -273,15 +280,38 @@ components: properties: flow-id: type: string - flow-urls: + access-entry: type: array items: - type: string + $ref: "#/components/schemas/IngressAccessEntry" is-baseline: type: boolean required: - flow-id - - flow-urls + - access-entry + + IngressAccessEntry: + type: object + properties: + flow-id: + type: string + flow-namespace: + type: string + hostname: + type: string + service: + type: string + namespace: + type: string + type: + type: string + required: + - flow-id + - flow-namespace + - hostname + - service + - namespace + - type FlowSpec: type: array @@ -438,3 +468,25 @@ components: name: networkingv1 required: - ingress + + GatewayConfig: + type: object + properties: + gateway: + x-go-type: gateway.Gateway + x-go-type-import: + path: sigs.k8s.io/gateway-api/apis/v1 + name: gateway + required: + - gateway + + RouteConfig: + type: object + properties: + httpRoute: + x-go-type: gateway.HTTPRoute + x-go-type-import: + path: sigs.k8s.io/gateway-api/apis/v1 + name: gateway + required: + - httpRoute diff --git a/libs/manager-kontrol-api/api/golang/server/server.gen.go b/libs/manager-kontrol-api/api/golang/server/server.gen.go index e09c4592..f1a585c7 100644 --- a/libs/manager-kontrol-api/api/golang/server/server.gen.go +++ b/libs/manager-kontrol-api/api/golang/server/server.gen.go @@ -160,19 +160,20 @@ func (sh *strictHandler) GetTenantUuidClusterResources(ctx echo.Context, uuid Uu // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/8RWTXPbNhD9K5ptj5RgxZcOb5468Wg6tTOK3R4yHg8CraiNSQBdLJSwHv73DgjqI7Ek", - "+9A2J4Lct4u3D9A+PYFxjXcWrQQon8Br1g0Kcv8WIy3Sc4HBMHkhZ6GEu7vZ5cgtR7LCEWNwkQ1CAZRi", - "XssKCrC6QShzfgGMf0ViXEApHLGAYFbY6FRYWp9wQZhsBV3XJXDwzgbsCVw7uXlMC+OsoJW01N7XZHQi", - "oz6HxOhpr+LPjEso4Se160vlaFDzofTMLl3e7LvGLH71aAQXI2R2DAkyJKfav9YxCPJ86DkLxs4jC+U3", - "HWXlmP7u2T14V5MZIiTY9Iuv48qNh77X008oejq52E97n7JaKHbIMTXecd/8IOyQCEUWvAQKQm5CTpma", - "0Mq4cso/Vkp7CiqgiUzSqk1WamtgoJl1C70SvnZts7kHB+lq78N6OrncQk+TzPAdx8dfQmKoPakUUutj", - "TIKQzQpyrE/Kp2u/0ueTy13KPNb4knY563XiWZQvjh/JVmqbeIg12rVrH5ZUb347pxm/TfB3PfpHsK20", - "4BfdHqV3NcT/B2oBeU3mxCkbx7ieTj5k3GlKGXvwyqXQsSu3Jpao64cXuWwF+iNnvIrUf3GEuw/u02c0", - "krr4Zrw9G03GLTA9l44bLWk4k5XzN7AtRFawQk6VGgxBV3hgQm/Qrxu0twmbh/rGAT7mArs9iszs/kRD", - "t8OWaGOTKrydz2/mUMDs+t0NFPDnxfx6dn21V2LfT2hQQ0jqFPtdW10hq9+cFXb16OL9DApYI4dsAtPJ", - "2eQs7e48Wu0JSjjvP+XT67VUglZbUU/J4Dplsi+Med8YKuzvQDqCfjDNFlDCFcptn3oXafHMTopv7Pfj", - "YY13ENXba3f/nWe+OTv71xzzGcUDrvkhGoMhLGM92vDIY3ypYy3HdthSVtnj+1EQm0ZzC+XGabd/L0YL", - "XJKlfscCRFdJH3iu+33Xdd0/AQAA//8hn+431AgAAA==", + "H4sIAAAAAAAC/8SWS3PjNgzHv4oH7VEW482lo1um2U09nSYZr9MedjIZrgzL2EgkC4LedTP67h2K8iMb", + "W8mhj5Me+AP8AaQEPEFpG2cNGvFQPIHTrBsU5O4pBFrE6wJ9yeSErIEC7u6mlyO7HMkKR4zeBi4RMqBo", + "c1pWkIHRDUKR/DNg/DMQ4wIK4YAZ+HKFjY6BZeOizguTqaBt2yj2zhqPHcC1lZvHeFNaI2gk3mrnaip1", + "hFFffCR6Ooj4I+MSCvhB7fNSyerVrA89NUubFvsuMYPfHJaCixEyW4Yo6Z1j7J/r4AV51uecCsbWIQul", + "Jx1kZZn+6ugenK2p7C0k2HQ338aVHfd5ryefUfQkvzh0u41eG8j2yjE1znKXfF/Y3hGyVPACyAvZnKwq", + "a0Ij48oq91gp7cgrj2Vgko3aesW0egLNrDfQVcLVdtNsz8FRXO2cX0/yy510GDLJ94yPP/lIqB2paFLr", + "UyReyKQKcqgHy6drt9Ln+eXeZRZqfK12yettxTMoXy0/kqnUzvEYNZq13Twsqd5+O8PE76P8Q6f+P2gr", + "LfhVb06D9oL8Kl2HGaudqEf0VPm83+7eOE7bTie3fSXiHtgGwdepfpnPb2dR+h9wkakYvR+gMij5NKmG", + "eQzK0a/h2a4dhfDIayoHGErLuJ7kH5NuGCNpj5JE0ymGNbEEXT+8yrI75L8njzdB/RvnfP/Cfv6CpcQs", + "nvWAF//v0i4wXpeWGy2xg5GR83ewC0RGsEKOkRr0Xld4pI1t1W/rRvOoTZ1v2yY/pQD7NbJEdj+Q0Lxf", + "Ek1oYoT3s9nNDDKYXn+4gQz+uJhdT6+vDkIcNl3qqyEkdbT9po2ukNWv1gjbenRxO4UM1sg+dcpJfpaf", + "xdWtQ6MdQQHn3au0e10tlaDRRtRTnAJaVabmOebD7llhdwbiFnR/7+kCCrhCmXeud4EWL3pu9mxG+XS8", + "xnuJ6maQ9v67weLd2dk/Nla8QDwyWnwMZYneL0M92nKkXrfUoZZTK+yQVRqEunkkNI3mDRTbcWQ3g40W", + "uCRD3YoZiK5ifeBl3e/btm3/DgAA//9xh5wN+QkAAA==", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/libs/manager-kontrol-api/api/golang/types/types.gen.go b/libs/manager-kontrol-api/api/golang/types/types.gen.go index 1e9463f9..7b45ec4d 100644 --- a/libs/manager-kontrol-api/api/golang/types/types.gen.go +++ b/libs/manager-kontrol-api/api/golang/types/types.gen.go @@ -8,6 +8,8 @@ import ( v1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" + net "k8s.io/api/networking/v1" + gateway "sigs.k8s.io/gateway-api/apis/v1" ) // Defines values for ResponseType. @@ -23,7 +25,9 @@ type ClusterResources struct { Deployments *[]appsv1.Deployment `json:"deployments,omitempty"` DestinationRules *[]v1alpha3.DestinationRule `json:"destination_rules,omitempty"` EnvoyFilters *[]v1alpha3.EnvoyFilter `json:"envoy_filters,omitempty"` - Gateway *v1alpha3.Gateway `json:"gateway,omitempty"` + Gateways *[]gateway.Gateway `json:"gateways,omitempty"` + HttpRoutes *[]gateway.HTTPRoute `json:"http_routes,omitempty"` + Ingresses *[]net.Ingress `json:"ingresses,omitempty"` Services *[]corev1.Service `json:"services,omitempty"` VirtualServices *[]v1alpha3.VirtualService `json:"virtual_services,omitempty"` } diff --git a/libs/manager-kontrol-api/api/typescript/client/types.d.ts b/libs/manager-kontrol-api/api/typescript/client/types.d.ts index ec8fbad2..9b2cd38c 100644 --- a/libs/manager-kontrol-api/api/typescript/client/types.d.ts +++ b/libs/manager-kontrol-api/api/typescript/client/types.d.ts @@ -43,7 +43,9 @@ export interface components { deployments?: unknown[]; virtual_services?: unknown[]; destination_rules?: unknown[]; - gateway?: unknown; + gateways?: unknown[]; + http_routes?: unknown[]; + ingresses?: unknown[]; envoy_filters?: unknown[]; authorization_policies?: unknown[]; }; diff --git a/libs/manager-kontrol-api/go.mod b/libs/manager-kontrol-api/go.mod index 1a278853..2a0d2acc 100644 --- a/libs/manager-kontrol-api/go.mod +++ b/libs/manager-kontrol-api/go.mod @@ -10,17 +10,18 @@ require ( github.com/oapi-codegen/runtime v1.1.1 istio.io/client-go v1.22.1 k8s.io/api v0.30.2 + sigs.k8s.io/gateway-api v1.1.0 ) require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/go-logr/logr v1.4.1 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/swag v0.22.8 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.5.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/invopop/yaml v0.2.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -46,7 +47,7 @@ require ( istio.io/api v1.22.1-0.20240524024004-b6815be0740d // indirect k8s.io/apimachinery v0.30.2 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/libs/manager-kontrol-api/go.sum b/libs/manager-kontrol-api/go.sum index 963bbb47..92ae0290 100644 --- a/libs/manager-kontrol-api/go.sum +++ b/libs/manager-kontrol-api/go.sum @@ -9,10 +9,10 @@ github.com/getkin/kin-openapi v0.125.0 h1:jyQCyf2qXS1qvs2U00xQzkGCqYPhEhZDmSmVt6 github.com/getkin/kin-openapi v0.125.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= -github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -25,8 +25,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -71,8 +71,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -141,11 +141,13 @@ k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22 h1:ao5hUqGhsqdm+bYbjH/pRkCs0unBGe9UyDahzs9zQzQ= +k8s.io/utils v0.0.0-20240423183400-0849a56e8f22/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM= +sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/libs/manager-kontrol-api/gomod2nix.toml b/libs/manager-kontrol-api/gomod2nix.toml index 990f7cd9..90f17b8a 100644 --- a/libs/manager-kontrol-api/gomod2nix.toml +++ b/libs/manager-kontrol-api/gomod2nix.toml @@ -34,6 +34,9 @@ schema = 3 [mod."github.com/adrg/xdg"] version = "v0.4.0" hash = "sha256-zGjkdUQmrVqD6rMO9oDY+TeJCpuqnHyvkPCaXDlac/U=" + [mod."github.com/ahmetb/gen-crd-api-reference-docs"] + version = "v0.3.0" + hash = "sha256-9W0jxXQn3E5bJ24SURs2tO1odSep/mIp0OIpjKCDM18=" [mod."github.com/andybalholm/brotli"] version = "v1.0.5" hash = "sha256-/qS8wU8yZQJ+uTOg66rEl9s7spxq9VIXF5L1BcaEClc=" @@ -98,11 +101,17 @@ schema = 3 version = "v0.0.0-20200823014737-9f7001d12a5f" hash = "sha256-n/7xo5CQqo4yLaWMSzSN1Muk/oqK6O5dgDOFWapeDUI=" [mod."github.com/emicklei/go-restful/v3"] - version = "v3.11.0" - hash = "sha256-Kp5ndPvj1PhK0nscM1pNNK2Q4ahUuLED/baEgL9pKNo=" + version = "v3.12.0" + hash = "sha256-w9mYeZiOWYEd5NLkOHYbaElfcbNurV6trMtbv2KPvL0=" [mod."github.com/evanphx/json-patch"] - version = "v5.6.0+incompatible" - hash = "sha256-F4hI+H6oWFCKa47+x74M4fqcwDtv3wXOLGVxqDn0F5c=" + version = "v5.7.0+incompatible" + hash = "sha256-6aTV41slcMtqRp2PdL4CKTDPUMoIXNP/tOgduzgGMCU=" + [mod."github.com/evanphx/json-patch/v5"] + version = "v5.9.0" + hash = "sha256-KG3giQTztHy6SX0wF2/Htje4MPs+1oEzfWhKDE0xl4U=" + [mod."github.com/fatih/color"] + version = "v1.16.0" + hash = "sha256-Aq/SM28aPJVzvapllQ64R/DM4aZ5CHPewcm/AUJPyJQ=" [mod."github.com/fatih/structs"] version = "v1.1.0" hash = "sha256-OCmubTLF1anwNnkvFZDYHnF6hFlX0WDoe/9+dDlaMPM=" @@ -131,14 +140,14 @@ schema = 3 version = "v1.4.1" hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY=" [mod."github.com/go-openapi/jsonpointer"] - version = "v0.20.2" - hash = "sha256-z9IZxP+JvJ1WvrHE7qbAZQqJ3XMx1uD0S611shTMna8=" + version = "v0.21.0" + hash = "sha256-bB8XTzo4hzXemi8Ey3tIXia3mfn38bvwIzKYLJYC650=" [mod."github.com/go-openapi/jsonreference"] - version = "v0.20.2" - hash = "sha256-klWZKK7LZqSg3HMIrSkjh/NwaZTr+8kTW2ok2+JlioE=" + version = "v0.21.0" + hash = "sha256-lkFb/kP0qt8L1jsLYLt+jXTY6jSk5SYJbfgAKKVlQYQ=" [mod."github.com/go-openapi/swag"] - version = "v0.22.8" - hash = "sha256-YMJpCbWT9ABlCmuLjxQRwhddlYYqDBWcyDIdnV8bAMc=" + version = "v0.23.0" + hash = "sha256-D5CzsSQ3SYJLwXT6BDahnG66LI8du59Dy1mY4KutA7A=" [mod."github.com/go-playground/locales"] version = "v0.14.1" hash = "sha256-BMJGAexq96waZn60DJXZfByRHb8zA/JP/i6f/YrW9oQ=" @@ -154,6 +163,9 @@ schema = 3 [mod."github.com/go-test/deep"] version = "v1.0.8" hash = "sha256-AKOpW32qcq1BTVEPC6MshiFA3ROucnmlJMIfvwYXvNY=" + [mod."github.com/gobuffalo/flect"] + version = "v1.0.2" + hash = "sha256-r0UXCY4OI/VIawB38WmZ4nAe/4qKsyqT5LD+UVhOylw=" [mod."github.com/goccy/go-json"] version = "v0.10.2" hash = "sha256-6fMD2/Rku8HT0zDdeA23pX0YxbohiIOC8OJNYbylJTQ=" @@ -209,8 +221,8 @@ schema = 3 version = "v1.8.1" hash = "sha256-nDABvAhlYgxUW2N/brrep7NkQXoSGcHhA+XI4+tK0F0=" [mod."github.com/gorilla/websocket"] - version = "v1.5.0" - hash = "sha256-EYVgkSEMo4HaVrsWKqnsYRp8SSS8gNf7t+Elva02Ofc=" + version = "v1.5.1" + hash = "sha256-eHZ/U+eeE5tSgWc1jEDuBwtTRbXKP9fqP9zfW4Zw8T0=" [mod."github.com/gregjones/httpcache"] version = "v0.0.0-20180305231024-9cad4c3443a7" hash = "sha256-2ngFfFuSm8YSTNZWGQuN5yTpsXlwY2R8aaIzjDnjTXI=" @@ -304,6 +316,9 @@ schema = 3 [mod."github.com/microcosm-cc/bluemonday"] version = "v1.0.25" hash = "sha256-/crG5s6cDrJ55nkDBwugLUpY7U+vQuHpCkKm7nnN8Zc=" + [mod."github.com/miekg/dns"] + version = "v1.1.58" + hash = "sha256-UGvyC1Abh2S5VaAUCV9AUuDMrCvpiWQy/UnYM9DfIB8=" [mod."github.com/moby/spdystream"] version = "v0.2.0" hash = "sha256-Feme5UoWuBCvnLPKw1ozKkF3SM7PAjjPFQZ3TJhghR0=" @@ -446,8 +461,8 @@ schema = 3 version = "v0.23.0" hash = "sha256-6hZjb/OazWFBef0C/aH63l49YQnzCh2vpIduzyfSSG8=" [mod."golang.org/x/exp"] - version = "v0.0.0-20220303212507-bbda1eaf7a17" - hash = "sha256-E8mRbh+ptVwyqnxBfYEtJ8pGqjWUvxUxVsz9vXxDIo4=" + version = "v0.0.0-20240416160154-fe59bbe5cc7f" + hash = "sha256-168CD9hlLJaQ7stQk/ztlP3zgaWXUMbIHa38gAeRRs4=" [mod."golang.org/x/mod"] version = "v0.17.0" hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" @@ -455,8 +470,8 @@ schema = 3 version = "v0.25.0" hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54=" [mod."golang.org/x/oauth2"] - version = "v0.16.0" - hash = "sha256-fJfS9dKaq82WaYSVWHMnxNLWH8+L4aip/C1AfJi4FFI=" + version = "v0.19.0" + hash = "sha256-IYdkq8R8BXnwoBt/ZLAMJr0DkLZDMVkjeBJNQ/Z9Bes=" [mod."golang.org/x/sync"] version = "v0.7.0" hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" @@ -485,8 +500,8 @@ schema = 3 version = "v0.126.0" hash = "sha256-G/J0Aba+S35gE7VevU2WrrbwQRsJCSj14DVSLTqz0vE=" [mod."google.golang.org/appengine"] - version = "v1.6.8" - hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" + version = "v1.6.7" + hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4=" [mod."google.golang.org/genproto"] version = "v0.0.0-20230530153820-e85fd2cbaebc" hash = "sha256-xuUQD0+WiF+LGKhQCCwaA5WKlZz6EG9WhClfEonHedk=" @@ -497,8 +512,11 @@ schema = 3 version = "v0.0.0-20240314234333-6e1732d8331c" hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" + [mod."google.golang.org/grpc/cmd/protoc-gen-go-grpc"] + version = "v1.3.0" + hash = "sha256-6M1gOZMu3hN08M/giGcVv4ic5ChGcUfKLUlUtZxvF7E=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" @@ -526,24 +544,45 @@ schema = 3 [mod."k8s.io/api"] version = "v0.30.2" hash = "sha256-sq8jdb0wnAIhTO/hactsJ34mRuUgEuUNOrKaQasbHpQ=" + [mod."k8s.io/apiextensions-apiserver"] + version = "v0.30.0" + hash = "sha256-1/T2iSEHRGZttj9pgl5VpQ3yAx7+GRMi7g9kLeaRvMM=" [mod."k8s.io/apimachinery"] version = "v0.30.2" hash = "sha256-EBWG9PlSfRwMed/u6oF8ME8n44/U5HGBCacH+Mns2UI=" [mod."k8s.io/client-go"] version = "v0.30.2" hash = "sha256-KwgEXnowk01jImaHhOStbVWc3dDVZKF2nVvfsJAvtgo=" + [mod."k8s.io/code-generator"] + version = "v0.30.0" + hash = "sha256-MCco4LG1k9A6tP/AHqAAZb0EyOG/IOhIC5R76J56cYs=" + [mod."k8s.io/gengo"] + version = "v0.0.0-20230829151522-9cce18d56c01" + hash = "sha256-JgsgX2R/iu1I96dQ45ZSe4AW1PIgEpArsF3Xa+yzTxI=" [mod."k8s.io/gengo/v2"] version = "v2.0.0-20240228010128-51d4e06bde70" hash = "sha256-igAJQwUliynE2iDbBYc2HONd744+r7o3mQtFyYDYLb4=" + [mod."k8s.io/klog"] + version = "v0.2.0" + hash = "sha256-YabDBrcEBN72ClwZ1bs9bA+2gjH9ZD7omGCjtWY/YUo=" [mod."k8s.io/klog/v2"] version = "v2.120.1" hash = "sha256-PU3q5ODCHEO8z//zUKsCq2tky6ZNx4xFl3nHSPJpuW8=" [mod."k8s.io/kube-openapi"] - version = "v0.0.0-20240228011516-70dd3763d340" - hash = "sha256-2BUbi2eNJFSTcmLyVYBYBe9Lhi0TVJoH2zVQlQ9eZIA=" + version = "v0.0.0-20240423202451-8948a665c108" + hash = "sha256-EXaKmh3z505YcvpGBCP+nwk6EIqH7H09kakalWKXLxk=" [mod."k8s.io/utils"] - version = "v0.0.0-20230726121419-3b25d923346b" - hash = "sha256-r8VhhAYGPouGGgXu02ymVwF6k+WmBc4ij0qynPRtXEE=" + version = "v0.0.0-20240423183400-0849a56e8f22" + hash = "sha256-4CiDxKJMHKJ173hu3KsVBD4XdAfGZRMiHIFeqW3AwYs=" + [mod."sigs.k8s.io/controller-runtime"] + version = "v0.18.0" + hash = "sha256-383Pun8npG9f4ITz3YGHunU48X6rvJtHd03EdNLjMhQ=" + [mod."sigs.k8s.io/controller-tools"] + version = "v0.15.0" + hash = "sha256-McJAHNx3tTjEww+/Sbz6vG5YR5z+WUovuzK2lH21Vnk=" + [mod."sigs.k8s.io/gateway-api"] + version = "v1.1.0" + hash = "sha256-v/Naf9D35XsQLieooRseVTfDQ7KwCqViX9mRviVeLDw=" [mod."sigs.k8s.io/json"] version = "v0.0.0-20221116044647-bc3834ca7abd" hash = "sha256-XDBMN2o450IHiAwEpBVsvo9e7tYZa+EXWrifUNTdNMU=" @@ -551,5 +590,5 @@ schema = 3 version = "v4.4.1" hash = "sha256-FcZHHZCKNNZW6/s1T1sKiS5Vj1TpHPmxVWr6YlL60xA=" [mod."sigs.k8s.io/yaml"] - version = "v1.3.0" - hash = "sha256-RVp8vca2wxg8pcBDYospG7Z1dujoH7zXNu2rgZ1kky0=" + version = "v1.4.0" + hash = "sha256-Hd/M0vIfIVobDd87eb58p1HyVOjYWNlGq2bRXfmtVno=" diff --git a/libs/manager-kontrol-api/specs/api.yaml b/libs/manager-kontrol-api/specs/api.yaml index 409a4a44..488b0374 100644 --- a/libs/manager-kontrol-api/specs/api.yaml +++ b/libs/manager-kontrol-api/specs/api.yaml @@ -13,7 +13,7 @@ paths: responses: default: $ref: "#/components/responses/NotOk" - '200': + "200": description: Successful response content: application/json: @@ -92,11 +92,27 @@ components: x-go-type-import: path: istio.io/client-go/pkg/apis/networking/v1alpha3 name: v1alpha3 - gateway: - x-go-type: v1alpha3.Gateway - x-go-type-import: - path: istio.io/client-go/pkg/apis/networking/v1alpha3 - name: v1alpha3 + gateways: + type: array + items: + x-go-type: gateway.Gateway + x-go-type-import: + path: sigs.k8s.io/gateway-api/apis/v1 + name: gateway + http_routes: + type: array + items: + x-go-type: gateway.HTTPRoute + x-go-type-import: + path: sigs.k8s.io/gateway-api/apis/v1 + name: gateway + ingresses: + type: array + items: + x-go-type: net.Ingress + x-go-type-import: + path: k8s.io/api/networking/v1 + name: net envoy_filters: type: array items: diff --git a/sidecars/redis-overlay-service/gomod2nix.toml b/sidecars/redis-overlay-service/gomod2nix.toml index 990f7cd9..90f17b8a 100644 --- a/sidecars/redis-overlay-service/gomod2nix.toml +++ b/sidecars/redis-overlay-service/gomod2nix.toml @@ -34,6 +34,9 @@ schema = 3 [mod."github.com/adrg/xdg"] version = "v0.4.0" hash = "sha256-zGjkdUQmrVqD6rMO9oDY+TeJCpuqnHyvkPCaXDlac/U=" + [mod."github.com/ahmetb/gen-crd-api-reference-docs"] + version = "v0.3.0" + hash = "sha256-9W0jxXQn3E5bJ24SURs2tO1odSep/mIp0OIpjKCDM18=" [mod."github.com/andybalholm/brotli"] version = "v1.0.5" hash = "sha256-/qS8wU8yZQJ+uTOg66rEl9s7spxq9VIXF5L1BcaEClc=" @@ -98,11 +101,17 @@ schema = 3 version = "v0.0.0-20200823014737-9f7001d12a5f" hash = "sha256-n/7xo5CQqo4yLaWMSzSN1Muk/oqK6O5dgDOFWapeDUI=" [mod."github.com/emicklei/go-restful/v3"] - version = "v3.11.0" - hash = "sha256-Kp5ndPvj1PhK0nscM1pNNK2Q4ahUuLED/baEgL9pKNo=" + version = "v3.12.0" + hash = "sha256-w9mYeZiOWYEd5NLkOHYbaElfcbNurV6trMtbv2KPvL0=" [mod."github.com/evanphx/json-patch"] - version = "v5.6.0+incompatible" - hash = "sha256-F4hI+H6oWFCKa47+x74M4fqcwDtv3wXOLGVxqDn0F5c=" + version = "v5.7.0+incompatible" + hash = "sha256-6aTV41slcMtqRp2PdL4CKTDPUMoIXNP/tOgduzgGMCU=" + [mod."github.com/evanphx/json-patch/v5"] + version = "v5.9.0" + hash = "sha256-KG3giQTztHy6SX0wF2/Htje4MPs+1oEzfWhKDE0xl4U=" + [mod."github.com/fatih/color"] + version = "v1.16.0" + hash = "sha256-Aq/SM28aPJVzvapllQ64R/DM4aZ5CHPewcm/AUJPyJQ=" [mod."github.com/fatih/structs"] version = "v1.1.0" hash = "sha256-OCmubTLF1anwNnkvFZDYHnF6hFlX0WDoe/9+dDlaMPM=" @@ -131,14 +140,14 @@ schema = 3 version = "v1.4.1" hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY=" [mod."github.com/go-openapi/jsonpointer"] - version = "v0.20.2" - hash = "sha256-z9IZxP+JvJ1WvrHE7qbAZQqJ3XMx1uD0S611shTMna8=" + version = "v0.21.0" + hash = "sha256-bB8XTzo4hzXemi8Ey3tIXia3mfn38bvwIzKYLJYC650=" [mod."github.com/go-openapi/jsonreference"] - version = "v0.20.2" - hash = "sha256-klWZKK7LZqSg3HMIrSkjh/NwaZTr+8kTW2ok2+JlioE=" + version = "v0.21.0" + hash = "sha256-lkFb/kP0qt8L1jsLYLt+jXTY6jSk5SYJbfgAKKVlQYQ=" [mod."github.com/go-openapi/swag"] - version = "v0.22.8" - hash = "sha256-YMJpCbWT9ABlCmuLjxQRwhddlYYqDBWcyDIdnV8bAMc=" + version = "v0.23.0" + hash = "sha256-D5CzsSQ3SYJLwXT6BDahnG66LI8du59Dy1mY4KutA7A=" [mod."github.com/go-playground/locales"] version = "v0.14.1" hash = "sha256-BMJGAexq96waZn60DJXZfByRHb8zA/JP/i6f/YrW9oQ=" @@ -154,6 +163,9 @@ schema = 3 [mod."github.com/go-test/deep"] version = "v1.0.8" hash = "sha256-AKOpW32qcq1BTVEPC6MshiFA3ROucnmlJMIfvwYXvNY=" + [mod."github.com/gobuffalo/flect"] + version = "v1.0.2" + hash = "sha256-r0UXCY4OI/VIawB38WmZ4nAe/4qKsyqT5LD+UVhOylw=" [mod."github.com/goccy/go-json"] version = "v0.10.2" hash = "sha256-6fMD2/Rku8HT0zDdeA23pX0YxbohiIOC8OJNYbylJTQ=" @@ -209,8 +221,8 @@ schema = 3 version = "v1.8.1" hash = "sha256-nDABvAhlYgxUW2N/brrep7NkQXoSGcHhA+XI4+tK0F0=" [mod."github.com/gorilla/websocket"] - version = "v1.5.0" - hash = "sha256-EYVgkSEMo4HaVrsWKqnsYRp8SSS8gNf7t+Elva02Ofc=" + version = "v1.5.1" + hash = "sha256-eHZ/U+eeE5tSgWc1jEDuBwtTRbXKP9fqP9zfW4Zw8T0=" [mod."github.com/gregjones/httpcache"] version = "v0.0.0-20180305231024-9cad4c3443a7" hash = "sha256-2ngFfFuSm8YSTNZWGQuN5yTpsXlwY2R8aaIzjDnjTXI=" @@ -304,6 +316,9 @@ schema = 3 [mod."github.com/microcosm-cc/bluemonday"] version = "v1.0.25" hash = "sha256-/crG5s6cDrJ55nkDBwugLUpY7U+vQuHpCkKm7nnN8Zc=" + [mod."github.com/miekg/dns"] + version = "v1.1.58" + hash = "sha256-UGvyC1Abh2S5VaAUCV9AUuDMrCvpiWQy/UnYM9DfIB8=" [mod."github.com/moby/spdystream"] version = "v0.2.0" hash = "sha256-Feme5UoWuBCvnLPKw1ozKkF3SM7PAjjPFQZ3TJhghR0=" @@ -446,8 +461,8 @@ schema = 3 version = "v0.23.0" hash = "sha256-6hZjb/OazWFBef0C/aH63l49YQnzCh2vpIduzyfSSG8=" [mod."golang.org/x/exp"] - version = "v0.0.0-20220303212507-bbda1eaf7a17" - hash = "sha256-E8mRbh+ptVwyqnxBfYEtJ8pGqjWUvxUxVsz9vXxDIo4=" + version = "v0.0.0-20240416160154-fe59bbe5cc7f" + hash = "sha256-168CD9hlLJaQ7stQk/ztlP3zgaWXUMbIHa38gAeRRs4=" [mod."golang.org/x/mod"] version = "v0.17.0" hash = "sha256-CLaPeF6uTFuRDv4oHwOQE6MCMvrzkUjWN3NuyywZjKU=" @@ -455,8 +470,8 @@ schema = 3 version = "v0.25.0" hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54=" [mod."golang.org/x/oauth2"] - version = "v0.16.0" - hash = "sha256-fJfS9dKaq82WaYSVWHMnxNLWH8+L4aip/C1AfJi4FFI=" + version = "v0.19.0" + hash = "sha256-IYdkq8R8BXnwoBt/ZLAMJr0DkLZDMVkjeBJNQ/Z9Bes=" [mod."golang.org/x/sync"] version = "v0.7.0" hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" @@ -485,8 +500,8 @@ schema = 3 version = "v0.126.0" hash = "sha256-G/J0Aba+S35gE7VevU2WrrbwQRsJCSj14DVSLTqz0vE=" [mod."google.golang.org/appengine"] - version = "v1.6.8" - hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" + version = "v1.6.7" + hash = "sha256-zIxGRHiq4QBvRqkrhMGMGCaVL4iM4TtlYpAi/hrivS4=" [mod."google.golang.org/genproto"] version = "v0.0.0-20230530153820-e85fd2cbaebc" hash = "sha256-xuUQD0+WiF+LGKhQCCwaA5WKlZz6EG9WhClfEonHedk=" @@ -497,8 +512,11 @@ schema = 3 version = "v0.0.0-20240314234333-6e1732d8331c" hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" + [mod."google.golang.org/grpc/cmd/protoc-gen-go-grpc"] + version = "v1.3.0" + hash = "sha256-6M1gOZMu3hN08M/giGcVv4ic5ChGcUfKLUlUtZxvF7E=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" @@ -526,24 +544,45 @@ schema = 3 [mod."k8s.io/api"] version = "v0.30.2" hash = "sha256-sq8jdb0wnAIhTO/hactsJ34mRuUgEuUNOrKaQasbHpQ=" + [mod."k8s.io/apiextensions-apiserver"] + version = "v0.30.0" + hash = "sha256-1/T2iSEHRGZttj9pgl5VpQ3yAx7+GRMi7g9kLeaRvMM=" [mod."k8s.io/apimachinery"] version = "v0.30.2" hash = "sha256-EBWG9PlSfRwMed/u6oF8ME8n44/U5HGBCacH+Mns2UI=" [mod."k8s.io/client-go"] version = "v0.30.2" hash = "sha256-KwgEXnowk01jImaHhOStbVWc3dDVZKF2nVvfsJAvtgo=" + [mod."k8s.io/code-generator"] + version = "v0.30.0" + hash = "sha256-MCco4LG1k9A6tP/AHqAAZb0EyOG/IOhIC5R76J56cYs=" + [mod."k8s.io/gengo"] + version = "v0.0.0-20230829151522-9cce18d56c01" + hash = "sha256-JgsgX2R/iu1I96dQ45ZSe4AW1PIgEpArsF3Xa+yzTxI=" [mod."k8s.io/gengo/v2"] version = "v2.0.0-20240228010128-51d4e06bde70" hash = "sha256-igAJQwUliynE2iDbBYc2HONd744+r7o3mQtFyYDYLb4=" + [mod."k8s.io/klog"] + version = "v0.2.0" + hash = "sha256-YabDBrcEBN72ClwZ1bs9bA+2gjH9ZD7omGCjtWY/YUo=" [mod."k8s.io/klog/v2"] version = "v2.120.1" hash = "sha256-PU3q5ODCHEO8z//zUKsCq2tky6ZNx4xFl3nHSPJpuW8=" [mod."k8s.io/kube-openapi"] - version = "v0.0.0-20240228011516-70dd3763d340" - hash = "sha256-2BUbi2eNJFSTcmLyVYBYBe9Lhi0TVJoH2zVQlQ9eZIA=" + version = "v0.0.0-20240423202451-8948a665c108" + hash = "sha256-EXaKmh3z505YcvpGBCP+nwk6EIqH7H09kakalWKXLxk=" [mod."k8s.io/utils"] - version = "v0.0.0-20230726121419-3b25d923346b" - hash = "sha256-r8VhhAYGPouGGgXu02ymVwF6k+WmBc4ij0qynPRtXEE=" + version = "v0.0.0-20240423183400-0849a56e8f22" + hash = "sha256-4CiDxKJMHKJ173hu3KsVBD4XdAfGZRMiHIFeqW3AwYs=" + [mod."sigs.k8s.io/controller-runtime"] + version = "v0.18.0" + hash = "sha256-383Pun8npG9f4ITz3YGHunU48X6rvJtHd03EdNLjMhQ=" + [mod."sigs.k8s.io/controller-tools"] + version = "v0.15.0" + hash = "sha256-McJAHNx3tTjEww+/Sbz6vG5YR5z+WUovuzK2lH21Vnk=" + [mod."sigs.k8s.io/gateway-api"] + version = "v1.1.0" + hash = "sha256-v/Naf9D35XsQLieooRseVTfDQ7KwCqViX9mRviVeLDw=" [mod."sigs.k8s.io/json"] version = "v0.0.0-20221116044647-bc3834ca7abd" hash = "sha256-XDBMN2o450IHiAwEpBVsvo9e7tYZa+EXWrifUNTdNMU=" @@ -551,5 +590,5 @@ schema = 3 version = "v4.4.1" hash = "sha256-FcZHHZCKNNZW6/s1T1sKiS5Vj1TpHPmxVWr6YlL60xA=" [mod."sigs.k8s.io/yaml"] - version = "v1.3.0" - hash = "sha256-RVp8vca2wxg8pcBDYospG7Z1dujoH7zXNu2rgZ1kky0=" + version = "v1.4.0" + hash = "sha256-Hd/M0vIfIVobDd87eb58p1HyVOjYWNlGq2bRXfmtVno="