diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 53aa5e1b6..36ffab8f7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,62 +13,59 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{github.event.pull_request.head.repo.full_name}} persist-credentials: false - name: Setup Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version-file: ./operators/go.mod - name: Check linting - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: - version: v1.50.1 + version: v1.56 working-directory: operators - args: --timeout=600s - gomodtidy: name: Enforce go.mod tidiness runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: "${{ github.event.pull_request.head.sha }}" - repository: ${{github.event.pull_request.head.repo.full_name}} - persist-credentials: false - - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.19 - - - name: Execute go mod tidy and check the outcome - working-directory: ./operators - run: | - go mod tidy - exit_code=$(git diff --exit-code) - exit ${exit_code} - - - name: Issue a comment in case the of failure - uses: peter-evans/create-or-update-comment@v2 - with: - token: ${{ secrets.CI_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: | - The `go.mod` and/or `go.sum` files appear not to be correctly tidied. - - Please, rerun `go mod tidy` to fix the issues. - reactions: confused - if: | - failure() && github.event.pull_request.head.repo.full_name == github.repository + - name: Checkout + uses: actions/checkout@v4 + with: + ref: "${{ github.event.pull_request.head.sha }}" + repository: ${{github.event.pull_request.head.repo.full_name}} + persist-credentials: false + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: ./operators/go.mod + - name: Execute go mod tidy and check the outcome + working-directory: ./operators + run: | + go mod tidy + exit_code=$(git diff --exit-code) + exit ${exit_code} + + - name: Issue a comment in case the of failure + uses: peter-evans/create-or-update-comment@v4 + with: + token: ${{ secrets.CI_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + The `go.mod` and/or `go.sum` files appear not to be correctly tidied. + + Please, rerun `go mod tidy` to fix the issues. + reactions: confused + if: | + failure() && github.event.pull_request.head.repo.full_name == github.repository python-lint: name: Lint python files @@ -76,7 +73,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{github.event.pull_request.head.repo.full_name}} @@ -85,14 +82,13 @@ jobs: - name: Check linting uses: TrueBrain/actions-flake8@v2 - markdown-lint: name: Lint markdown files (check links validity) runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{github.event.pull_request.head.repo.full_name}} @@ -101,8 +97,7 @@ jobs: - name: Check the validity of the links in the documentation uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: - use-quiet-mode: 'yes' - + use-quiet-mode: "yes" shell-lint: name: Lint shell files @@ -110,7 +105,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{github.event.pull_request.head.repo.full_name}} @@ -119,8 +114,7 @@ jobs: - name: Run shellcheck uses: azohra/shell-linter@v0.6.0 with: - exclude-paths: "**/.husky/*-commit" - + exclude-paths: "**/.husky/*-commit" frontend-lint: name: Lint frontend files @@ -128,14 +122,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{github.event.pull_request.head.repo.full_name}} persist-credentials: false - name: Setup nodeJS - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 14 @@ -147,21 +141,20 @@ jobs: working-directory: ./frontend run: yarn check-format-lint - qlkube-lint: name: Lint qlkube files runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{github.event.pull_request.head.repo.full_name}} persist-credentials: false - name: Setup nodeJS - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 14 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 79372a496..86baa5d39 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: '1.21' - uses: actions/setup-python@v4 with: @@ -74,15 +74,14 @@ jobs: - name: Install Kubebuilder run: | - version=2.3.1 # latest stable version - kubernetes_version=1.25.0 - curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_$(go env GOARCH).tar.gz" - tar -zxvf kubebuilder_${version}_linux_$(go env GOARCH).tar.gz - mv kubebuilder_${version}_linux_$(go env GOARCH) kubebuilder + version=3.14.1 # latest stable version + kubernetes_version=1.28.0 + curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_linux_$(go env GOARCH)" curl --fail -sSLo envtest-bins.tar.gz "https://go.kubebuilder.io/test-tools/${kubernetes_version}/$(go env GOOS)/$(go env GOARCH)" - tar -zxvf envtest-bins.tar.gz kubebuilder/bin/kube-apiserver --overwrite -C kubebuilder/bin + tar -zxvf envtest-bins.tar.gz && rm -f envtest-bins.tar.gz + mv kubebuilder_linux_$(go env GOARCH) kubebuilder/bin/kubebuilder sudo mv kubebuilder /usr/local/ - + sudo chmod +x /usr/local/kubebuilder/bin/* - name: Perform the tests working-directory: operators/ run: | diff --git a/.golangci.yml b/.golangci.yml index 14456cc9b..9c93166fe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,14 +1,17 @@ run: - skip-files: - - "zz_generated.*.go" - - ".*mock.go" + deadline: 5m + allow-parallel-runners: true linters-settings: exhaustive: check-generated: false default-signifies-exhaustive: true gci: - local-prefixes: github.com/netgroup-polito/CrownLabs + sections: + - standard + - default + - prefix(github.com/netgroup-polito/CrownLabs) + goconst: min-len: 2 min-occurrences: 2 @@ -43,7 +46,7 @@ linters-settings: goimports: local-prefixes: github.com/netgroup-polito/CrownLabs govet: - check-shadowing: true + shadow: true misspell: locale: US nolintlint: @@ -57,7 +60,7 @@ linters: enable: - asciicheck - bodyclose - - depguard + # - depguard - dogsled - dupl - durationcheck @@ -115,6 +118,10 @@ issues: # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked + exclude-files: + - "zz_generated.*.go" + - ".*mock.go" + exclude-rules: - linters: - govet @@ -125,6 +132,10 @@ issues: # Excluding, as many packages are currently affected by this text: "don't use an underscore in package name" + - linters: + - revive + text: "should not use dot imports" + - linters: - stylecheck # Excluding, as many packages are currently affected by this @@ -134,3 +145,12 @@ issues: - path: _test\.go linters: - gosec + + - path: "api/*" + linters: + - lll + + - path: "internal/*" + linters: + - dupl + - lll diff --git a/infrastructure/docker-registry/README.md b/infrastructure/docker-registry/README.md index ffb8229af..3f2ad473b 100644 --- a/infrastructure/docker-registry/README.md +++ b/infrastructure/docker-registry/README.md @@ -40,7 +40,7 @@ To install Harbor, it is possible to leverage the [official Helm Chart](https:// 6. PVC that can be shared across nodes (i.e., with `ReadWriteMany` access mode) or external object storage ### Redis Configuration -In our architecture we have a [Redis-Sentinel](https://redis.io/docs/manual/sentinel/) service, instead of [Redis Cluster](https://redis.io/docs/manual/scaling/), because with this architecture Sentinel manages automatically the failover of the master. +In our architecture we have a [Redis-Sentinel](https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/) service, instead of [Redis Cluster](https://redis.io/docs/latest/operate/oss_and_stack/management/scaling/), because with this architecture Sentinel manages automatically the failover of the master. To enable the `Redis-Sentinel ` architecture it is necessary to configure the following parameter in the redis file values (`redis-service-values.yaml`): ```yaml sentinel.enabled=true diff --git a/infrastructure/monitoring/kube-prometheus-stack/README.md b/infrastructure/monitoring/kube-prometheus-stack/README.md index c382ad6b8..2eec1c3e8 100644 --- a/infrastructure/monitoring/kube-prometheus-stack/README.md +++ b/infrastructure/monitoring/kube-prometheus-stack/README.md @@ -174,7 +174,7 @@ The access to Alertmanager and Prometheus is limited to users belonging to the ` #### Additional references 1. [ingress-nginx - External OAUTH authentication](https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/auth/oauth-external-auth) -2. [oauth2-proxy - Configuration](https://oauth2-proxy.github.io/oauth2-proxy/docs/configuration/overview) +2. [oauth2-proxy - Configuration](https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview) ### Monitor the Bind DNS Server diff --git a/operators/Makefile b/operators/Makefile index 36b1127b3..5325f4be2 100644 --- a/operators/Makefile +++ b/operators/Makefile @@ -1,3 +1,10 @@ +### NOTE: THIS FILE IS CURRENTLY NOT UP TO DATE WITH THE ACTUAL KUBEBUILDER 3 BOILERPLATE + +# Image URL to use all building/pushing image targets +IMG ?= controller:latest +# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. +ENVTEST_K8S_VERSION = 1.29.0 + # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) GOBIN=$(shell go env GOPATH)/bin @@ -59,7 +66,7 @@ generate: controller-gen # download controller-gen if necessary controller-gen: ifeq (, $(shell which controller-gen)) - @go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1 + @go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 CONTROLLER_GEN=$(GOBIN)/controller-gen else CONTROLLER_GEN=$(shell which controller-gen) diff --git a/operators/PROJECT b/operators/PROJECT new file mode 100644 index 000000000..a54c9a4ef --- /dev/null +++ b/operators/PROJECT @@ -0,0 +1,10 @@ +# Code generated by tool. DO NOT EDIT. +# This file is used to track the info used to scaffold your project +# and allow the plugins properly work. +# More info: https://book.kubebuilder.io/reference/project-config.html +domain: crownlabs.polito.it +layout: +- go.kubebuilder.io/v4 +projectName: operators +repo: github.com/netgroup-polito/CrownLabs/operators +version: "3" diff --git a/operators/api/v1alpha1/zz_generated.deepcopy.go b/operators/api/v1alpha1/zz_generated.deepcopy.go index 1634254e2..758bd0949 100644 --- a/operators/api/v1alpha1/zz_generated.deepcopy.go +++ b/operators/api/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Copyright 2020-2024 Politecnico di Torino // diff --git a/operators/api/v1alpha2/zz_generated.deepcopy.go b/operators/api/v1alpha2/zz_generated.deepcopy.go index 0de4d13bd..5dd49a1a0 100644 --- a/operators/api/v1alpha2/zz_generated.deepcopy.go +++ b/operators/api/v1alpha2/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Copyright 2020-2024 Politecnico di Torino // diff --git a/operators/build/golang-common/Dockerfile b/operators/build/golang-common/Dockerfile index 815f431ba..067154bcd 100644 --- a/operators/build/golang-common/Dockerfile +++ b/operators/build/golang-common/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.19 as builder +FROM golang:1.21 as builder WORKDIR /tmp/builder COPY go.mod ./go.mod @@ -12,7 +12,7 @@ COPY . ./ RUN CGO_ENABLED=0 GOOS=linux GOARCH=$(go env GOARCH) go build -ldflags="-s -w" ./cmd/$COMPONENT -FROM alpine:3.14 +FROM alpine:3.19 RUN apk update && \ apk add --no-cache ca-certificates && \ diff --git a/operators/cmd/bastion-operator/main.go b/operators/cmd/bastion-operator/main.go index bf5e1a418..6d444414b 100644 --- a/operators/cmd/bastion-operator/main.go +++ b/operators/cmd/bastion-operator/main.go @@ -25,6 +25,8 @@ import ( "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" + "sigs.k8s.io/controller-runtime/pkg/webhook" crownlabsv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" crownlabsv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" @@ -55,8 +57,8 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, + Metrics: server.Options{BindAddress: metricsAddr}, + WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}), LeaderElection: enableLeaderElection, HealthProbeBindAddress: ":8081", LivenessEndpointName: "/healthz", diff --git a/operators/cmd/examagent/main.go b/operators/cmd/examagent/main.go index 5e4aaac58..5a084e14e 100644 --- a/operators/cmd/examagent/main.go +++ b/operators/cmd/examagent/main.go @@ -22,14 +22,14 @@ import ( "path" "time" - "k8s.io/klog/v2/klogr" + "k8s.io/klog/v2/textlogger" "github.com/netgroup-polito/CrownLabs/operators/pkg/examagent" ) func main() { examagent.Options.Init() - log := klogr.NewWithOptions().WithName("examagent") + log := textlogger.NewLogger(textlogger.NewConfig()).WithName("examagent") if err := examagent.Options.Parse(); err != nil { log.Error(err, "invalid configuration") diff --git a/operators/cmd/instance-operator/main.go b/operators/cmd/instance-operator/main.go index d3d531598..20ac0cd12 100644 --- a/operators/cmd/instance-operator/main.go +++ b/operators/cmd/instance-operator/main.go @@ -27,11 +27,12 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "k8s.io/klog/v2" - "k8s.io/klog/v2/klogr" + "k8s.io/klog/v2/textlogger" virtv1 "kubevirt.io/api/core/v1" cdiv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" crownlabsv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" crownlabsv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" @@ -95,7 +96,7 @@ func main() { klog.InitFlags(nil) flag.Parse() - ctrl.SetLogger(klogr.NewWithOptions()) + ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig())) log := ctrl.Log.WithName("setup") @@ -105,7 +106,7 @@ func main() { // Configure the manager mgr, err := ctrl.NewManager(restcfg.SetRateLimiter(ctrl.GetConfigOrDie()), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: *metricsAddr, + Metrics: server.Options{BindAddress: *metricsAddr}, LeaderElection: *enableLeaderElection, HealthProbeBindAddress: ":8081", LivenessEndpointName: "/healthz", diff --git a/operators/cmd/instmetrics/main.go b/operators/cmd/instmetrics/main.go index 4c56feddd..ba4ef8086 100644 --- a/operators/cmd/instmetrics/main.go +++ b/operators/cmd/instmetrics/main.go @@ -20,12 +20,10 @@ import ( "flag" "net/http" "os" - "sync" "time" - "github.com/docker/docker/client" "k8s.io/klog/v2" - "k8s.io/klog/v2/klogr" + "k8s.io/klog/v2/textlogger" clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" "github.com/netgroup-polito/CrownLabs/operators/pkg/instmetrics" @@ -40,7 +38,7 @@ func main() { klog.InitFlags(nil) flag.Parse() - log := klogr.NewWithOptions().WithName("instmetrics") + log := textlogger.NewLogger(textlogger.NewConfig()).WithName("instmetrics") ctx := clctx.LoggerIntoContext(context.Background(), log) remoteRuntimeClient, err := instmetrics.GetRuntimeService(ctx, *connectionTimeout, *runtimeEndpoint) @@ -49,19 +47,7 @@ func main() { os.Exit(1) } - var statsScraper instmetrics.StatsScraper - - switch *runtimeEndpoint { - case "unix:///run/dockershim.sock": - dockerCli, err := client.NewClientWithOpts(client.WithVersion("v1.41")) - if err != nil { - log.Error(err, "Unable to initialize docker API client") - os.Exit(1) - } - statsScraper = instmetrics.DockerMetricsScraper{DockerClient: dockerCli, ContStatsListMutex: &sync.RWMutex{}} - default: - statsScraper = instmetrics.CRIMetricsScraper{RuntimeClient: remoteRuntimeClient} - } + var statsScraper instmetrics.StatsScraper = instmetrics.CRIMetricsScraper{RuntimeClient: remoteRuntimeClient} go func() { http.Handle("/ready", &instmetrics.ReadinessProbeHandler{RuntimeClient: remoteRuntimeClient, Log: log.WithName("probeHandler"), Ready: false}) @@ -71,13 +57,13 @@ func main() { } }() - err = instmetrics.Server{ + err = (&instmetrics.Server{ MetricsScraperPeriod: *updatePeriod, Log: log.WithName("gRPCServer"), Port: *grpcPort, RuntimeClient: remoteRuntimeClient, StatsScraper: &statsScraper, - }.Start(ctx) + }).Start(ctx) if err != nil { log.Error(err, "Unable to initialize gRPC server") os.Exit(1) diff --git a/operators/cmd/tenant-operator/main.go b/operators/cmd/tenant-operator/main.go index 45b529ffc..28b251987 100644 --- a/operators/cmd/tenant-operator/main.go +++ b/operators/cmd/tenant-operator/main.go @@ -27,9 +27,11 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "k8s.io/klog/v2" - "k8s.io/klog/v2/klogr" + "k8s.io/klog/v2/textlogger" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" + "sigs.k8s.io/controller-runtime/pkg/webhook" clv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" clv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" @@ -107,7 +109,7 @@ func main() { klog.InitFlags(nil) flag.Parse() - ctrl.SetLogger(klogr.NewWithOptions()) + ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig())) ctx := ctrl.SetupSignalHandler() log := ctrl.Log.WithName("setup") @@ -126,8 +128,8 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, + Metrics: server.Options{BindAddress: metricsAddr}, + WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}), LeaderElection: enableLeaderElection, LeaderElectionID: "f547a6ba.crownlabs.polito.it", HealthProbeBindAddress: ":8081", @@ -148,8 +150,14 @@ func main() { if *enableWH { hookServer := mgr.GetWebhookServer() webhookBypassGroupsList := strings.Split(webhookBypassGroups, ",") - hookServer.Register(ValidatingWebhookPath, tenantwh.MakeTenantValidator(mgr.GetClient(), webhookBypassGroupsList)) - hookServer.Register(MutatingWebhookPath, tenantwh.MakeTenantMutator(mgr.GetClient(), webhookBypassGroupsList, targetLabelKey, targetLabelValue, baseWorkspacesList)) + hookServer.Register( + ValidatingWebhookPath, + tenantwh.MakeTenantValidator(mgr.GetClient(), webhookBypassGroupsList, mgr.GetScheme()), + ) + hookServer.Register( + MutatingWebhookPath, + tenantwh.MakeTenantMutator(mgr.GetClient(), webhookBypassGroupsList, targetLabelKey, targetLabelValue, baseWorkspacesList, mgr.GetScheme()), + ) } else { log.Info("Webhook set up: operation skipped") } diff --git a/operators/deploy/crds/crownlabs.polito.it_imagelists.yaml b/operators/deploy/crds/crownlabs.polito.it_imagelists.yaml index f51842f73..5115a9fd0 100644 --- a/operators/deploy/crds/crownlabs.polito.it_imagelists.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_imagelists.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: imagelists.crownlabs.polito.it spec: group: crownlabs.polito.it @@ -26,14 +25,19 @@ spec: registry. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/operators/deploy/crds/crownlabs.polito.it_instances.yaml b/operators/deploy/crds/crownlabs.polito.it_instances.yaml index 3caec5baa..be6ef8d30 100644 --- a/operators/deploy/crds/crownlabs.polito.it_instances.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_instances.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: instances.crownlabs.polito.it spec: group: crownlabs.polito.it @@ -47,14 +46,19 @@ spec: description: Instance describes the instance of a CrownLabs environment Template. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -85,21 +89,22 @@ spec: type: string type: object prettyName: - description: Custom name the user can assign and change at any time + description: |- + Custom name the user can assign and change at any time in order to more easily identify the instance. type: string running: default: true - description: Whether the current instance is running or not. The meaning - of this flag is different depending on whether the instance refers - to a persistent environment or not. If the first case, it allows - to stop the environment (e.g. the underlying VM) without deleting - the associated disk. Setting the flag to true will restart the environment, - attaching it to the same disk used previously. Differently, if the - environment is not persistent, it only tears down the exposition - objects, making the instance effectively unreachable from outside - the cluster, but allowing the subsequent recreation without data - loss. + description: |- + Whether the current instance is running or not. + The meaning of this flag is different depending on whether the instance + refers to a persistent environment or not. If the first case, it allows to + stop the environment (e.g. the underlying VM) without deleting the associated + disk. Setting the flag to true will restart the environment, attaching it + to the same disk used previously. Differently, if the environment is not + persistent, it only tears down the exposition objects, making the instance + effectively unreachable from outside the cluster, but allowing the + subsequent recreation without data loss. type: boolean template.crownlabs.polito.it/TemplateRef: description: The reference to the Template to be instantiated. @@ -108,8 +113,9 @@ spec: description: The name of the resource to be referenced. type: string namespace: - description: The namespace containing the resource to be referenced. - It should be left empty in case of cluster-wide resources. + description: |- + The namespace containing the resource to be referenced. It should be left + empty in case of cluster-wide resources. type: string required: - name @@ -121,8 +127,9 @@ spec: description: The name of the resource to be referenced. type: string namespace: - description: The namespace containing the resource to be referenced. - It should be left empty in case of cluster-wide resources. + description: |- + The namespace containing the resource to be referenced. It should be left + empty in case of cluster-wide resources. type: string required: - name @@ -154,20 +161,22 @@ spec: type: string type: object initialReadyTime: - description: The amount of time the Instance required to become ready - for the first time upon creation. + description: |- + The amount of time the Instance required to become ready for the first time + upon creation. type: string ip: - description: The internal IP address associated with the remote environment, - which can be used to access it through the SSH protocol (leveraging - the SSH bastion in case it is not contacted from another CrownLabs - Instance). + description: |- + The internal IP address associated with the remote environment, which can + be used to access it through the SSH protocol (leveraging the SSH bastion + in case it is not contacted from another CrownLabs Instance). type: string phase: - description: The current status Instance, with reference to the associated - environment (e.g. VM). This conveys which resource is being created, - as well as whether the associated VM is being scheduled, is running - or ready to accept incoming connections. + description: |- + The current status Instance, with reference to the associated environment + (e.g. VM). This conveys which resource is being created, as well as + whether the associated VM is being scheduled, is running or ready to + accept incoming connections. enum: - "" - Importing @@ -181,8 +190,9 @@ spec: - CreationLoopBackoff type: string url: - description: The URL where it is possible to access the remote desktop - of the instance (in case of graphical environments) + description: |- + The URL where it is possible to access the remote desktop of the instance + (in case of graphical environments) type: string type: object type: object diff --git a/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml b/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml index 81c1b5467..f8857170e 100644 --- a/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_instancesnapshots.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: instancesnapshots.crownlabs.polito.it spec: group: crownlabs.polito.it @@ -33,14 +32,19 @@ spec: description: InstanceSnapshot is the Schema for the instancesnapshots API. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -48,16 +52,17 @@ spec: description: InstanceSnapshotSpec defines the desired state of InstanceSnapshot. properties: environmentRef: - description: Environment represents the reference to the environment - to be snapshotted, in case more are associated with the same Instance. - If not specified, the first available environment is considered. + description: |- + Environment represents the reference to the environment to be snapshotted, in case more are + associated with the same Instance. If not specified, the first available environment is considered. properties: name: description: The name of the resource to be referenced. type: string namespace: - description: The namespace containing the resource to be referenced. - It should be left empty in case of cluster-wide resources. + description: |- + The namespace containing the resource to be referenced. It should be left + empty in case of cluster-wide resources. type: string required: - name @@ -68,16 +73,18 @@ spec: minLength: 1 type: string instanceRef: - description: Instance is the reference to the persistent VM instance - to be snapshotted. The instance should not be running, otherwise - it won't be possible to steal the volume and extract its content. + description: |- + Instance is the reference to the persistent VM instance to be snapshotted. + The instance should not be running, otherwise it won't be possible to + steal the volume and extract its content. properties: name: description: The name of the resource to be referenced. type: string namespace: - description: The namespace containing the resource to be referenced. - It should be left empty in case of cluster-wide resources. + description: |- + The namespace containing the resource to be referenced. It should be left + empty in case of cluster-wide resources. type: string required: - name diff --git a/operators/deploy/crds/crownlabs.polito.it_templates.yaml b/operators/deploy/crds/crownlabs.polito.it_templates.yaml index c8b87e321..a5e5ef88c 100644 --- a/operators/deploy/crds/crownlabs.polito.it_templates.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_templates.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: templates.crownlabs.polito.it spec: group: crownlabs.polito.it @@ -50,14 +49,19 @@ spec: be instantiated. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -67,10 +71,11 @@ spec: properties: deleteAfter: default: never - description: The maximum lifetime of an Instance referencing the current - Template. Once this period is expired, the Instance may be automatically - deleted or stopped to save resources. If set to "never", the instance - will not be automatically terminated. + description: |- + The maximum lifetime of an Instance referencing the current Template. + Once this period is expired, the Instance may be automatically deleted + or stopped to save resources. If set to "never", the instance will not be + automatically terminated. pattern: ^(never|[0-9]+[mhd])$ type: string description: @@ -87,9 +92,9 @@ spec: description: Options to customize container startup properties: contentPath: - description: Path on which storage (EmptyDir/Storage) will - be mounted and into which, if given in SourceArchiveURL, - will be extracted the archive + description: |- + Path on which storage (EmptyDir/Storage) will be mounted + and into which, if given in SourceArchiveURL, will be extracted the archive type: string enforceWorkdir: default: false @@ -114,8 +119,9 @@ spec: bar when true type: boolean environmentType: - description: The type of environment to be instantiated, among - VirtualMachine, Container, CloudVM and Standalone. + description: |- + The type of environment to be instantiated, among VirtualMachine, + Container, CloudVM and Standalone. enum: - VirtualMachine - Container @@ -150,19 +156,19 @@ spec: type: string persistent: default: false - description: Whether the environment should be persistent (i.e. - preserved when the corresponding instance is terminated) or - not. + description: |- + Whether the environment should be persistent (i.e. preserved when the + corresponding instance is terminated) or not. type: boolean resources: description: The amount of computational resources associated with the environment. properties: cpu: - description: The maximum number of CPU cores made available - to the environment (at least 1 core). This maps to the - 'limits' specified for the actual pod representing the - environment. + description: |- + The maximum number of CPU cores made available to the environment + (at least 1 core). This maps to the 'limits' specified + for the actual pod representing the environment. format: int32 minimum: 1 type: integer @@ -170,29 +176,28 @@ spec: anyOf: - type: integer - type: string - description: The size of the persistent disk allocated for - the given environment. This field is meaningful only in - case of persistent or container-based environments, while - it is silently ignored in the other cases. In case of - containers, when this field is not specified, an emptyDir - will be attached to the pod but this could result in data - loss whenever the pod dies. + description: |- + The size of the persistent disk allocated for the given environment. + This field is meaningful only in case of persistent or container-based + environments, while it is silently ignored in the other cases. + In case of containers, when this field is not specified, an emptyDir will be + attached to the pod but this could result in data loss whenever the pod dies. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true memory: anyOf: - type: integer - type: string - description: The amount of RAM memory assigned to the given - environment. Requests and limits do correspond to avoid - OOMKill issues. + description: |- + The amount of RAM memory assigned to the given environment. Requests and + limits do correspond to avoid OOMKill issues. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true reservedCPUPercentage: - description: The percentage of reserved CPU cores, ranging - between 1 and 100, with respect to the 'CPU' value. Essentially, - this corresponds to the 'requests' specified for the actual - pod representing the environment. + description: |- + The percentage of reserved CPU cores, ranging between 1 and 100, with + respect to the 'CPU' value. Essentially, this corresponds to the 'requests' + specified for the actual pod representing the environment. format: int32 maximum: 100 minimum: 1 @@ -230,8 +235,9 @@ spec: description: The name of the resource to be referenced. type: string namespace: - description: The namespace containing the resource to be referenced. - It should be left empty in case of cluster-wide resources. + description: |- + The namespace containing the resource to be referenced. It should be left + empty in case of cluster-wide resources. type: string required: - name diff --git a/operators/deploy/crds/crownlabs.polito.it_tenants.yaml b/operators/deploy/crds/crownlabs.polito.it_tenants.yaml index 289542e50..a1686317a 100644 --- a/operators/deploy/crds/crownlabs.polito.it_tenants.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_tenants.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: tenants.crownlabs.polito.it spec: group: crownlabs.polito.it @@ -42,14 +41,19 @@ spec: description: Tenant describes a user of CrownLabs. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -59,12 +63,14 @@ spec: properties: createSandbox: default: false - description: Whether a sandbox namespace should be created to allow - the Tenant play with Kubernetes. + description: |- + Whether a sandbox namespace should be created to allow the Tenant play + with Kubernetes. type: boolean email: - description: The email associated with the Tenant, which will be used - to log-in into the system. + description: |- + The email associated with the Tenant, which will be used to log-in + into the system. pattern: ^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$ type: string firstName: @@ -78,9 +84,9 @@ spec: description: The last name of the Tenant. type: string publicKeys: - description: The list of the SSH public keys associated with the Tenant. - These will be used to enable to access the remote environments through - the SSH protocol. + description: |- + The list of the SSH public keys associated with the Tenant. These will be + used to enable to access the remote environments through the SSH protocol. items: type: string type: array @@ -117,12 +123,13 @@ spec: - memory type: object workspaces: - description: The list of the Workspaces the Tenant is subscribed to, - along with his/her role in each of them. + description: |- + The list of the Workspaces the Tenant is subscribed to, along with his/her + role in each of them. items: - description: TenantWorkspaceEntry contains the information regarding - one of the Workspaces the Tenant is subscribed to, including his/her - role. + description: |- + TenantWorkspaceEntry contains the information regarding one of the Workspaces + the Tenant is subscribed to, including his/her role. properties: name: description: The Workspace the Tenant is subscribed to. @@ -152,17 +159,19 @@ spec: the Tenant. properties: failingWorkspaces: - description: The list of Workspaces that are throwing errors during - subscription. This mainly happens if .spec.Workspaces contains references - to Workspaces which do not exist. + description: |- + The list of Workspaces that are throwing errors during subscription. + This mainly happens if .spec.Workspaces contains references to Workspaces + which do not exist. items: type: string type: array personalNamespace: - description: The namespace containing all CrownLabs related objects - of the Tenant. This is the namespace that groups his/her own Instances, - together with all the accessory resources (e.g. RBACs, resource - quota, network policies, ...) created by the tenant-operator. + description: |- + The namespace containing all CrownLabs related objects of the Tenant. + This is the namespace that groups his/her own Instances, together with + all the accessory resources (e.g. RBACs, resource quota, network policies, + ...) created by the tenant-operator. properties: created: description: Whether the creation succeeded or not. @@ -206,15 +215,16 @@ spec: - memory type: object ready: - description: Whether all subscriptions and resource creations succeeded - or an error occurred. In case of errors, the other status fields - provide additional information about which problem occurred. Will - be set to true even when personal workspace is intentionally deleted. + description: |- + Whether all subscriptions and resource creations succeeded or an error + occurred. In case of errors, the other status fields provide additional + information about which problem occurred. + Will be set to true even when personal workspace is intentionally deleted. type: boolean sandboxNamespace: - description: The namespace that can be freely used by the Tenant to - play with Kubernetes. This namespace is created only if the .spec.CreateSandbox - flag is true. + description: |- + The namespace that can be freely used by the Tenant to play with Kubernetes. + This namespace is created only if the .spec.CreateSandbox flag is true. properties: created: description: Whether the creation succeeded or not. @@ -227,16 +237,17 @@ spec: type: object subscriptions: additionalProperties: - description: SubscriptionStatus is an enumeration of the different - states that can be assumed by the subscription to a service (e.g. - successful or failing). + description: |- + SubscriptionStatus is an enumeration of the different states that can be + assumed by the subscription to a service (e.g. successful or failing). enum: - Ok - Failed type: string - description: The list of the subscriptions to external services (e.g. - Keycloak, ...), indicating for each one whether it succeeded or - an error occurred. + description: |- + The list of the subscriptions to external services (e.g. Keycloak, + ...), indicating for each one whether it succeeded or an error + occurred. type: object required: - failingWorkspaces diff --git a/operators/deploy/crds/crownlabs.polito.it_workspaces.yaml b/operators/deploy/crds/crownlabs.polito.it_workspaces.yaml index 284a87955..5b26590a6 100644 --- a/operators/deploy/crds/crownlabs.polito.it_workspaces.yaml +++ b/operators/deploy/crds/crownlabs.polito.it_workspaces.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: workspaces.crownlabs.polito.it spec: group: crownlabs.polito.it @@ -34,14 +33,19 @@ spec: description: Workspace describes a workspace in CrownLabs. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -99,10 +103,11 @@ spec: of the Workspace. properties: namespace: - description: The namespace containing all CrownLabs related objects - of the Workspace. This is the namespace that groups multiple related - templates, together with all the accessory resources (e.g. RBACs) - created by the tenant operator. + description: |- + The namespace containing all CrownLabs related objects of the Workspace. + This is the namespace that groups multiple related templates, together + with all the accessory resources (e.g. RBACs) created by the tenant + operator. properties: created: description: Whether the creation succeeded or not. @@ -114,22 +119,24 @@ spec: - created type: object ready: - description: Whether all subscriptions and resource creations succeeded - or an error occurred. In case of errors, the other status fields - provide additional information about which problem occurred. + description: |- + Whether all subscriptions and resource creations succeeded or an error + occurred. In case of errors, the other status fields provide additional + information about which problem occurred. type: boolean subscription: additionalProperties: - description: SubscriptionStatus is an enumeration of the different - states that can be assumed by the subscription to a service (e.g. - successful or failing). + description: |- + SubscriptionStatus is an enumeration of the different states that can be + assumed by the subscription to a service (e.g. successful or failing). enum: - Ok - Failed type: string - description: The list of the subscriptions to external services (e.g. - Keycloak, ...), indicating for each one whether it succeeded or - an error occurred. + description: |- + The list of the subscriptions to external services (e.g. Keycloak, + ...), indicating for each one whether it succeeded or an error + occurred. type: object type: object type: object diff --git a/operators/go.mod b/operators/go.mod index eb66b9bab..ae846ee5f 100644 --- a/operators/go.mod +++ b/operators/go.mod @@ -1,93 +1,84 @@ module github.com/netgroup-polito/CrownLabs/operators -go 1.19 +go 1.21 require ( github.com/Nerzal/gocloak/v7 v7.11.0 github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 - github.com/docker/docker v24.0.7+incompatible - github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 - github.com/go-logr/logr v1.2.3 - github.com/go-resty/resty/v2 v2.7.0 + github.com/dustinkirkland/golang-petname v0.0.0-20231002161417-6a283f1aaaf2 + github.com/go-logr/logr v1.4.1 + github.com/go-resty/resty/v2 v2.12.0 github.com/golang/mock v1.6.0 - github.com/onsi/ginkgo/v2 v2.6.1 - github.com/onsi/gomega v1.24.2 - github.com/prometheus/client_golang v1.14.0 - golang.org/x/sync v0.1.0 - golang.org/x/text v0.13.0 - google.golang.org/grpc v1.56.3 - google.golang.org/protobuf v1.30.0 + github.com/onsi/ginkgo/v2 v2.17.1 + github.com/onsi/gomega v1.32.0 + github.com/prometheus/client_golang v1.19.0 + golang.org/x/text v0.14.0 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.26.0 - k8s.io/apimachinery v0.26.0 - k8s.io/client-go v0.26.0 - k8s.io/cri-api v0.24.0 - k8s.io/klog/v2 v2.80.1 - k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 - kubevirt.io/api v0.58.0 - kubevirt.io/containerized-data-importer-api v1.55.2 - sigs.k8s.io/controller-runtime v0.14.1 + k8s.io/api v0.29.3 + k8s.io/apimachinery v0.29.3 + k8s.io/client-go v0.29.3 + k8s.io/cri-api v0.29.3 + k8s.io/klog/v2 v2.120.1 + k8s.io/utils v0.0.0-20240310230437-4693a0247e57 + kubevirt.io/api v1.2.0 + kubevirt.io/containerized-data-importer-api v1.58.3 + sigs.k8s.io/controller-runtime v0.17.2 ) require ( - github.com/Microsoft/go-winio v0.6.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/emicklei/go-restful/v3 v3.10.1 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/evanphx/json-patch/v5 v5.8.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/imdario/mergo v0.3.6 // 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 - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect - github.com/openshift/api v0.0.0-20211217221424-8779abfbd571 // indirect + github.com/openshift/api v0.0.0-20230503133300-8bbcb7ca7183 // indirect github.com/openshift/custom-resource-status v1.1.2 // indirect - github.com/pborman/uuid v1.2.1 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.39.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/segmentio/ksuid v1.0.4 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/segmentio/ksuid v1.0.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/mod v0.8.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.6.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.17.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apiextensions-apiserver v0.26.0 // indirect - k8s.io/component-base v0.26.0 // indirect - k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 // indirect - kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 // indirect + k8s.io/apiextensions-apiserver v0.29.0 // indirect + k8s.io/component-base v0.29.0 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/operators/go.sum b/operators/go.sum index aa9d63a74..ccbeb9a85 100644 --- a/operators/go.sum +++ b/operators/go.sum @@ -1,102 +1,76 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363/go.mod h1:WG7q7swWsS2f9PYpt5DoEP/EBYWx8We5UoRltn9vJl8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/Nerzal/gocloak/v7 v7.11.0 h1:ab2E55lIMCaUfn47uEHiFhvvMHw+yDHL6Pb+GrM+x04= github.com/Nerzal/gocloak/v7 v7.11.0/go.mod h1:8fu/dbbIRa1FmLEAOVReZ8PKfbnsl2DwEk6U0giK3KI= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= -github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= -github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= -github.com/dave/kerr v0.0.0-20170318121727-bc25dd6abe8e/go.mod h1:qZqlPyPvfsDJt+3wHJ1EvSXDuVjFTK0j2p/ca+gtsb8= -github.com/dave/rebecca v0.9.1/go.mod h1:N6XYdMD/OKw3lkF3ywh8Z6wPGuwNFDNtWYEMFWEmXBA= 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/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 h1:90Ly+6UfUypEF6vvvW5rQIv9opIL8CbmW9FT20LDQoY= -github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0/go.mod h1:V+Qd57rJe8gd4eiGzZyg4h54VLHmYVVw54iMnlAMrF8= +github.com/dustinkirkland/golang-petname v0.0.0-20231002161417-6a283f1aaaf2 h1:S6Dco8FtAhEI/qkg/00H6RdEGC+MCy5GPiQ+xweNRFE= +github.com/dustinkirkland/golang-petname v0.0.0-20231002161417-6a283f1aaaf2/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.15.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= -github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +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/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= +github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro= +github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= +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-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +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.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= -github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= -github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-resty/resty/v2 v2.12.0 h1:rsVL8P90LFvkUYq/V5BTVe203WfRIU4gvcf+yfzJzGA= +github.com/go-resty/resty/v2 v2.12.0/go.mod h1:o0yGPrkS3lOe1+eFajk6kBW8ScXzwU3hD69/gt2yB/0= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -106,10 +80,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -117,43 +88,39 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 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 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +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.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= 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.1.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-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.0.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.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.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/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gordonklaus/ineffassign v0.0.0-20201107091007-3b93a8888063/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -162,8 +129,10 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm 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.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/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= @@ -173,19 +142,14 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -199,76 +163,75 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= -github.com/onsi/ginkgo/v2 v2.6.1/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= -github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= -github.com/openshift/api v0.0.0-20211217221424-8779abfbd571 h1:+ShYlGoPriGahTTFTjQ0RtNXW0srxDodk2STdc238Rk= -github.com/openshift/api v0.0.0-20211217221424-8779abfbd571/go.mod h1:F/eU6jgr6Q2VhMu1mSpMmygxAELd7+BUxs3NHZ25jV4= -github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/openshift/api v0.0.0-20230503133300-8bbcb7ca7183 h1:t/CahSnpqY46sQR01SoS+Jt0jtjgmhgE6lFmRnO4q70= +github.com/openshift/api v0.0.0-20230503133300-8bbcb7ca7183/go.mod h1:4VWG+W22wrB4HfBL88P40DxLEpSOaiBVxUnfalfJo9k= github.com/openshift/custom-resource-status v1.1.2 h1:C3DL44LEbvlbItfd8mT5jWrqPfHnSOQoQf/sypqA6A4= github.com/openshift/custom-resource-status v1.1.2/go.mod h1:DB/Mf2oTeiAmVVX1gN+NEqweonAPY0TKUwADizj8+ZA= -github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= -github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= -github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/segmentio/ksuid v1.0.3 h1:FoResxvleQwYiPAVKe1tMUlEirodZqlqglIuFsdDntY= github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= -github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 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/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +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 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 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.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -golang.org/x/arch v0.0.0-20180920145803-b19384d3c130/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= 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-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= +golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -276,16 +239,14 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 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-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -293,32 +254,32 @@ golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= +golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -341,23 +302,33 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.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.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= 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.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -365,7 +336,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -373,36 +343,33 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= 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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= +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= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +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 v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +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/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -412,25 +379,23 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/src-d/go-billy.v4 v4.3.0/go.mod h1:tm33zBoOwxjYHZIE+OV8bxTWFMJLrconzFMd38aARFk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -439,63 +404,57 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= k8s.io/api v0.23.3/go.mod h1:w258XdGyvCmnBj/vGzQMj6kzdufJZVUwEM1U2fRJwSQ= -k8s.io/api v0.26.0 h1:IpPlZnxBpV1xl7TGk/X6lFtpgjgntCg8PJ+qrPHAC7I= -k8s.io/api v0.26.0/go.mod h1:k6HDTaIFC8yn1i6pSClSqIwLABIcLV9l5Q4EcngKnQg= -k8s.io/apiextensions-apiserver v0.26.0 h1:Gy93Xo1eg2ZIkNX/8vy5xviVSxwQulsnUdQ00nEdpDo= -k8s.io/apiextensions-apiserver v0.26.0/go.mod h1:7ez0LTiyW5nq3vADtK6C3kMESxadD51Bh6uz3JOlqWQ= -k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= +k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= +k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= +k8s.io/apiextensions-apiserver v0.29.0 h1:0VuspFG7Hj+SxyF/Z/2T0uFbI5gb5LRgEyUVE3Q4lV0= +k8s.io/apiextensions-apiserver v0.29.0/go.mod h1:TKmpy3bTS0mr9pylH0nOt/QzQRrW7/h7yLdRForMZwc= k8s.io/apimachinery v0.23.3/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.26.0 h1:1feANjElT7MvPqp0JT6F3Ss6TWDwmcjLypwoPpEf7zg= -k8s.io/apimachinery v0.26.0/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/client-go v0.26.0 h1:lT1D3OfO+wIi9UFolCrifbjUUgu7CpLca0AD8ghRLI8= -k8s.io/client-go v0.26.0/go.mod h1:I2Sh57A79EQsDmn7F7ASpmru1cceh3ocVT9KlX2jEZg= -k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= +k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= +k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= +k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= +k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= k8s.io/code-generator v0.23.3/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= -k8s.io/component-base v0.26.0 h1:0IkChOCohtDHttmKuz+EP3j3+qKmV55rM9gIFTXA7Vs= -k8s.io/component-base v0.26.0/go.mod h1:lqHwlfV1/haa14F/Z5Zizk5QmzaVf23nQzCwVOQpfC8= -k8s.io/cri-api v0.24.0 h1:PZ/MqhgYq4rxCarYe2rGNmd8G9ZuyS1NU9igolbkqlI= -k8s.io/cri-api v0.24.0/go.mod h1:t3tImFtGeStN+ES69bQUX9sFg67ek38BM9YIJhMmuig= +k8s.io/component-base v0.29.0 h1:T7rjd5wvLnPBV1vC4zWd/iWRbV8Mdxs+nGaoaFzGw3s= +k8s.io/component-base v0.29.0/go.mod h1:sADonFTQ9Zc9yFLghpDpmNXEdHyQmFIGbiuZbqAXQ1M= +k8s.io/cri-api v0.29.3 h1:ppKSui+hhTJW774Mou6x+/ealmzt2jmTM0vsEQVWrjI= +k8s.io/cri-api v0.29.3/go.mod h1:3X7EnhsNaQnCweGhQCJwKNHlH7wHEYuKQ19bRvXMoJY= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +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-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 h1:tBEbstoM+K0FiBV5KGAKQ0kuvf54v/hwpldiJt69w1s= -k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -kubevirt.io/api v0.58.0 h1:qeNeRtD6AIJ5WVJuRXajmmXtnrO5dYchy+hpCm6QwhE= -kubevirt.io/api v0.58.0/go.mod h1:U0CQlZR0JoJCaC+Va0wz4dMOtYDdVywJ98OT1KmOkzI= -kubevirt.io/containerized-data-importer-api v1.55.2 h1:AzYnKIUFkKwO6c0uCQZYlAIxfzbiPkJXP29hFhauaQ8= -kubevirt.io/containerized-data-importer-api v1.55.2/go.mod h1:92HiQEyzPoeMiCbgfG5Qe10JQVbtWMZOXucy56dKdGg= -kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4 h1:fZYvD3/Vnitfkx6IJxjLAk8ugnZQ7CXVYcRfkSKmuZY= -kubevirt.io/controller-lifecycle-operator-sdk/api v0.2.4/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc= -sigs.k8s.io/controller-runtime v0.14.1 h1:vThDes9pzg0Y+UbCPY3Wj34CGIYPgdmspPm2GIpxpzM= -sigs.k8s.io/controller-runtime v0.14.1/go.mod h1:GaRkrY8a7UZF0kqFFbUKG7n9ICiTY5T55P1RiE3UZlU= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= +k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +kubevirt.io/api v1.2.0 h1:1f8XQLPl4BuHPsc6SHTPnYSYeDxucKCQGa8CdrGJSRc= +kubevirt.io/api v1.2.0/go.mod h1:SbeR9ma4EwnaOZEUkh/lNz0kzYm5LPpEDE30vKXC5Zg= +kubevirt.io/containerized-data-importer-api v1.58.3 h1:gTccZSu7CTD/wswbm68AUlz9YThz/5SsdLK1Htt7uL8= +kubevirt.io/containerized-data-importer-api v1.58.3/go.mod h1:Y/8ETgHS1GjO89bl682DPtQOYEU/1ctPFBz6Sjxm4DM= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 h1:QMrd0nKP0BGbnxTqakhDZAUhGKxPiPiN5gSDqKUmGGc= +kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90/go.mod h1:018lASpFYBsYN6XwmA2TIrPCx6e0gviTd/ZNtSitKgc= +sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0= +sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= 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.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/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.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +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/operators/pkg/bastion-controller/suite_test.go b/operators/pkg/bastion-controller/suite_test.go index 9c8f05f95..a11e74b82 100644 --- a/operators/pkg/bastion-controller/suite_test.go +++ b/operators/pkg/bastion-controller/suite_test.go @@ -27,6 +27,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" crownlabsv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" crownlabsv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" @@ -67,8 +68,8 @@ var _ = BeforeSuite(func() { // +kubebuilder:scaffold:scheme k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{ - Scheme: scheme.Scheme, - MetricsBindAddress: "0", + Scheme: scheme.Scheme, + Metrics: server.Options{BindAddress: "0"}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/operators/pkg/examagent/instance.go b/operators/pkg/examagent/instance.go index a42eab09e..e8f32fa58 100644 --- a/operators/pkg/examagent/instance.go +++ b/operators/pkg/examagent/instance.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -275,7 +275,7 @@ func InstanceAdapterFromRequest(r *http.Request, log logr.Logger) (InstanceAdapt // InstanceSpecFromAdapter creates an InstanceSpec from a given InstanceAdapter. func InstanceSpecFromAdapter(instReq *InstanceAdapter) clv1alpha2.InstanceSpec { - running := pointer.BoolDeref(instReq.Running, true) + running := ptr.Deref(instReq.Running, true) return clv1alpha2.InstanceSpec{ Template: clv1alpha2.GenericRef{ Name: instReq.Template, @@ -295,7 +295,7 @@ func AdapterFromInstance(inst *clv1alpha2.Instance) *InstanceAdapter { adapter := &InstanceAdapter{ ID: inst.Name, Template: inst.Spec.Template.Name, - Running: pointer.Bool(inst.Spec.Running), + Running: ptr.To(inst.Spec.Running), URL: inst.Status.URL, Phase: string(inst.Status.Phase), Labels: inst.GetLabels(), diff --git a/operators/pkg/forge/cloudinit-startup.sh b/operators/pkg/forge/cloudinit-startup.sh new file mode 100644 index 000000000..22bac3908 --- /dev/null +++ b/operators/pkg/forge/cloudinit-startup.sh @@ -0,0 +1,3 @@ +#!/bin/bash +mkdir -p "$NFSPATH" +chown 1000:1000 "$NFSPATH" diff --git a/operators/pkg/forge/cloudinit.go b/operators/pkg/forge/cloudinit.go index 08d620285..2b4cdb49b 100644 --- a/operators/pkg/forge/cloudinit.go +++ b/operators/pkg/forge/cloudinit.go @@ -15,6 +15,8 @@ package forge import ( + "bytes" + _ "embed" "fmt" "gopkg.in/yaml.v3" @@ -49,6 +51,15 @@ type interf struct { DHCP4 bool `yaml:"dhcp4"` } +//go:embed cloudinit-startup.sh +var scriptdata []byte + +// CloudInitUserScriptData configures and forges the cloud-init startup script. +func CloudInitUserScriptData() ([]byte, error) { + userScriptData := bytes.ReplaceAll(scriptdata, []byte("$NFSPATH"), []byte(MyDriveVolumeMountPath)) + return userScriptData, nil +} + // CloudInitUserData forges the yaml manifest representing the cloud-init userdata configuration. func CloudInitUserData(nfsServerName, nfsPath string, publicKeys []string) ([]byte, error) { config := userdata{ @@ -73,7 +84,7 @@ func CloudInitUserData(nfsServerName, nfsPath string, publicKeys []string) ([]by fmt.Sprintf("%s:%s", nfsServerName, nfsPath), MyDriveVolumeMountPath, "nfs", - "rw,tcp,hard,intr,rsize=8192,wsize=8192,timeo=14", + "rw,tcp,hard,intr,rsize=8192,wsize=8192,timeo=14,_netdev,user", "0", "0", }} diff --git a/operators/pkg/forge/cloudinit_test.go b/operators/pkg/forge/cloudinit_test.go index dfa03dea4..67e941668 100644 --- a/operators/pkg/forge/cloudinit_test.go +++ b/operators/pkg/forge/cloudinit_test.go @@ -23,7 +23,7 @@ import ( "github.com/netgroup-polito/CrownLabs/operators/pkg/forge" ) -var _ = Describe("CloudInit userdata generation", func() { +var _ = Describe("CloudInit files generation", func() { Context("The CloudInitUserData function", func() { const ( serviceName = "rook-ceph-nfs-my-nfs-a.rook-ceph.svc.cluster.local" @@ -48,7 +48,7 @@ mounts: - - rook-ceph-nfs-my-nfs-a.rook-ceph.svc.cluster.local:/path - /media/mydrive - nfs - - rw,tcp,hard,intr,rsize=8192,wsize=8192,timeo=14 + - rw,tcp,hard,intr,rsize=8192,wsize=8192,timeo=14,_netdev,user - "0" - "0" ssh_authorized_keys: @@ -74,4 +74,20 @@ ssh_authorized_keys: It("Should succeed", func() { Expect(err).ToNot(HaveOccurred()) }) It("Should match the expected output", func() { Expect(output).To(WithTransform(Transformer, Equal(Transformer([]byte(expected))))) }) }) + + Context("The CloudInitUserScriptData function", func() { + const expected = `#!/bin/bash +mkdir -p "/media/mydrive" +chown 1000:1000 "/media/mydrive" +` + + var ( + scriptdata []byte + err error + ) + JustBeforeEach(func() { scriptdata, err = forge.CloudInitUserScriptData() }) + + It("Should succeed", func() { Expect(err).ToNot(HaveOccurred()) }) + It("Should match the expected output", func() { Expect(scriptdata).To(Equal([]byte(expected))) }) + }) }) diff --git a/operators/pkg/forge/containers.go b/operators/pkg/forge/containers.go index 1df6cb75b..6c1fe5a90 100644 --- a/operators/pkg/forge/containers.go +++ b/operators/pkg/forge/containers.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" ) @@ -92,7 +92,7 @@ func PVCSpec(environment *clv1alpha2.Environment) corev1.PersistentVolumeClaimSp corev1.ReadWriteOnce, }, StorageClassName: PVCStorageClassName(environment), - Resources: corev1.ResourceRequirements{ + Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ corev1.ResourceStorage: environment.Resources.Disk, }, @@ -103,7 +103,7 @@ func PVCSpec(environment *clv1alpha2.Environment) corev1.PersistentVolumeClaimSp // PVCStorageClassName returns the storage class configured as option, or nil if empty. func PVCStorageClassName(environment *clv1alpha2.Environment) *string { if environment.StorageClassName != "" { - return pointer.String(environment.StorageClassName) + return ptr.To[string](environment.StorageClassName) } return nil } @@ -112,10 +112,10 @@ func PVCStorageClassName(environment *clv1alpha2.Environment) *string { // with 1010 UID and GID and RunAsNonRoot set. func PodSecurityContext() *corev1.PodSecurityContext { return &corev1.PodSecurityContext{ - RunAsUser: pointer.Int64(CrownLabsUserID), - RunAsGroup: pointer.Int64(CrownLabsUserID), - FSGroup: pointer.Int64(CrownLabsUserID), - RunAsNonRoot: pointer.Bool(true), + RunAsUser: ptr.To(CrownLabsUserID), + RunAsGroup: ptr.To(CrownLabsUserID), + FSGroup: ptr.To(CrownLabsUserID), + RunAsNonRoot: ptr.To(true), } } @@ -123,9 +123,9 @@ func PodSecurityContext() *corev1.PodSecurityContext { // or, if persistent, in case environment spec is set as running; 0 otherwise. func ReplicasCount(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment, isNew bool) *int32 { if (!isNew && !environment.Persistent) || instance.Spec.Running { - return pointer.Int32(1) + return ptr.To[int32](1) } - return pointer.Int32(0) + return ptr.To[int32](0) } // DeploymentSpec forges the complete DeploymentSpec (without replicas) @@ -149,10 +149,10 @@ func PodSpec(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment, Containers: ContainersSpec(instance, environment, opts), Volumes: ContainerVolumes(instance, environment, nfsServerName, nfsPath), SecurityContext: PodSecurityContext(), - AutomountServiceAccountToken: pointer.Bool(false), - TerminationGracePeriodSeconds: pointer.Int64(containersTerminationGracePeriod), + AutomountServiceAccountToken: ptr.To(false), + TerminationGracePeriodSeconds: ptr.To[int64](containersTerminationGracePeriod), InitContainers: InitContainers(instance, environment, opts), - EnableServiceLinks: pointer.Bool(false), + EnableServiceLinks: ptr.To(false), Hostname: InstanceHostname(environment), } return spec @@ -161,8 +161,8 @@ func PodSpec(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment, // SubmissionJobSpec returns the job spec for the submission job. func SubmissionJobSpec(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment, opts *ContainerEnvOpts) batchv1.JobSpec { return batchv1.JobSpec{ - BackoffLimit: pointer.Int32(SubmissionJobMaxRetries), - TTLSecondsAfterFinished: pointer.Int32(SubmissionJobTTLSeconds), + BackoffLimit: ptr.To[int32](SubmissionJobMaxRetries), + TTLSecondsAfterFinished: ptr.To[int32](SubmissionJobTTLSeconds), Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -170,7 +170,7 @@ func SubmissionJobSpec(instance *clv1alpha2.Instance, environment *clv1alpha2.En }, Volumes: ContainerVolumes(instance, environment, "", ""), SecurityContext: PodSecurityContext(), - AutomountServiceAccountToken: pointer.Bool(false), + AutomountServiceAccountToken: ptr.To(false), RestartPolicy: corev1.RestartPolicyOnFailure, }, }, @@ -183,7 +183,7 @@ func ContainersSpec(instance *clv1alpha2.Instance, environment *clv1alpha2.Envir volumeMountPath := PersistentMountPath(environment) switch environment.EnvironmentType { case clv1alpha2.ClassContainer: - containers = append(containers, WebsockifyContainer(opts, environment, instance), XVncContainer(opts), AppContainer(instance, environment, volumeMountPath)) + containers = append(containers, WebsockifyContainer(opts, environment, instance), XVncContainer(opts), AppContainer(environment, volumeMountPath)) case clv1alpha2.ClassStandalone: containers = append(containers, StandaloneContainer(instance, environment, volumeMountPath)) default: @@ -224,7 +224,7 @@ func XVncContainer(opts *ContainerEnvOpts) corev1.Container { // StandaloneContainer forges the Standalone application container of the environment. func StandaloneContainer(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment, volumeMountPath string) corev1.Container { - standaloneContainer := AppContainer(instance, environment, volumeMountPath) + standaloneContainer := AppContainer(environment, volumeMountPath) AddTCPPortToContainer(&standaloneContainer, GUIPortName, GUIPortNumber) AddEnvVariableToContainer(&standaloneContainer, "CROWNLABS_BASE_PATH", IngressGUICleanPath(instance)) @@ -240,7 +240,7 @@ func StandaloneContainer(instance *clv1alpha2.Instance, environment *clv1alpha2. } // AppContainer forges the main application container of the environment. -func AppContainer(instance *clv1alpha2.Instance, environment *clv1alpha2.Environment, volumeMountPath string) corev1.Container { +func AppContainer(environment *clv1alpha2.Environment, volumeMountPath string) corev1.Container { appContainer := GenericContainer(environment.Name, environment.Image) SetContainerResourcesFromEnvironment(&appContainer, environment) AddEnvVariableFromResourcesToContainer(&appContainer, "CROWNLABS_CPU_REQUESTS", appContainer.Name, corev1.ResourceRequestsCPU, DefaultDivisor) @@ -305,8 +305,8 @@ func RestrictiveSecurityContext() *corev1.SecurityContext { corev1.Capability("ALL"), }, }, - Privileged: pointer.Bool(false), - AllowPrivilegeEscalation: pointer.Bool(false), + Privileged: ptr.To(false), + AllowPrivilegeEscalation: ptr.To(false), } } diff --git a/operators/pkg/forge/containers_test.go b/operators/pkg/forge/containers_test.go index 65c35fe60..8f66374c6 100644 --- a/operators/pkg/forge/containers_test.go +++ b/operators/pkg/forge/containers_test.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" "github.com/netgroup-polito/CrownLabs/operators/pkg/forge" @@ -273,7 +273,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { return []corev1.Container{ forge.WebsockifyContainer(&opts, e, i), forge.XVncContainer(&opts), - forge.AppContainer(i, e, forge.PersistentMountPath(e)), + forge.AppContainer(e, forge.PersistentMountPath(e)), } }, })) @@ -285,7 +285,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { return []corev1.Container{ forge.WebsockifyContainer(&opts, e, i), forge.XVncContainer(&opts), - forge.AppContainer(i, e, forge.PersistentMountPath(e)), + forge.AppContainer(e, forge.PersistentMountPath(e)), } }, })) @@ -297,7 +297,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { return []corev1.Container{ forge.WebsockifyContainer(&opts, e, i), forge.XVncContainer(&opts), - forge.AppContainer(i, e, forge.PersistentMountPath(&environment)), + forge.AppContainer(e, forge.PersistentMountPath(&environment)), } }, })) @@ -482,7 +482,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { Context("Has to set the general parameters", func() { JustBeforeEach(func() { - actual = forge.AppContainer(&instance, &environment, forge.PersistentMountPath(&environment)) + actual = forge.AppContainer(&environment, forge.PersistentMountPath(&environment)) }) It("Should set the correct container name and image", func() { @@ -521,7 +521,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { }) JustBeforeEach(func() { - actual = forge.AppContainer(&instance, &environment, forge.PersistentMountPath(&environment)) + actual = forge.AppContainer(&environment, forge.PersistentMountPath(&environment)) }) It("Should set the VolumeMounts accordingly", func() { @@ -564,7 +564,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { }) JustBeforeEach(func() { - actual = forge.AppContainer(&instance, &environment, forge.PersistentMountPath(&environment)) + actual = forge.AppContainer(&environment, forge.PersistentMountPath(&environment)) }) It("Should return the correct startup args", func() { @@ -575,17 +575,17 @@ var _ = Describe("Containers and Deployment spec forging", func() { When("ContainerStartupOptions is nil", WhenBody(ContainerCase{ StartupOpts: nil, - ExpectedOutput: func(e *clv1alpha2.Environment) []string { return nil }, + ExpectedOutput: func(_ *clv1alpha2.Environment) []string { return nil }, })) When("startup argument are not set", WhenBody(ContainerCase{ StartupOpts: &clv1alpha2.ContainerStartupOpts{}, - ExpectedOutput: func(e *clv1alpha2.Environment) []string { return nil }, + ExpectedOutput: func(_ *clv1alpha2.Environment) []string { return nil }, })) When("startup argument are not set", WhenBody(ContainerCase{ StartupOpts: &clv1alpha2.ContainerStartupOpts{StartupArgs: testArguments}, - ExpectedOutput: func(e *clv1alpha2.Environment) []string { return testArguments }, + ExpectedOutput: func(_ *clv1alpha2.Environment) []string { return testArguments }, })) }) @@ -602,7 +602,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { }) JustBeforeEach(func() { - actual = forge.AppContainer(&instance, &environment, forge.PersistentMountPath(&environment)) + actual = forge.AppContainer(&environment, forge.PersistentMountPath(&environment)) }) It("Should set the WorkingDirectory accordingly", func() { @@ -613,7 +613,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { When("ContainerStartupOptions is nil", WhenBody(ContainerCase{ StartupOpts: nil, - ExpectedOutput: func(e *clv1alpha2.Environment) string { return "" }, + ExpectedOutput: func(_ *clv1alpha2.Environment) string { return "" }, })) When("EnforceWorkdir is set", WhenBody(ContainerCase{ @@ -649,13 +649,13 @@ var _ = Describe("Containers and Deployment spec forging", func() { When("ContainerStartupOpts is nil", WhenBody(InitContainersCase{ StartupOpts: nil, - ExpectedOutput: func(i *clv1alpha2.Instance, e *clv1alpha2.Environment) []corev1.Container { + ExpectedOutput: func(_ *clv1alpha2.Instance, _ *clv1alpha2.Environment) []corev1.Container { return nil }, })) When("no archive source is specified", WhenBody(InitContainersCase{ StartupOpts: &clv1alpha2.ContainerStartupOpts{}, - ExpectedOutput: func(i *clv1alpha2.Instance, e *clv1alpha2.Environment) []corev1.Container { + ExpectedOutput: func(_ *clv1alpha2.Instance, _ *clv1alpha2.Environment) []corev1.Container { return nil }, })) @@ -718,8 +718,8 @@ var _ = Describe("Containers and Deployment spec forging", func() { It("should return the correct podSpecification", func() { Expect(actual).To(Equal(batchv1.JobSpec{ - BackoffLimit: pointer.Int32(forge.SubmissionJobMaxRetries), - TTLSecondsAfterFinished: pointer.Int32(forge.SubmissionJobTTLSeconds), + BackoffLimit: ptr.To[int32](forge.SubmissionJobMaxRetries), + TTLSecondsAfterFinished: ptr.To[int32](forge.SubmissionJobTTLSeconds), Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -727,7 +727,7 @@ var _ = Describe("Containers and Deployment spec forging", func() { }, Volumes: forge.ContainerVolumes(&instance, &environment, "", ""), SecurityContext: forge.PodSecurityContext(), - AutomountServiceAccountToken: pointer.Bool(false), + AutomountServiceAccountToken: ptr.To(false), RestartPolicy: corev1.RestartPolicyOnFailure, }, }, diff --git a/operators/pkg/forge/virtualmachines.go b/operators/pkg/forge/virtualmachines.go index 5bde382ce..16e401375 100644 --- a/operators/pkg/forge/virtualmachines.go +++ b/operators/pkg/forge/virtualmachines.go @@ -19,7 +19,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" virtv1 "kubevirt.io/api/core/v1" cdiv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" @@ -71,7 +71,7 @@ func VirtualMachineInstanceSpec(instance *clv1alpha2.Instance, environment *clv1 Volumes: Volumes(instance, environment), ReadinessProbe: VirtualMachineReadinessProbe(environment), Networks: []virtv1.Network{*virtv1.DefaultPodNetwork()}, - TerminationGracePeriodSeconds: pointer.Int64(terminationGracePeriod), + TerminationGracePeriodSeconds: ptr.To[int64](terminationGracePeriod), } } @@ -233,8 +233,8 @@ func DataVolumeSourceForge(environment *clv1alpha2.Environment) *cdiv1beta1.Data } return &cdiv1beta1.DataVolumeSource{ Registry: &cdiv1beta1.DataVolumeSourceRegistry{ - URL: pointer.String(urlDockerPrefix + environment.Image), - SecretRef: pointer.String(cdiSecretName), + URL: ptr.To[string](urlDockerPrefix + environment.Image), + SecretRef: ptr.To[string](cdiSecretName), }, } } @@ -247,7 +247,7 @@ func DataVolumeTemplate(name string, environment *clv1alpha2.Environment) virtv1 Source: DataVolumeSourceForge(environment), PVC: &corev1.PersistentVolumeClaimSpec{ AccessModes: []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}, - Resources: corev1.ResourceRequirements{ + Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ corev1.ResourceStorage: environment.Resources.Disk, }, diff --git a/operators/pkg/instancesnapshot-controller/instancesnapshot_controller_suite_test.go b/operators/pkg/instancesnapshot-controller/instancesnapshot_controller_suite_test.go index 17b7e71a8..2268aaf10 100644 --- a/operators/pkg/instancesnapshot-controller/instancesnapshot_controller_suite_test.go +++ b/operators/pkg/instancesnapshot-controller/instancesnapshot_controller_suite_test.go @@ -30,6 +30,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" crownlabsv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" instancesnapshot_controller "github.com/netgroup-polito/CrownLabs/operators/pkg/instancesnapshot-controller" @@ -66,8 +67,8 @@ var _ = BeforeSuite(func() { // +kubebuilder:scaffold:scheme k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{ - Scheme: scheme.Scheme, - MetricsBindAddress: "0", + Scheme: scheme.Scheme, + Metrics: server.Options{BindAddress: "0"}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/operators/pkg/instctrl/cloudinit.go b/operators/pkg/instctrl/cloudinit.go index e5786c231..ccc592d77 100644 --- a/operators/pkg/instctrl/cloudinit.go +++ b/operators/pkg/instctrl/cloudinit.go @@ -71,12 +71,19 @@ func (r *InstanceReconciler) EnforceCloudInitSecret(ctx context.Context) error { log.Error(err, "unable to marshal secret content") return err } + + userScriptData, err := forge.CloudInitUserScriptData() + if err != nil { + log.Error(err, "unable to marshal secret content") + return err + } + // Enforce the cloud-init secret presence. instance := clctx.InstanceFrom(ctx) secret := corev1.Secret{ObjectMeta: forge.ObjectMeta(instance)} res, err := ctrl.CreateOrUpdate(ctx, r.Client, &secret, func() error { secret.SetLabels(forge.InstanceObjectLabels(secret.GetLabels(), instance)) - secret.Data = map[string][]byte{UserDataKey: userdata} + secret.Data = map[string][]byte{UserDataKey: userdata, "x-shellscript": userScriptData} secret.Type = corev1.SecretTypeOpaque return ctrl.SetControllerReference(instance, &secret, r.Scheme) }) diff --git a/operators/pkg/instctrl/cloudinit_test.go b/operators/pkg/instctrl/cloudinit_test.go index eaf3d64a1..2a7a8969c 100644 --- a/operators/pkg/instctrl/cloudinit_test.go +++ b/operators/pkg/instctrl/cloudinit_test.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -110,8 +110,8 @@ var _ = Describe("Generation of the cloud-init configuration", func() { Kind: "Instance", Name: instance.GetName(), UID: instance.GetUID(), - BlockOwnerDeletion: pointer.Bool(true), - Controller: pointer.Bool(true), + BlockOwnerDeletion: ptr.To(true), + Controller: ptr.To(true), } }) diff --git a/operators/pkg/instctrl/containers_test.go b/operators/pkg/instctrl/containers_test.go index 0e0dab8b5..acd2b7bbd 100644 --- a/operators/pkg/instctrl/containers_test.go +++ b/operators/pkg/instctrl/containers_test.go @@ -28,7 +28,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -150,8 +150,8 @@ var _ = Describe("Generation of the container based instances", func() { Kind: "Instance", Name: instance.GetName(), UID: instance.GetUID(), - BlockOwnerDeletion: pointer.Bool(true), - Controller: pointer.Bool(true), + BlockOwnerDeletion: ptr.To(true), + Controller: ptr.To(true), } }) diff --git a/operators/pkg/instctrl/controller.go b/operators/pkg/instctrl/controller.go index 311440a43..cf33416aa 100644 --- a/operators/pkg/instctrl/controller.go +++ b/operators/pkg/instctrl/controller.go @@ -37,7 +37,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" clv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" @@ -249,7 +248,7 @@ func (r *InstanceReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) Owns(&virtv1.VirtualMachine{}). // Here, we use Watches instead of Owns since we need to react also in case a VMI generated from a VM is updated, // to correctly update the instance phase in case of persistent VMs with resource quota exceeded. - Watches(&source.Kind{Type: &virtv1.VirtualMachineInstance{}}, handler.EnqueueRequestsFromMapFunc(r.vmiToInstance)). + Watches(&virtv1.VirtualMachineInstance{}, handler.EnqueueRequestsFromMapFunc(r.vmiToInstance)). WithOptions(controller.Options{ MaxConcurrentReconciles: concurrency, }). @@ -258,7 +257,7 @@ func (r *InstanceReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) } // vmiToInstance returns a reconcile request for the instance associated with the given VMI object. -func (r *InstanceReconciler) vmiToInstance(o client.Object) []reconcile.Request { +func (r *InstanceReconciler) vmiToInstance(_ context.Context, o client.Object) []reconcile.Request { if instance, found := forge.InstanceNameFromLabels(o.GetLabels()); found { return []reconcile.Request{{NamespacedName: types.NamespacedName{Namespace: o.GetNamespace(), Name: instance}}} } diff --git a/operators/pkg/instctrl/exposition_test.go b/operators/pkg/instctrl/exposition_test.go index 6f32c3ca8..5d67696a7 100644 --- a/operators/pkg/instctrl/exposition_test.go +++ b/operators/pkg/instctrl/exposition_test.go @@ -17,6 +17,7 @@ package instctrl_test import ( "context" "fmt" + "reflect" "time" "github.com/go-logr/logr" @@ -29,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -109,8 +110,8 @@ var _ = Describe("Generation of the exposition environment", func() { Kind: "Instance", Name: instance.GetName(), UID: instance.GetUID(), - BlockOwnerDeletion: pointer.Bool(true), - Controller: pointer.Bool(true), + BlockOwnerDeletion: ptr.To(true), + Controller: ptr.To(true), } }) @@ -174,15 +175,13 @@ var _ = Describe("Generation of the exposition environment", func() { BeforeEach(func() { instance.Spec.Running = true }) ObjectToSpec := func(obj client.Object) interface{} { - switch obj.GetObjectKind().GroupVersionKind().Kind { - case "Service": - return obj.(*corev1.Service).Spec - case "Ingress": - return obj.(*netv1.Ingress).Spec - default: - Fail("Unexpected resource type " + obj.GetObjectKind().GroupVersionKind().Kind) - return nil + if svc, ok := obj.(*corev1.Service); ok { + return svc.Spec + } else if ing, ok := obj.(*netv1.Ingress); ok { + return ing.Spec } + Fail("Unexpected resource type " + reflect.TypeOf(obj).String()) + return nil } DescribeBodyPresent := func(p DescribeBodyParameters) { diff --git a/operators/pkg/instctrl/suite_test.go b/operators/pkg/instctrl/suite_test.go index 5d77c31ed..8ecd298fa 100644 --- a/operators/pkg/instctrl/suite_test.go +++ b/operators/pkg/instctrl/suite_test.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" - "k8s.io/klog/v2/klogr" + "k8s.io/klog/v2/textlogger" virtv1 "kubevirt.io/api/core/v1" cdiv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1" ctrl "sigs.k8s.io/controller-runtime" @@ -48,10 +48,13 @@ func TestAPIs(t *testing.T) { var ( instanceReconciler instctrl.InstanceReconciler k8sClient client.Client - testEnv = envtest.Environment{CRDDirectoryPaths: []string{ - filepath.Join("..", "..", "deploy", "crds"), - filepath.Join("..", "..", "tests", "crds"), - }} + testEnv = envtest.Environment{ + CRDDirectoryPaths: []string{ + filepath.Join("..", "..", "deploy", "crds"), + filepath.Join("..", "..", "tests", "crds"), + }, + ErrorIfCRDPathMissing: true, + } whiteListMap = map[string]string{"production": "true"} ) @@ -62,15 +65,16 @@ var _ = BeforeSuite(func() { Expect(err).ToNot(HaveOccurred()) Expect(cfg).ToNot(BeNil()) - Expect(clv1alpha2.AddToScheme(scheme.Scheme)).To(Succeed()) + Expect(clv1alpha2.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) Expect(clv1alpha1.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) Expect(virtv1.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) Expect(cdiv1beta1.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) - ctrl.SetLogger(klogr.NewWithOptions()) + ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig())) k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) Expect(err).ToNot(HaveOccurred()) + Expect(k8sClient).NotTo(BeNil()) instanceReconciler = instctrl.InstanceReconciler{ Client: k8sClient, diff --git a/operators/pkg/instctrl/virtualmachines.go b/operators/pkg/instctrl/virtualmachines.go index 13e633d5a..838e060b1 100644 --- a/operators/pkg/instctrl/virtualmachines.go +++ b/operators/pkg/instctrl/virtualmachines.go @@ -18,7 +18,7 @@ import ( "context" "k8s.io/klog/v2" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" virtv1 "kubevirt.io/api/core/v1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -73,7 +73,7 @@ func (r *InstanceReconciler) enforceVirtualMachine(ctx context.Context) error { vm.Spec = forge.VirtualMachineSpec(instance, environment) } // Afterwards, the only modification to the specifications is performed to configure the running flag. - vm.Spec.Running = pointer.Bool(instance.Spec.Running) + vm.Spec.Running = ptr.To(instance.Spec.Running) vm.SetLabels(forge.InstanceObjectLabels(vm.GetLabels(), instance)) return ctrl.SetControllerReference(instance, &vm, r.Scheme) }) @@ -90,6 +90,8 @@ func (r *InstanceReconciler) enforceVirtualMachine(ctx context.Context) error { if err = r.Get(ctx, client.ObjectKeyFromObject(&vmi), &vmi); client.IgnoreNotFound(err) != nil { log.Error(err, "failed to retrieve virtualmachineinstance", "virtualmachineinstance", klog.KObj(&vm)) return err + } else if err != nil { + klog.Infof("VMI %s doesn't exist", instance.Name) } phase := r.RetrievePhaseFromVM(&vm, &vmi) diff --git a/operators/pkg/instctrl/virtualmachines_test.go b/operators/pkg/instctrl/virtualmachines_test.go index 9c832222f..e3ca767ae 100644 --- a/operators/pkg/instctrl/virtualmachines_test.go +++ b/operators/pkg/instctrl/virtualmachines_test.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" virtv1 "kubevirt.io/api/core/v1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -133,8 +133,8 @@ var _ = Describe("Generation of the virtual machine and virtual machine instance Kind: "Instance", Name: instance.GetName(), UID: instance.GetUID(), - BlockOwnerDeletion: pointer.Bool(true), - Controller: pointer.Bool(true), + BlockOwnerDeletion: ptr.To(true), + Controller: ptr.To(true), } }) @@ -326,7 +326,7 @@ var _ = Describe("Generation of the virtual machine and virtual machine instance BeforeEach(func() { existing := virtv1.VirtualMachine{ ObjectMeta: forge.NamespacedNameToObjectMeta(objectName), - Spec: virtv1.VirtualMachineSpec{Running: pointer.Bool(running)}, + Spec: virtv1.VirtualMachineSpec{Running: ptr.To(running)}, Status: virtv1.VirtualMachineStatus{PrintableStatus: virtv1.VirtualMachineStatusRunning}, } existing.SetCreationTimestamp(metav1.NewTime(time.Now())) diff --git a/operators/pkg/instmetrics/cri_scraper.go b/operators/pkg/instmetrics/cri_scraper.go index cef44a312..3570c3d33 100644 --- a/operators/pkg/instmetrics/cri_scraper.go +++ b/operators/pkg/instmetrics/cri_scraper.go @@ -17,7 +17,7 @@ package instmetrics import ( "context" - criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + criapi "k8s.io/cri-api/pkg/apis/runtime/v1" "k8s.io/utils/trace" clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" diff --git a/operators/pkg/instmetrics/docker_scraper.go b/operators/pkg/instmetrics/docker_scraper.go deleted file mode 100644 index d42f3d667..000000000 --- a/operators/pkg/instmetrics/docker_scraper.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2020-2024 Politecnico di Torino -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package instmetrics - -import ( - "context" - "encoding/json" - "strings" - sync "sync" - - "github.com/docker/docker/client" - "golang.org/x/sync/errgroup" - criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" - "k8s.io/utils/trace" - - clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" -) - -// ContainerStatsResponse is the response from the docker API for container stats. -type ContainerStatsResponse struct { - MemoryStats struct { - Usage uint64 `json:"usage"` - } `json:"memory_stats"` - - CPUStats struct { - Timestamp int64 `json:"system_cpu_usage"` - Cores uint64 `json:"online_cpus"` - - Usage struct { - Total uint64 `json:"total_usage"` - } `json:"cpu_usage"` - } `json:"cpu_stats"` -} - -// DockerMetricsScraper extracts container stats using the docker API client. -type DockerMetricsScraper struct { - // Client is the API client that performs all operations against a docker server. - DockerClient *client.Client - ContStatsListMutex *sync.RWMutex -} - -func (s DockerMetricsScraper) getStats(ctx context.Context, containers []*criapi.Container) ([]ContainerStats, error) { - log := clctx.LoggerFromContext(ctx).WithName("docker-metrics-scraper") - errs, ctx := errgroup.WithContext(ctx) - tracer := trace.New("docker-metrics-scraper") - - var containerStatsList []ContainerStats - - for _, container := range containers { - container := container // https://golang.org/doc/faq#closures_and_goroutines - containerID := container.GetId() - - errs.Go(func() error { - log = log.WithValues("containerID", containerID) - - stats, err := getContainerStatsOneShot(ctx, containerID, s.DockerClient) - log.V(3).Info("getContainerStatsOneShot obtained") - - if err != nil { - if strings.Contains(err.Error(), "No such container") { - s.ContStatsListMutex.Lock() - containerStatsList = append(containerStatsList, ContainerStats{container: container, runningContainer: false}) - s.ContStatsListMutex.Unlock() - return nil - } - return err - } - - s.ContStatsListMutex.Lock() - containerStatsList = append(containerStatsList, ContainerStats{ - CPUTimestamp: stats.CPUStats.Timestamp, - UsageCoreNanoSeconds: stats.CPUStats.Usage.Total * stats.CPUStats.Cores, // Total cores usage. - MemoryUsageInBytes: stats.MemoryStats.Usage, - DiskUsageInBytes: 0, // Not supported. - container: container, - runningContainer: true}) - s.ContStatsListMutex.Unlock() - - return nil - }) - } - - if err := errs.Wait(); err != nil { - return nil, err - } - tracer.Log() - - return containerStatsList, nil -} - -func getContainerStatsOneShot(ctx context.Context, cID string, cli *client.Client) (*ContainerStatsResponse, error) { - stats, err := cli.ContainerStatsOneShot(ctx, cID) - if err != nil { - return nil, err - } - - out := stats.Body - defer out.Close() - - containerStatsResponse := ContainerStatsResponse{} - if err := json.NewDecoder(out).Decode(&containerStatsResponse); err != nil { - return nil, err - } - - return &containerStatsResponse, nil -} diff --git a/operators/pkg/instmetrics/metrics_scraper.go b/operators/pkg/instmetrics/metrics_scraper.go index f1f2866ff..6a6ce6684 100644 --- a/operators/pkg/instmetrics/metrics_scraper.go +++ b/operators/pkg/instmetrics/metrics_scraper.go @@ -21,7 +21,7 @@ import ( "time" "github.com/go-logr/logr" - criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + criapi "k8s.io/cri-api/pkg/apis/runtime/v1" "k8s.io/utils/trace" clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" diff --git a/operators/pkg/instmetrics/readinessprobe.go b/operators/pkg/instmetrics/readinessprobe.go index f9e6210b7..ba69c2482 100644 --- a/operators/pkg/instmetrics/readinessprobe.go +++ b/operators/pkg/instmetrics/readinessprobe.go @@ -19,7 +19,7 @@ import ( "net/http" "github.com/go-logr/logr" - criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + criapi "k8s.io/cri-api/pkg/apis/runtime/v1" clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" ) diff --git a/operators/pkg/instmetrics/remote_runtime.go b/operators/pkg/instmetrics/remote_runtime.go index fd61465b3..2c640ab34 100644 --- a/operators/pkg/instmetrics/remote_runtime.go +++ b/operators/pkg/instmetrics/remote_runtime.go @@ -23,7 +23,7 @@ import ( // criapi "k8s.io/cri-api/pkg/apis/runtime/v1". "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - criapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + criapi "k8s.io/cri-api/pkg/apis/runtime/v1" clctx "github.com/netgroup-polito/CrownLabs/operators/pkg/context" ) diff --git a/operators/pkg/instmetrics/server.go b/operators/pkg/instmetrics/server.go index d58767ef7..174bcc3a9 100644 --- a/operators/pkg/instmetrics/server.go +++ b/operators/pkg/instmetrics/server.go @@ -40,14 +40,14 @@ type Server struct { } // Start metricsScraper and RPC server. -func (instmetrics Server) Start(ctx context.Context) error { +func (instmetrics *Server) Start(ctx context.Context) error { lis, err := net.Listen("tcp", fmt.Sprintf("%s%d", "0.0.0.0:", instmetrics.Port)) if err != nil { return err } instmetrics.grpcServer = grpc.NewServer() - RegisterInstanceMetricsServer(instmetrics.grpcServer, &instmetrics) + RegisterInstanceMetricsServer(instmetrics.grpcServer, instmetrics) instmetrics.Log.Info("Custom Metrics gRPC Server started", "listenerAddress", lis.Addr()) @@ -69,7 +69,7 @@ func (instmetrics Server) Start(ctx context.Context) error { } // ContainerMetrics receives the PodName and returns a ContainerMetricsResponse with resource utilization. -func (instmetrics *Server) ContainerMetrics(ctx context.Context, in *ContainerMetricsRequest) (*ContainerMetricsResponse, error) { +func (instmetrics *Server) ContainerMetrics(_ context.Context, in *ContainerMetricsRequest) (*ContainerMetricsResponse, error) { if in == nil || in.PodName == "" { return nil, fmt.Errorf("wrong request: valid CustomMetricsRequest required") } diff --git a/operators/pkg/tenant-controller/autoenroll_test.go b/operators/pkg/tenant-controller/autoenroll_test.go index 2e2d90612..5fdcb4710 100644 --- a/operators/pkg/tenant-controller/autoenroll_test.go +++ b/operators/pkg/tenant-controller/autoenroll_test.go @@ -74,7 +74,7 @@ var _ = Describe("Workspace AutoEnroll Update", func() { }) JustBeforeEach(func() { - cl = builder.WithObjects(&tenant, &workspace).Build() + cl = builder.WithObjects(&tenant, &workspace).WithStatusSubresource(&tenant, &workspace).Build() tnReconciler = tntctrl.TenantReconciler{ Client: cl, Scheme: scheme.Scheme, TargetLabelKey: labelkey, TargetLabelValue: labelvalue, diff --git a/operators/pkg/tenant-controller/lastlogin_test.go b/operators/pkg/tenant-controller/lastlogin_test.go index babf00078..15c4a783d 100644 --- a/operators/pkg/tenant-controller/lastlogin_test.go +++ b/operators/pkg/tenant-controller/lastlogin_test.go @@ -61,7 +61,7 @@ var _ = Describe("Automatic namespace deletion", func() { }) JustBeforeEach(func() { - cl = builder.WithObjects(&tenant).Build() + cl = builder.WithObjects(&tenant).WithStatusSubresource(&tenant).Build() reconciler := tntctrl.TenantReconciler{ Client: cl, Scheme: scheme.Scheme, TenantNSKeepAlive: 1 * time.Hour, RequeueTimeMinimum: 1 + time.Hour, RequeueTimeMaximum: 2 * time.Hour, diff --git a/operators/pkg/tenant-controller/sandbox_test.go b/operators/pkg/tenant-controller/sandbox_test.go index 24fc6e7b4..8d8250321 100644 --- a/operators/pkg/tenant-controller/sandbox_test.go +++ b/operators/pkg/tenant-controller/sandbox_test.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -173,8 +173,8 @@ var _ = Describe("Sandbox", func() { Kind: "Tenant", Name: tenant.Name, UID: tenant.GetUID(), - BlockOwnerDeletion: pointer.Bool(true), - Controller: pointer.Bool(true), + BlockOwnerDeletion: ptr.To[bool](true), + Controller: ptr.To[bool](true), } sandboxNSname = types.NamespacedName{ Name: forge.CanonicalSandboxName(tenantName), diff --git a/operators/pkg/tenant-controller/suite_test.go b/operators/pkg/tenant-controller/suite_test.go index 9ac3a257c..c2f7f211d 100644 --- a/operators/pkg/tenant-controller/suite_test.go +++ b/operators/pkg/tenant-controller/suite_test.go @@ -33,6 +33,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" + "sigs.k8s.io/controller-runtime/pkg/metrics/server" crownlabsv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" crownlabsv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" @@ -89,7 +90,11 @@ var _ = BeforeSuite(func() { By("bootstrapping test environment") testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "deploy", "crds")}, + CRDDirectoryPaths: []string{ + filepath.Join("..", "..", "deploy", "crds"), + filepath.Join("..", "..", "tests", "crds"), + }, + ErrorIfCRDPathMissing: true, } var err error @@ -103,8 +108,8 @@ var _ = BeforeSuite(func() { // +kubebuilder:scaffold:scheme k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{ - Scheme: scheme.Scheme, - MetricsBindAddress: "0", + Scheme: scheme.Scheme, + Metrics: server.Options{BindAddress: "0"}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/operators/pkg/tenant-controller/tenant_controller.go b/operators/pkg/tenant-controller/tenant_controller.go index 6a92c9b4e..5b8908456 100644 --- a/operators/pkg/tenant-controller/tenant_controller.go +++ b/operators/pkg/tenant-controller/tenant_controller.go @@ -37,7 +37,6 @@ import ( ctrlUtil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" crownlabsv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" crownlabsv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" @@ -192,7 +191,7 @@ func (r *TenantReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr } if err = r.EnforceSandboxResources(ctx, &tn); err != nil { - klog.Error("Failed checking sandbox for tenant %s -> %s", tn.Name, err) + klog.Errorf("Failed checking sandbox for tenant %s -> %s", tn.Name, err) tn.Status.SandboxNamespace.Created = false tnOpinternalErrors.WithLabelValues("tenant", "sandbox-resources").Inc() return ctrl.Result{}, err @@ -244,7 +243,7 @@ func (r *TenantReconciler) SetupWithManager(mgr ctrl.Manager) error { Owns(&rbacv1.ClusterRole{}). Owns(&rbacv1.ClusterRoleBinding{}). Owns(&netv1.NetworkPolicy{}). - Watches(&source.Kind{Type: &crownlabsv1alpha1.Workspace{}}, + Watches(&crownlabsv1alpha1.Workspace{}, handler.EnqueueRequestsFromMapFunc(r.workspaceToEnrolledTenants)). WithOptions(controller.Options{ MaxConcurrentReconciles: r.Concurrency, @@ -335,7 +334,7 @@ func (r *TenantReconciler) checkNamespaceKeepAlive(ctx context.Context, tn *crow // Attempt to get instances in current namespace list := &crownlabsv1alpha2.InstanceList{} - if err := r.List(context.Background(), list, client.InNamespace(nsName)); err != nil { + if err := r.List(ctx, list, client.InNamespace(nsName)); err != nil { return true, err } @@ -691,10 +690,10 @@ func (r *TenantReconciler) updateTnResourceCommonLabels(labels map[string]string return labels } -func (r *TenantReconciler) workspaceToEnrolledTenants(o client.Object) []reconcile.Request { +func (r *TenantReconciler) workspaceToEnrolledTenants(ctx context.Context, o client.Object) []reconcile.Request { var enqueues []reconcile.Request var tenants crownlabsv1alpha2.TenantList - if err := r.List(context.Background(), &tenants, client.HasLabels{ + if err := r.List(ctx, &tenants, client.HasLabels{ fmt.Sprintf("%s%s", crownlabsv1alpha2.WorkspaceLabelPrefix, o.GetName()), }); err != nil { klog.Errorf("Error when retrieving tenants enrolled in %s -> %s", o.GetName(), err) diff --git a/operators/pkg/tenant-controller/tenant_controller_test.go b/operators/pkg/tenant-controller/tenant_controller_test.go index efa64cef0..34575970b 100644 --- a/operators/pkg/tenant-controller/tenant_controller_test.go +++ b/operators/pkg/tenant-controller/tenant_controller_test.go @@ -279,7 +279,7 @@ var _ = Describe("Tenant controller", func() { }) -func checkTnPVBound(ctx context.Context, tnName, nsName string, timeout, interval time.Duration, serverName, rookCephNamespace, path string) { +func checkTnPVBound(ctx context.Context, tnName string, timeout, interval time.Duration, serverName, rookCephNamespace, path string) { var pvc v1.PersistentVolumeClaim doesEventuallyExists(ctx, types.NamespacedName{Name: myDrivePVCName(tnName), Namespace: testMyDrivePVCsNamespace}, &pvc, BeTrue(), timeout, interval) @@ -432,7 +432,7 @@ func checkTnClusterResourceCreation(ctx context.Context, tnName, nsName string, Expect(createdNetPolAllow.Spec.Ingress[0].From[0].NamespaceSelector.MatchLabels["crownlabs.polito.it/allow-instance-access"]).Should(Equal("true")) By("By checking that the mydrive-info secret of the tenant has been created") - checkTnPVBound(ctx, tnName, nsName, timeout, interval, serverName, rookCephNamespace, path) + checkTnPVBound(ctx, tnName, timeout, interval, serverName, rookCephNamespace, path) By("By checking that the mydrive-info secret of the tenant has been created") NFSSecretLookupKey := types.NamespacedName{Name: NFSSecretName, Namespace: nsName} diff --git a/operators/pkg/tenantwh/common.go b/operators/pkg/tenantwh/common.go index 2e50c4409..a9a893af7 100644 --- a/operators/pkg/tenantwh/common.go +++ b/operators/pkg/tenantwh/common.go @@ -16,6 +16,7 @@ package tenantwh import ( "context" + "errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" @@ -38,14 +39,11 @@ func (twh *TenantWebhook) CheckWebhookOverride(req *admission.Request) bool { return utils.MatchOneInStringSlices(twh.BypassGroups, req.UserInfo.Groups) } -// InjectDecoder injects the decoder - this method is used by controller runtime. -func (twh *TenantWebhook) InjectDecoder(d *admission.Decoder) error { - twh.decoder = d - return nil -} - // DecodeTenant decodes the tenant from the incoming request. func (twh *TenantWebhook) DecodeTenant(obj runtime.RawExtension) (tenant *clv1alpha2.Tenant, err error) { + if twh.decoder == nil { + return nil, errors.New("missing decoder") + } tenant = &clv1alpha2.Tenant{} err = twh.decoder.DecodeRaw(obj, tenant) return diff --git a/operators/pkg/tenantwh/mutating.go b/operators/pkg/tenantwh/mutating.go index 317d5ff05..6274166ea 100644 --- a/operators/pkg/tenantwh/mutating.go +++ b/operators/pkg/tenantwh/mutating.go @@ -21,6 +21,7 @@ import ( "strings" admissionv1 "k8s.io/api/admission/v1" + "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook" @@ -38,10 +39,14 @@ type TenantMutator struct { } // MakeTenantMutator creates a new webhook handler suitable for controller runtime based on TenantMutator. -func MakeTenantMutator(c client.Client, webhookBypassGroups []string, opSelectorKey, opSelectorValue string, baseWorkspaces []string) *webhook.Admission { +func MakeTenantMutator(c client.Client, webhookBypassGroups []string, opSelectorKey, opSelectorValue string, baseWorkspaces []string, scheme *runtime.Scheme) *webhook.Admission { return &webhook.Admission{Handler: &TenantMutator{ opSelectorKey, opSelectorValue, baseWorkspaces, - TenantWebhook{Client: c, BypassGroups: webhookBypassGroups}, + TenantWebhook{ + Client: c, + BypassGroups: webhookBypassGroups, + decoder: admission.NewDecoder(scheme), + }, }} } diff --git a/operators/pkg/tenantwh/mutating_test.go b/operators/pkg/tenantwh/mutating_test.go index 418ff2590..00507989c 100644 --- a/operators/pkg/tenantwh/mutating_test.go +++ b/operators/pkg/tenantwh/mutating_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package tenantwh_test +package tenantwh import ( "net/http" @@ -26,12 +26,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook/admission" clv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" - "github.com/netgroup-polito/CrownLabs/operators/pkg/tenantwh" ) var _ = Describe("Mutating webhook", func() { var ( - mutatingWH *tenantwh.TenantMutator + mutatingWH *TenantMutator request admission.Request opSelectorKey = "crownlabs.polito.it/op-sel" @@ -53,8 +52,8 @@ var _ = Describe("Mutating webhook", func() { JustBeforeEach(func() { fakeClient := fake.NewClientBuilder().WithScheme(scheme).Build() - mutatingWH = tenantwh.MakeTenantMutator(fakeClient, bypassGroups, opSelectorKey, opSelectorValue, baseWorkspaces).Handler.(*tenantwh.TenantMutator) - Expect(mutatingWH.InjectDecoder(decoder)).To(Succeed()) + mutatingWH = MakeTenantMutator(fakeClient, bypassGroups, opSelectorKey, opSelectorValue, baseWorkspaces, scheme).Handler.(*TenantMutator) + Expect(mutatingWH.decoder).NotTo(BeNil()) }) Describe("The TenantMutator.Handle method", func() { diff --git a/operators/pkg/tenantwh/tenantwh_suite_test.go b/operators/pkg/tenantwh/tenantwh_suite_test.go index 15cfbb677..c7929a917 100644 --- a/operators/pkg/tenantwh/tenantwh_suite_test.go +++ b/operators/pkg/tenantwh/tenantwh_suite_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package tenantwh_test +package tenantwh import ( "context" @@ -30,9 +30,8 @@ import ( ) var ( - scheme *runtime.Scheme - decoder *admission.Decoder - ctx = context.Background() + scheme *runtime.Scheme + ctx = context.Background() bypassGroups = []string{"admins"} testTenantName = "test-tenant" @@ -43,9 +42,6 @@ var _ = BeforeSuite(func() { scheme = runtime.NewScheme() Expect(clv1alpha1.AddToScheme(scheme)).To(Succeed()) Expect(clv1alpha2.AddToScheme(scheme)).To(Succeed()) - var err error - decoder, err = admission.NewDecoder(scheme) - Expect(err).ToNot(HaveOccurred()) }) func TestTenantWebHooks(t *testing.T) { diff --git a/operators/pkg/tenantwh/validating.go b/operators/pkg/tenantwh/validating.go index 20240f820..247a13874 100644 --- a/operators/pkg/tenantwh/validating.go +++ b/operators/pkg/tenantwh/validating.go @@ -25,6 +25,7 @@ import ( admissionv1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook" @@ -42,10 +43,11 @@ const LastLoginToleration = time.Hour * 24 type TenantValidator struct{ TenantWebhook } // MakeTenantValidator creates a new webhook handler suitable for controller runtime based on TenantValidator. -func MakeTenantValidator(c client.Client, webhookBypassGroups []string) *webhook.Admission { +func MakeTenantValidator(c client.Client, webhookBypassGroups []string, scheme *runtime.Scheme) *webhook.Admission { return &webhook.Admission{Handler: &TenantValidator{TenantWebhook{ Client: c, BypassGroups: webhookBypassGroups, + decoder: admission.NewDecoder(scheme), }}} } diff --git a/operators/pkg/tenantwh/validating_test.go b/operators/pkg/tenantwh/validating_test.go index 035d6ac8d..3f1ebfeaa 100644 --- a/operators/pkg/tenantwh/validating_test.go +++ b/operators/pkg/tenantwh/validating_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package tenantwh_test +package tenantwh import ( "net/http" @@ -27,7 +27,6 @@ import ( clv1alpha1 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha1" clv1alpha2 "github.com/netgroup-polito/CrownLabs/operators/api/v1alpha2" - "github.com/netgroup-polito/CrownLabs/operators/pkg/tenantwh" ) var _ = Describe("Validating webhook", func() { @@ -47,7 +46,7 @@ var _ = Describe("Validating webhook", func() { } var ( - validatingWH *tenantwh.TenantValidator + validatingWH *TenantValidator request admission.Request response admission.Response manager *clv1alpha2.Tenant @@ -111,8 +110,9 @@ var _ = Describe("Validating webhook", func() { workspaceIM, ).Build() - validatingWH = tenantwh.MakeTenantValidator(fakeClient, bypassGroups).Handler.(*tenantwh.TenantValidator) - Expect(validatingWH.InjectDecoder(decoder)).To(Succeed()) + validatingWH = MakeTenantValidator(fakeClient, bypassGroups, scheme).Handler.(*TenantValidator) + + Expect(validatingWH.decoder).NotTo(BeNil()) }) Describe("The TenantValidator.Handle method", func() { @@ -185,7 +185,7 @@ var _ = Describe("Validating webhook", func() { BeforeEach(func() { newTenant = &clv1alpha2.Tenant{Spec: clv1alpha2.TenantSpec{ LastLogin: metav1.Time{ - Time: time.Now().Add(tenantwh.LastLoginToleration / 2), + Time: time.Now().Add(LastLoginToleration / 2), }, }} }) @@ -198,7 +198,7 @@ var _ = Describe("Validating webhook", func() { BeforeEach(func() { newTenant = &clv1alpha2.Tenant{Spec: clv1alpha2.TenantSpec{ LastLogin: metav1.Time{ - Time: time.Now().Add(tenantwh.LastLoginToleration + time.Millisecond), + Time: time.Now().Add(LastLoginToleration + time.Millisecond), }, }} }) @@ -372,7 +372,7 @@ var _ = Describe("Validating webhook", func() { WhenBody := func(cwdc CalcWsDiffCase) func() { return func() { var actuals []string - result := tenantwh.CalculateWorkspacesDiff( + result := CalculateWorkspacesDiff( &clv1alpha2.Tenant{Spec: clv1alpha2.TenantSpec{Workspaces: cwdc.a}}, &clv1alpha2.Tenant{Spec: clv1alpha2.TenantSpec{Workspaces: cwdc.b}}, ) diff --git a/operators/pkg/utils/logs.go b/operators/pkg/utils/logs.go index d8f873acb..3beeccd99 100644 --- a/operators/pkg/utils/logs.go +++ b/operators/pkg/utils/logs.go @@ -31,7 +31,7 @@ const ( // LogConstructor returns a constructor for a logger to be used by the given controller. func LogConstructor(logger logr.Logger, ctrlname string) func(*reconcile.Request) logr.Logger { - return func(r *reconcile.Request) logr.Logger { + return func(_ *reconcile.Request) logr.Logger { return logger.WithName(ctrlname) } }