From 195b9bdba841459791282cec08a4570a878d8bad Mon Sep 17 00:00:00 2001 From: Alex Arica Date: Thu, 26 Oct 2023 17:39:04 +0100 Subject: [PATCH] #162, #165 : Compatible with PostgreSql 16 and upgraded the operator framework libraries Kubebuilder 3.12.0 in order to benefit from the latest features up to Kubernetes version 1.27.3 --- .dockerignore | 1 - .gitignore | 6 +- Dockerfile | 28 +- Makefile | 79 +- PROJECT | 6 +- README.md | 28 +- Kubebuilder-cmd => Upgrade-Kubebuilder | 0 api/v1/groupversion_info.go | 6 +- api/v1/kubegres_types.go | 12 +- api/v1/zz_generated.deepcopy.go | 3 +- main.go => cmd/main.go | 20 +- .../yamlcopy}/WriteYamlTemplatesInGoFile.go | 27 +- .../kubegres.reactive-tech.io_kubegres.yaml | 251 +- config/crd/kustomization.yaml | 6 +- .../crd/patches/cainjection_in_kubegres.yaml | 2 +- config/default/kustomization.yaml | 138 +- config/default/manager_auth_proxy_patch.yaml | 2 +- config/default/manager_config_patch.yaml | 10 - .../custom-namespace/configMap.yaml | 22 +- .../custom-namespace/kubegres.yaml | 2 +- .../custom-namespace/secret.yaml | 6 +- .../default-namespace/configMap.yaml | 22 +- .../default-namespace/kubegres.yaml | 2 +- .../default-namespace/secret.yaml | 6 +- config/manager/controller_manager_config.yaml | 21 - config/manager/kustomization.yaml | 10 +- config/manager/manager.yaml | 32 + config/prometheus/monitor.yaml | 6 + .../rbac/auth_proxy_client_clusterrole.yaml | 7 + config/rbac/auth_proxy_role.yaml | 7 + config/rbac/auth_proxy_role_binding.yaml | 7 + config/rbac/auth_proxy_service.yaml | 6 + config/rbac/kubegres_editor_role.yaml | 7 + config/rbac/kubegres_viewer_role.yaml | 7 + config/rbac/leader_election_role.yaml | 7 + config/rbac/leader_election_role_binding.yaml | 7 + config/rbac/role.yaml | 1 - config/rbac/role_binding.yaml | 7 + config/rbac/service_account.yaml | 7 + config/samples/kubegres_v1_kubegres.yaml | 6 + config/samples/kustomization.yaml | 4 + go.mod | 112 +- go.sum | 1027 ++----- hack/boilerplate.go.txt | 2 +- .../ctx/CreateOwnerKeyIndexation.go | 2 +- .../controller}/ctx/KubegresContext.go | 6 +- .../controller}/ctx/log/InterfaceArrayUtil.go | 2 +- .../controller}/ctx/log/LogWrapper.go | 2 +- .../ctx/resources/ResourcesContext.go | 106 +- .../ctx/status/KubegresStatusWrapper.go | 2 +- .../controller}/kubegres_controller.go | 19 +- .../operation/BlockingOperation.go | 4 +- .../operation/BlockingOperationConfig.go | 0 .../operation/BlockingOperationError.go | 0 .../operation/log/BlockingOperationLogger.go | 4 +- .../controller}/spec/checker/SpecChecker.go | 8 +- .../spec/defaultspec/DefaultStorageClass.go | 4 +- .../defaultspec/UndefinedSpecValuesChecker.go | 4 +- .../enforcer/comparator/PodSpecComparator.go | 2 +- .../BackUpCronJobCountSpecEnforcer.go | 14 +- .../BaseConfigMapCountSpecEnforcer.go | 30 +- .../ResourcesCountSpecEnforcer.go | 2 +- .../ServicesCountSpecEnforcer.go | 8 +- .../StatefulSetCountSpecEnforcer.go | 12 +- .../statefulset/PrimaryDbCountSpecEnforcer.go | 32 +- .../statefulset/ReplicaDbCountSpecEnforcer.go | 48 +- .../failover/PrimaryToReplicaFailOver.go | 59 +- .../statefulset_spec/AffinitySpecEnforcer.go | 4 +- .../AllStatefulSetsSpecEnforcer.go | 66 +- .../CustomConfigSpecEnforcer.go | 4 +- .../statefulset_spec/ImageSpecEnforcer.go | 4 +- .../LivenessProbeSpecEnforcer.go | 6 +- .../statefulset_spec/PortSpecEnforcer.go | 6 +- .../ReadinessProbeSpecEnforcer.go | 4 +- .../statefulset_spec/ResourcesSpecEnforcer.go | 4 +- .../SecurityContextSpecEnforcer.go | 4 +- .../StatefulSetSpecDifferences.go | 0 .../StatefulSetsSpecEnforcer.go | 4 +- .../StorageClassSizeSpecEnforcer.go | 8 +- .../TolerationsSpecEnforcer.go | 4 +- .../statefulset_spec/VolumeSpecEnforcer.go | 4 +- .../spec/template/CustomConfigSpecHelper.go | 22 +- .../spec/template/ResourceTemplateLoader.go | 6 +- .../template/ResourcesCreatorFromTemplate.go | 4 +- .../template/yaml/BackUpCronJobTemplate.yaml | 0 .../template/yaml/BaseConfigMapTemplate.yaml | 47 +- .../template/yaml/PrimaryServiceTemplate.yaml | 0 .../yaml/PrimaryStatefulSetTemplate.yaml | 0 .../template/yaml/ReplicaServiceTemplate.yaml | 0 .../yaml/ReplicaStatefulSetTemplate.yaml | 2 +- .../spec/template/yaml/Templates.go | 51 +- .../controller}/states/BackUpStates.go | 4 +- .../controller}/states/ConfigStates.go | 4 +- .../states/DbStorageClassStates.go | 4 +- .../controller}/states/ResourcesStates.go | 6 +- .../controller}/states/ServicesStates.go | 4 +- .../states/log/ResourcesStatesLogger.go | 12 +- .../states/statefulset/PodsStates.go | 4 +- .../states/statefulset/StatefulSetWrapper.go | 0 .../statefulset/StatefulSetWrappersSorting.go | 2 +- .../states/statefulset/StatefulSetsStates.go | 4 +- .../test}/custom_annotation_test.go | 36 +- .../test}/custom_namespace_test.go | 32 +- .../test}/data_is_replicated_test.go | 42 +- .../many_diff_kubegres_instances_test.go | 34 +- .../postgres_conf_wal_level_logical_test.go | 44 +- .../primary_failure_and_recovery_test.go | 42 +- .../replica_failure_and_recovery_test.go | 40 +- .../test}/resourceConfigs/ConfigForTest.go | 2 +- .../test}/resourceConfigs/LoadTestYaml.go | 2 +- .../test}/resourceConfigs/backupPvc.yaml | 0 .../customConfig/configMap_empty.yaml | 0 .../configMap_with_all_configs.yaml | 16 +- ...configMap_with_backup_database_script.yaml | 0 .../configMap_with_pg_hba_conf.yaml | 0 .../configMap_with_postgres_conf.yaml | 0 ...ostgres_conf_and_wal_level_to_logical.yaml | 0 .../configMap_with_primary_init_script.yaml | 6 +- .../test}/resourceConfigs/kubegres.yaml | 2 +- .../test}/resourceConfigs/primaryService.yaml | 0 .../test}/resourceConfigs/replicaService.yaml | 0 .../test}/resourceConfigs/secret.yaml | 0 {test => internal/test}/spec_affinity_test.go | 46 +- {test => internal/test}/spec_backup_test.go | 70 +- .../test}/spec_customConfig_test.go | 80 +- .../test}/spec_databaseSize_test.go | 34 +- .../spec_databaseStorageClassName_test.go | 40 +- .../test}/spec_databaseVolumeMount_test.go | 36 +- .../test}/spec_envVariables_test.go | 38 +- .../test}/spec_failover_is_disabled_test.go | 38 +- {test => internal/test}/spec_image_test.go | 60 +- .../test}/spec_livenessProbe_test.go | 30 +- .../test}/spec_pod_manually_promoted_test.go | 44 +- {test => internal/test}/spec_port_test.go | 46 +- .../test}/spec_readinessProbe_test.go | 28 +- {test => internal/test}/spec_replica_test.go | 34 +- {test => internal/test}/spec_resource_test.go | 34 +- .../test}/spec_securityContext_test.go | 36 +- .../test}/spec_tolerations_test.go | 36 +- .../test}/spec_volumeAndVolumeMount_test.go | 42 +- .../test}/spec_volumeClaimTemplates_test.go | 42 +- {test => internal/test}/suite_test.go | 31 +- .../test}/util/DbConnectionTestUtil.go | 4 +- .../test}/util/MockEventRecorderTestUtil.go | 4 +- {test => internal/test}/util/MockLogger.go | 4 +- .../test}/util/TestResourceCreator.go | 58 +- .../test}/util/TestResourceModifier.go | 0 .../test}/util/TestResourceRetriever.go | 6 +- .../util/kindcluster/KindTestClusterUtil.go | 4 +- .../test}/util/kindcluster/createCluster.sh | 0 .../util/kindcluster/kind-cluster-config.yaml | 0 .../test}/util/testcases/DbQueryTestCases.go | 20 +- kubegres.yaml | 2463 +++++++++++++---- 153 files changed, 3713 insertions(+), 2636 deletions(-) rename Kubebuilder-cmd => Upgrade-Kubebuilder (100%) rename main.go => cmd/main.go (88%) rename {scripts => cmd/yamlcopy}/WriteYamlTemplatesInGoFile.go (66%) delete mode 100644 config/manager/controller_manager_config.yaml create mode 100644 config/samples/kustomization.yaml rename {controllers => internal/controller}/ctx/CreateOwnerKeyIndexation.go (98%) rename {controllers => internal/controller}/ctx/KubegresContext.go (93%) rename {controllers => internal/controller}/ctx/log/InterfaceArrayUtil.go (97%) rename {controllers => internal/controller}/ctx/log/LogWrapper.go (98%) rename {controllers => internal/controller}/ctx/resources/ResourcesContext.go (52%) rename {controllers => internal/controller}/ctx/status/KubegresStatusWrapper.go (97%) rename {controllers => internal/controller}/kubegres_controller.go (91%) rename {controllers => internal/controller}/operation/BlockingOperation.go (99%) rename {controllers => internal/controller}/operation/BlockingOperationConfig.go (100%) rename {controllers => internal/controller}/operation/BlockingOperationError.go (100%) rename {controllers => internal/controller}/operation/log/BlockingOperationLogger.go (95%) rename {controllers => internal/controller}/spec/checker/SpecChecker.go (98%) rename {controllers => internal/controller}/spec/defaultspec/DefaultStorageClass.go (95%) rename {controllers => internal/controller}/spec/defaultspec/UndefinedSpecValuesChecker.go (97%) rename {controllers => internal/controller}/spec/enforcer/comparator/PodSpecComparator.go (97%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go (93%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go (83%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go (96%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go (94%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go (76%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go (89%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go (89%) rename {controllers => internal/controller}/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go (87%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go (95%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go (86%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go (94%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go (95%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go (93%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/PortSpecEnforcer.go (96%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go (95%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go (96%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go (95%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/StatefulSetSpecDifferences.go (100%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go (97%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go (96%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go (96%) rename {controllers => internal/controller}/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go (98%) rename {controllers => internal/controller}/spec/template/CustomConfigSpecHelper.go (89%) rename {controllers => internal/controller}/spec/template/ResourceTemplateLoader.go (94%) rename {controllers => internal/controller}/spec/template/ResourcesCreatorFromTemplate.go (99%) rename {controllers => internal/controller}/spec/template/yaml/BackUpCronJobTemplate.yaml (100%) rename {controllers => internal/controller}/spec/template/yaml/BaseConfigMapTemplate.yaml (88%) rename {controllers => internal/controller}/spec/template/yaml/PrimaryServiceTemplate.yaml (100%) rename {controllers => internal/controller}/spec/template/yaml/PrimaryStatefulSetTemplate.yaml (100%) rename {controllers => internal/controller}/spec/template/yaml/ReplicaServiceTemplate.yaml (100%) rename {controllers => internal/controller}/spec/template/yaml/ReplicaStatefulSetTemplate.yaml (96%) rename {controllers => internal/controller}/spec/template/yaml/Templates.go (93%) rename {controllers => internal/controller}/states/BackUpStates.go (97%) rename {controllers => internal/controller}/states/ConfigStates.go (98%) rename {controllers => internal/controller}/states/DbStorageClassStates.go (96%) rename {controllers => internal/controller}/states/ResourcesStates.go (93%) rename {controllers => internal/controller}/states/ServicesStates.go (96%) rename {controllers => internal/controller}/states/log/ResourcesStatesLogger.go (90%) rename {controllers => internal/controller}/states/statefulset/PodsStates.go (97%) rename {controllers => internal/controller}/states/statefulset/StatefulSetWrapper.go (100%) rename {controllers => internal/controller}/states/statefulset/StatefulSetWrappersSorting.go (97%) rename {controllers => internal/controller}/states/statefulset/StatefulSetsStates.go (98%) rename {test => internal/test}/custom_annotation_test.go (84%) rename {test => internal/test}/custom_namespace_test.go (85%) rename {test => internal/test}/data_is_replicated_test.go (80%) rename {test => internal/test}/many_diff_kubegres_instances_test.go (82%) rename {test => internal/test}/postgres_conf_wal_level_logical_test.go (80%) rename {test => internal/test}/primary_failure_and_recovery_test.go (84%) rename {test => internal/test}/replica_failure_and_recovery_test.go (76%) rename {test => internal/test}/resourceConfigs/ConfigForTest.go (98%) rename {test => internal/test}/resourceConfigs/LoadTestYaml.go (98%) rename {test => internal/test}/resourceConfigs/backupPvc.yaml (100%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_empty.yaml (100%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_with_all_configs.yaml (83%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_with_backup_database_script.yaml (100%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_with_pg_hba_conf.yaml (100%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_with_postgres_conf.yaml (100%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_with_postgres_conf_and_wal_level_to_logical.yaml (100%) rename {test => internal/test}/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml (75%) rename {test => internal/test}/resourceConfigs/kubegres.yaml (97%) rename {test => internal/test}/resourceConfigs/primaryService.yaml (100%) rename {test => internal/test}/resourceConfigs/replicaService.yaml (100%) rename {test => internal/test}/resourceConfigs/secret.yaml (100%) rename {test => internal/test}/spec_affinity_test.go (88%) rename {test => internal/test}/spec_backup_test.go (86%) rename {test => internal/test}/spec_customConfig_test.go (87%) rename {test => internal/test}/spec_databaseSize_test.go (87%) rename {test => internal/test}/spec_databaseStorageClassName_test.go (87%) rename {test => internal/test}/spec_databaseVolumeMount_test.go (88%) rename {test => internal/test}/spec_envVariables_test.go (87%) rename {test => internal/test}/spec_failover_is_disabled_test.go (85%) rename {test => internal/test}/spec_image_test.go (70%) rename {test => internal/test}/spec_livenessProbe_test.go (87%) rename {test => internal/test}/spec_pod_manually_promoted_test.go (89%) rename {test => internal/test}/spec_port_test.go (85%) rename {test => internal/test}/spec_readinessProbe_test.go (88%) rename {test => internal/test}/spec_replica_test.go (88%) rename {test => internal/test}/spec_resource_test.go (89%) rename {test => internal/test}/spec_securityContext_test.go (88%) rename {test => internal/test}/spec_tolerations_test.go (88%) rename {test => internal/test}/spec_volumeAndVolumeMount_test.go (93%) rename {test => internal/test}/spec_volumeClaimTemplates_test.go (93%) rename {test => internal/test}/suite_test.go (82%) rename {test => internal/test}/util/DbConnectionTestUtil.go (98%) rename {test => internal/test}/util/MockEventRecorderTestUtil.go (96%) rename {test => internal/test}/util/MockLogger.go (95%) rename {test => internal/test}/util/TestResourceCreator.go (77%) rename {test => internal/test}/util/TestResourceModifier.go (100%) rename {test => internal/test}/util/TestResourceRetriever.go (98%) rename {test => internal/test}/util/kindcluster/KindTestClusterUtil.go (98%) rename {test => internal/test}/util/kindcluster/createCluster.sh (100%) rename {test => internal/test}/util/kindcluster/kind-cluster-config.yaml (100%) rename {test => internal/test}/util/testcases/DbQueryTestCases.go (71%) diff --git a/.dockerignore b/.dockerignore index 0f04682..a3aab7a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file # Ignore build and test binaries. bin/ -testbin/ diff --git a/.gitignore b/.gitignore index dfe74ec..64b6e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,9 @@ docker-build *.dll *.so *.dylib -bin +bin/* testbin/* +Dockerfile.cross # Test binary, build with `go test -c` *.test @@ -19,8 +20,11 @@ testbin/* !vendor/**/zz_generated.* +test-output.txt + # editor and IDE paraphernalia .idea +.vscode *.swp *.swo *~ diff --git a/Dockerfile b/Dockerfile index 502cd84..aa74435 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ # Build the manager binary -FROM golang:1.18 as builder - -ARG TARGETPLATFORM -ARG BUILDPLATFORM +FROM golang:1.21 as builder +ARG TARGETOS +ARG TARGETARCH WORKDIR /workspace # Copy the Go Modules manifests @@ -13,23 +12,16 @@ COPY go.sum go.sum RUN go mod download # Copy the go source -COPY main.go main.go +COPY cmd/main.go cmd/main.go COPY api/ api/ -COPY controllers/ controllers/ +COPY internal/controller/ internal/controller/ # Build -ENV CGO_ENABLED=0 \ - GO111MODULE=on - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN \ - export GOOS \ - && GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) \ - && export GOARCH \ - && GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) \ - && export GOARM \ - && GOARM=$(echo ${TARGETPLATFORM} | cut -d / -f3 | cut -c2-) \ - && go build -a -o manager main.go +# the GOARCH has not a default value to allow the binary be built according to the host where the command +# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO +# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, +# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/Makefile b/Makefile index 35e361e..2f4fbb1 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ LATEST = controller:latest IMG ?= $(LATEST) # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.24.2 +ENVTEST_K8S_VERSION = 1.27.3 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -12,6 +12,12 @@ else GOBIN=$(shell go env GOBIN) endif +# CONTAINER_TOOL defines the container tool to be used for building images. +# Be aware that the target commands are only tested with Docker which is +# scaffolded by default. However, you might want to replace it to use other +# tools. (i.e. podman) +CONTAINER_TOOL ?= docker + # Setting SHELL to bash allows bash commands to be executed by recipes. # Options are set to exit when a recipe line exits non-zero or a piped command fails. SHELL = /usr/bin/env bash -o pipefail @@ -24,7 +30,7 @@ all: build # The help target prints out all targets with their descriptions organized # beneath their categories. The categories are represented by '##@' and the -# target descriptions by '##'. The awk commands is responsible for reading the +# target descriptions by '##'. The awk command is responsible for reading the # entire set of makefiles included in this invocation, looking for lines of the # file as xyz: ## something, and then pretty-format the target and help. Then, # if there's a line with ##@ something, that gets pretty-printed as a category. @@ -57,33 +63,47 @@ vet: ## Run go vet against code. .PHONY: test test: build envtest ## Run tests. - go test $(shell pwd)/test -run $(shell pwd)/test/suite_test.go -v -test.timeout 10000s - #KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test $(shell pwd)/test -run $(shell pwd)/test/suite_test.go -v -coverprofile cover.out -test.timeout 10000s - #KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test test/suite_test.go -coverprofile cover.out -v -test.timeout 10000s + go test $(shell pwd)/internal/test -run $(shell pwd)/internal/test/suite_test.go -v -test.timeout 10000s + #KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out ##@ Build .PHONY: build build: manifests generate fmt vet ## Build manager binary. - go generate - go build -o bin/manager main.go + go generate cmd/main.go + go build -o bin/manager cmd/main.go .PHONY: run run: install ## Run a controller from your host. - go run ./main.go - -#docker-build: test ## Build docker image with the manager. -.PHONY: docker-build-push -docker-build-push: build ## Build docker image with the manager. - docker buildx build --platform linux/amd64,linux/arm64 -t ${IMG} --push . + go run ./cmd/main.go +# If you wish to build the manager image targeting other platforms you can use the --platform flag. +# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it. +# More info: https://docs.docker.com/develop/develop-images/build_enhancements/ #.PHONY: docker-build -#docker-build: test ## Build docker image with the manager. -# docker build -t ${IMG} . +#docker-build: ## Build docker image with the manager. +# $(CONTAINER_TOOL) build -t ${IMG} . #.PHONY: docker-push #docker-push: ## Push docker image with the manager. -# docker push ${IMG} +# $(CONTAINER_TOOL) push ${IMG} + +# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple +# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to: +# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/ +# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/ +# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail) +# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option. +PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le +.PHONY: docker-buildx +docker-buildx: ## Build and push docker image for the manager for cross-platform support + # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile + sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross + - $(CONTAINER_TOOL) buildx create --name project-v3-builder + - $(CONTAINER_TOOL) buildx use project-v3-builder + - $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross . + - $(CONTAINER_TOOL) buildx rm project-v3-builder + rm Dockerfile.cross ##@ Deployment @@ -93,11 +113,11 @@ endif .PHONY: install install: build kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | kubectl apply -f - + $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f - .PHONY: uninstall uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f - + $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: deploy-check deploy-check: @@ -112,14 +132,14 @@ endif ## Run acceptance tests then deploy into Docker Hub the controller as the Docker image provided in arg ${IMG} ## and update the local file "kubegres.yaml" with the image ${IMG} .PHONY: deploy -deploy: deploy-check test docker-build-push kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. +deploy: deploy-check docker-buildx kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} $(KUSTOMIZE) build config/default > kubegres.yaml @echo "DEPLOYED $(IMG) INTO DOCKER HUB. UPDATED 'kubegres.yaml' WITH '$(IMG)'. YOU CAN COMMIT 'kubegres.yaml' AND CREATE A RELEASE IN GITHUB." .PHONY: undeploy undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. - $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - + $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - ##@ Build Dependencies @@ -129,24 +149,29 @@ $(LOCALBIN): mkdir -p $(LOCALBIN) ## Tool Binaries +KUBECTL ?= kubectl KUSTOMIZE ?= $(LOCALBIN)/kustomize CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest ## Tool Versions -KUSTOMIZE_VERSION ?= v3.8.7 -CONTROLLER_TOOLS_VERSION ?= v0.9.2 +KUSTOMIZE_VERSION ?= v5.2.1 +CONTROLLER_TOOLS_VERSION ?= v0.13.0 -KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize -kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. +kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading. $(KUSTOMIZE): $(LOCALBIN) - test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); } + @if test -x $(LOCALBIN)/kustomize && ! $(LOCALBIN)/kustomize version | grep -q $(KUSTOMIZE_VERSION); then \ + echo "$(LOCALBIN)/kustomize version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \ + rm -rf $(LOCALBIN)/kustomize; \ + fi + test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION) .PHONY: controller-gen -controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. +controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten. $(CONTROLLER_GEN): $(LOCALBIN) - test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \ + GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. diff --git a/PROJECT b/PROJECT index 7d167c3..5f79be9 100644 --- a/PROJECT +++ b/PROJECT @@ -1,6 +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: reactive-tech.io layout: -- go.kubebuilder.io/v3 +- go.kubebuilder.io/v4 projectName: kubegres repo: reactive-tech.io/kubegres resources: diff --git a/README.md b/README.md index 182d83a..bd3e123 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -[Kubegres](https://www.kubegres.io/) is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql pods with data -replication and failover enabled out-of-the box. It brings simplicity when using PostgreSql considering how complex managing +[Kubegres](https://www.kubegres.io/) is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql pods with data +replication and failover enabled out-of-the box. It brings simplicity when using PostgreSql considering how complex managing stateful-set's life-cycle and data replication could be with Kubernetes. **Features** -* It can manage one or many clusters of Postgres instances. - Each cluster of Postgres instances is created using a YAML of "kind: Kubegres". Each cluster is self-contained and is +* It can manage one or many clusters of Postgres instances. + Each cluster of Postgres instances is created using a YAML of "kind: Kubegres". Each cluster is self-contained and is identified by its unique name and namespace. -* It creates a cluster of PostgreSql servers with [Streaming Replication](https://wiki.postgresql.org/wiki/Streaming_Replication) enabled: it creates a Primary PostgreSql pod and a +* It creates a cluster of PostgreSql servers with [Streaming Replication](https://wiki.postgresql.org/wiki/Streaming_Replication) enabled: it creates a Primary PostgreSql pod and a number of Replica PostgreSql pods and replicates primary's database in real-time to Replica pods. * It manages fail-over: if a Primary PostgreSql crashes, it automatically promotes a Replica PostgreSql as a Primary. @@ -17,14 +17,14 @@ stateful-set's life-cycle and data replication could be with Kubernetes. * It provides a very simple YAML with properties specialised for PostgreSql. -* It is resilient, has over [85 automatized tests](https://github.com/reactive-tech/kubegres/tree/main/test) cases and - has been running in production. +* It is resilient, has over [85 automatized tests](https://github.com/reactive-tech/kubegres/tree/main/test) cases and + has been running in production. **How does Kubegres differentiate itself?** Kubegres is fully integrated with Kubernetes' lifecycle as it runs as an operator written in Go. -It is minimalist in terms of codebase compared to other open-source Postgres operators. It has the minimal and +It is minimalist in terms of codebase compared to other open-source Postgres operators. It has the minimal and yet robust required features to manage a cluster of PostgreSql on Kubernetes. We aim keeping this project small and simple. Among many reasons, there are [5 main ones why we recommend Kubegres](https://www.kubegres.io/#kubegres_compared). @@ -39,23 +39,23 @@ If you would like to contribute to Kubegres, please read the page [How to contri **More details about the project** -[Kubegres](https://www.kubegres.io/) was developed by [Reactive Tech Limited](https://www.reactive-tech.io/) and Alex -Arica as the lead developer. Reactive Tech offers [support services](https://www.kubegres.io/support/) for Kubegres, +[Kubegres](https://www.kubegres.io/) was developed by [Reactive Tech Limited](https://www.reactive-tech.io/) and Alex +Arica as the lead developer. Reactive Tech offers [support services](https://www.kubegres.io/support/) for Kubegres, Kubernetes and PostgreSql. -It was developed with the framework [Kubebuilder](https://book.kubebuilder.io/) version 3, an SDK for building Kubernetes +It was developed with the framework [Kubebuilder](https://book.kubebuilder.io/) version 3, an SDK for building Kubernetes APIs using CRDs. Kubebuilder is maintained by the official Kubernetes API Machinery Special Interest Group (SIG). **Support** -[Reactive Tech Limited](https://www.reactive-tech.io/) offers support for organisations using Kubegres. And we prioritise +[Reactive Tech Limited](https://www.reactive-tech.io/) offers support for organisations using Kubegres. And we prioritise new features requested by organisations paying supports as long the new features would benefit the Open Source community. -We start working on the implementation of new features within 24h of the request from organisations paying supports. +We start working on the implementation of new features within 24h of the request from organisations paying supports. More details in the [support page](https://www.kubegres.io/support/). **Sponsor** -If you would like to help this project by sponsoring it, we can display your company's logo on this GitHub page +If you would like to help this project by sponsoring it, we can display your company's logo on this GitHub page and on [https://www.kubegres.io](https://www.kubegres.io). More details in the [sponsor page](https://www.kubegres.io/sponsor/). **Interesting links** diff --git a/Kubebuilder-cmd b/Upgrade-Kubebuilder similarity index 100% rename from Kubebuilder-cmd rename to Upgrade-Kubebuilder diff --git a/api/v1/groupversion_info.go b/api/v1/groupversion_info.go index cdf06ea..57382bd 100644 --- a/api/v1/groupversion_info.go +++ b/api/v1/groupversion_info.go @@ -1,9 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. -"Reactive Tech Limited" is a company located in England, United Kingdom. -https://www.reactive-tech.io - -Lead Developer: Alex Arica +Copyright 2023. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/api/v1/kubegres_types.go b/api/v1/kubegres_types.go index d557d3e..5533e35 100644 --- a/api/v1/kubegres_types.go +++ b/api/v1/kubegres_types.go @@ -1,9 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. -"Reactive Tech Limited" is a company located in England, United Kingdom. -https://www.reactive-tech.io - -Lead Developer: Alex Arica +Copyright 2023. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -113,8 +109,8 @@ type KubegresStatus struct { // ----------------------- RESOURCE --------------------------------------- -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status // Kubegres is the Schema for the kubegres API type Kubegres struct { @@ -125,7 +121,7 @@ type Kubegres struct { Status KubegresStatus `json:"status,omitempty"` } -// +kubebuilder:object:root=true +//+kubebuilder:object:root=true // KubegresList contains a list of Kubegres type KubegresList struct { diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 34f27dc..c31dad1 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1,8 +1,7 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* -Copyright 2022. +Copyright 2023. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/main.go b/cmd/main.go similarity index 88% rename from main.go rename to cmd/main.go index db3829a..fcb09e4 100644 --- a/main.go +++ b/cmd/main.go @@ -1,9 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. -"Reactive Tech Limited" is a company located in England, United Kingdom. -https://www.reactive-tech.io - -Lead Developer: Alex Arica +Copyright 2023. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,7 +19,8 @@ package main import ( "flag" "os" - ctx2 "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller" + ctx2 "reactive-tech.io/kubegres/internal/controller/ctx" // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. @@ -35,13 +32,13 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" kubegresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers" //+kubebuilder:scaffold:imports ) -//go:generate go run scripts/WriteYamlTemplatesInGoFile.go +//go:generate go run yamlcopy/WriteYamlTemplatesInGoFile.go var ( scheme = runtime.NewScheme() @@ -74,8 +71,7 @@ func main() { mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, - MetricsBindAddress: metricsAddr, - Port: 9443, + Metrics: metricsserver.Options{BindAddress: metricsAddr}, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "d5ccd92e.reactive-tech.io", @@ -96,9 +92,9 @@ func main() { os.Exit(1) } - if err = (&controllers.KubegresReconciler{ + if err = (&controller.KubegresReconciler{ Client: mgr.GetClient(), - Logger: ctrl.Log.WithName("controllers").WithName(ctx2.KindKubegres), + Logger: ctrl.Log.WithName("controller").WithName(ctx2.KindKubegres), Scheme: mgr.GetScheme(), Recorder: mgr.GetEventRecorderFor("Kubegres-controller"), }).SetupWithManager(mgr); err != nil { diff --git a/scripts/WriteYamlTemplatesInGoFile.go b/cmd/yamlcopy/WriteYamlTemplatesInGoFile.go similarity index 66% rename from scripts/WriteYamlTemplatesInGoFile.go rename to cmd/yamlcopy/WriteYamlTemplatesInGoFile.go index 0b3533f..55ae8c8 100644 --- a/scripts/WriteYamlTemplatesInGoFile.go +++ b/cmd/yamlcopy/WriteYamlTemplatesInGoFile.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -20,9 +20,10 @@ limitations under the License. /* This script is executed every time this project is compiled. - See main.go where there is a comment triggering this script: "//go:generate go run scripts/WriteYamlTemplatesInGoFile.go" - It copies each YAML file inside the package "controllers/template/yaml" - and set them as constants in the file "controllers/template/yaml/Templates.go". + See cmd/main.go where there is a comment triggering this script: "//go:generate go run cmd/yamlcopy/WriteYamlTemplatesInGoFile.go" + + It copies each YAML file inside the package "internal/controller/template/yaml" + and set them as constants in the file "internal/controller/template/yaml/Templates.go". This mechanism allows developers to work with YAML files when defining templates for resources managed by this operator. It is more convenient to work directly with YAML files than GO API classes when developing. */ @@ -32,40 +33,40 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "strings" ) const ( - yamlTemplateDir = "controllers/spec/template/yaml" + yamlTemplateDir = "../internal/controller/spec/template/yaml" destinationGoFile = yamlTemplateDir + "/Templates.go" ) func main() { - fs, _ := ioutil.ReadDir(yamlTemplateDir) + entries, _ := os.ReadDir(yamlTemplateDir) out, _ := os.Create(destinationGoFile) out.Write([]byte("package yaml " + - "\n\n // This file is auto generated by the script in 'WriteYamlTemplatesInGoFile.go'. " + + "\n\n // This file is auto generated by 'WriteYamlTemplatesInGoFile.go'. " + "\n // Any manual modification to this file will be lost during next compilation. " + "\n\nconst (\n")) fmt.Println("Setting constants in the file: '" + destinationGoFile + "', by copying the YAML contents of the following files:") - for _, f := range fs { - - if strings.HasSuffix(f.Name(), ".yaml") { + for _, entry := range entries { + fileInfo, _ := entry.Info() + if strings.HasSuffix(fileInfo.Name(), ".yaml") { - templateYamlFilePath := yamlTemplateDir + "/" + f.Name() + templateYamlFilePath := yamlTemplateDir + "/" + fileInfo.Name() fmt.Println("- '" + templateYamlFilePath + "'") - out.Write([]byte(strings.TrimSuffix(f.Name(), ".yaml") + " = `")) + out.Write([]byte(strings.TrimSuffix(fileInfo.Name(), ".yaml") + " = `")) f, _ := os.Open(templateYamlFilePath) io.Copy(out, f) out.Write([]byte("`\n")) } + } out.Write([]byte(")\n")) } diff --git a/config/crd/bases/kubegres.reactive-tech.io_kubegres.yaml b/config/crd/bases/kubegres.reactive-tech.io_kubegres.yaml index 4848587..2c43a7f 100644 --- a/config/crd/bases/kubegres.reactive-tech.io_kubegres.yaml +++ b/config/crd/bases/kubegres.reactive-tech.io_kubegres.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: kubegres.kubegres.reactive-tech.io spec: group: kubegres.reactive-tech.io @@ -217,8 +216,6 @@ spec: type: integer grpc: description: GRPC specifies an action involving a GRPC port. - This is a beta field and requires enabling GRPCContainerProbe - feature gate. properties: port: description: Port number of the gRPC service. Number must @@ -250,7 +247,9 @@ spec: be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will be + canonicalized upon output, so case-variant names + will be understood as the same header. type: string value: description: The header field value @@ -367,8 +366,6 @@ spec: type: integer grpc: description: GRPC specifies an action involving a GRPC port. - This is a beta field and requires enabling GRPCContainerProbe - feature gate. properties: port: description: Port number of the gRPC service. Number must @@ -400,7 +397,9 @@ spec: be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will be + canonicalized upon output, so case-variant names + will be understood as the same header. type: string value: description: The header field value @@ -495,6 +494,27 @@ spec: resources: description: ResourceRequirements describes the compute resource requirements. properties: + claims: + description: "Claims lists the names of resources, defined in + spec.resourceClaims, that are used by this container. \n This + is an alpha field and requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can only be set + for containers." + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims + of the Pod where this field is used. It makes that resource + available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -515,7 +535,8 @@ spec: description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object scheduler: @@ -1518,7 +1539,8 @@ spec: in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile - location. Must only be set if type is "Localhost". + location. Must be set if type is "Localhost". Must NOT be + set for any other type. type: string type: description: "type indicates which kind of seccomp profile @@ -1532,9 +1554,14 @@ spec: type: object supplementalGroups: description: A list of groups applied to the first process run - in each container, in addition to the container's primary GID. If - unspecified, no groups will be added to any container. Note - that this field cannot be set when spec.os.name is windows. + in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in + the container image for the uid of the container process. If + unspecified, no additional groups are added to any container. + Note that group memberships defined in the container image for + the uid of the container process are still effective, even if + they are not included in this list. Note that this field cannot + be set when spec.os.name is windows. items: format: int64 type: integer @@ -1577,14 +1604,11 @@ spec: type: string hostProcess: description: HostProcess determines if a container should - be run as a 'Host Process' container. This field is alpha-level - and will only be honored by components that enable the WindowsHostProcessContainers - feature flag. Setting this field without the feature flag - will result in errors when validating the Pod. All of a - Pod's containers must have the same effective HostProcess - value (it is not allowed to have a mix of HostProcess containers - and non-HostProcess containers). In addition, if HostProcess - is true then HostNetwork must also be set to true. + be run as a 'Host Process' container. All of a Pod's containers + must have the same effective HostProcess value (it is not + allowed to have a mix of HostProcess containers and non-HostProcess + containers). In addition, if HostProcess is true then HostNetwork + must also be set to true. type: boolean runAsUserName: description: The UserName in Windows to run the entrypoint @@ -1619,10 +1643,12 @@ spec: * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on - the contents of the specified data source. If the - AnyVolumeDataSource feature gate is enabled, this - field will always have the same contents as the DataSourceRef - field.' + the contents of the specified data source. When the + AnyVolumeDataSource feature gate is enabled, dataSource + contents will be copied to dataSourceRef, and dataSourceRef + contents will be copied to dataSource when dataSourceRef.namespace + is not specified. If the namespace is specified, then + dataSourceRef will not be copied to dataSource.' properties: apiGroup: description: APIGroup is the group for the resource @@ -1646,25 +1672,32 @@ spec: dataSourceRef: description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty - volume is desired. This may be any local object from - a non-empty API group (non core object) or a PersistentVolumeClaim + volume is desired. This may be any object from a non-empty + API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality - of the DataSource field and as such if both fields + of the dataSource field and as such if both fields are non-empty, they must have the same value. For - backwards compatibility, both fields (DataSource and - DataSourceRef) will be set to the same value automatically - if one of them is empty and the other is non-empty. - There are two important differences between DataSource - and DataSourceRef: * While DataSource only allows - two specific types of objects, DataSourceRef allows + backwards compatibility, when namespace isn''t specified + in dataSourceRef, both fields (dataSource and dataSourceRef) + will be set to the same value automatically if one + of them is empty and the other is non-empty. When + namespace is specified in dataSourceRef, dataSource + isn''t set to the same value and must be empty. There + are three important differences between dataSource + and dataSourceRef: * While dataSource only allows + two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim - objects. * While DataSource ignores disallowed values - (dropping them), DataSourceRef preserves all values, + objects. * While dataSource ignores disallowed values + (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. - (Beta) Using this field requires the AnyVolumeDataSource + * While dataSource only allows local objects, dataSourceRef + allows objects in any namespaces. (Beta) Using this + field requires the AnyVolumeDataSource feature gate + to be enabled. (Alpha) Using the namespace field of + dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.' properties: apiGroup: @@ -1681,11 +1714,20 @@ spec: description: Name is the name of resource being referenced type: string + namespace: + description: Namespace is the namespace of resource + being referenced Note that when a namespace is + specified, a gateway.networking.k8s.io/ReferenceGrant + object is required in the referent namespace to + allow that namespace's owner to accept the reference. + See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource + feature gate to be enabled. + type: string required: - kind - name type: object - x-kubernetes-map-type: atomic resources: description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure @@ -1694,6 +1736,30 @@ spec: must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: + claims: + description: "Claims lists the names of resources, + defined in spec.resourceClaims, that are used + by this container. \n This is an alpha field and + requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can + only be set for containers." + items: + description: ResourceClaim references one entry + in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one + entry in pod.spec.resourceClaims of the + Pod where this field is used. It makes that + resource available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -1715,7 +1781,8 @@ spec: of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to - an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + an implementation-defined value. Requests cannot + exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: @@ -2222,7 +2289,7 @@ spec: value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. - More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object @@ -2297,10 +2364,13 @@ spec: If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents - of the specified data source. If the AnyVolumeDataSource - feature gate is enabled, this field will always - have the same contents as the DataSourceRef - field.' + of the specified data source. When the AnyVolumeDataSource + feature gate is enabled, dataSource contents + will be copied to dataSourceRef, and dataSourceRef + contents will be copied to dataSource when + dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef + will not be copied to dataSource.' properties: apiGroup: description: APIGroup is the group for the @@ -2326,29 +2396,37 @@ spec: description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may - be any local object from a non-empty API group - (non core object) or a PersistentVolumeClaim - object. When this field is specified, volume - binding will only succeed if the type of the - specified object matches some installed volume - populator or dynamic provisioner. This field - will replace the functionality of the DataSource - field and as such if both fields are non-empty, + be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding + will only succeed if the type of the specified + object matches some installed volume populator + or dynamic provisioner. This field will replace + the functionality of the dataSource field + and as such if both fields are non-empty, they must have the same value. For backwards - compatibility, both fields (DataSource and - DataSourceRef) will be set to the same value - automatically if one of them is empty and - the other is non-empty. There are two important - differences between DataSource and DataSourceRef: - * While DataSource only allows two specific - types of objects, DataSourceRef allows any - non-core object, as well as PersistentVolumeClaim - objects. * While DataSource ignores disallowed - values (dropping them), DataSourceRef preserves - all values, and generates an error if a disallowed - value is specified. (Beta) Using this field - requires the AnyVolumeDataSource feature gate - to be enabled.' + compatibility, when namespace isn''t specified + in dataSourceRef, both fields (dataSource + and dataSourceRef) will be set to the same + value automatically if one of them is empty + and the other is non-empty. When namespace + is specified in dataSourceRef, dataSource + isn''t set to the same value and must be empty. + There are three important differences between + dataSource and dataSourceRef: * While dataSource + only allows two specific types of objects, + dataSourceRef allows any non-core object, + as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values + (dropping them), dataSourceRef preserves all + values, and generates an error if a disallowed + value is specified. * While dataSource only + allows local objects, dataSourceRef allows + objects in any namespaces. (Beta) Using this + field requires the AnyVolumeDataSource feature + gate to be enabled. (Alpha) Using the namespace + field of dataSourceRef requires the CrossNamespaceVolumeDataSource + feature gate to be enabled.' properties: apiGroup: description: APIGroup is the group for the @@ -2365,11 +2443,21 @@ spec: description: Name is the name of resource being referenced type: string + namespace: + description: Namespace is the namespace + of resource being referenced Note that + when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant + object is required in the referent namespace + to allow that namespace's owner to accept + the reference. See the ReferenceGrant + documentation for details. (Alpha) This + field requires the CrossNamespaceVolumeDataSource + feature gate to be enabled. + type: string required: - kind - name type: object - x-kubernetes-map-type: atomic resources: description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure @@ -2379,6 +2467,32 @@ spec: capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: + claims: + description: "Claims lists the names of + resources, defined in spec.resourceClaims, + that are used by this container. \n This + is an alpha field and requires enabling + the DynamicResourceAllocation feature + gate. \n This field is immutable. It can + only be set for containers." + items: + description: ResourceClaim references + one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name + of one entry in pod.spec.resourceClaims + of the Pod where this field is used. + It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -2402,7 +2516,8 @@ spec: If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined - value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index c7afb8f..a143fbf 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -5,15 +5,15 @@ resources: - bases/kubegres.reactive-tech.io_kubegres.yaml #+kubebuilder:scaffold:crdkustomizeresource -patchesStrategicMerge: +patches: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_kubegres.yaml +#- path: patches/webhook_in_kubegres.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD -#- patches/cainjection_in_kubegres.yaml +#- path: patches/cainjection_in_kubegres.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_kubegres.yaml b/config/crd/patches/cainjection_in_kubegres.yaml index bce55bd..4eec6ba 100644 --- a/config/crd/patches/cainjection_in_kubegres.yaml +++ b/config/crd/patches/cainjection_in_kubegres.yaml @@ -3,5 +3,5 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME name: kubegres.kubegres.reactive-tech.io diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 37e1b95..f0e9b00 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -9,10 +9,12 @@ namespace: kubegres-system namePrefix: kubegres- # Labels to add to all resources and selectors. -#commonLabels: -# someName: someValue +#labels: +#- includeSelectors: true +# pairs: +# someName: someValue -bases: +resources: - ../crd - ../rbac - ../manager @@ -30,9 +32,7 @@ patchesStrategicMerge: # endpoint w/o any authn/z, please comment the following line. - manager_auth_proxy_patch.yaml -# Mount the controller config file for loading manager configurations -# through a ComponentConfig type -#- manager_config_patch.yaml + # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml @@ -43,32 +43,102 @@ patchesStrategicMerge: # 'CERTMANAGER' needs to be enabled to use ca injection #- webhookcainjection_patch.yaml -# the following config is for teaching kustomize how to do var substitution -vars: # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldref: -# fieldpath: metadata.namespace -#- name: CERTIFICATE_NAME -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -#- name: SERVICE_NAMESPACE # namespace of the service -# objref: -# kind: Service -# version: v1 -# name: webhook-service -# fieldref: -# fieldpath: metadata.namespace -#- name: SERVICE_NAME -# objref: -# kind: Service -# version: v1 -# name: webhook-service +# Uncomment the following replacements to add the cert-manager CA injection annotations +#replacements: +# - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs +# kind: Certificate +# group: cert-manager.io +# version: v1 +# name: serving-cert # this name should match the one in certificate.yaml +# fieldPath: .metadata.namespace # namespace of the certificate CR +# targets: +# - select: +# kind: ValidatingWebhookConfiguration +# fieldPaths: +# - .metadata.annotations.[cert-manager.io/inject-ca-from] +# options: +# delimiter: '/' +# index: 0 +# create: true +# - select: +# kind: MutatingWebhookConfiguration +# fieldPaths: +# - .metadata.annotations.[cert-manager.io/inject-ca-from] +# options: +# delimiter: '/' +# index: 0 +# create: true +# - select: +# kind: CustomResourceDefinition +# fieldPaths: +# - .metadata.annotations.[cert-manager.io/inject-ca-from] +# options: +# delimiter: '/' +# index: 0 +# create: true +# - source: +# kind: Certificate +# group: cert-manager.io +# version: v1 +# name: serving-cert # this name should match the one in certificate.yaml +# fieldPath: .metadata.name +# targets: +# - select: +# kind: ValidatingWebhookConfiguration +# fieldPaths: +# - .metadata.annotations.[cert-manager.io/inject-ca-from] +# options: +# delimiter: '/' +# index: 1 +# create: true +# - select: +# kind: MutatingWebhookConfiguration +# fieldPaths: +# - .metadata.annotations.[cert-manager.io/inject-ca-from] +# options: +# delimiter: '/' +# index: 1 +# create: true +# - select: +# kind: CustomResourceDefinition +# fieldPaths: +# - .metadata.annotations.[cert-manager.io/inject-ca-from] +# options: +# delimiter: '/' +# index: 1 +# create: true +# - source: # Add cert-manager annotation to the webhook Service +# kind: Service +# version: v1 +# name: webhook-service +# fieldPath: .metadata.name # namespace of the service +# targets: +# - select: +# kind: Certificate +# group: cert-manager.io +# version: v1 +# fieldPaths: +# - .spec.dnsNames.0 +# - .spec.dnsNames.1 +# options: +# delimiter: '.' +# index: 0 +# create: true +# - source: +# kind: Service +# version: v1 +# name: webhook-service +# fieldPath: .metadata.namespace # namespace of the service +# targets: +# - select: +# kind: Certificate +# group: cert-manager.io +# version: v1 +# fieldPaths: +# - .spec.dnsNames.0 +# - .spec.dnsNames.1 +# options: +# delimiter: '.' +# index: 1 +# create: true diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index cec149a..73fad2a 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -15,7 +15,7 @@ spec: capabilities: drop: - "ALL" - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1 args: - "--secure-listen-address=0.0.0.0:8443" - "--upstream=http://127.0.0.1:8080/" diff --git a/config/default/manager_config_patch.yaml b/config/default/manager_config_patch.yaml index 6c40015..f6f5891 100644 --- a/config/default/manager_config_patch.yaml +++ b/config/default/manager_config_patch.yaml @@ -8,13 +8,3 @@ spec: spec: containers: - name: manager - args: - - "--config=controller_manager_config.yaml" - volumeMounts: - - name: manager-config - mountPath: /controller_manager_config.yaml - subPath: controller_manager_config.yaml - volumes: - - name: manager-config - configMap: - name: manager-config diff --git a/config/localresource/custom-namespace/configMap.yaml b/config/localresource/custom-namespace/configMap.yaml index 8a82647..c458f50 100644 --- a/config/localresource/custom-namespace/configMap.yaml +++ b/config/localresource/custom-namespace/configMap.yaml @@ -31,15 +31,19 @@ data: echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ..."; psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE DATABASE $customDatabaseName; - CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; - \connect $customDatabaseName; - CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); - INSERT INTO account VALUES (1, 'username1'); - INSERT INTO account VALUES (2, 'username2'); - GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName; - GRANT ALL ON "account" to $customUserName; + + CREATE DATABASE $customDatabaseName; + \connect $customDatabaseName; + + CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); + INSERT INTO account VALUES (1, 'username1'); + INSERT INTO account VALUES (2, 'username2'); + + CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; + GRANT SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO $customUserName; + GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $customUserName; + GRANT USAGE, CREATE ON SCHEMA public TO $customUserName; + EOSQL echo "$dt - Init script is completed"; - diff --git a/config/localresource/custom-namespace/kubegres.yaml b/config/localresource/custom-namespace/kubegres.yaml index bd0a35a..f847be7 100644 --- a/config/localresource/custom-namespace/kubegres.yaml +++ b/config/localresource/custom-namespace/kubegres.yaml @@ -6,7 +6,7 @@ metadata: spec: replicas: 3 - image: postgres:14.5 + image: postgres:16.0 port: 5432 #imagePullSecrets: diff --git a/config/localresource/custom-namespace/secret.yaml b/config/localresource/custom-namespace/secret.yaml index 6a226f4..4fac82c 100644 --- a/config/localresource/custom-namespace/secret.yaml +++ b/config/localresource/custom-namespace/secret.yaml @@ -5,6 +5,6 @@ metadata: namespace: custom type: Opaque stringData: - superUserPassword: postgresSuperUserPsw - replicationUserPassword: postgresReplicaPsw - myAppUserPassword: myAppUserPsw + superUserPassword: test + replicationUserPassword: test + myAppUserPassword: test diff --git a/config/localresource/default-namespace/configMap.yaml b/config/localresource/default-namespace/configMap.yaml index 231c2ee..2e95d4b 100644 --- a/config/localresource/default-namespace/configMap.yaml +++ b/config/localresource/default-namespace/configMap.yaml @@ -31,15 +31,19 @@ data: echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ..."; psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE DATABASE $customDatabaseName; - CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; - \connect $customDatabaseName; - CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); - INSERT INTO account VALUES (1, 'username1'); - INSERT INTO account VALUES (2, 'username2'); - GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName; - GRANT ALL ON "account" to $customUserName; + + CREATE DATABASE $customDatabaseName; + \connect $customDatabaseName; + + CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); + INSERT INTO account VALUES (1, 'username1'); + INSERT INTO account VALUES (2, 'username2'); + + CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; + GRANT SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO $customUserName; + GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $customUserName; + GRANT USAGE, CREATE ON SCHEMA public TO $customUserName; + EOSQL echo "$dt - Init script is completed"; - diff --git a/config/localresource/default-namespace/kubegres.yaml b/config/localresource/default-namespace/kubegres.yaml index a0894bc..18e8e9d 100644 --- a/config/localresource/default-namespace/kubegres.yaml +++ b/config/localresource/default-namespace/kubegres.yaml @@ -6,7 +6,7 @@ metadata: spec: replicas: 3 - image: postgres:14.5 + image: postgres:16.0 #port: 5432 database: diff --git a/config/localresource/default-namespace/secret.yaml b/config/localresource/default-namespace/secret.yaml index 4f37a0f..da13e29 100644 --- a/config/localresource/default-namespace/secret.yaml +++ b/config/localresource/default-namespace/secret.yaml @@ -5,6 +5,6 @@ metadata: namespace: default type: Opaque stringData: - superUserPassword: postgresSuperUserPsw - replicationUserPassword: postgresReplicaPsw - myAppUserPassword: myAppUserPsw + superUserPassword: test + replicationUserPassword: test + myAppUserPassword: test diff --git a/config/manager/controller_manager_config.yaml b/config/manager/controller_manager_config.yaml deleted file mode 100644 index 4e4d910..0000000 --- a/config/manager/controller_manager_config.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 -kind: ControllerManagerConfig -health: - healthProbeBindAddress: :8081 -metrics: - bindAddress: 127.0.0.1:8080 -webhook: - port: 9443 -leaderElection: - leaderElect: true - resourceName: d5ccd92e.reactive-tech.io -# leaderElectionReleaseOnCancel defines if the leader should step down volume -# when the Manager ends. This requires the binary to immediately end when the -# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly -# speeds up voluntary leader transitions as the new leader don't have to wait -# LeaseDuration time first. -# In the default scaffold provided, the program ends immediately after -# the manager stops, so would be fine to enable this option. However, -# if you are doing or is intended to do any operation such as perform cleanups -# after the manager stops then its usage might be unsafe. -# leaderElectionReleaseOnCancel: true diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 23a524b..d1308e4 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,16 +1,8 @@ resources: - manager.yaml - -generatorOptions: - disableNameSuffixHash: true - -configMapGenerator: -- files: - - controller_manager_config.yaml - name: manager-config apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller newName: reactivetechio/kubegres - newTag: "1.16" + newTag: "1.17" diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 878ad48..eea78f6 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -3,6 +3,12 @@ kind: Namespace metadata: labels: control-plane: controller-manager + app.kubernetes.io/name: namespace + app.kubernetes.io/instance: system + app.kubernetes.io/component: manager + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: system --- apiVersion: apps/v1 @@ -12,6 +18,12 @@ metadata: namespace: system labels: control-plane: controller-manager + app.kubernetes.io/name: deployment + app.kubernetes.io/instance: controller-manager + app.kubernetes.io/component: manager + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize spec: selector: matchLabels: @@ -24,6 +36,26 @@ spec: labels: control-plane: controller-manager spec: + # TODO(user): Uncomment the following code to configure the nodeAffinity expression + # according to the platforms which are supported by your solution. + # It is considered best practice to support multiple architectures. You can + # build your manager image using the makefile target docker-buildx. + # affinity: + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: kubernetes.io/arch + # operator: In + # values: + # - amd64 + # - arm64 + # - ppc64le + # - s390x + # - key: kubernetes.io/os + # operator: In + # values: + # - linux securityContext: runAsNonRoot: true # TODO(user): For common cases that do not require escalating privileges diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index d19136a..e91e836 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -5,6 +5,12 @@ kind: ServiceMonitor metadata: labels: control-plane: controller-manager + app.kubernetes.io/name: servicemonitor + app.kubernetes.io/instance: controller-manager-metrics-monitor + app.kubernetes.io/component: metrics + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: controller-manager-metrics-monitor namespace: system spec: diff --git a/config/rbac/auth_proxy_client_clusterrole.yaml b/config/rbac/auth_proxy_client_clusterrole.yaml index 51a75db..574aa76 100644 --- a/config/rbac/auth_proxy_client_clusterrole.yaml +++ b/config/rbac/auth_proxy_client_clusterrole.yaml @@ -1,6 +1,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: metrics-reader + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: metrics-reader rules: - nonResourceURLs: diff --git a/config/rbac/auth_proxy_role.yaml b/config/rbac/auth_proxy_role.yaml index 80e1857..c42d950 100644 --- a/config/rbac/auth_proxy_role.yaml +++ b/config/rbac/auth_proxy_role.yaml @@ -1,6 +1,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: proxy-role + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: proxy-role rules: - apiGroups: diff --git a/config/rbac/auth_proxy_role_binding.yaml b/config/rbac/auth_proxy_role_binding.yaml index ec7acc0..59bfbaf 100644 --- a/config/rbac/auth_proxy_role_binding.yaml +++ b/config/rbac/auth_proxy_role_binding.yaml @@ -1,6 +1,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: + labels: + app.kubernetes.io/name: clusterrolebinding + app.kubernetes.io/instance: proxy-rolebinding + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: proxy-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/config/rbac/auth_proxy_service.yaml b/config/rbac/auth_proxy_service.yaml index 71f1797..58b4365 100644 --- a/config/rbac/auth_proxy_service.yaml +++ b/config/rbac/auth_proxy_service.yaml @@ -3,6 +3,12 @@ kind: Service metadata: labels: control-plane: controller-manager + app.kubernetes.io/name: service + app.kubernetes.io/instance: controller-manager-metrics-service + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: controller-manager-metrics-service namespace: system spec: diff --git a/config/rbac/kubegres_editor_role.yaml b/config/rbac/kubegres_editor_role.yaml index 8285f94..e9229fa 100644 --- a/config/rbac/kubegres_editor_role.yaml +++ b/config/rbac/kubegres_editor_role.yaml @@ -2,6 +2,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: kubegres-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: kubegres-editor-role rules: - apiGroups: diff --git a/config/rbac/kubegres_viewer_role.yaml b/config/rbac/kubegres_viewer_role.yaml index 8e0ce25..ef9aac1 100644 --- a/config/rbac/kubegres_viewer_role.yaml +++ b/config/rbac/kubegres_viewer_role.yaml @@ -2,6 +2,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: kubegres-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: kubegres-viewer-role rules: - apiGroups: diff --git a/config/rbac/leader_election_role.yaml b/config/rbac/leader_election_role.yaml index 4190ec8..bd355a8 100644 --- a/config/rbac/leader_election_role.yaml +++ b/config/rbac/leader_election_role.yaml @@ -2,6 +2,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: + labels: + app.kubernetes.io/name: role + app.kubernetes.io/instance: leader-election-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: leader-election-role rules: - apiGroups: diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 1d1321e..fff1f14 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -1,6 +1,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: + labels: + app.kubernetes.io/name: rolebinding + app.kubernetes.io/instance: leader-election-rolebinding + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: leader-election-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index b1a19a0..089e107 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -2,7 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - creationTimestamp: null name: manager-role rules: - apiGroups: diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index 2070ede..a2e4ad7 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -1,6 +1,13 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: + labels: + app.kubernetes.io/name: clusterrolebinding + app.kubernetes.io/instance: manager-rolebinding + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index 7cd6025..93267ce 100644 --- a/config/rbac/service_account.yaml +++ b/config/rbac/service_account.yaml @@ -1,5 +1,12 @@ apiVersion: v1 kind: ServiceAccount metadata: + labels: + app.kubernetes.io/name: serviceaccount + app.kubernetes.io/instance: controller-manager-sa + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize name: controller-manager namespace: system diff --git a/config/samples/kubegres_v1_kubegres.yaml b/config/samples/kubegres_v1_kubegres.yaml index b9fe6f3..254f609 100644 --- a/config/samples/kubegres_v1_kubegres.yaml +++ b/config/samples/kubegres_v1_kubegres.yaml @@ -1,6 +1,12 @@ apiVersion: kubegres.reactive-tech.io/v1 kind: Kubegres metadata: + labels: + app.kubernetes.io/name: kubegres + app.kubernetes.io/instance: kubegres-sample + app.kubernetes.io/part-of: kubegres + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/created-by: kubegres name: kubegres-sample spec: # TODO(user): Add fields here diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml new file mode 100644 index 0000000..b3d1271 --- /dev/null +++ b/config/samples/kustomization.yaml @@ -0,0 +1,4 @@ +## Append samples of your project ## +resources: +- kubegres_v1_kubegres.yaml +#+kubebuilder:scaffold:manifestskustomizesamples diff --git a/go.mod b/go.mod index 426c1f3..052c45a 100644 --- a/go.mod +++ b/go.mod @@ -1,84 +1,74 @@ module reactive-tech.io/kubegres -go 1.18 +go 1.21.3 require ( - github.com/go-logr/logr v1.2.3 - github.com/lib/pq v1.10.7 - github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.18.1 - k8s.io/api v0.24.2 - k8s.io/apimachinery v0.24.2 - k8s.io/client-go v0.24.2 - k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 - sigs.k8s.io/controller-runtime v0.12.2 + github.com/go-logr/logr v1.2.4 + github.com/lib/pq v1.10.9 + github.com/onsi/ginkgo/v2 v2.11.0 + github.com/onsi/gomega v1.27.10 + k8s.io/apimachinery v0.28.0 + k8s.io/client-go v0.28.0 + sigs.k8s.io/controller-runtime v0.16.0 ) require ( - cloud.google.com/go v0.81.0 // indirect - github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest v0.11.18 // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect - github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect - github.com/Azure/go-autorest/logger v0.2.1 // indirect - github.com/Azure/go-autorest/tracing v0.6.0 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful v2.9.5+incompatible // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-logr/zapr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/go-logr/zapr v1.2.4 // 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.2 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.5 // indirect - github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect - github.com/imdario/mergo v0.3.12 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.5.9 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect + github.com/google/uuid v1.3.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.6 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // 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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nxadm/tail v1.4.8 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.12.1 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.19.1 // indirect - golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.25.0 // indirect + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect + golang.org/x/net v0.13.0 // indirect + golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.9.3 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/apiextensions-apiserver v0.24.2 // indirect - k8s.io/component-base v0.24.2 // indirect - k8s.io/klog/v2 v2.60.1 // indirect - k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect - sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.28.0 // indirect + k8s.io/apiextensions-apiserver v0.28.0 // indirect + k8s.io/component-base v0.28.0 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect + k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // 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 ) diff --git a/go.sum b/go.sum index 001f947..ba6a1c8 100644 --- a/go.sum +++ b/go.sum @@ -1,980 +1,267 @@ -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= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= +github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +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-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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 v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -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.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -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.20210217033140-668b12f5399d/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/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -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.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +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/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= 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.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +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.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +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= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= 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.4/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= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -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.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= -github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= -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.4.1/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +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/cel-go v0.16.0 h1:DG9YQ8nFCFXAs/FDDwBxmL1tpKNrdlGUM9U3537bX/Y= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/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 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -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/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-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +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/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= 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/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= 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/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -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/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +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/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 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -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/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= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -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 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= 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/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +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.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +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.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/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.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= +go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE= +go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 h1:sxoY9kG1s1WpSYNyzm24rlwH4lnRYFXUVVBmKMBfRgw= +go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4= +go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs= +go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= +go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= +go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +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.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +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-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -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-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/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/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= 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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/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-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -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-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -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/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY= +golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/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-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= -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.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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.4/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 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/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= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/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-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= 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= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +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.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201102152239-715cce707fb0/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -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= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -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/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= 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 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +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= 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 h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/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/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -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.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= 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= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 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 h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.24.2 h1:g518dPU/L7VRLxWfcadQn2OnsiGWVOadTLpdnqgY2OI= -k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= -k8s.io/apiextensions-apiserver v0.24.2 h1:/4NEQHKlEz1MlaK/wHT5KMKC9UKYz6NZz6JE6ov4G6k= -k8s.io/apiextensions-apiserver v0.24.2/go.mod h1:e5t2GMFVngUEHUd0wuCJzw8YDwZoqZfJiGOW6mm2hLQ= -k8s.io/apimachinery v0.24.2 h1:5QlH9SL2C8KMcrNJPor+LbXVTaZRReml7svPEh4OKDM= -k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apiserver v0.24.2/go.mod h1:pSuKzr3zV+L+MWqsEo0kHHYwCo77AT5qXbFXP2jbvFI= -k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= -k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= -k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= -k8s.io/component-base v0.24.2 h1:kwpQdoSfbcH+8MPN4tALtajLDfSfYxBDYlXobNWI6OU= -k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= -k8s.io/gengo v0.0.0-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.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= -k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/controller-runtime v0.12.2 h1:nqV02cvhbAj7tbt21bpPpTByrXGn2INHRsi39lXy9sE= -sigs.k8s.io/controller-runtime v0.12.2/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM= +k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY= +k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E= +k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE= +k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA= +k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw= +k8s.io/apiserver v0.28.0 h1:wVh7bK6Xj7hq+5ntInysTeQRAOqqFoKGUOW2yj8DXrY= +k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM= +k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc= +k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI= +k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kms v0.28.0 h1:BwJhU9qPcJhHLUcQjtelOSjYti+1/caJLr+4jHbKzTA= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= +k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA= +sigs.k8s.io/controller-runtime v0.16.0 h1:5koYaaRVBHDr0LZAJjO5dWzUjMsh6cwa7q1Mmusrdvk= +sigs.k8s.io/controller-runtime v0.16.0/go.mod h1:77DnuwA8+J7AO0njzv3wbNlMOnGuLrwFr8JPNwx3J7g= +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.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 29c55ec..65b8622 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2022. +Copyright 2023. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/controllers/ctx/CreateOwnerKeyIndexation.go b/internal/controller/ctx/CreateOwnerKeyIndexation.go similarity index 98% rename from controllers/ctx/CreateOwnerKeyIndexation.go rename to internal/controller/ctx/CreateOwnerKeyIndexation.go index 2fce6cc..0f894e3 100644 --- a/controllers/ctx/CreateOwnerKeyIndexation.go +++ b/internal/controller/ctx/CreateOwnerKeyIndexation.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/controllers/ctx/KubegresContext.go b/internal/controller/ctx/KubegresContext.go similarity index 93% rename from controllers/ctx/KubegresContext.go rename to internal/controller/ctx/KubegresContext.go index 9aee002..f420606 100644 --- a/controllers/ctx/KubegresContext.go +++ b/internal/controller/ctx/KubegresContext.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,8 +23,8 @@ package ctx import ( "context" "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx/log" - "reactive-tech.io/kubegres/controllers/ctx/status" + "reactive-tech.io/kubegres/internal/controller/ctx/log" + "reactive-tech.io/kubegres/internal/controller/ctx/status" "sigs.k8s.io/controller-runtime/pkg/client" "strconv" "strings" diff --git a/controllers/ctx/log/InterfaceArrayUtil.go b/internal/controller/ctx/log/InterfaceArrayUtil.go similarity index 97% rename from controllers/ctx/log/InterfaceArrayUtil.go rename to internal/controller/ctx/log/InterfaceArrayUtil.go index 5fbaeb3..fabd7ff 100644 --- a/controllers/ctx/log/InterfaceArrayUtil.go +++ b/internal/controller/ctx/log/InterfaceArrayUtil.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/controllers/ctx/log/LogWrapper.go b/internal/controller/ctx/log/LogWrapper.go similarity index 98% rename from controllers/ctx/log/LogWrapper.go rename to internal/controller/ctx/log/LogWrapper.go index 0ecff79..2aab377 100644 --- a/controllers/ctx/log/LogWrapper.go +++ b/internal/controller/ctx/log/LogWrapper.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/controllers/ctx/resources/ResourcesContext.go b/internal/controller/ctx/resources/ResourcesContext.go similarity index 52% rename from controllers/ctx/resources/ResourcesContext.go rename to internal/controller/ctx/resources/ResourcesContext.go index f3e283d..916b408 100644 --- a/controllers/ctx/resources/ResourcesContext.go +++ b/internal/controller/ctx/resources/ResourcesContext.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,24 +22,24 @@ package resources import ( "context" + ctx2 "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx/log" + "reactive-tech.io/kubegres/internal/controller/ctx/status" + "reactive-tech.io/kubegres/internal/controller/operation" + log3 "reactive-tech.io/kubegres/internal/controller/operation/log" + "reactive-tech.io/kubegres/internal/controller/spec/checker" + defaultspec2 "reactive-tech.io/kubegres/internal/controller/spec/defaultspec" + resources_count_spec2 "reactive-tech.io/kubegres/internal/controller/spec/enforcer/resources_count_spec" + statefulset2 "reactive-tech.io/kubegres/internal/controller/spec/enforcer/resources_count_spec/statefulset" + "reactive-tech.io/kubegres/internal/controller/spec/enforcer/resources_count_spec/statefulset/failover" + statefulset_spec2 "reactive-tech.io/kubegres/internal/controller/spec/enforcer/statefulset_spec" + template2 "reactive-tech.io/kubegres/internal/controller/spec/template" + "reactive-tech.io/kubegres/internal/controller/states" + log2 "reactive-tech.io/kubegres/internal/controller/states/log" "github.com/go-logr/logr" "k8s.io/client-go/tools/record" postgresV1 "reactive-tech.io/kubegres/api/v1" - ctx2 "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/ctx/log" - "reactive-tech.io/kubegres/controllers/ctx/status" - "reactive-tech.io/kubegres/controllers/operation" - log3 "reactive-tech.io/kubegres/controllers/operation/log" - "reactive-tech.io/kubegres/controllers/spec/checker" - "reactive-tech.io/kubegres/controllers/spec/defaultspec" - "reactive-tech.io/kubegres/controllers/spec/enforcer/resources_count_spec" - "reactive-tech.io/kubegres/controllers/spec/enforcer/resources_count_spec/statefulset" - "reactive-tech.io/kubegres/controllers/spec/enforcer/resources_count_spec/statefulset/failover" - "reactive-tech.io/kubegres/controllers/spec/enforcer/statefulset_spec" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/controllers/states" - log2 "reactive-tech.io/kubegres/controllers/states/log" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -50,23 +50,23 @@ type ResourcesContext struct { ResourcesStates states.ResourcesStates ResourcesStatesLogger log2.ResourcesStatesLogger SpecChecker checker.SpecChecker - DefaultStorageClass defaultspec.DefaultStorageClass - CustomConfigSpecHelper template.CustomConfigSpecHelper - ResourcesCreatorFromTemplate template.ResourcesCreatorFromTemplate - ResourcesCountSpecEnforcer resources_count_spec.ResourcesCountSpecEnforcer - AllStatefulSetsSpecEnforcer statefulset_spec.AllStatefulSetsSpecEnforcer - StatefulSetsSpecsEnforcer statefulset_spec.StatefulSetsSpecsEnforcer + DefaultStorageClass defaultspec2.DefaultStorageClass + CustomConfigSpecHelper template2.CustomConfigSpecHelper + ResourcesCreatorFromTemplate template2.ResourcesCreatorFromTemplate + ResourcesCountSpecEnforcer resources_count_spec2.ResourcesCountSpecEnforcer + AllStatefulSetsSpecEnforcer statefulset_spec2.AllStatefulSetsSpecEnforcer + StatefulSetsSpecsEnforcer statefulset_spec2.StatefulSetsSpecsEnforcer BlockingOperation *operation.BlockingOperation BlockingOperationLogger log3.BlockingOperationLogger PrimaryToReplicaFailOver failover.PrimaryToReplicaFailOver - PrimaryDbCountSpecEnforcer statefulset.PrimaryDbCountSpecEnforcer - ReplicaDbCountSpecEnforcer statefulset.ReplicaDbCountSpecEnforcer + PrimaryDbCountSpecEnforcer statefulset2.PrimaryDbCountSpecEnforcer + ReplicaDbCountSpecEnforcer statefulset2.ReplicaDbCountSpecEnforcer - BaseConfigMapCountSpecEnforcer resources_count_spec.BaseConfigMapCountSpecEnforcer - StatefulSetCountSpecEnforcer resources_count_spec.StatefulSetCountSpecEnforcer - ServicesCountSpecEnforcer resources_count_spec.ServicesCountSpecEnforcer - BackUpCronJobCountSpecEnforcer resources_count_spec.BackUpCronJobCountSpecEnforcer + BaseConfigMapCountSpecEnforcer resources_count_spec2.BaseConfigMapCountSpecEnforcer + StatefulSetCountSpecEnforcer resources_count_spec2.StatefulSetCountSpecEnforcer + ServicesCountSpecEnforcer resources_count_spec2.ServicesCountSpecEnforcer + BackUpCronJobCountSpecEnforcer resources_count_spec2.BackUpCronJobCountSpecEnforcer } func CreateResourcesContext(kubegres *postgresV1.Kubegres, @@ -98,8 +98,8 @@ func CreateResourcesContext(kubegres *postgresV1.Kubegres, Client: client, } - rc.DefaultStorageClass = defaultspec.CreateDefaultStorageClass(rc.KubegresContext) - if err = defaultspec.SetDefaultForUndefinedSpecValues(rc.KubegresContext, rc.DefaultStorageClass); err != nil { + rc.DefaultStorageClass = defaultspec2.CreateDefaultStorageClass(rc.KubegresContext) + if err = defaultspec2.SetDefaultForUndefinedSpecValues(rc.KubegresContext, rc.DefaultStorageClass); err != nil { return nil, err } @@ -115,10 +115,10 @@ func CreateResourcesContext(kubegres *postgresV1.Kubegres, rc.SpecChecker = checker.CreateSpecChecker(rc.KubegresContext, rc.ResourcesStates) - rc.CustomConfigSpecHelper = template.CreateCustomConfigSpecHelper(rc.KubegresContext, rc.ResourcesStates) + rc.CustomConfigSpecHelper = template2.CreateCustomConfigSpecHelper(rc.KubegresContext, rc.ResourcesStates) - resourceTemplateLoader := template.ResourceTemplateLoader{} - rc.ResourcesCreatorFromTemplate = template.CreateResourcesCreatorFromTemplate(rc.KubegresContext, rc.CustomConfigSpecHelper, resourceTemplateLoader) + resourceTemplateLoader := template2.ResourceTemplateLoader{} + rc.ResourcesCreatorFromTemplate = template2.CreateResourcesCreatorFromTemplate(rc.KubegresContext, rc.CustomConfigSpecHelper, resourceTemplateLoader) addResourcesCountSpecEnforcers(rc) addStatefulSetSpecEnforcers(rc) @@ -139,15 +139,15 @@ func setReplicaFieldToZeroIfNil(kubegres *postgresV1.Kubegres) { func addResourcesCountSpecEnforcers(rc *ResourcesContext) { rc.PrimaryToReplicaFailOver = failover.CreatePrimaryToReplicaFailOver(rc.KubegresContext, rc.ResourcesStates, rc.BlockingOperation) - rc.PrimaryDbCountSpecEnforcer = statefulset.CreatePrimaryDbCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate, rc.BlockingOperation, rc.PrimaryToReplicaFailOver) - rc.ReplicaDbCountSpecEnforcer = statefulset.CreateReplicaDbCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate, rc.BlockingOperation) - rc.StatefulSetCountSpecEnforcer = resources_count_spec.CreateStatefulSetCountSpecEnforcer(rc.PrimaryDbCountSpecEnforcer, rc.ReplicaDbCountSpecEnforcer) + rc.PrimaryDbCountSpecEnforcer = statefulset2.CreatePrimaryDbCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate, rc.BlockingOperation, rc.PrimaryToReplicaFailOver) + rc.ReplicaDbCountSpecEnforcer = statefulset2.CreateReplicaDbCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate, rc.BlockingOperation) + rc.StatefulSetCountSpecEnforcer = resources_count_spec2.CreateStatefulSetCountSpecEnforcer(rc.PrimaryDbCountSpecEnforcer, rc.ReplicaDbCountSpecEnforcer) - rc.BaseConfigMapCountSpecEnforcer = resources_count_spec.CreateBaseConfigMapCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate, rc.BlockingOperation) - rc.ServicesCountSpecEnforcer = resources_count_spec.CreateServicesCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate) - rc.BackUpCronJobCountSpecEnforcer = resources_count_spec.CreateBackUpCronJobCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate) + rc.BaseConfigMapCountSpecEnforcer = resources_count_spec2.CreateBaseConfigMapCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate, rc.BlockingOperation) + rc.ServicesCountSpecEnforcer = resources_count_spec2.CreateServicesCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate) + rc.BackUpCronJobCountSpecEnforcer = resources_count_spec2.CreateBackUpCronJobCountSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.ResourcesCreatorFromTemplate) - rc.ResourcesCountSpecEnforcer = resources_count_spec.ResourcesCountSpecEnforcer{} + rc.ResourcesCountSpecEnforcer = resources_count_spec2.ResourcesCountSpecEnforcer{} rc.ResourcesCountSpecEnforcer.AddSpecEnforcer(&rc.BaseConfigMapCountSpecEnforcer) rc.ResourcesCountSpecEnforcer.AddSpecEnforcer(&rc.StatefulSetCountSpecEnforcer) rc.ResourcesCountSpecEnforcer.AddSpecEnforcer(&rc.ServicesCountSpecEnforcer) @@ -155,19 +155,19 @@ func addResourcesCountSpecEnforcers(rc *ResourcesContext) { } func addStatefulSetSpecEnforcers(rc *ResourcesContext) { - imageSpecEnforcer := statefulset_spec.CreateImageSpecEnforcer(rc.KubegresContext) - portSpecEnforcer := statefulset_spec.CreatePortSpecEnforcer(rc.KubegresContext, rc.ResourcesStates) - storageClassSizeSpecEnforcer := statefulset_spec.CreateStorageClassSizeSpecEnforcer(rc.KubegresContext, rc.ResourcesStates) - customConfigSpecEnforcer := statefulset_spec.CreateCustomConfigSpecEnforcer(rc.CustomConfigSpecHelper) - affinitySpecEnforcer := statefulset_spec.CreateAffinitySpecEnforcer(rc.KubegresContext) - tolerationsSpecEnforcer := statefulset_spec.CreateTolerationsSpecEnforcer(rc.KubegresContext) - resourcesSpecEnforcer := statefulset_spec.CreateResourcesSpecEnforcer(rc.KubegresContext) - volumeSpecEnforcer := statefulset_spec.CreateVolumeSpecEnforcer(rc.KubegresContext) - securityContextSpecEnforcer := statefulset_spec.CreateSecurityContextSpecEnforcer(rc.KubegresContext) - livenessProbeSpecEnforcer := statefulset_spec.CreateLivenessProbeSpecEnforcer(rc.KubegresContext) - readinessProbeSpecEnforcer := statefulset_spec.CreateReadinessProbeSpecEnforcer(rc.KubegresContext) - - rc.StatefulSetsSpecsEnforcer = statefulset_spec.CreateStatefulSetsSpecsEnforcer(rc.KubegresContext) + imageSpecEnforcer := statefulset_spec2.CreateImageSpecEnforcer(rc.KubegresContext) + portSpecEnforcer := statefulset_spec2.CreatePortSpecEnforcer(rc.KubegresContext, rc.ResourcesStates) + storageClassSizeSpecEnforcer := statefulset_spec2.CreateStorageClassSizeSpecEnforcer(rc.KubegresContext, rc.ResourcesStates) + customConfigSpecEnforcer := statefulset_spec2.CreateCustomConfigSpecEnforcer(rc.CustomConfigSpecHelper) + affinitySpecEnforcer := statefulset_spec2.CreateAffinitySpecEnforcer(rc.KubegresContext) + tolerationsSpecEnforcer := statefulset_spec2.CreateTolerationsSpecEnforcer(rc.KubegresContext) + resourcesSpecEnforcer := statefulset_spec2.CreateResourcesSpecEnforcer(rc.KubegresContext) + volumeSpecEnforcer := statefulset_spec2.CreateVolumeSpecEnforcer(rc.KubegresContext) + securityContextSpecEnforcer := statefulset_spec2.CreateSecurityContextSpecEnforcer(rc.KubegresContext) + livenessProbeSpecEnforcer := statefulset_spec2.CreateLivenessProbeSpecEnforcer(rc.KubegresContext) + readinessProbeSpecEnforcer := statefulset_spec2.CreateReadinessProbeSpecEnforcer(rc.KubegresContext) + + rc.StatefulSetsSpecsEnforcer = statefulset_spec2.CreateStatefulSetsSpecsEnforcer(rc.KubegresContext) rc.StatefulSetsSpecsEnforcer.AddSpecEnforcer(&imageSpecEnforcer) rc.StatefulSetsSpecsEnforcer.AddSpecEnforcer(&portSpecEnforcer) rc.StatefulSetsSpecsEnforcer.AddSpecEnforcer(&storageClassSizeSpecEnforcer) @@ -180,7 +180,7 @@ func addStatefulSetSpecEnforcers(rc *ResourcesContext) { rc.StatefulSetsSpecsEnforcer.AddSpecEnforcer(&livenessProbeSpecEnforcer) rc.StatefulSetsSpecsEnforcer.AddSpecEnforcer(&readinessProbeSpecEnforcer) - rc.AllStatefulSetsSpecEnforcer = statefulset_spec.CreateAllStatefulSetsSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.BlockingOperation, rc.StatefulSetsSpecsEnforcer) + rc.AllStatefulSetsSpecEnforcer = statefulset_spec2.CreateAllStatefulSetsSpecEnforcer(rc.KubegresContext, rc.ResourcesStates, rc.BlockingOperation, rc.StatefulSetsSpecsEnforcer) } func addBlockingOperationConfigs(rc *ResourcesContext) { diff --git a/controllers/ctx/status/KubegresStatusWrapper.go b/internal/controller/ctx/status/KubegresStatusWrapper.go similarity index 97% rename from controllers/ctx/status/KubegresStatusWrapper.go rename to internal/controller/ctx/status/KubegresStatusWrapper.go index 98d9ba4..8fcf7cc 100644 --- a/controllers/ctx/status/KubegresStatusWrapper.go +++ b/internal/controller/ctx/status/KubegresStatusWrapper.go @@ -3,7 +3,7 @@ package status import ( "context" v1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx/log" + "reactive-tech.io/kubegres/internal/controller/ctx/log" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/kubegres_controller.go b/internal/controller/kubegres_controller.go similarity index 91% rename from controllers/kubegres_controller.go rename to internal/controller/kubegres_controller.go index 48adc71..1ea877d 100644 --- a/controllers/kubegres_controller.go +++ b/internal/controller/kubegres_controller.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -18,7 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package controllers +package controller import ( "context" @@ -26,15 +26,14 @@ import ( apps "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" "k8s.io/client-go/tools/record" - ctx2 "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/ctx/resources" + ctx2 "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx/resources" "time" "k8s.io/apimachinery/pkg/runtime" + kubegresv1 "reactive-tech.io/kubegres/api/v1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - - kubegresv1 "reactive-tech.io/kubegres/api/v1" ) // KubegresReconciler reconciles a Kubegres object @@ -60,8 +59,13 @@ type KubegresReconciler struct { // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. +// TODO(user): Modify the Reconcile function to compare the state specified by +// the Kubegres object against the actual cluster state, and then +// perform operations to make the cluster state reflect the state specified by +// the user. +// // For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.7.2/pkg/reconcile +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile func (r *KubegresReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { //_ = r.Logger.WithValues("kubegres", req.NamespacedName) @@ -148,6 +152,7 @@ func (r *KubegresReconciler) enforceAllStatefulSetsSpec(resourcesContext *resour return resourcesContext.AllStatefulSetsSpecEnforcer.EnforceSpec() } +// SetupWithManager sets up the controller with the Manager. func (r *KubegresReconciler) SetupWithManager(mgr ctrl.Manager) error { ctx := context.Background() diff --git a/controllers/operation/BlockingOperation.go b/internal/controller/operation/BlockingOperation.go similarity index 99% rename from controllers/operation/BlockingOperation.go rename to internal/controller/operation/BlockingOperation.go index fea4490..96879cf 100644 --- a/controllers/operation/BlockingOperation.go +++ b/internal/controller/operation/BlockingOperation.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,7 +22,7 @@ package operation import ( v1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "time" ) diff --git a/controllers/operation/BlockingOperationConfig.go b/internal/controller/operation/BlockingOperationConfig.go similarity index 100% rename from controllers/operation/BlockingOperationConfig.go rename to internal/controller/operation/BlockingOperationConfig.go diff --git a/controllers/operation/BlockingOperationError.go b/internal/controller/operation/BlockingOperationError.go similarity index 100% rename from controllers/operation/BlockingOperationError.go rename to internal/controller/operation/BlockingOperationError.go diff --git a/controllers/operation/log/BlockingOperationLogger.go b/internal/controller/operation/log/BlockingOperationLogger.go similarity index 95% rename from controllers/operation/log/BlockingOperationLogger.go rename to internal/controller/operation/log/BlockingOperationLogger.go index 31dfb13..8556c2d 100644 --- a/controllers/operation/log/BlockingOperationLogger.go +++ b/internal/controller/operation/log/BlockingOperationLogger.go @@ -2,8 +2,8 @@ package log import ( v1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/operation" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/operation" ) type BlockingOperationLogger struct { diff --git a/controllers/spec/checker/SpecChecker.go b/internal/controller/spec/checker/SpecChecker.go similarity index 98% rename from controllers/spec/checker/SpecChecker.go rename to internal/controller/spec/checker/SpecChecker.go index 00097d4..08899fd 100644 --- a/controllers/spec/checker/SpecChecker.go +++ b/internal/controller/spec/checker/SpecChecker.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -25,9 +25,9 @@ import ( apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" postgresV1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/states" + "reactive-tech.io/kubegres/internal/controller/states/statefulset" "reflect" ) diff --git a/controllers/spec/defaultspec/DefaultStorageClass.go b/internal/controller/spec/defaultspec/DefaultStorageClass.go similarity index 95% rename from controllers/spec/defaultspec/DefaultStorageClass.go rename to internal/controller/spec/defaultspec/DefaultStorageClass.go index 71ee876..788efc2 100644 --- a/controllers/spec/defaultspec/DefaultStorageClass.go +++ b/internal/controller/spec/defaultspec/DefaultStorageClass.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,7 +24,7 @@ import ( "errors" storage "k8s.io/api/storage/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" ) type DefaultStorageClass struct { diff --git a/controllers/spec/defaultspec/UndefinedSpecValuesChecker.go b/internal/controller/spec/defaultspec/UndefinedSpecValuesChecker.go similarity index 97% rename from controllers/spec/defaultspec/UndefinedSpecValuesChecker.go rename to internal/controller/spec/defaultspec/UndefinedSpecValuesChecker.go index 8063ea2..6404627 100644 --- a/controllers/spec/defaultspec/UndefinedSpecValuesChecker.go +++ b/internal/controller/spec/defaultspec/UndefinedSpecValuesChecker.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package defaultspec import ( core "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "strconv" ) diff --git a/controllers/spec/enforcer/comparator/PodSpecComparator.go b/internal/controller/spec/enforcer/comparator/PodSpecComparator.go similarity index 97% rename from controllers/spec/enforcer/comparator/PodSpecComparator.go rename to internal/controller/spec/enforcer/comparator/PodSpecComparator.go index 8ba1657..29f0b46 100644 --- a/controllers/spec/enforcer/comparator/PodSpecComparator.go +++ b/internal/controller/spec/enforcer/comparator/PodSpecComparator.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/controllers/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go similarity index 93% rename from controllers/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go index c3c42a5..e01aa0a 100644 --- a/controllers/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/BackUpCronJobCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,19 +22,19 @@ package resources_count_spec import ( batch "k8s.io/api/batch/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/spec/template" + states2 "reactive-tech.io/kubegres/internal/controller/states" ) type BackUpCronJobCountSpecEnforcer struct { kubegresContext ctx.KubegresContext - resourcesStates states.ResourcesStates + resourcesStates states2.ResourcesStates resourcesCreator template.ResourcesCreatorFromTemplate } func CreateBackUpCronJobCountSpecEnforcer(kubegresContext ctx.KubegresContext, - resourcesStates states.ResourcesStates, + resourcesStates states2.ResourcesStates, resourcesCreator template.ResourcesCreatorFromTemplate) BackUpCronJobCountSpecEnforcer { return BackUpCronJobCountSpecEnforcer{ @@ -72,7 +72,7 @@ func (r *BackUpCronJobCountSpecEnforcer) EnforceSpec() error { return r.deployCronJob(cronJob) } -func (r *BackUpCronJobCountSpecEnforcer) getConfigMapNameForBackUp(configStates states.ConfigStates) string { +func (r *BackUpCronJobCountSpecEnforcer) getConfigMapNameForBackUp(configStates states2.ConfigStates) string { if configStates.ConfigLocations.BackUpScript == ctx.BaseConfigMapVolumeName { return configStates.BaseConfigName } diff --git a/controllers/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go similarity index 83% rename from controllers/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go index 7d0780a..feb04e5 100644 --- a/controllers/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/BaseConfigMapCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,10 +24,10 @@ import ( "errors" core "k8s.io/api/core/v1" v1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/operation" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + operation2 "reactive-tech.io/kubegres/internal/controller/operation" + "reactive-tech.io/kubegres/internal/controller/spec/template" + "reactive-tech.io/kubegres/internal/controller/states" "strconv" ) @@ -35,13 +35,13 @@ type BaseConfigMapCountSpecEnforcer struct { kubegresContext ctx.KubegresContext resourcesStates states.ResourcesStates resourcesCreator template.ResourcesCreatorFromTemplate - blockingOperation *operation.BlockingOperation + blockingOperation *operation2.BlockingOperation } func CreateBaseConfigMapCountSpecEnforcer(kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates, resourcesCreator template.ResourcesCreatorFromTemplate, - blockingOperation *operation.BlockingOperation) BaseConfigMapCountSpecEnforcer { + blockingOperation *operation2.BlockingOperation) BaseConfigMapCountSpecEnforcer { return BaseConfigMapCountSpecEnforcer{ kubegresContext: kubegresContext, @@ -51,11 +51,11 @@ func CreateBaseConfigMapCountSpecEnforcer(kubegresContext ctx.KubegresContext, } } -func (r *BaseConfigMapCountSpecEnforcer) CreateOperationConfig() operation.BlockingOperationConfig { +func (r *BaseConfigMapCountSpecEnforcer) CreateOperationConfig() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdBaseConfigCountSpecEnforcement, - StepId: operation.OperationStepIdBaseConfigDeploying, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdBaseConfigCountSpecEnforcement, + StepId: operation2.OperationStepIdBaseConfigDeploying, TimeOutInSeconds: 10, CompletionChecker: func(operation v1.KubegresBlockingOperation) bool { return r.isBaseConfigDeployed() }, } @@ -63,7 +63,7 @@ func (r *BaseConfigMapCountSpecEnforcer) CreateOperationConfig() operation.Block func (r *BaseConfigMapCountSpecEnforcer) EnforceSpec() error { - if r.blockingOperation.IsActiveOperationIdDifferentOf(operation.OperationIdBaseConfigCountSpecEnforcement) { + if r.blockingOperation.IsActiveOperationIdDifferentOf(operation2.OperationIdBaseConfigCountSpecEnforcement) { return nil } @@ -99,7 +99,7 @@ func (r *BaseConfigMapCountSpecEnforcer) isBaseConfigDeployed() bool { } func (r *BaseConfigMapCountSpecEnforcer) hasLastAttemptTimedOut() bool { - return r.blockingOperation.HasActiveOperationIdTimedOut(operation.OperationIdBaseConfigCountSpecEnforcement) + return r.blockingOperation.HasActiveOperationIdTimedOut(operation2.OperationIdBaseConfigCountSpecEnforcement) } func (r *BaseConfigMapCountSpecEnforcer) logKubegresFeaturesAreReEnabled() { @@ -144,6 +144,6 @@ func (r *BaseConfigMapCountSpecEnforcer) deployBaseConfigMap(configMap core.Conf } func (r *BaseConfigMapCountSpecEnforcer) activateBlockingOperationForDeployment() error { - return r.blockingOperation.ActivateOperation(operation.OperationIdBaseConfigCountSpecEnforcement, - operation.OperationStepIdBaseConfigDeploying) + return r.blockingOperation.ActivateOperation(operation2.OperationIdBaseConfigCountSpecEnforcement, + operation2.OperationStepIdBaseConfigDeploying) } diff --git a/controllers/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go similarity index 96% rename from controllers/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go index 9ef79f6..6f29510 100644 --- a/controllers/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/ResourcesCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/controllers/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go similarity index 94% rename from controllers/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go index d8a0a58..2664740 100644 --- a/controllers/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/ServicesCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,9 +22,9 @@ package resources_count_spec import ( core "k8s.io/api/core/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/spec/template" + "reactive-tech.io/kubegres/internal/controller/states" ) type ServicesCountSpecEnforcer struct { diff --git a/controllers/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go similarity index 76% rename from controllers/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go index 6f3cde8..ba1e973 100644 --- a/controllers/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/StatefulSetCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,16 +21,16 @@ limitations under the License. package resources_count_spec import ( - "reactive-tech.io/kubegres/controllers/spec/enforcer/resources_count_spec/statefulset" + statefulset2 "reactive-tech.io/kubegres/internal/controller/spec/enforcer/resources_count_spec/statefulset" ) type StatefulSetCountSpecEnforcer struct { - primaryDbCountSpecEnforcer statefulset.PrimaryDbCountSpecEnforcer - replicaDbCountSpecEnforcer statefulset.ReplicaDbCountSpecEnforcer + primaryDbCountSpecEnforcer statefulset2.PrimaryDbCountSpecEnforcer + replicaDbCountSpecEnforcer statefulset2.ReplicaDbCountSpecEnforcer } -func CreateStatefulSetCountSpecEnforcer(primaryDbCountSpecEnforcer statefulset.PrimaryDbCountSpecEnforcer, - replicaDbCountSpecEnforcer statefulset.ReplicaDbCountSpecEnforcer) StatefulSetCountSpecEnforcer { +func CreateStatefulSetCountSpecEnforcer(primaryDbCountSpecEnforcer statefulset2.PrimaryDbCountSpecEnforcer, + replicaDbCountSpecEnforcer statefulset2.ReplicaDbCountSpecEnforcer) StatefulSetCountSpecEnforcer { return StatefulSetCountSpecEnforcer{ primaryDbCountSpecEnforcer: primaryDbCountSpecEnforcer, diff --git a/controllers/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go similarity index 89% rename from controllers/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go index 0a9f6e6..c04d127 100644 --- a/controllers/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/statefulset/PrimaryDbCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,11 +24,11 @@ import ( "errors" v1 "k8s.io/api/core/v1" postgresV1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/operation" - "reactive-tech.io/kubegres/controllers/spec/enforcer/resources_count_spec/statefulset/failover" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + operation2 "reactive-tech.io/kubegres/internal/controller/operation" + "reactive-tech.io/kubegres/internal/controller/spec/enforcer/resources_count_spec/statefulset/failover" + "reactive-tech.io/kubegres/internal/controller/spec/template" + "reactive-tech.io/kubegres/internal/controller/states" "sigs.k8s.io/controller-runtime/pkg/client" "strconv" ) @@ -38,14 +38,14 @@ type PrimaryDbCountSpecEnforcer struct { resourcesStates states.ResourcesStates resourcesCreator template.ResourcesCreatorFromTemplate primaryToReplicaFailOver failover.PrimaryToReplicaFailOver - blockingOperation *operation.BlockingOperation + blockingOperation *operation2.BlockingOperation } func CreatePrimaryDbCountSpecEnforcer( kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates, resourcesCreator template.ResourcesCreatorFromTemplate, - blockingOperation *operation.BlockingOperation, + blockingOperation *operation2.BlockingOperation, primaryToReplicaFailOver failover.PrimaryToReplicaFailOver) PrimaryDbCountSpecEnforcer { return PrimaryDbCountSpecEnforcer{ @@ -57,11 +57,11 @@ func CreatePrimaryDbCountSpecEnforcer( } } -func (r *PrimaryDbCountSpecEnforcer) CreateOperationConfigForPrimaryDbDeploying() operation.BlockingOperationConfig { +func (r *PrimaryDbCountSpecEnforcer) CreateOperationConfigForPrimaryDbDeploying() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdPrimaryDbCountSpecEnforcement, - StepId: operation.OperationStepIdPrimaryDbDeploying, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdPrimaryDbCountSpecEnforcement, + StepId: operation2.OperationStepIdPrimaryDbDeploying, TimeOutInSeconds: 300, CompletionChecker: func(operation postgresV1.KubegresBlockingOperation) bool { return r.isPrimaryDbReady() }, } @@ -73,7 +73,7 @@ func (r *PrimaryDbCountSpecEnforcer) Enforce() error { // added in Kubegres' status from version 1.8 r.initialiseStatusEnforcedReplicas() - if r.blockingOperation.IsActiveOperationIdDifferentOf(operation.OperationIdPrimaryDbCountSpecEnforcement) { + if r.blockingOperation.IsActiveOperationIdDifferentOf(operation2.OperationIdPrimaryDbCountSpecEnforcement) { return nil } @@ -105,7 +105,7 @@ func (r *PrimaryDbCountSpecEnforcer) initialiseStatusEnforcedReplicas() { } func (r *PrimaryDbCountSpecEnforcer) hasLastPrimaryCountSpecEnforcementAttemptTimedOut() bool { - return r.blockingOperation.HasActiveOperationIdTimedOut(operation.OperationIdPrimaryDbCountSpecEnforcement) + return r.blockingOperation.HasActiveOperationIdTimedOut(operation2.OperationIdPrimaryDbCountSpecEnforcement) } func (r *PrimaryDbCountSpecEnforcer) isPrimaryDbReady() bool { @@ -215,8 +215,8 @@ func (r *PrimaryDbCountSpecEnforcer) wasPrimaryNeverDeployed() bool { } func (r *PrimaryDbCountSpecEnforcer) activateBlockingOperation(statefulSetInstanceIndex int32) error { - return r.blockingOperation.ActivateOperationOnStatefulSet(operation.OperationIdPrimaryDbCountSpecEnforcement, - operation.OperationStepIdPrimaryDbDeploying, + return r.blockingOperation.ActivateOperationOnStatefulSet(operation2.OperationIdPrimaryDbCountSpecEnforcement, + operation2.OperationStepIdPrimaryDbDeploying, statefulSetInstanceIndex) } diff --git a/controllers/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go b/internal/controller/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go similarity index 89% rename from controllers/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go rename to internal/controller/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go index 46c32f7..9b5bc8f 100644 --- a/controllers/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go +++ b/internal/controller/spec/enforcer/resources_count_spec/statefulset/ReplicaDbCountSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,11 +24,11 @@ import ( "errors" v1 "k8s.io/api/apps/v1" postgresV1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/operation" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + operation2 "reactive-tech.io/kubegres/internal/controller/operation" + "reactive-tech.io/kubegres/internal/controller/spec/template" + "reactive-tech.io/kubegres/internal/controller/states" + "reactive-tech.io/kubegres/internal/controller/states/statefulset" "strconv" ) @@ -36,14 +36,14 @@ type ReplicaDbCountSpecEnforcer struct { kubegresContext ctx.KubegresContext resourcesStates states.ResourcesStates resourcesCreator template.ResourcesCreatorFromTemplate - blockingOperation *operation.BlockingOperation + blockingOperation *operation2.BlockingOperation } func CreateReplicaDbCountSpecEnforcer( kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates, resourcesCreator template.ResourcesCreatorFromTemplate, - blockingOperation *operation.BlockingOperation) ReplicaDbCountSpecEnforcer { + blockingOperation *operation2.BlockingOperation) ReplicaDbCountSpecEnforcer { return ReplicaDbCountSpecEnforcer{ kubegresContext: kubegresContext, @@ -53,21 +53,21 @@ func CreateReplicaDbCountSpecEnforcer( } } -func (r *ReplicaDbCountSpecEnforcer) CreateOperationConfigForReplicaDbDeploying() operation.BlockingOperationConfig { +func (r *ReplicaDbCountSpecEnforcer) CreateOperationConfigForReplicaDbDeploying() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdReplicaDbCountSpecEnforcement, - StepId: operation.OperationStepIdReplicaDbDeploying, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdReplicaDbCountSpecEnforcement, + StepId: operation2.OperationStepIdReplicaDbDeploying, TimeOutInSeconds: 300, CompletionChecker: r.isReplicaDbReady, } } -func (r *ReplicaDbCountSpecEnforcer) CreateOperationConfigForReplicaDbUndeploying() operation.BlockingOperationConfig { +func (r *ReplicaDbCountSpecEnforcer) CreateOperationConfigForReplicaDbUndeploying() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdReplicaDbCountSpecEnforcement, - StepId: operation.OperationStepIdReplicaDbUndeploying, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdReplicaDbCountSpecEnforcement, + StepId: operation2.OperationStepIdReplicaDbUndeploying, TimeOutInSeconds: 60, CompletionChecker: r.isReplicaDbUndeployed, } @@ -75,7 +75,7 @@ func (r *ReplicaDbCountSpecEnforcer) CreateOperationConfigForReplicaDbUndeployin func (r *ReplicaDbCountSpecEnforcer) Enforce() error { - if r.blockingOperation.IsActiveOperationIdDifferentOf(operation.OperationIdReplicaDbCountSpecEnforcement) { + if r.blockingOperation.IsActiveOperationIdDifferentOf(operation2.OperationIdReplicaDbCountSpecEnforcement) { return nil } @@ -135,7 +135,7 @@ func (r *ReplicaDbCountSpecEnforcer) Enforce() error { } func (r *ReplicaDbCountSpecEnforcer) isReplicaOperationInProgress() bool { - return r.blockingOperation.GetActiveOperation().OperationId == operation.OperationIdReplicaDbCountSpecEnforcement + return r.blockingOperation.GetActiveOperation().OperationId == operation2.OperationIdReplicaDbCountSpecEnforcement } func (r *ReplicaDbCountSpecEnforcer) getDeployedReplicas() []statefulset.StatefulSetWrapper { @@ -156,7 +156,7 @@ func (r *ReplicaDbCountSpecEnforcer) getExpectedNbreReplicasToDeploy() int32 { } func (r *ReplicaDbCountSpecEnforcer) hasLastAttemptTimedOut() bool { - return r.blockingOperation.HasActiveOperationIdTimedOut(operation.OperationIdReplicaDbCountSpecEnforcement) + return r.blockingOperation.HasActiveOperationIdTimedOut(operation2.OperationIdReplicaDbCountSpecEnforcement) } func (r *ReplicaDbCountSpecEnforcer) isPreviouslyFailedAttemptOnReplicaDbFixed() bool { @@ -178,7 +178,7 @@ func (r *ReplicaDbCountSpecEnforcer) logTimedOut() { operationTimeOutStr := strconv.FormatInt(r.CreateOperationConfigForReplicaDbDeploying().TimeOutInSeconds, 10) replicaStatefulSetName := activeOperation.StatefulSetOperation.Name - if activeOperation.StepId == operation.OperationStepIdReplicaDbDeploying { + if activeOperation.StepId == operation2.OperationStepIdReplicaDbDeploying { err := errors.New("Replica DB StatefulSet deployment timed-out") r.kubegresContext.Log.ErrorEvent("ReplicaStatefulSetDeploymentTimedOutErr", err, @@ -272,14 +272,14 @@ func (r *ReplicaDbCountSpecEnforcer) deployReplicaStatefulSet() error { } func (r *ReplicaDbCountSpecEnforcer) activateBlockingOperationForDeployment(statefulSetInstanceIndex int32) error { - return r.blockingOperation.ActivateOperationOnStatefulSet(operation.OperationIdReplicaDbCountSpecEnforcement, - operation.OperationStepIdReplicaDbDeploying, + return r.blockingOperation.ActivateOperationOnStatefulSet(operation2.OperationIdReplicaDbCountSpecEnforcement, + operation2.OperationStepIdReplicaDbDeploying, statefulSetInstanceIndex) } func (r *ReplicaDbCountSpecEnforcer) activateBlockingOperationForUndeployment(statefulSetInstanceIndex int32) error { - return r.blockingOperation.ActivateOperationOnStatefulSet(operation.OperationIdReplicaDbCountSpecEnforcement, - operation.OperationStepIdReplicaDbUndeploying, + return r.blockingOperation.ActivateOperationOnStatefulSet(operation2.OperationIdReplicaDbCountSpecEnforcement, + operation2.OperationStepIdReplicaDbUndeploying, statefulSetInstanceIndex) } diff --git a/controllers/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go b/internal/controller/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go similarity index 87% rename from controllers/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go rename to internal/controller/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go index 3552459..396a87d 100644 --- a/controllers/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go +++ b/internal/controller/spec/enforcer/resources_count_spec/statefulset/failover/PrimaryToReplicaFailOver.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,22 +24,22 @@ import ( "errors" core "k8s.io/api/core/v1" v1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/operation" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + operation2 "reactive-tech.io/kubegres/internal/controller/operation" + "reactive-tech.io/kubegres/internal/controller/states" + "reactive-tech.io/kubegres/internal/controller/states/statefulset" "strconv" ) type PrimaryToReplicaFailOver struct { kubegresContext ctx.KubegresContext resourcesStates states.ResourcesStates - blockingOperation *operation.BlockingOperation + blockingOperation *operation2.BlockingOperation } func CreatePrimaryToReplicaFailOver(kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates, - blockingOperation *operation.BlockingOperation) PrimaryToReplicaFailOver { + blockingOperation *operation2.BlockingOperation) PrimaryToReplicaFailOver { return PrimaryToReplicaFailOver{ kubegresContext: kubegresContext, @@ -48,19 +48,19 @@ func CreatePrimaryToReplicaFailOver(kubegresContext ctx.KubegresContext, } } -func (r *PrimaryToReplicaFailOver) CreateOperationConfigWaitingBeforeForFailingOver() operation.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdPrimaryDbCountSpecEnforcement, - StepId: operation.OperationStepIdPrimaryDbWaitingBeforeFailingOver, +func (r *PrimaryToReplicaFailOver) CreateOperationConfigWaitingBeforeForFailingOver() operation2.BlockingOperationConfig { + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdPrimaryDbCountSpecEnforcement, + StepId: operation2.OperationStepIdPrimaryDbWaitingBeforeFailingOver, TimeOutInSeconds: 10, AfterCompletionMoveToTransitionStep: true, } } -func (r *PrimaryToReplicaFailOver) CreateOperationConfigForFailingOver() operation.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdPrimaryDbCountSpecEnforcement, - StepId: operation.OperationStepIdPrimaryDbFailingOver, +func (r *PrimaryToReplicaFailOver) CreateOperationConfigForFailingOver() operation2.BlockingOperationConfig { + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdPrimaryDbCountSpecEnforcement, + StepId: operation2.OperationStepIdPrimaryDbFailingOver, TimeOutInSeconds: 300, CompletionChecker: r.isFailOverCompleted, } @@ -92,7 +92,7 @@ func (r *PrimaryToReplicaFailOver) ShouldWeFailOver() bool { func (r *PrimaryToReplicaFailOver) FailOver() error { - if r.blockingOperation.IsActiveOperationIdDifferentOf(operation.OperationIdPrimaryDbCountSpecEnforcement) { + if r.blockingOperation.IsActiveOperationIdDifferentOf(operation2.OperationIdPrimaryDbCountSpecEnforcement) { return nil } @@ -149,7 +149,7 @@ func (r *PrimaryToReplicaFailOver) isPrimaryDbDeployed() bool { } func (r *PrimaryToReplicaFailOver) hasLastFailOverAttemptTimedOut() bool { - return r.blockingOperation.HasActiveOperationIdTimedOut(operation.OperationIdPrimaryDbCountSpecEnforcement) + return r.blockingOperation.HasActiveOperationIdTimedOut(operation2.OperationIdPrimaryDbCountSpecEnforcement) } func (r *PrimaryToReplicaFailOver) logFailoverTimedOut() { @@ -196,12 +196,12 @@ func (r *PrimaryToReplicaFailOver) isManualFailoverRequested() bool { } func (r *PrimaryToReplicaFailOver) isWaitingBeforeStartingFailOver() bool { - if !r.blockingOperation.IsActiveOperationInTransition(operation.OperationIdPrimaryDbCountSpecEnforcement) { + if !r.blockingOperation.IsActiveOperationInTransition(operation2.OperationIdPrimaryDbCountSpecEnforcement) { return false } previouslyActiveOperation := r.blockingOperation.GetPreviouslyActiveOperation() - return previouslyActiveOperation.StepId == operation.OperationStepIdPrimaryDbWaitingBeforeFailingOver + return previouslyActiveOperation.StepId == operation2.OperationStepIdPrimaryDbWaitingBeforeFailingOver } func (r *PrimaryToReplicaFailOver) getStatefulSetByInstanceIndex(newPrimaryInstanceIndex int32) (statefulset.StatefulSetWrapper, error) { @@ -249,9 +249,16 @@ func (r *PrimaryToReplicaFailOver) promoteReplicaToPrimary(newPrimary statefulse SubPath: "promote_replica_to_primary.sh", } - initContainer := &newPrimary.StatefulSet.Spec.Template.Spec.InitContainers[0] - initContainer.VolumeMounts = append(initContainer.VolumeMounts, volumeMount) - initContainer.Command = []string{"sh", "-c", "/tmp/promote_replica_to_primary.sh"} + newPrimaryContainer := &newPrimary.StatefulSet.Spec.Template.Spec.Containers[0] + newPrimaryContainer.VolumeMounts = append(newPrimaryContainer.VolumeMounts, volumeMount) + + newPrimaryContainer.Lifecycle = &core.Lifecycle{ + PostStart: &core.LifecycleHandler{ + Exec: &core.ExecAction{ + Command: []string{"sh", "-c", "/tmp/promote_replica_to_primary.sh"}, + }, + }, + } err := r.activateOperationFailingOver(newPrimary) if err != nil { @@ -294,14 +301,14 @@ func (r *PrimaryToReplicaFailOver) waitBeforePromotingReplicaToPrimary(newPrimar } func (r *PrimaryToReplicaFailOver) activateOperationWaitingBeforeFailingOver(newPrimary statefulset.StatefulSetWrapper) error { - return r.blockingOperation.ActivateOperationOnStatefulSet(operation.OperationIdPrimaryDbCountSpecEnforcement, - operation.OperationStepIdPrimaryDbWaitingBeforeFailingOver, + return r.blockingOperation.ActivateOperationOnStatefulSet(operation2.OperationIdPrimaryDbCountSpecEnforcement, + operation2.OperationStepIdPrimaryDbWaitingBeforeFailingOver, newPrimary.InstanceIndex) } func (r *PrimaryToReplicaFailOver) activateOperationFailingOver(newPrimary statefulset.StatefulSetWrapper) error { - return r.blockingOperation.ActivateOperationOnStatefulSet(operation.OperationIdPrimaryDbCountSpecEnforcement, - operation.OperationStepIdPrimaryDbFailingOver, + return r.blockingOperation.ActivateOperationOnStatefulSet(operation2.OperationIdPrimaryDbCountSpecEnforcement, + operation2.OperationStepIdPrimaryDbFailingOver, newPrimary.InstanceIndex) } diff --git a/controllers/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go similarity index 95% rename from controllers/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go index 3f4e6ba..3d79091 100644 --- a/controllers/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/AffinitySpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,7 +22,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "reflect" ) diff --git a/controllers/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go similarity index 86% rename from controllers/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go index cc36943..65e7263 100644 --- a/controllers/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/AllStatefulSetsSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,11 +24,11 @@ import ( "errors" apps "k8s.io/api/apps/v1" postgresV1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/operation" - "reactive-tech.io/kubegres/controllers/spec/enforcer/comparator" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + operation2 "reactive-tech.io/kubegres/internal/controller/operation" + "reactive-tech.io/kubegres/internal/controller/spec/enforcer/comparator" + "reactive-tech.io/kubegres/internal/controller/states" + statefulset2 "reactive-tech.io/kubegres/internal/controller/states/statefulset" ) // Note about Kubernetes: "Forbidden: updates to Statefulset spec for fields other than 'replicas', 'template', @@ -37,13 +37,13 @@ import ( type AllStatefulSetsSpecEnforcer struct { kubegresContext ctx.KubegresContext resourcesStates states.ResourcesStates - blockingOperation *operation.BlockingOperation + blockingOperation *operation2.BlockingOperation specsEnforcers StatefulSetsSpecsEnforcer } func CreateAllStatefulSetsSpecEnforcer(kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates, - blockingOperation *operation.BlockingOperation, + blockingOperation *operation2.BlockingOperation, specsEnforcers StatefulSetsSpecsEnforcer) AllStatefulSetsSpecEnforcer { return AllStatefulSetsSpecEnforcer{ @@ -54,33 +54,33 @@ func CreateAllStatefulSetsSpecEnforcer(kubegresContext ctx.KubegresContext, } } -func (r *AllStatefulSetsSpecEnforcer) CreateOperationConfigForStatefulSetSpecUpdating() operation.BlockingOperationConfig { +func (r *AllStatefulSetsSpecEnforcer) CreateOperationConfigForStatefulSetSpecUpdating() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdStatefulSetSpecEnforcing, - StepId: operation.OperationStepIdStatefulSetSpecUpdating, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdStatefulSetSpecEnforcing, + StepId: operation2.OperationStepIdStatefulSetSpecUpdating, TimeOutInSeconds: 300, CompletionChecker: r.isStatefulSetSpecUpdated, AfterCompletionMoveToTransitionStep: true, } } -func (r *AllStatefulSetsSpecEnforcer) CreateOperationConfigForStatefulSetSpecPodUpdating() operation.BlockingOperationConfig { +func (r *AllStatefulSetsSpecEnforcer) CreateOperationConfigForStatefulSetSpecPodUpdating() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdStatefulSetSpecEnforcing, - StepId: operation.OperationStepIdStatefulSetPodSpecUpdating, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdStatefulSetSpecEnforcing, + StepId: operation2.OperationStepIdStatefulSetPodSpecUpdating, TimeOutInSeconds: 300, CompletionChecker: r.isStatefulSetPodSpecUpdated, AfterCompletionMoveToTransitionStep: true, } } -func (r *AllStatefulSetsSpecEnforcer) CreateOperationConfigForStatefulSetWaitingOnStuckPod() operation.BlockingOperationConfig { +func (r *AllStatefulSetsSpecEnforcer) CreateOperationConfigForStatefulSetWaitingOnStuckPod() operation2.BlockingOperationConfig { - return operation.BlockingOperationConfig{ - OperationId: operation.OperationIdStatefulSetSpecEnforcing, - StepId: operation.OperationStepIdStatefulSetWaitingOnStuckPod, + return operation2.BlockingOperationConfig{ + OperationId: operation2.OperationIdStatefulSetSpecEnforcing, + StepId: operation2.OperationStepIdStatefulSetWaitingOnStuckPod, TimeOutInSeconds: 300, CompletionChecker: r.isStatefulSetPodNotStuck, AfterCompletionMoveToTransitionStep: true, @@ -93,7 +93,7 @@ func (r *AllStatefulSetsSpecEnforcer) EnforceSpec() error { return nil } - if r.blockingOperation.IsActiveOperationIdDifferentOf(operation.OperationIdStatefulSetSpecEnforcing) { + if r.blockingOperation.IsActiveOperationIdDifferentOf(operation2.OperationIdStatefulSetSpecEnforcing) { return nil } @@ -134,13 +134,13 @@ func (r *AllStatefulSetsSpecEnforcer) isPrimaryDbReady() bool { return r.resourcesStates.StatefulSets.Primary.IsReady } -func (r *AllStatefulSetsSpecEnforcer) getAllReverseSortedByInstanceIndex() []statefulset.StatefulSetWrapper { +func (r *AllStatefulSetsSpecEnforcer) getAllReverseSortedByInstanceIndex() []statefulset2.StatefulSetWrapper { replicas := r.resourcesStates.StatefulSets.Replicas.All.GetAllReverseSortedByInstanceIndex() return append(replicas, r.resourcesStates.StatefulSets.Primary) } func (r *AllStatefulSetsSpecEnforcer) hasLastSpecUpdateAttemptTimedOut(statefulSetInstanceIndex int32) bool { - if !r.blockingOperation.HasActiveOperationIdTimedOut(operation.OperationIdStatefulSetSpecEnforcing) { + if !r.blockingOperation.HasActiveOperationIdTimedOut(operation2.OperationIdStatefulSetSpecEnforcing) { return false } @@ -196,7 +196,7 @@ func (r *AllStatefulSetsSpecEnforcer) enforceSpec(statefulSet apps.StatefulSet, return nil } -func (r *AllStatefulSetsSpecEnforcer) verifySpecEnforcementIsAppliedToPod(statefulSetWrapper statefulset.StatefulSetWrapper, +func (r *AllStatefulSetsSpecEnforcer) verifySpecEnforcementIsAppliedToPod(statefulSetWrapper statefulset2.StatefulSetWrapper, specDifferences StatefulSetSpecDifferences) (isPodReadyAndSpecUpdated bool, err error) { podWrapper := statefulSetWrapper.Pod @@ -216,7 +216,7 @@ func (r *AllStatefulSetsSpecEnforcer) verifySpecEnforcementIsAppliedToPod(statef return true, r.specsEnforcers.OnSpecUpdatedSuccessfully(&statefulSetWrapper.StatefulSet) } -func (r *AllStatefulSetsSpecEnforcer) handleWhenStuckPod(podWrapper statefulset.PodWrapper, +func (r *AllStatefulSetsSpecEnforcer) handleWhenStuckPod(podWrapper statefulset2.PodWrapper, specDifferences StatefulSetSpecDifferences) (err error) { err = r.activateOperationStepWaitingUntilPodIsNotStuck(podWrapper.InstanceIndex, specDifferences) @@ -239,7 +239,7 @@ func (r *AllStatefulSetsSpecEnforcer) handleWhenStuckPod(podWrapper statefulset. return nil } -func (r *AllStatefulSetsSpecEnforcer) handleWhenPodSpecNotUpToDateOrNotReady(podWrapper statefulset.PodWrapper, +func (r *AllStatefulSetsSpecEnforcer) handleWhenPodSpecNotUpToDateOrNotReady(podWrapper statefulset2.PodWrapper, isPodSpecUpToDate bool, specDifferences StatefulSetSpecDifferences) (err error) { @@ -264,7 +264,7 @@ func (r *AllStatefulSetsSpecEnforcer) handleWhenPodSpecNotUpToDateOrNotReady(pod } func (r *AllStatefulSetsSpecEnforcer) isStatefulSetSpecUpdating(statefulSetInstanceIndex int32) bool { - if !r.blockingOperation.IsActiveOperationInTransition(operation.OperationIdStatefulSetSpecEnforcing) { + if !r.blockingOperation.IsActiveOperationInTransition(operation2.OperationIdStatefulSetSpecEnforcing) { return false } @@ -330,8 +330,8 @@ func (r *AllStatefulSetsSpecEnforcer) isStatefulSetPodNotStuck(operation postgre func (r *AllStatefulSetsSpecEnforcer) activateOperationStepStatefulSetSpecUpdating(statefulSetInstanceIndex int32, specDifferences StatefulSetSpecDifferences) error { - return r.blockingOperation.ActivateOperationOnStatefulSetSpecUpdate(operation.OperationIdStatefulSetSpecEnforcing, - operation.OperationStepIdStatefulSetSpecUpdating, + return r.blockingOperation.ActivateOperationOnStatefulSetSpecUpdate(operation2.OperationIdStatefulSetSpecEnforcing, + operation2.OperationStepIdStatefulSetSpecUpdating, statefulSetInstanceIndex, specDifferences.GetSpecDifferencesAsString()) } @@ -339,8 +339,8 @@ func (r *AllStatefulSetsSpecEnforcer) activateOperationStepStatefulSetSpecUpdati func (r *AllStatefulSetsSpecEnforcer) activateOperationStepStatefulSetPodSpecUpdating(statefulSetInstanceIndex int32, specDifferences StatefulSetSpecDifferences) error { - return r.blockingOperation.ActivateOperationOnStatefulSetSpecUpdate(operation.OperationIdStatefulSetSpecEnforcing, - operation.OperationStepIdStatefulSetPodSpecUpdating, + return r.blockingOperation.ActivateOperationOnStatefulSetSpecUpdate(operation2.OperationIdStatefulSetSpecEnforcing, + operation2.OperationStepIdStatefulSetPodSpecUpdating, statefulSetInstanceIndex, specDifferences.GetSpecDifferencesAsString()) } @@ -348,8 +348,8 @@ func (r *AllStatefulSetsSpecEnforcer) activateOperationStepStatefulSetPodSpecUpd func (r *AllStatefulSetsSpecEnforcer) activateOperationStepWaitingUntilPodIsNotStuck(statefulSetInstanceIndex int32, specDifferences StatefulSetSpecDifferences) error { - return r.blockingOperation.ActivateOperationOnStatefulSetSpecUpdate(operation.OperationIdStatefulSetSpecEnforcing, - operation.OperationStepIdStatefulSetWaitingOnStuckPod, + return r.blockingOperation.ActivateOperationOnStatefulSetSpecUpdate(operation2.OperationIdStatefulSetSpecEnforcing, + operation2.OperationStepIdStatefulSetWaitingOnStuckPod, statefulSetInstanceIndex, specDifferences.GetSpecDifferencesAsString()) } diff --git a/controllers/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go similarity index 94% rename from controllers/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go index f2ae6bd..1e618c2 100644 --- a/controllers/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/CustomConfigSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,7 +22,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/spec/template" + "reactive-tech.io/kubegres/internal/controller/spec/template" ) type CustomConfigSpecEnforcer struct { diff --git a/controllers/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go similarity index 95% rename from controllers/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go index f745be0..6848619 100644 --- a/controllers/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/ImageSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,7 +22,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" ) type ImageSpecEnforcer struct { diff --git a/controllers/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go similarity index 93% rename from controllers/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go index 5894f23..f60c492 100644 --- a/controllers/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/LivenessProbeSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,8 +22,8 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/states" "reflect" ) diff --git a/controllers/spec/enforcer/statefulset_spec/PortSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/PortSpecEnforcer.go similarity index 96% rename from controllers/spec/enforcer/statefulset_spec/PortSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/PortSpecEnforcer.go index c3ac8c5..ce625f6 100644 --- a/controllers/spec/enforcer/statefulset_spec/PortSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/PortSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,8 +23,8 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/states" "strconv" ) diff --git a/controllers/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go similarity index 95% rename from controllers/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go index c63a8c1..e373a02 100644 --- a/controllers/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/ReadinessProbeSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,7 +22,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "reflect" ) diff --git a/controllers/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go similarity index 96% rename from controllers/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go index abc3816..d67ffdc 100644 --- a/controllers/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/ResourcesSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,7 +24,7 @@ import ( apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" ) type ResourcesSpecEnforcer struct { diff --git a/controllers/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go similarity index 95% rename from controllers/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go index cd1f70b..7a682fa 100644 --- a/controllers/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/SecurityContextSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,10 +22,10 @@ package statefulset_spec import ( v1 "k8s.io/api/core/v1" + "reactive-tech.io/kubegres/internal/controller/ctx" "reflect" apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/ctx" ) type SecurityContextSpecEnforcer struct { diff --git a/controllers/spec/enforcer/statefulset_spec/StatefulSetSpecDifferences.go b/internal/controller/spec/enforcer/statefulset_spec/StatefulSetSpecDifferences.go similarity index 100% rename from controllers/spec/enforcer/statefulset_spec/StatefulSetSpecDifferences.go rename to internal/controller/spec/enforcer/statefulset_spec/StatefulSetSpecDifferences.go diff --git a/controllers/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go similarity index 97% rename from controllers/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go index af03b54..9e66273 100644 --- a/controllers/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/StatefulSetsSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,7 +22,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" ) type StatefulSetSpecEnforcer interface { diff --git a/controllers/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go similarity index 96% rename from controllers/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go index cc182bf..e4982dd 100644 --- a/controllers/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/StorageClassSizeSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -26,9 +26,9 @@ import ( apps "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/states" + "reactive-tech.io/kubegres/internal/controller/states/statefulset" "sigs.k8s.io/controller-runtime/pkg/client" "strconv" ) diff --git a/controllers/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go similarity index 96% rename from controllers/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go index f23307f..b9d8d22 100644 --- a/controllers/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/TolerationsSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "reflect" ) diff --git a/controllers/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go b/internal/controller/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go similarity index 98% rename from controllers/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go rename to internal/controller/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go index 051f46f..eedd8bd 100644 --- a/controllers/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go +++ b/internal/controller/spec/enforcer/statefulset_spec/VolumeSpecEnforcer.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package statefulset_spec import ( apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "reflect" ) diff --git a/controllers/spec/template/CustomConfigSpecHelper.go b/internal/controller/spec/template/CustomConfigSpecHelper.go similarity index 89% rename from controllers/spec/template/CustomConfigSpecHelper.go rename to internal/controller/spec/template/CustomConfigSpecHelper.go index 5174400..51be656 100644 --- a/controllers/spec/template/CustomConfigSpecHelper.go +++ b/internal/controller/spec/template/CustomConfigSpecHelper.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,8 +23,8 @@ package template import ( "k8s.io/api/apps/v1" core "k8s.io/api/core/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" + "reactive-tech.io/kubegres/internal/controller/ctx" + states2 "reactive-tech.io/kubegres/internal/controller/states" ) const ( @@ -33,10 +33,10 @@ const ( type CustomConfigSpecHelper struct { kubegresContext ctx.KubegresContext - resourcesStates states.ResourcesStates + resourcesStates states2.ResourcesStates } -func CreateCustomConfigSpecHelper(kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates) CustomConfigSpecHelper { +func CreateCustomConfigSpecHelper(kubegresContext ctx.KubegresContext, resourcesStates states2.ResourcesStates) CustomConfigSpecHelper { return CustomConfigSpecHelper{kubegresContext: kubegresContext, resourcesStates: resourcesStates} } @@ -44,18 +44,18 @@ func (r *CustomConfigSpecHelper) ConfigureStatefulSet(statefulSet *v1.StatefulSe configMap := r.resourcesStates.Config - if r.updateVolumeMountNameIfChanged(configMap.ConfigLocations.PostgreConf, states.ConfigMapDataKeyPostgresConf, statefulSet) { - differenceDetails += r.createDescriptionMsg(configMap.ConfigLocations.PostgreConf, states.ConfigMapDataKeyPostgresConf) + if r.updateVolumeMountNameIfChanged(configMap.ConfigLocations.PostgreConf, states2.ConfigMapDataKeyPostgresConf, statefulSet) { + differenceDetails += r.createDescriptionMsg(configMap.ConfigLocations.PostgreConf, states2.ConfigMapDataKeyPostgresConf) hasStatefulSetChanged = true } - if r.updateVolumeMountNameIfChanged(configMap.ConfigLocations.PrimaryInitScript, states.ConfigMapDataKeyPrimaryInitScript, statefulSet) { - differenceDetails += r.createDescriptionMsg(configMap.ConfigLocations.PrimaryInitScript, states.ConfigMapDataKeyPrimaryInitScript) + if r.updateVolumeMountNameIfChanged(configMap.ConfigLocations.PrimaryInitScript, states2.ConfigMapDataKeyPrimaryInitScript, statefulSet) { + differenceDetails += r.createDescriptionMsg(configMap.ConfigLocations.PrimaryInitScript, states2.ConfigMapDataKeyPrimaryInitScript) hasStatefulSetChanged = true } - if r.updateVolumeMountNameIfChanged(configMap.ConfigLocations.PgHbaConf, states.ConfigMapDataKeyPgHbaConf, statefulSet) { - differenceDetails += r.createDescriptionMsg(configMap.ConfigLocations.PgHbaConf, states.ConfigMapDataKeyPgHbaConf) + if r.updateVolumeMountNameIfChanged(configMap.ConfigLocations.PgHbaConf, states2.ConfigMapDataKeyPgHbaConf, statefulSet) { + differenceDetails += r.createDescriptionMsg(configMap.ConfigLocations.PgHbaConf, states2.ConfigMapDataKeyPgHbaConf) hasStatefulSetChanged = true } diff --git a/controllers/spec/template/ResourceTemplateLoader.go b/internal/controller/spec/template/ResourceTemplateLoader.go similarity index 94% rename from controllers/spec/template/ResourceTemplateLoader.go rename to internal/controller/spec/template/ResourceTemplateLoader.go index b908540..d98d68d 100644 --- a/controllers/spec/template/ResourceTemplateLoader.go +++ b/internal/controller/spec/template/ResourceTemplateLoader.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -26,8 +26,8 @@ import ( core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" - log2 "reactive-tech.io/kubegres/controllers/ctx/log" - "reactive-tech.io/kubegres/controllers/spec/template/yaml" + log2 "reactive-tech.io/kubegres/internal/controller/ctx/log" + "reactive-tech.io/kubegres/internal/controller/spec/template/yaml" ) type ResourceTemplateLoader struct { diff --git a/controllers/spec/template/ResourcesCreatorFromTemplate.go b/internal/controller/spec/template/ResourcesCreatorFromTemplate.go similarity index 99% rename from controllers/spec/template/ResourcesCreatorFromTemplate.go rename to internal/controller/spec/template/ResourcesCreatorFromTemplate.go index 9ff9f5a..2d8cae8 100644 --- a/controllers/spec/template/ResourcesCreatorFromTemplate.go +++ b/internal/controller/spec/template/ResourcesCreatorFromTemplate.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,6 +21,7 @@ limitations under the License. package template import ( + "reactive-tech.io/kubegres/internal/controller/ctx" "strconv" apps "k8s.io/api/apps/v1" @@ -29,7 +30,6 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" postgresV1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" ) type ResourcesCreatorFromTemplate struct { diff --git a/controllers/spec/template/yaml/BackUpCronJobTemplate.yaml b/internal/controller/spec/template/yaml/BackUpCronJobTemplate.yaml similarity index 100% rename from controllers/spec/template/yaml/BackUpCronJobTemplate.yaml rename to internal/controller/spec/template/yaml/BackUpCronJobTemplate.yaml diff --git a/controllers/spec/template/yaml/BaseConfigMapTemplate.yaml b/internal/controller/spec/template/yaml/BaseConfigMapTemplate.yaml similarity index 88% rename from controllers/spec/template/yaml/BaseConfigMapTemplate.yaml rename to internal/controller/spec/template/yaml/BaseConfigMapTemplate.yaml index 3e57b06..e416b0c 100644 --- a/controllers/spec/template/yaml/BaseConfigMapTemplate.yaml +++ b/internal/controller/spec/template/yaml/BaseConfigMapTemplate.yaml @@ -85,14 +85,12 @@ data: #echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ..."; #psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - #CREATE DATABASE $customDatabaseName; - #CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; - #\connect $customDatabaseName; - #CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); - #INSERT INTO account VALUES (1, 'username1'); - #INSERT INTO account VALUES (2, 'username2'); - #GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName; - #GRANT ALL ON "account" to $customUserName; + #CREATE DATABASE $customDatabaseName; + #\connect $customDatabaseName; + #CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; + #GRANT SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO $customUserName; + #GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $customUserName; + #GRANT USAGE, CREATE ON SCHEMA public TO $customUserName; #EOSQL #echo "$dt - Init script is completed"; @@ -231,22 +229,29 @@ data: set -e dt=$(date '+%d/%m/%Y %H:%M:%S'); - echo "$dt - Attempting to promote a Replica PostgreSql to Primary..."; + echo "$dt - Attempting to promote a Replica PostgreSql to Primary..." > /usr/share/promotion.log standbyFilePath="$PGDATA/standby.signal" if [ ! -f "$standbyFilePath" ]; then - echo "$dt - Skipping as this PostgreSql is already a Primary since the file '$standbyFilePath' does not exist." - exit 0 - fi - - promotionTriggerFilePath="$PGDATA/promote_replica_to_primary.log" - - if [ -f "$promotionTriggerFilePath" ]; then - echo "$dt - Skipping as the promotion trigger file '$promotionTriggerFilePath' already exists" - exit 0 + echo "$dt - Skipping as this PostgreSql is already a Primary since the file '$standbyFilePath' does not exist." >> /usr/share/promotion.log + + else + + counter=1 + until pg_isready -U postgres || [ $counter -gt 10 ] + do + echo "$dt - Attempt $counter - Postgres is not ready yet. Waiting..." > /usr/share/promotion.log + ((counter++)) + sleep 5 + done + + if pg_isready -U postgres; then + echo "$dt - Running: su -c '/usr/lib/postgresql/$PG_MAJOR/bin/pg_ctl promote -D $PGDATA' postgres" >> /usr/share/promotion.log + su -c '/usr/lib/postgresql/$PG_MAJOR/bin/pg_ctl promote -D $PGDATA' postgres >> /usr/share/promotion.log + else + echo "$dt - Postgres is still not ready. We tried $counter times. Stopping attempts." > /usr/share/promotion.log + fi + fi - echo "$dt - Promoting by creating the promotion trigger file: '$promotionTriggerFilePath'" - touch $promotionTriggerFilePath - diff --git a/controllers/spec/template/yaml/PrimaryServiceTemplate.yaml b/internal/controller/spec/template/yaml/PrimaryServiceTemplate.yaml similarity index 100% rename from controllers/spec/template/yaml/PrimaryServiceTemplate.yaml rename to internal/controller/spec/template/yaml/PrimaryServiceTemplate.yaml diff --git a/controllers/spec/template/yaml/PrimaryStatefulSetTemplate.yaml b/internal/controller/spec/template/yaml/PrimaryStatefulSetTemplate.yaml similarity index 100% rename from controllers/spec/template/yaml/PrimaryStatefulSetTemplate.yaml rename to internal/controller/spec/template/yaml/PrimaryStatefulSetTemplate.yaml diff --git a/controllers/spec/template/yaml/ReplicaServiceTemplate.yaml b/internal/controller/spec/template/yaml/ReplicaServiceTemplate.yaml similarity index 100% rename from controllers/spec/template/yaml/ReplicaServiceTemplate.yaml rename to internal/controller/spec/template/yaml/ReplicaServiceTemplate.yaml diff --git a/controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml b/internal/controller/spec/template/yaml/ReplicaStatefulSetTemplate.yaml similarity index 96% rename from controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml rename to internal/controller/spec/template/yaml/ReplicaStatefulSetTemplate.yaml index cb4bbe9..9158cd8 100644 --- a/controllers/spec/template/yaml/ReplicaStatefulSetTemplate.yaml +++ b/internal/controller/spec/template/yaml/ReplicaStatefulSetTemplate.yaml @@ -72,7 +72,7 @@ spec: - name: postgres-name-1 image: postgres:latest imagePullPolicy: IfNotPresent - args: ["-c", "config_file=/etc/postgres.conf", "-c", "hba_file=/etc/pg_hba.conf", "-c", "promote_trigger_file=$(PGDATA)/promote_replica_to_primary.log"] + args: ["-c", "config_file=/etc/postgres.conf", "-c", "hba_file=/etc/pg_hba.conf"] ports: - containerPort: 5432 diff --git a/controllers/spec/template/yaml/Templates.go b/internal/controller/spec/template/yaml/Templates.go similarity index 93% rename from controllers/spec/template/yaml/Templates.go rename to internal/controller/spec/template/yaml/Templates.go index 537a9f2..9889f56 100644 --- a/controllers/spec/template/yaml/Templates.go +++ b/internal/controller/spec/template/yaml/Templates.go @@ -1,6 +1,6 @@ package yaml - // This file is auto generated by the script in 'WriteYamlTemplatesInGoFile.go'. + // This file is auto generated by 'WriteYamlTemplatesInGoFile.go'. // Any manual modification to this file will be lost during next compilation. const ( @@ -152,14 +152,12 @@ data: #echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ..."; #psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - #CREATE DATABASE $customDatabaseName; - #CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; - #\connect $customDatabaseName; - #CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); - #INSERT INTO account VALUES (1, 'username1'); - #INSERT INTO account VALUES (2, 'username2'); - #GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName; - #GRANT ALL ON "account" to $customUserName; + #CREATE DATABASE $customDatabaseName; + #\connect $customDatabaseName; + #CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; + #GRANT SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO $customUserName; + #GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $customUserName; + #GRANT USAGE, CREATE ON SCHEMA public TO $customUserName; #EOSQL #echo "$dt - Init script is completed"; @@ -298,25 +296,32 @@ data: set -e dt=$(date '+%d/%m/%Y %H:%M:%S'); - echo "$dt - Attempting to promote a Replica PostgreSql to Primary..."; + echo "$dt - Attempting to promote a Replica PostgreSql to Primary..." > /usr/share/promotion.log standbyFilePath="$PGDATA/standby.signal" if [ ! -f "$standbyFilePath" ]; then - echo "$dt - Skipping as this PostgreSql is already a Primary since the file '$standbyFilePath' does not exist." - exit 0 - fi - - promotionTriggerFilePath="$PGDATA/promote_replica_to_primary.log" - - if [ -f "$promotionTriggerFilePath" ]; then - echo "$dt - Skipping as the promotion trigger file '$promotionTriggerFilePath' already exists" - exit 0 + echo "$dt - Skipping as this PostgreSql is already a Primary since the file '$standbyFilePath' does not exist." >> /usr/share/promotion.log + + else + + counter=1 + until pg_isready -U postgres || [ $counter -gt 10 ] + do + echo "$dt - Attempt $counter - Postgres is not ready yet. Waiting..." > /usr/share/promotion.log + ((counter++)) + sleep 5 + done + + if pg_isready -U postgres; then + echo "$dt - Running: su -c '/usr/lib/postgresql/$PG_MAJOR/bin/pg_ctl promote -D $PGDATA' postgres" >> /usr/share/promotion.log + su -c '/usr/lib/postgresql/$PG_MAJOR/bin/pg_ctl promote -D $PGDATA' postgres >> /usr/share/promotion.log + else + echo "$dt - Postgres is still not ready. We tried $counter times. Stopping attempts." > /usr/share/promotion.log + fi + fi - echo "$dt - Promoting by creating the promotion trigger file: '$promotionTriggerFilePath'" - touch $promotionTriggerFilePath - ` PrimaryServiceTemplate = `apiVersion: v1 kind: Service @@ -535,7 +540,7 @@ spec: - name: postgres-name-1 image: postgres:latest imagePullPolicy: IfNotPresent - args: ["-c", "config_file=/etc/postgres.conf", "-c", "hba_file=/etc/pg_hba.conf", "-c", "promote_trigger_file=$(PGDATA)/promote_replica_to_primary.log"] + args: ["-c", "config_file=/etc/postgres.conf", "-c", "hba_file=/etc/pg_hba.conf"] ports: - containerPort: 5432 diff --git a/controllers/states/BackUpStates.go b/internal/controller/states/BackUpStates.go similarity index 97% rename from controllers/states/BackUpStates.go rename to internal/controller/states/BackUpStates.go index 4ec6135..9f93e96 100644 --- a/controllers/states/BackUpStates.go +++ b/internal/controller/states/BackUpStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,7 +24,7 @@ import ( batch "k8s.io/api/batch/v1" "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/states/ConfigStates.go b/internal/controller/states/ConfigStates.go similarity index 98% rename from controllers/states/ConfigStates.go rename to internal/controller/states/ConfigStates.go index db0ed4b..b3f8cb1 100644 --- a/controllers/states/ConfigStates.go +++ b/internal/controller/states/ConfigStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package states import ( core "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/states/DbStorageClassStates.go b/internal/controller/states/DbStorageClassStates.go similarity index 96% rename from controllers/states/DbStorageClassStates.go rename to internal/controller/states/DbStorageClassStates.go index 68d6783..8a08aee 100644 --- a/controllers/states/DbStorageClassStates.go +++ b/internal/controller/states/DbStorageClassStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package states import ( storage "k8s.io/api/storage/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/states/ResourcesStates.go b/internal/controller/states/ResourcesStates.go similarity index 93% rename from controllers/states/ResourcesStates.go rename to internal/controller/states/ResourcesStates.go index 511196c..27fabad 100644 --- a/controllers/states/ResourcesStates.go +++ b/internal/controller/states/ResourcesStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,8 +21,8 @@ limitations under the License. package states import ( - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/states/statefulset" ) type ResourcesStates struct { diff --git a/controllers/states/ServicesStates.go b/internal/controller/states/ServicesStates.go similarity index 96% rename from controllers/states/ServicesStates.go rename to internal/controller/states/ServicesStates.go index c31c10c..8d585c1 100644 --- a/controllers/states/ServicesStates.go +++ b/internal/controller/states/ServicesStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package states import ( core "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/states/log/ResourcesStatesLogger.go b/internal/controller/states/log/ResourcesStatesLogger.go similarity index 90% rename from controllers/states/log/ResourcesStatesLogger.go rename to internal/controller/states/log/ResourcesStatesLogger.go index 65387dc..89e0d53 100644 --- a/controllers/states/log/ResourcesStatesLogger.go +++ b/internal/controller/states/log/ResourcesStatesLogger.go @@ -1,17 +1,17 @@ package log import ( - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/controllers/states/statefulset" + "reactive-tech.io/kubegres/internal/controller/ctx" + states2 "reactive-tech.io/kubegres/internal/controller/states" + "reactive-tech.io/kubegres/internal/controller/states/statefulset" ) type ResourcesStatesLogger struct { kubegresContext ctx.KubegresContext - resourcesStates states.ResourcesStates + resourcesStates states2.ResourcesStates } -func CreateResourcesStatesLogger(kubegresContext ctx.KubegresContext, resourcesStates states.ResourcesStates) ResourcesStatesLogger { +func CreateResourcesStatesLogger(kubegresContext ctx.KubegresContext, resourcesStates states2.ResourcesStates) ResourcesStatesLogger { return ResourcesStatesLogger{kubegresContext: kubegresContext, resourcesStates: resourcesStates} } @@ -77,7 +77,7 @@ func (r *ResourcesStatesLogger) logServicesStates() { r.logServiceWrapper("Replica Service states", r.resourcesStates.Services.Replica) } -func (r *ResourcesStatesLogger) logServiceWrapper(logLabel string, serviceWrapper states.ServiceWrapper) { +func (r *ResourcesStatesLogger) logServiceWrapper(logLabel string, serviceWrapper states2.ServiceWrapper) { if !serviceWrapper.IsDeployed { r.kubegresContext.Log.Info(logLabel+": ", diff --git a/controllers/states/statefulset/PodsStates.go b/internal/controller/states/statefulset/PodsStates.go similarity index 97% rename from controllers/states/statefulset/PodsStates.go rename to internal/controller/states/statefulset/PodsStates.go index 0dd5b4c..4cd2cb4 100644 --- a/controllers/states/statefulset/PodsStates.go +++ b/internal/controller/states/statefulset/PodsStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package statefulset import ( core "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "sigs.k8s.io/controller-runtime/pkg/client" "strconv" ) diff --git a/controllers/states/statefulset/StatefulSetWrapper.go b/internal/controller/states/statefulset/StatefulSetWrapper.go similarity index 100% rename from controllers/states/statefulset/StatefulSetWrapper.go rename to internal/controller/states/statefulset/StatefulSetWrapper.go diff --git a/controllers/states/statefulset/StatefulSetWrappersSorting.go b/internal/controller/states/statefulset/StatefulSetWrappersSorting.go similarity index 97% rename from controllers/states/statefulset/StatefulSetWrappersSorting.go rename to internal/controller/states/statefulset/StatefulSetWrappersSorting.go index 81dd1ba..b755020 100644 --- a/controllers/states/statefulset/StatefulSetWrappersSorting.go +++ b/internal/controller/states/statefulset/StatefulSetWrappersSorting.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/controllers/states/statefulset/StatefulSetsStates.go b/internal/controller/states/statefulset/StatefulSetsStates.go similarity index 98% rename from controllers/states/statefulset/StatefulSetsStates.go rename to internal/controller/states/statefulset/StatefulSetsStates.go index c235847..9cacb6c 100644 --- a/controllers/states/statefulset/StatefulSetsStates.go +++ b/internal/controller/states/statefulset/StatefulSetsStates.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,7 +24,7 @@ import ( "errors" apps "k8s.io/api/apps/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "reactive-tech.io/kubegres/controllers/ctx" + "reactive-tech.io/kubegres/internal/controller/ctx" "sigs.k8s.io/controller-runtime/pkg/client" "strconv" ) diff --git a/test/custom_annotation_test.go b/internal/test/custom_annotation_test.go similarity index 84% rename from test/custom_annotation_test.go rename to internal/test/custom_annotation_test.go index e152970..8fddef5 100644 --- a/test/custom_annotation_test.go +++ b/internal/test/custom_annotation_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/spec/template" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/spec/template" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -45,11 +45,11 @@ var _ = Describe("Creating Kubegres with custom annotations", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) - test.kubegresResource = resourceConfigs.LoadKubegresYaml() + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) + test.kubegresResource = resourceConfigs2.LoadKubegresYaml() }) AfterEach(func() { @@ -91,9 +91,9 @@ var _ = Describe("Creating Kubegres with custom annotations", func() { type CustomAnnotationTest struct { kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever - resourceModifier util.TestResourceModifier + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever + resourceModifier util2.TestResourceModifier } func (r *CustomAnnotationTest) givenKubegresAnnotationIsSetTo(annotationKey string, annotationValue string) { @@ -131,7 +131,7 @@ func (r *CustomAnnotationTest) thenPodsAndStatefulSetsShouldHaveAnnotation(annot log.Println("Pods and StatefulSets do contain the annotation '" + annotationKey + ":" + annotationValue + "'") return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *CustomAnnotationTest) thenPodsAndStatefulSetsShouldNOTHaveAnnotationKey(annotationKey string) bool { @@ -161,7 +161,7 @@ func (r *CustomAnnotationTest) thenPodsAndStatefulSetsShouldNOTHaveAnnotationKey log.Println("As expected, Pods and StatefulSets do NOT contain the annotation key '" + annotationKey + "'") return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *CustomAnnotationTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -177,14 +177,14 @@ func (r *CustomAnnotationTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas pods.NbreDeployedPrimary == nbrePrimary && pods.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *CustomAnnotationTest) thenDeployedKubegresSpecShouldBeSetTo(specNbreReplicas int32) { diff --git a/test/custom_namespace_test.go b/internal/test/custom_namespace_test.go similarity index 85% rename from test/custom_namespace_test.go rename to internal/test/custom_namespace_test.go index d32b8b8..dea66a9 100644 --- a/test/custom_namespace_test.go +++ b/internal/test/custom_namespace_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -40,12 +40,12 @@ var _ = Describe("Creating Kubegres with a custom namespace", func() { var test = CustomNamespaceTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") namespace := customNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCasesWithNodePorts(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort+4, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort+4) + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCasesWithNodePorts(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort+4, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort+4) }) AfterEach(func() { @@ -142,12 +142,12 @@ type CustomNamespaceTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *CustomNamespaceTest) givenNewKubegresSpecIsSetTo(namespace string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Namespace = namespace r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -174,7 +174,7 @@ func (r *CustomNamespaceTest) whenKubernetesIsUpdated() { } func (r *CustomNamespaceTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.replicas' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -186,7 +186,7 @@ func (r *CustomNamespaceTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *CustomNamespaceTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -202,14 +202,14 @@ func (r *CustomNamespaceTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas i pods.NbreDeployedPrimary == nbrePrimary && pods.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *CustomNamespaceTest) thenDeployedKubegresSpecShouldBeSetTo(specNbreReplicas int32) { diff --git a/test/data_is_replicated_test.go b/internal/test/data_is_replicated_test.go similarity index 80% rename from test/data_is_replicated_test.go rename to internal/test/data_is_replicated_test.go index bea6fea..4bbb121 100644 --- a/test/data_is_replicated_test.go +++ b/internal/test/data_is_replicated_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,13 +21,13 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" "strconv" "time" ) @@ -37,13 +37,13 @@ var _ = Describe("Checking changes in Primary DB is replicated in Replica DBs", var test = DataIsReplicatedTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.connectionPrimaryDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, true) - test.connectionReplicaDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort, false) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.connectionPrimaryDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, true) + test.connectionReplicaDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort, false) }) AfterEach(func() { @@ -137,16 +137,16 @@ var _ = Describe("Checking changes in Primary DB is replicated in Replica DBs", type DataIsReplicatedTest struct { kubegresResource *postgresv1.Kubegres - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever customEnvVariableName string customEnvVariableKey string } func (r *DataIsReplicatedTest) givenNewKubegresSpecIsSetTo(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -184,26 +184,26 @@ func (r *DataIsReplicatedTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *DataIsReplicatedTest) GivenUserAddedInPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.InsertUser() - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *DataIsReplicatedTest) GivenUserDeletedFromPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.DeleteUser(r.connectionPrimaryDb.LastInsertedUserId) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *DataIsReplicatedTest) ThenPrimaryDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -220,7 +220,7 @@ func (r *DataIsReplicatedTest) ThenPrimaryDbContainsExpectedNbreUsers(expectedNb return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *DataIsReplicatedTest) ThenReplicaDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -237,5 +237,5 @@ func (r *DataIsReplicatedTest) ThenReplicaDbContainsExpectedNbreUsers(expectedNb return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/many_diff_kubegres_instances_test.go b/internal/test/many_diff_kubegres_instances_test.go similarity index 82% rename from test/many_diff_kubegres_instances_test.go rename to internal/test/many_diff_kubegres_instances_test.go index c1ae541..9afeaab 100644 --- a/test/many_diff_kubegres_instances_test.go +++ b/internal/test/many_diff_kubegres_instances_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -45,11 +45,11 @@ var _ = Describe("Testing when there are 2 different Kubegres instances running BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.kubegresOneDbQueryTestCases = testcases.InitDbQueryTestCasesWithNodePorts(test.resourceCreator, kubegresOne, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort) - test.kubegresTwoDbQueryTestCases = testcases.InitDbQueryTestCasesWithNodePorts(test.resourceCreator, kubegresTwo, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort+2, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort+2) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.kubegresOneDbQueryTestCases = testcases.InitDbQueryTestCasesWithNodePorts(test.resourceCreator, kubegresOne, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort) + test.kubegresTwoDbQueryTestCases = testcases.InitDbQueryTestCasesWithNodePorts(test.resourceCreator, kubegresTwo, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort+2, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort+2) }) AfterEach(func() { @@ -90,12 +90,12 @@ var _ = Describe("Testing when there are 2 different Kubegres instances running type ManyDifferentKubegresInstancesTest struct { kubegresOneDbQueryTestCases testcases.DbQueryTestCases kubegresTwoDbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *ManyDifferentKubegresInstancesTest) givenNewKubegresSpecIsSetTo(kubegresName string, specNbreReplicas int32) *postgresv1.Kubegres { - kubegresResource := resourceConfigs.LoadKubegresYaml() + kubegresResource := resourceConfigs2.LoadKubegresYaml() kubegresResource.Name = kubegresName kubegresResource.Spec.Replicas = &specNbreReplicas return kubegresResource @@ -123,7 +123,7 @@ func (r *ManyDifferentKubegresInstancesTest) whenKubernetesIsUpdated(kubegresRes } func (r *ManyDifferentKubegresInstancesTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.replicas' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -135,7 +135,7 @@ func (r *ManyDifferentKubegresInstancesTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *ManyDifferentKubegresInstancesTest) thenPodsStatesShouldBe(kubegresName string, nbrePrimary, nbreReplicas int) bool { @@ -151,14 +151,14 @@ func (r *ManyDifferentKubegresInstancesTest) thenPodsStatesShouldBe(kubegresName pods.NbreDeployedPrimary == nbrePrimary && pods.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *ManyDifferentKubegresInstancesTest) thenDeployedKubegresSpecShouldBeSetTo(kubegresName string, specNbreReplicas int32) { diff --git a/test/postgres_conf_wal_level_logical_test.go b/internal/test/postgres_conf_wal_level_logical_test.go similarity index 80% rename from test/postgres_conf_wal_level_logical_test.go rename to internal/test/postgres_conf_wal_level_logical_test.go index bc873dc..f0d10ab 100644 --- a/test/postgres_conf_wal_level_logical_test.go +++ b/internal/test/postgres_conf_wal_level_logical_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,13 +21,13 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" "strconv" "time" ) @@ -37,13 +37,13 @@ var _ = Describe("We set the wal-level to 'logical' and simulate when Primary in var test = PostgresConfWalLevelLogicalTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.connectionPrimaryDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, true) - test.connectionReplicaDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort, false) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.connectionPrimaryDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, true) + test.connectionReplicaDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort, false) test.resourceCreator.CreateConfigMapWithPostgresConfAndWalLevelSetToLogical() }) @@ -57,7 +57,7 @@ var _ = Describe("We set the wal-level to 'logical' and simulate when Primary in log.Print("START OF: Test 'GIVEN Kubegres custom ConfigMap with wal-level set to 'logical' AND with 1 primary and 2 replicas AND primary is deleted'") - test.givenNewKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithPostgresConfAndWalLevelSetToLogicalResourceName, 3) + test.givenNewKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithPostgresConfAndWalLevelSetToLogicalResourceName, 3) test.whenKubegresIsCreated() @@ -92,16 +92,16 @@ var _ = Describe("We set the wal-level to 'logical' and simulate when Primary in type PostgresConfWalLevelLogicalTest struct { kubegresResource *postgresv1.Kubegres - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever customEnvVariableName string customEnvVariableKey string } func (r *PostgresConfWalLevelLogicalTest) givenNewKubegresSpecIsSetTo(customConfig string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.CustomConfig = customConfig r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -181,7 +181,7 @@ func (r *PostgresConfWalLevelLogicalTest) wait10Seconds() bool { return Eventually(func() bool { waitingAttempts++ return waitingAttempts == 13 - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PostgresConfWalLevelLogicalTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -197,20 +197,20 @@ func (r *PostgresConfWalLevelLogicalTest) thenPodsStatesShouldBe(nbrePrimary, nb kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PostgresConfWalLevelLogicalTest) GivenUserAddedInPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.InsertUser() - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PostgresConfWalLevelLogicalTest) ThenPrimaryDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -227,7 +227,7 @@ func (r *PostgresConfWalLevelLogicalTest) ThenPrimaryDbContainsExpectedNbreUsers return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PostgresConfWalLevelLogicalTest) ThenReplicaDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -244,5 +244,5 @@ func (r *PostgresConfWalLevelLogicalTest) ThenReplicaDbContainsExpectedNbreUsers return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/primary_failure_and_recovery_test.go b/internal/test/primary_failure_and_recovery_test.go similarity index 84% rename from test/primary_failure_and_recovery_test.go rename to internal/test/primary_failure_and_recovery_test.go index ee8c55e..42706b7 100644 --- a/test/primary_failure_and_recovery_test.go +++ b/internal/test/primary_failure_and_recovery_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,13 +21,13 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" "strconv" "time" ) @@ -37,13 +37,13 @@ var _ = Describe("Primary instances is not available, checking recovery works", var test = PrimaryFailureAndRecoveryTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.connectionPrimaryDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, true) - test.connectionReplicaDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort, false) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.connectionPrimaryDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, true) + test.connectionReplicaDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort, false) }) AfterEach(func() { @@ -157,16 +157,16 @@ var _ = Describe("Primary instances is not available, checking recovery works", type PrimaryFailureAndRecoveryTest struct { kubegresResource *postgresv1.Kubegres - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever customEnvVariableName string customEnvVariableKey string } func (r *PrimaryFailureAndRecoveryTest) givenNewKubegresSpecIsSetTo(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -245,7 +245,7 @@ func (r *PrimaryFailureAndRecoveryTest) wait10Seconds() bool { return Eventually(func() bool { waitingAttempts++ return waitingAttempts == 13 - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PrimaryFailureAndRecoveryTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -261,20 +261,20 @@ func (r *PrimaryFailureAndRecoveryTest) thenPodsStatesShouldBe(nbrePrimary, nbre kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PrimaryFailureAndRecoveryTest) GivenUserAddedInPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.InsertUser() - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PrimaryFailureAndRecoveryTest) ThenPrimaryDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -291,7 +291,7 @@ func (r *PrimaryFailureAndRecoveryTest) ThenPrimaryDbContainsExpectedNbreUsers(e return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *PrimaryFailureAndRecoveryTest) ThenReplicaDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -308,5 +308,5 @@ func (r *PrimaryFailureAndRecoveryTest) ThenReplicaDbContainsExpectedNbreUsers(e return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/replica_failure_and_recovery_test.go b/internal/test/replica_failure_and_recovery_test.go similarity index 76% rename from test/replica_failure_and_recovery_test.go rename to internal/test/replica_failure_and_recovery_test.go index 0dc1edb..bab089e 100644 --- a/test/replica_failure_and_recovery_test.go +++ b/internal/test/replica_failure_and_recovery_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,13 +21,13 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" "strconv" "time" ) @@ -37,13 +37,13 @@ var _ = Describe("Replica instances are not available, checking recovery works", var test = ReplicaFailureAndRecoveryTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.connectionPrimaryDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, true) - test.connectionReplicaDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort, false) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.connectionPrimaryDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, true) + test.connectionReplicaDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort, false) }) AfterEach(func() { @@ -87,16 +87,16 @@ var _ = Describe("Replica instances are not available, checking recovery works", type ReplicaFailureAndRecoveryTest struct { kubegresResource *postgresv1.Kubegres - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever customEnvVariableName string customEnvVariableKey string } func (r *ReplicaFailureAndRecoveryTest) givenNewKubegresSpecIsSetTo(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -140,20 +140,20 @@ func (r *ReplicaFailureAndRecoveryTest) thenPodsStatesShouldBe(nbrePrimary, nbre kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *ReplicaFailureAndRecoveryTest) GivenUserAddedInPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.InsertUser() - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *ReplicaFailureAndRecoveryTest) ThenPrimaryDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -170,7 +170,7 @@ func (r *ReplicaFailureAndRecoveryTest) ThenPrimaryDbContainsExpectedNbreUsers(e return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *ReplicaFailureAndRecoveryTest) ThenReplicaDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -187,5 +187,5 @@ func (r *ReplicaFailureAndRecoveryTest) ThenReplicaDbContainsExpectedNbreUsers(e return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/resourceConfigs/ConfigForTest.go b/internal/test/resourceConfigs/ConfigForTest.go similarity index 98% rename from test/resourceConfigs/ConfigForTest.go rename to internal/test/resourceConfigs/ConfigForTest.go index cb72429..768eb8a 100644 --- a/test/resourceConfigs/ConfigForTest.go +++ b/internal/test/resourceConfigs/ConfigForTest.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/test/resourceConfigs/LoadTestYaml.go b/internal/test/resourceConfigs/LoadTestYaml.go similarity index 98% rename from test/resourceConfigs/LoadTestYaml.go rename to internal/test/resourceConfigs/LoadTestYaml.go index a68cb14..1a2ba1b 100644 --- a/test/resourceConfigs/LoadTestYaml.go +++ b/internal/test/resourceConfigs/LoadTestYaml.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io diff --git a/test/resourceConfigs/backupPvc.yaml b/internal/test/resourceConfigs/backupPvc.yaml similarity index 100% rename from test/resourceConfigs/backupPvc.yaml rename to internal/test/resourceConfigs/backupPvc.yaml diff --git a/test/resourceConfigs/customConfig/configMap_empty.yaml b/internal/test/resourceConfigs/customConfig/configMap_empty.yaml similarity index 100% rename from test/resourceConfigs/customConfig/configMap_empty.yaml rename to internal/test/resourceConfigs/customConfig/configMap_empty.yaml diff --git a/test/resourceConfigs/customConfig/configMap_with_all_configs.yaml b/internal/test/resourceConfigs/customConfig/configMap_with_all_configs.yaml similarity index 83% rename from test/resourceConfigs/customConfig/configMap_with_all_configs.yaml rename to internal/test/resourceConfigs/customConfig/configMap_with_all_configs.yaml index ed1b364..359b20a 100644 --- a/test/resourceConfigs/customConfig/configMap_with_all_configs.yaml +++ b/internal/test/resourceConfigs/customConfig/configMap_with_all_configs.yaml @@ -35,14 +35,14 @@ data: echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ..."; psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE DATABASE $customDatabaseName; - CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; - \connect $customDatabaseName; - CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); - INSERT INTO account VALUES (1, 'username1'); - INSERT INTO account VALUES (2, 'username2'); - GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName; - GRANT ALL ON "account" to $customUserName; + CREATE DATABASE $customDatabaseName; + CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD'; + \connect $customDatabaseName; + CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); + INSERT INTO account VALUES (1, 'username1'); + INSERT INTO account VALUES (2, 'username2'); + GRANT ALL PRIVILEGES ON DATABASE "$customDatabaseName" to $customUserName; + GRANT ALL ON "account" to $customUserName; EOSQL echo "$dt - Init script is completed"; diff --git a/test/resourceConfigs/customConfig/configMap_with_backup_database_script.yaml b/internal/test/resourceConfigs/customConfig/configMap_with_backup_database_script.yaml similarity index 100% rename from test/resourceConfigs/customConfig/configMap_with_backup_database_script.yaml rename to internal/test/resourceConfigs/customConfig/configMap_with_backup_database_script.yaml diff --git a/test/resourceConfigs/customConfig/configMap_with_pg_hba_conf.yaml b/internal/test/resourceConfigs/customConfig/configMap_with_pg_hba_conf.yaml similarity index 100% rename from test/resourceConfigs/customConfig/configMap_with_pg_hba_conf.yaml rename to internal/test/resourceConfigs/customConfig/configMap_with_pg_hba_conf.yaml diff --git a/test/resourceConfigs/customConfig/configMap_with_postgres_conf.yaml b/internal/test/resourceConfigs/customConfig/configMap_with_postgres_conf.yaml similarity index 100% rename from test/resourceConfigs/customConfig/configMap_with_postgres_conf.yaml rename to internal/test/resourceConfigs/customConfig/configMap_with_postgres_conf.yaml diff --git a/test/resourceConfigs/customConfig/configMap_with_postgres_conf_and_wal_level_to_logical.yaml b/internal/test/resourceConfigs/customConfig/configMap_with_postgres_conf_and_wal_level_to_logical.yaml similarity index 100% rename from test/resourceConfigs/customConfig/configMap_with_postgres_conf_and_wal_level_to_logical.yaml rename to internal/test/resourceConfigs/customConfig/configMap_with_postgres_conf_and_wal_level_to_logical.yaml diff --git a/test/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml b/internal/test/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml similarity index 75% rename from test/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml rename to internal/test/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml index a8ab00b..1623a5e 100644 --- a/test/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml +++ b/internal/test/resourceConfigs/customConfig/configMap_with_primary_init_script.yaml @@ -18,9 +18,9 @@ data: echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ..."; psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL - CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); - INSERT INTO account VALUES (1, 'username1'); - INSERT INTO account VALUES (2, 'username2'); + CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL); + INSERT INTO account VALUES (1, 'username1'); + INSERT INTO account VALUES (2, 'username2'); EOSQL echo "$dt - Init script is completed"; diff --git a/test/resourceConfigs/kubegres.yaml b/internal/test/resourceConfigs/kubegres.yaml similarity index 97% rename from test/resourceConfigs/kubegres.yaml rename to internal/test/resourceConfigs/kubegres.yaml index 5a9a455..013f452 100644 --- a/test/resourceConfigs/kubegres.yaml +++ b/internal/test/resourceConfigs/kubegres.yaml @@ -8,7 +8,7 @@ metadata: spec: replicas: 3 - image: postgres:14.5 + image: postgres:16.0 port: 5432 database: diff --git a/test/resourceConfigs/primaryService.yaml b/internal/test/resourceConfigs/primaryService.yaml similarity index 100% rename from test/resourceConfigs/primaryService.yaml rename to internal/test/resourceConfigs/primaryService.yaml diff --git a/test/resourceConfigs/replicaService.yaml b/internal/test/resourceConfigs/replicaService.yaml similarity index 100% rename from test/resourceConfigs/replicaService.yaml rename to internal/test/resourceConfigs/replicaService.yaml diff --git a/test/resourceConfigs/secret.yaml b/internal/test/resourceConfigs/secret.yaml similarity index 100% rename from test/resourceConfigs/secret.yaml rename to internal/test/resourceConfigs/secret.yaml diff --git a/test/spec_affinity_test.go b/internal/test/spec_affinity_test.go similarity index 88% rename from test/spec_affinity_test.go rename to internal/test/spec_affinity_test.go index 212005d..047ba00 100644 --- a/test/spec_affinity_test.go +++ b/internal/test/spec_affinity_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,16 +21,16 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" ) @@ -40,12 +40,12 @@ var _ = Describe("Setting Kubegres spec 'scheduler.affinity'", func() { var test = SpecAffinityTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -129,13 +129,13 @@ type SpecAffinityTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecAffinityTest) givenDefaultAffinity() *v12.Affinity { - resourceName := resourceConfigs.KubegresResourceName + resourceName := resourceConfigs2.KubegresResourceName weightedPodAffinityTerm := v12.WeightedPodAffinityTerm{ Weight: 100, @@ -162,7 +162,7 @@ func (r *SpecAffinityTest) givenDefaultAffinity() *v12.Affinity { func (r *SpecAffinityTest) givenAffinity1() *v12.Affinity { - resourceName := resourceConfigs.KubegresResourceName + resourceName := resourceConfigs2.KubegresResourceName weightedPodAffinityTerm := v12.WeightedPodAffinityTerm{ Weight: 90, @@ -189,7 +189,7 @@ func (r *SpecAffinityTest) givenAffinity1() *v12.Affinity { func (r *SpecAffinityTest) givenAffinity2() *v12.Affinity { - resourceName := resourceConfigs.KubegresResourceName + resourceName := resourceConfigs2.KubegresResourceName weightedPodAffinityTerm := v12.WeightedPodAffinityTerm{ Weight: 80, @@ -215,13 +215,13 @@ func (r *SpecAffinityTest) givenAffinity2() *v12.Affinity { } func (r *SpecAffinityTest) givenNewKubegresSpecIsWithoutAffinity(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Scheduler.Affinity = nil r.kubegresResource.Spec.Replicas = &specNbreReplicas } func (r *SpecAffinityTest) givenNewKubegresSpecIsSetTo(affinity *v12.Affinity, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Scheduler.Affinity = affinity r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -249,7 +249,7 @@ func (r *SpecAffinityTest) whenKubernetesIsUpdated() { func (r *SpecAffinityTest) thenEventShouldBeLoggedSayingAffinityIsSetToDefaultValue() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeNormal, Reason: "DefaultSpecValue", Message: "A default value was set for a field in Kubegres YAML spec. 'spec.Affinity': New value: " + r.givenDefaultAffinity().String(), @@ -261,7 +261,7 @@ func (r *SpecAffinityTest) thenEventShouldBeLoggedSayingAffinityIsSetToDefaultVa } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecAffinityTest) thenStatefulSetStatesShouldBeWithDefaultAffinity(nbrePrimary, nbreReplicas int) bool { @@ -288,14 +288,14 @@ func (r *SpecAffinityTest) thenStatefulSetStatesShouldBeWithDefaultAffinity(nbre kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecAffinityTest) thenStatefulSetStatesShouldBe(expectedAffinity *v12.Affinity, nbrePrimary, nbreReplicas int) bool { @@ -321,14 +321,14 @@ func (r *SpecAffinityTest) thenStatefulSetStatesShouldBe(expectedAffinity *v12.A kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecAffinityTest) thenDeployedKubegresSpecShouldWithDefaultAffinity() { diff --git a/test/spec_backup_test.go b/internal/test/spec_backup_test.go similarity index 86% rename from test/spec_backup_test.go rename to internal/test/spec_backup_test.go index f26755d..17764a4 100644 --- a/test/spec_backup_test.go +++ b/internal/test/spec_backup_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,16 +21,16 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -48,10 +48,10 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) test.resourceCreator.CreateConfigMapWithBackupDatabaseScript() test.resourceCreator.CreateConfigMapWithPgHbaConf() test.resourceCreator.CreateBackUpPvc() @@ -60,7 +60,7 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { AfterEach(func() { if !test.keepCreatedResourcesForNextTest { - test.resourceCreator.DeleteAllTestResources(resourceConfigs.BackUpPvcResourceName, resourceConfigs.BackUpPvcResourceName2) + test.resourceCreator.DeleteAllTestResources(resourceConfigs2.BackUpPvcResourceName, resourceConfigs2.BackUpPvcResourceName2) } else { test.keepCreatedResourcesForNextTest = false } @@ -90,7 +90,7 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created without spec 'backup.schedule' BUT with spec 'backup.volumeMount' AND with spec 'backup.pvcName'") - test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, "", resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres", 3) + test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, "", resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres", 3) test.whenKubegresIsCreated() @@ -108,7 +108,7 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'backup.schedule' BUT WITHOUT spec 'backup.volumeMount''") - test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "", 3) + test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "", 3) test.whenKubegresIsCreated() @@ -156,7 +156,7 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'backup.schedule' AND 'backup.volumeMount' AND 'backup.pvcName' and the given PVC is deployed") - test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres", 3) + test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres", 3) test.givenKubegresEnvVarIsSetTo(customEnvVarName, customEnvVarValue) test.givenKubegresAnnotationIsSetTo(customAnnotationKey, customAnnotationValue) @@ -164,7 +164,7 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { test.thenPodsStatesShouldBe(1, 2) - test.thenCronJobExistsWithSpec(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres") + test.thenCronJobExistsWithSpec(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres") test.thenCronJobSpecShouldHaveEnvVar(customEnvVarName, customEnvVarValue) test.thenCronJobSpecShouldHaveAnnotation(customAnnotationKey, customAnnotationValue) @@ -178,17 +178,17 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with backup specs set AND later Kubegres is updated with new values for backup specs'") - test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres", 3) + test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres", 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.givenExistingKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEvery2Mins, resourceConfigs.BackUpPvcResourceName2, "/tmp/my-kubegres-2") + test.givenExistingKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEvery2Mins, resourceConfigs2.BackUpPvcResourceName2, "/tmp/my-kubegres-2") test.whenKubernetesIsUpdated() - test.thenCronJobExistsWithSpec(ctx.BaseConfigMapName, scheduleBackupEvery2Mins, resourceConfigs.BackUpPvcResourceName2, "/tmp/my-kubegres-2") + test.thenCronJobExistsWithSpec(ctx.BaseConfigMapName, scheduleBackupEvery2Mins, resourceConfigs2.BackUpPvcResourceName2, "/tmp/my-kubegres-2") log.Print("END OF: Test 'GIVEN new Kubegres is created with backup specs set AND later Kubegres is updated with new values for backup specs'") }) @@ -202,17 +202,17 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with backup specs AND later the Kubernetes field " + "'spec.customConfig' is changed to a configMap which does NOT contain 'backup_database.sh'") - test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres", 3) + test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres", 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.givenExistingKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithPgHbaConfResourceName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres") + test.givenExistingKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithPgHbaConfResourceName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres") test.whenKubernetesIsUpdated() - test.thenCronJobExistsWithSpec(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres") + test.thenCronJobExistsWithSpec(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres") test.keepCreatedResourcesForNextTest = true @@ -226,11 +226,11 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with backup specs AND later the Kubernetes field " + "'spec.customConfig' is changed to a configMap which contain 'backup_database.sh'") - test.givenExistingKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres") + test.givenExistingKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres") test.whenKubernetesIsUpdated() - test.thenCronJobExistsWithSpec(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres") + test.thenCronJobExistsWithSpec(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres") log.Print("END OF: Test 'GIVEN new Kubegres is created with backup specs AND later the Kubernetes field " + "'spec.customConfig' is changed to a configMap which contain 'backup_database.sh'") @@ -243,7 +243,7 @@ var _ = Describe("Setting Kubegres specs 'backup.*'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with backup specs set AND later Kubegres is updated with backup disabled'") - test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs.BackUpPvcResourceName, "/tmp/my-kubegres", 3) + test.givenNewKubegresSpecIsSetTo(ctx.BaseConfigMapName, scheduleBackupEveryMin, resourceConfigs2.BackUpPvcResourceName, "/tmp/my-kubegres", 3) test.whenKubegresIsCreated() @@ -267,13 +267,13 @@ type SpecBackUpTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever - resourceModifier util.TestResourceModifier + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever + resourceModifier util2.TestResourceModifier } func (r *SpecBackUpTest) givenNewKubegresSpecIsSetTo(customConfig, backupSchedule, backupPvcName, backupVolumeMount string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.CustomConfig = customConfig r.kubegresResource.Spec.Replicas = &specNbreReplicas @@ -309,7 +309,7 @@ func (r *SpecBackUpTest) givenExistingKubegresSpecIsSetTo(customConfig, backupSc func (r *SpecBackUpTest) whenKubegresIsCreated() { if r.kubegresResource == nil { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() } r.resourceCreator.CreateKubegres(r.kubegresResource) } @@ -319,7 +319,7 @@ func (r *SpecBackUpTest) whenKubernetesIsUpdated() { } func (r *SpecBackUpTest) thenErrorEventShouldBeLogged(specName string) { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of '" + specName + "' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -331,11 +331,11 @@ func (r *SpecBackUpTest) thenErrorEventShouldBeLogged(specName string) { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecBackUpTest) thenErrorEventSayingPvcIsNotDeployed() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.Backup.PvcName' has a PersistentVolumeClaim name which is not deployed. Please deploy this PersistentVolumeClaim, otherwise this operator cannot work correctly.", @@ -347,7 +347,7 @@ func (r *SpecBackUpTest) thenErrorEventSayingPvcIsNotDeployed() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecBackUpTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -363,14 +363,14 @@ func (r *SpecBackUpTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) b kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecBackUpTest) thenBackupCronJobDoesNOTExist() bool { diff --git a/test/spec_customConfig_test.go b/internal/test/spec_customConfig_test.go similarity index 87% rename from test/spec_customConfig_test.go rename to internal/test/spec_customConfig_test.go index 6e2dba0..4fccf88 100644 --- a/test/spec_customConfig_test.go +++ b/internal/test/spec_customConfig_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,18 +21,18 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v1 "k8s.io/api/apps/v1" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/controllers/states" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/controller/states" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -41,12 +41,12 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { var test = SpecCustomConfigTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) test.resourceCreator.CreateBackUpPvc() test.resourceCreator.CreateConfigMapEmpty() test.resourceCreator.CreateConfigMapWithAllConfigs() @@ -57,7 +57,7 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { }) AfterEach(func() { - test.resourceCreator.DeleteAllTestResources(resourceConfigs.BackUpPvcResourceName) + test.resourceCreator.DeleteAllTestResources(resourceConfigs2.BackUpPvcResourceName) }) Context("GIVEN new Kubegres is created without spec 'customConfig' and spec 'replica' set to 3", func() { @@ -108,13 +108,13 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'customConfig' set to a ConfigMap which is empty'") - test.givenNewKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapEmptyResourceName, 3) + test.givenNewKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapEmptyResourceName, 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapEmptyResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapEmptyResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.BaseConfigMapVolumeName, states.ConfigMapDataKeyPostgresConf, false) @@ -132,13 +132,13 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'customConfig' set to a ConfigMap containing 'postgres.conf''") - test.givenNewKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithPostgresConfResourceName, 3) + test.givenNewKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithPostgresConfResourceName, 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapWithPostgresConfResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapWithPostgresConfResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.CustomConfigMapVolumeName, states.ConfigMapDataKeyPostgresConf, false) @@ -156,13 +156,13 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'customConfig' set to a ConfigMap containing 'primary_init_script.sh''") - test.givenNewKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithPrimaryInitScriptResourceName, 3) + test.givenNewKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithPrimaryInitScriptResourceName, 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapWithPrimaryInitScriptResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapWithPrimaryInitScriptResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.CustomConfigMapVolumeName, states.ConfigMapDataKeyPrimaryInitScript, true) @@ -180,13 +180,13 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'customConfig' set to a ConfigMap containing 'pg_hba.conf''") - test.givenNewKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithPgHbaConfResourceName, 3) + test.givenNewKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithPgHbaConfResourceName, 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapWithPgHbaConfResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapWithPgHbaConfResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.CustomConfigMapVolumeName, states.ConfigMapDataKeyPgHbaConf, false) @@ -213,11 +213,11 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { test.dbQueryTestCases.ThenWeCanSqlQueryPrimaryDb() test.dbQueryTestCases.ThenWeCanSqlQueryReplicaDb() - test.givenExistingKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithPostgresConfResourceName) + test.givenExistingKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithPostgresConfResourceName) test.whenKubernetesIsUpdated() - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapWithPostgresConfResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapWithPostgresConfResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.CustomConfigMapVolumeName, states.ConfigMapDataKeyPostgresConf, false) @@ -238,15 +238,15 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { log.Print("START OF: Test 'GIVEN new Kubegres is created with backUp enabled and spec 'customConfig' set to a ConfigMap containing 'backup_database.sh''") - test.givenNewKubegresSpecHasBackupEnabledWithCustomConfig(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName, 3) + test.givenNewKubegresSpecHasBackupEnabledWithCustomConfig(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName, 3) test.whenKubegresIsCreated() test.thenPodsStatesShouldBe(1, 2) - test.thenCronJobContainsConfigMap(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName) + test.thenCronJobContainsConfigMap(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName) - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.BaseConfigMapVolumeName, states.ConfigMapDataKeyPgHbaConf, false) @@ -275,13 +275,13 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { test.dbQueryTestCases.ThenWeCanSqlQueryPrimaryDb() test.dbQueryTestCases.ThenWeCanSqlQueryReplicaDb() - test.givenExistingKubegresSpecIsSetTo(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName) + test.givenExistingKubegresSpecIsSetTo(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName) test.whenKubernetesIsUpdated() - test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName) + test.thenPodsContainsCustomConfigWithResourceName(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName) - test.thenCronJobContainsConfigMap(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName) + test.thenCronJobContainsConfigMap(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName) test.thenPodsContainsConfigTypeAssociatedToFile(ctx.BaseConfigMapVolumeName, states.ConfigMapDataKeyPgHbaConf, false) @@ -301,12 +301,12 @@ var _ = Describe("Setting Kubegres specs 'customConfig'", func() { type SpecCustomConfigTest struct { kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecCustomConfigTest) givenNewKubegresSpecIsSetTo(customConfig string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.CustomConfig = customConfig r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -325,17 +325,17 @@ func (r *SpecCustomConfigTest) givenExistingKubegresSpecIsSetTo(customConfig str } func (r *SpecCustomConfigTest) givenNewKubegresSpecHasBackupEnabledWithCustomConfig(customConfig string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.CustomConfig = customConfig r.kubegresResource.Spec.Replicas = &specNbreReplicas r.kubegresResource.Spec.Backup.Schedule = "*/1 * * * *" - r.kubegresResource.Spec.Backup.PvcName = resourceConfigs.BackUpPvcResourceName + r.kubegresResource.Spec.Backup.PvcName = resourceConfigs2.BackUpPvcResourceName r.kubegresResource.Spec.Backup.VolumeMount = "/tmp/my-kubegres" } func (r *SpecCustomConfigTest) whenKubegresIsCreated() { if r.kubegresResource == nil { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() } r.resourceCreator.CreateKubegres(r.kubegresResource) } @@ -345,7 +345,7 @@ func (r *SpecCustomConfigTest) whenKubernetesIsUpdated() { } func (r *SpecCustomConfigTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.customConfig' has a configMap name which is not deployed. Please deploy this configMap otherwise this operator cannot work correctly.", @@ -357,7 +357,7 @@ func (r *SpecCustomConfigTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecCustomConfigTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -373,14 +373,14 @@ func (r *SpecCustomConfigTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecCustomConfigTest) thenPodsShouldNotContainsCustomConfig() bool { @@ -425,7 +425,7 @@ func (r *SpecCustomConfigTest) thenPodsContainsCustomConfigWithResourceName(expe return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/spec_databaseSize_test.go b/internal/test/spec_databaseSize_test.go similarity index 87% rename from test/spec_databaseSize_test.go rename to internal/test/spec_databaseSize_test.go index 62d705d..ae1ffe9 100644 --- a/test/spec_databaseSize_test.go +++ b/internal/test/spec_databaseSize_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -40,10 +40,10 @@ var _ = Describe("Setting Kubegres specs 'database.size'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -119,12 +119,12 @@ type SpecDatabaseSizeTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecDatabaseSizeTest) givenNewKubegresSpecIsSetTo(databaseSize string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Database.Size = databaseSize r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -151,7 +151,7 @@ func (r *SpecDatabaseSizeTest) whenKubernetesIsUpdated() { } func (r *SpecDatabaseSizeTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.database.size' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -163,7 +163,7 @@ func (r *SpecDatabaseSizeTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseSizeTest) thenPodsStatesShouldBe(databaseSize string, nbrePrimary, nbreReplicas int) bool { @@ -188,14 +188,14 @@ func (r *SpecDatabaseSizeTest) thenPodsStatesShouldBe(databaseSize string, nbreP kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseSizeTest) thenDeployedKubegresSpecShouldBeSetTo(databaseSize string) { @@ -212,7 +212,7 @@ func (r *SpecDatabaseSizeTest) thenDeployedKubegresSpecShouldBeSetTo(databaseSiz } func (r *SpecDatabaseSizeTest) thenErrorEventShouldBeLoggedSayingCannotChangeStorageSize(currentValue, newValue string) { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.database.size' cannot be changed from '" + currentValue + "' to '" + newValue + "' after Pods were created. " + diff --git a/test/spec_databaseStorageClassName_test.go b/internal/test/spec_databaseStorageClassName_test.go similarity index 87% rename from test/spec_databaseStorageClassName_test.go rename to internal/test/spec_databaseStorageClassName_test.go index 377c03e..395c65e 100644 --- a/test/spec_databaseStorageClassName_test.go +++ b/internal/test/spec_databaseStorageClassName_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -38,12 +38,12 @@ var _ = Describe("Setting Kubegres specs 'database.storageClassName'", func() { var test = SpecDatabaseStorageClassTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -130,12 +130,12 @@ type SpecDatabaseStorageClassTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecDatabaseStorageClassTest) givenNewKubegresSpecIsSetTo(databaseStorageClassName *string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Database.StorageClassName = databaseStorageClassName r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -162,7 +162,7 @@ func (r *SpecDatabaseStorageClassTest) whenKubernetesIsUpdated() { } func (r *SpecDatabaseStorageClassTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.database.storageClassName' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -174,7 +174,7 @@ func (r *SpecDatabaseStorageClassTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseStorageClassTest) thenPodsStatesShouldBe(databaseStorageClassName string, nbrePrimary, nbreReplicas int) bool { @@ -199,14 +199,14 @@ func (r *SpecDatabaseStorageClassTest) thenPodsStatesShouldBe(databaseStorageCla kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseStorageClassTest) thenDeployedKubegresSpecShouldBeSetTo(databaseStorageClassName string) { @@ -224,7 +224,7 @@ func (r *SpecDatabaseStorageClassTest) thenDeployedKubegresSpecShouldBeSetTo(dat func (r *SpecDatabaseStorageClassTest) thenEventShouldBeLoggedSayingStorageClassNameWasSetToDefaultValue() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeNormal, Reason: "DefaultSpecValue", Message: "A default value was set for a field in Kubegres YAML spec. 'spec.Database.StorageClassName': New value: standard", @@ -236,11 +236,11 @@ func (r *SpecDatabaseStorageClassTest) thenEventShouldBeLoggedSayingStorageClass } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseStorageClassTest) thenErrorEventShouldBeLoggedSayingCannotChangeStorageClassName(currentValue, newValue string) { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.database.storageClassName' cannot be changed from '" + currentValue + "' to '" + newValue + "' after Pods were created. " + diff --git a/test/spec_databaseVolumeMount_test.go b/internal/test/spec_databaseVolumeMount_test.go similarity index 88% rename from test/spec_databaseVolumeMount_test.go rename to internal/test/spec_databaseVolumeMount_test.go index 2c35909..42f252c 100644 --- a/test/spec_databaseVolumeMount_test.go +++ b/internal/test/spec_databaseVolumeMount_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,16 +21,16 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -41,10 +41,10 @@ var _ = Describe("Setting Kubegres specs 'database.volumeMount'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -127,12 +127,12 @@ type SpecDatabaseVolumeMountTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecDatabaseVolumeMountTest) givenNewKubegresSpecIsSetTo(databaseVolumeMount string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Database.VolumeMount = databaseVolumeMount r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -160,7 +160,7 @@ func (r *SpecDatabaseVolumeMountTest) whenKubernetesIsUpdated() { func (r *SpecDatabaseVolumeMountTest) thenEventShouldBeLoggedSayingDatabaseVolumeMountWasSetToDefaultValue() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeNormal, Reason: "DefaultSpecValue", Message: "A default value was set for a field in Kubegres YAML spec. 'spec.database.volumeMount': New value: " + ctx.DefaultDatabaseVolumeMount, @@ -172,7 +172,7 @@ func (r *SpecDatabaseVolumeMountTest) thenEventShouldBeLoggedSayingDatabaseVolum } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseVolumeMountTest) thenPodsStatesShouldBe(databaseVolumeMount string, nbrePrimary, nbreReplicas int) bool { @@ -197,14 +197,14 @@ func (r *SpecDatabaseVolumeMountTest) thenPodsStatesShouldBe(databaseVolumeMount kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecDatabaseVolumeMountTest) thenDeployedKubegresSpecShouldBeSetTo(databaseVolumeMount string) { @@ -221,7 +221,7 @@ func (r *SpecDatabaseVolumeMountTest) thenDeployedKubegresSpecShouldBeSetTo(data } func (r *SpecDatabaseVolumeMountTest) thenErrorEventShouldBeLoggedSayingCannotChangeDatabaseVolumeMount(currentValue, newValue string) { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.database.volumeMount' cannot be changed from '" + currentValue + "' to '" + newValue + "' after Pods were created. " + diff --git a/test/spec_envVariables_test.go b/internal/test/spec_envVariables_test.go similarity index 87% rename from test/spec_envVariables_test.go rename to internal/test/spec_envVariables_test.go index 51cd03f..736e967 100644 --- a/test/spec_envVariables_test.go +++ b/internal/test/spec_envVariables_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,16 +21,16 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" ) var _ = Describe("Setting Kubegres spec 'env.*'", func() { @@ -40,10 +40,10 @@ var _ = Describe("Setting Kubegres spec 'env.*'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -128,28 +128,28 @@ var _ = Describe("Setting Kubegres spec 'env.*'", func() { type SpecEnVariablesTest struct { kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever - resourceModifier util.TestResourceModifier + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever + resourceModifier util2.TestResourceModifier customEnvVariableName string customEnvVariableKey string } func (r *SpecEnVariablesTest) givenNewKubegresWithoutEnvVarOfPostgresSuperUserPassword() { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Env = []v12.EnvVar{} r.resourceModifier.AppendEnvVarFromSecretKey(ctx.EnvVarNameOfPostgresReplicationUserPsw, "replicationUserPassword", r.kubegresResource) } func (r *SpecEnVariablesTest) givenNewKubegresWithoutEnvVarOfPostgresReplicationUserPassword() { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Env = []v12.EnvVar{} r.resourceModifier.AppendEnvVarFromSecretKey(ctx.EnvVarNameOfPostgresSuperUserPsw, "superUserPassword", r.kubegresResource) } func (r *SpecEnVariablesTest) givenNewKubegresWithAllEnvVarsSet(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas r.kubegresResource.Spec.Env = []v12.EnvVar{} @@ -204,7 +204,7 @@ func (r *SpecEnVariablesTest) thenPodsShouldContainAllEnvVariables(nbrePrimary, kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecEnVariablesTest) thenDeployedKubegresSpecShouldHaveAllEnvVars() { @@ -231,7 +231,7 @@ func (r *SpecEnVariablesTest) doesEnvVarExist(envVarName string, envVars []v12.E } func (r *SpecEnVariablesTest) thenErrorEventShouldBeLogged(specName string) { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of '" + specName + "' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -243,5 +243,5 @@ func (r *SpecEnVariablesTest) thenErrorEventShouldBeLogged(specName string) { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/spec_failover_is_disabled_test.go b/internal/test/spec_failover_is_disabled_test.go similarity index 85% rename from test/spec_failover_is_disabled_test.go rename to internal/test/spec_failover_is_disabled_test.go index df5f93d..80f774a 100644 --- a/test/spec_failover_is_disabled_test.go +++ b/internal/test/spec_failover_is_disabled_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,13 +21,13 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" "strconv" "time" ) @@ -37,13 +37,13 @@ var _ = Describe("Primary instances is not available, when failover is disabled var test = SpecFailoverIsDisabledTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.connectionPrimaryDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, true) - test.connectionReplicaDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort, false) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.connectionPrimaryDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, true) + test.connectionReplicaDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort, false) }) AfterEach(func() { @@ -162,16 +162,16 @@ var _ = Describe("Primary instances is not available, when failover is disabled type SpecFailoverIsDisabledTest struct { kubegresResource *postgresv1.Kubegres - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever customEnvVariableName string customEnvVariableKey string } func (r *SpecFailoverIsDisabledTest) givenNewKubegresSpecIsSetTo(isFailoverDisabled bool, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas r.kubegresResource.Spec.Failover.IsDisabled = isFailoverDisabled } @@ -193,7 +193,7 @@ func (r *SpecFailoverIsDisabledTest) givenExistingKubegresSpecIsSetTo(isFailover func (r *SpecFailoverIsDisabledTest) givenUserAddedInPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.InsertUser() - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledTest) whenKubegresIsCreated() { @@ -272,14 +272,14 @@ func (r *SpecFailoverIsDisabledTest) thenPodsStatesShouldBe(nbrePrimary, nbreRep kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledTest) thenReplicaDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -296,5 +296,5 @@ func (r *SpecFailoverIsDisabledTest) thenReplicaDbContainsExpectedNbreUsers(expe return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } diff --git a/test/spec_image_test.go b/internal/test/spec_image_test.go similarity index 70% rename from test/spec_image_test.go rename to internal/test/spec_image_test.go index e80992a..afa199a 100644 --- a/test/spec_image_test.go +++ b/internal/test/spec_image_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -38,12 +38,12 @@ var _ = Describe("Setting Kubegres spec 'image'", func() { var test = SpecImageTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -70,44 +70,44 @@ var _ = Describe("Setting Kubegres spec 'image'", func() { }) }) - Context("GIVEN new Kubegres is created with spec 'image' set to 'postgres:14.4' and spec 'replica' set to 3 and later 'image' is updated to 'postgres:14.5'", func() { + Context("GIVEN new Kubegres is created with spec 'image' set to 'postgres:16.0-bullseye' and spec 'replica' set to 3 and later 'image' is updated to 'postgres:16.0'", func() { - It("GIVEN new Kubegres is created with spec 'image' set to 'postgres:14.4' and spec 'replica' set to 3 THEN 1 primary and 2 replica should be created with spec 'image' set to 'postgres:14.5'", func() { + It("GIVEN new Kubegres is created with spec 'image' set to 'postgres:16.0-bullseye' and spec 'replica' set to 3 THEN 1 primary and 2 replica should be created with spec 'image' set to 'postgres:16.0'", func() { - log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'image' set to 'postgres:14.4' and spec 'replica' set to 3") + log.Print("START OF: Test 'GIVEN new Kubegres is created with spec 'image' set to 'postgres:16.0-bullseye' and spec 'replica' set to 3") - test.givenNewKubegresSpecIsSetTo("postgres:14.4", 3) + test.givenNewKubegresSpecIsSetTo("postgres:16.0-bullseye", 3) test.whenKubegresIsCreated() - test.thenPodsStatesShouldBe("postgres:14.4", 1, 2) + test.thenPodsStatesShouldBe("postgres:16.0-bullseye", 1, 2) - test.thenDeployedKubegresSpecShouldBeSetTo("postgres:14.4") + test.thenDeployedKubegresSpecShouldBeSetTo("postgres:16.0-bullseye") test.dbQueryTestCases.ThenWeCanSqlQueryPrimaryDb() test.dbQueryTestCases.ThenWeCanSqlQueryReplicaDb() test.keepCreatedResourcesForNextTest = true - log.Print("END OF: Test 'GIVEN new Kubegres is created with spec 'image' set to 'postgres:14.4' and spec 'replica' set to 3'") + log.Print("END OF: Test 'GIVEN new Kubegres is created with spec 'image' set to 'postgres:16.0-bullseye' and spec 'replica' set to 3'") }) - It("GIVEN existing Kubegres is updated with spec 'image' set from 'postgres:14.4' to 'postgres:14.5' THEN 1 primary and 2 replica should be re-deployed with spec 'image' set to 'postgres:14.5'", func() { + It("GIVEN existing Kubegres is updated with spec 'image' set from 'postgres:16.0-bullseye' to 'postgres:16.0' THEN 1 primary and 2 replica should be re-deployed with spec 'image' set to 'postgres:16.0'", func() { - log.Print("START OF: Test 'GIVEN existing Kubegres is updated with spec 'image' set from 'postgres:14.4' to 'postgres:14.5'") + log.Print("START OF: Test 'GIVEN existing Kubegres is updated with spec 'image' set from 'postgres:16.0-bullseye' to 'postgres:16.0'") - test.givenExistingKubegresSpecIsSetTo("postgres:14.5") + test.givenExistingKubegresSpecIsSetTo("postgres:16.0") test.whenKubernetesIsUpdated() - test.thenPodsStatesShouldBe("postgres:14.5", 1, 2) + test.thenPodsStatesShouldBe("postgres:16.0", 1, 2) - test.thenDeployedKubegresSpecShouldBeSetTo("postgres:14.5") + test.thenDeployedKubegresSpecShouldBeSetTo("postgres:16.0") test.dbQueryTestCases.ThenWeCanSqlQueryPrimaryDb() test.dbQueryTestCases.ThenWeCanSqlQueryReplicaDb() - log.Print("END OF: Test 'GIVEN existing Kubegres is updated with spec 'image' set from 'postgres:14.4' to 'postgres:14.5'") + log.Print("END OF: Test 'GIVEN existing Kubegres is updated with spec 'image' set from 'postgres:16.0-bullseye' to 'postgres:16.0'") }) }) @@ -118,12 +118,12 @@ type SpecImageTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecImageTest) givenNewKubegresSpecIsSetTo(image string, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Image = image r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -150,7 +150,7 @@ func (r *SpecImageTest) whenKubernetesIsUpdated() { } func (r *SpecImageTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.image' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -162,7 +162,7 @@ func (r *SpecImageTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecImageTest) thenPodsStatesShouldBe(image string, nbrePrimary, nbreReplicas int) bool { @@ -187,14 +187,14 @@ func (r *SpecImageTest) thenPodsStatesShouldBe(image string, nbrePrimary, nbreRe kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecImageTest) thenDeployedKubegresSpecShouldBeSetTo(image string) { diff --git a/test/spec_livenessProbe_test.go b/internal/test/spec_livenessProbe_test.go similarity index 87% rename from test/spec_livenessProbe_test.go rename to internal/test/spec_livenessProbe_test.go index cea6070..a793a3c 100644 --- a/test/spec_livenessProbe_test.go +++ b/internal/test/spec_livenessProbe_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,17 +22,17 @@ package test import ( "log" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" ) var _ = Describe("Setting Kubegres spec 'livenessProbe'", func() { @@ -40,12 +40,12 @@ var _ = Describe("Setting Kubegres spec 'livenessProbe'", func() { var test = SpecLivenessProbeTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -107,8 +107,8 @@ type SpecLivenessProbeTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecLivenessProbeTest) whenKubernetesIsUpdated() { @@ -144,7 +144,7 @@ func (r *SpecLivenessProbeTest) givenLivenessProbe2() *v12.Probe { } func (r *SpecLivenessProbeTest) givenNewKubegresSpecIsSetTo(livenessProbe *v12.Probe, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Probe.LivenessProbe = livenessProbe r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -189,14 +189,14 @@ func (r *SpecLivenessProbeTest) thenStatefulSetStatesShouldBe(expectedProbe *v12 kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecLivenessProbeTest) thenDeployedKubegresSpecShouldBeSetTo(expectedProbe *v12.Probe) { diff --git a/test/spec_pod_manually_promoted_test.go b/internal/test/spec_pod_manually_promoted_test.go similarity index 89% rename from test/spec_pod_manually_promoted_test.go rename to internal/test/spec_pod_manually_promoted_test.go index 1936e0e..7e60883 100644 --- a/test/spec_pod_manually_promoted_test.go +++ b/internal/test/spec_pod_manually_promoted_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,14 +21,14 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" "strconv" "time" ) @@ -38,13 +38,13 @@ var _ = Describe("Primary instances is not available, when the promotion of a Po var test = SpecFailoverIsDisabledAndPromotePodAreSetTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.connectionPrimaryDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, true) - test.connectionReplicaDb = util.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs.KubegresResourceName, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort, false) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.connectionPrimaryDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryPrimaryDbNodePort, true) + test.connectionReplicaDb = util2.InitDbConnectionDbUtil(test.resourceCreator, resourceConfigs2.KubegresResourceName, resourceConfigs2.ServiceToSqlQueryReplicaDbNodePort, false) }) AfterEach(func() { @@ -224,16 +224,16 @@ var _ = Describe("Primary instances is not available, when the promotion of a Po type SpecFailoverIsDisabledAndPromotePodAreSetTest struct { kubegresResource *postgresv1.Kubegres - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever customEnvVariableName string customEnvVariableKey string } func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) givenNewKubegresSpecIsSetTo(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -267,7 +267,7 @@ func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) givenExistingKubegresSpe func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) givenUserAddedInPrimaryDb() { Eventually(func() bool { return r.connectionPrimaryDb.InsertUser() - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) getDeployedPodNames() (primaryPodName, replicaPodName string) { @@ -332,19 +332,19 @@ func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenPodsStatesShouldBe(n kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenErrorEventShouldBeLogged(podName string) { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "ManualFailoverCannotHappenAsConfigErr", Message: "The value of the field 'failover.promotePod' is set to '" + podName + "'. " + @@ -358,7 +358,7 @@ func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenErrorEventShouldBeLo } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) getReplicaPodName() string { @@ -385,7 +385,7 @@ func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenPrimaryDbContainsExp return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenReplicaDbContainsExpectedNbreUsers(expectedNbreUsers int) { @@ -402,7 +402,7 @@ func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenReplicaDbContainsExp return true - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecFailoverIsDisabledAndPromotePodAreSetTest) thenDeployedPodNamesMatch(primaryPodName, replicaPodName string) { diff --git a/test/spec_port_test.go b/internal/test/spec_port_test.go similarity index 85% rename from test/spec_port_test.go rename to internal/test/spec_port_test.go index 38f6dc2..8f98e46 100644 --- a/test/spec_port_test.go +++ b/internal/test/spec_port_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,16 +21,16 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "strconv" "time" ) @@ -40,12 +40,12 @@ var _ = Describe("Setting Kubegres spec 'port'", func() { var test = SpecPortTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -122,7 +122,7 @@ var _ = Describe("Setting Kubegres spec 'port'", func() { test.dbQueryTestCases.ThenWeCanSqlQueryPrimaryDb() test.dbQueryTestCases.ThenWeCanSqlQueryReplicaDb() - test.updateTestServicesPort(resourceConfigs.DbPort) + test.updateTestServicesPort(resourceConfigs2.DbPort) log.Print("END OF: Test 'GIVEN existing Kubegres is updated with spec 'port' set from '5433' to '5434'") }) @@ -134,12 +134,12 @@ type SpecPortTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecPortTest) givenNewKubegresSpecIsSetTo(port int32, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Port = port r.kubegresResource.Spec.Replicas = &specNbreReplicas @@ -175,7 +175,7 @@ func (r *SpecPortTest) whenKubernetesIsUpdated() { func (r *SpecPortTest) thenEventShouldBeLoggedSayingPortIsSetToDefaultValue() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeNormal, Reason: "DefaultSpecValue", Message: "A default value was set for a field in Kubegres YAML spec. 'spec.port': New value: " + strconv.Itoa(ctx.DefaultContainerPortNumber), @@ -187,7 +187,7 @@ func (r *SpecPortTest) thenEventShouldBeLoggedSayingPortIsSetToDefaultValue() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecPortTest) thenPodsStatesShouldBe(port int32, nbrePrimary, nbreReplicas int) bool { @@ -212,14 +212,14 @@ func (r *SpecPortTest) thenPodsStatesShouldBe(port int32, nbrePrimary, nbreRepli kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecPortTest) thenDeployedKubegresSpecShouldBeSetTo(port int32) { @@ -239,13 +239,13 @@ func (r *SpecPortTest) thenPortOfKubegresPrimaryAndReplicaServicesShouldBeSetTo( Eventually(func() bool { - primaryService, err := r.resourceRetriever.GetService(resourceConfigs.KubegresResourceName) + primaryService, err := r.resourceRetriever.GetService(resourceConfigs2.KubegresResourceName) if err != nil { log.Println("Error while getting Kubegres Primary Service resource : ", err) return false } - replicaService, err := r.resourceRetriever.GetService(resourceConfigs.KubegresResourceName + "-replica") + replicaService, err := r.resourceRetriever.GetService(resourceConfigs2.KubegresResourceName + "-replica") if err != nil { log.Println("Error while getting Kubegres Replica Service resource : ", err) return false @@ -258,7 +258,7 @@ func (r *SpecPortTest) thenPortOfKubegresPrimaryAndReplicaServicesShouldBeSetTo( func (r *SpecPortTest) updateTestServicesPort(port int32) { - serviceNameAllowingToSqlQueryPrimaryDb := r.resourceRetriever.GetServiceNameAllowingToSqlQueryDb(resourceConfigs.KubegresResourceName, true) + serviceNameAllowingToSqlQueryPrimaryDb := r.resourceRetriever.GetServiceNameAllowingToSqlQueryDb(resourceConfigs2.KubegresResourceName, true) primaryTestService, err := r.resourceRetriever.GetService(serviceNameAllowingToSqlQueryPrimaryDb) if err != nil { log.Println("Error while getting Primary Test service resource : ", err) @@ -267,7 +267,7 @@ func (r *SpecPortTest) updateTestServicesPort(port int32) { primaryTestService.Spec.Ports[0].Port = port r.resourceCreator.UpdateResource(primaryTestService, "Primary Test Service") - serviceNameAllowingToSqlQueryReplicaDb := r.resourceRetriever.GetServiceNameAllowingToSqlQueryDb(resourceConfigs.KubegresResourceName, false) + serviceNameAllowingToSqlQueryReplicaDb := r.resourceRetriever.GetServiceNameAllowingToSqlQueryDb(resourceConfigs2.KubegresResourceName, false) replicaTestService, err := r.resourceRetriever.GetService(serviceNameAllowingToSqlQueryReplicaDb) if err != nil { log.Println("Error while getting Replica Test service resource : ", err) diff --git a/test/spec_readinessProbe_test.go b/internal/test/spec_readinessProbe_test.go similarity index 88% rename from test/spec_readinessProbe_test.go rename to internal/test/spec_readinessProbe_test.go index b04c21f..0b7f714 100644 --- a/test/spec_readinessProbe_test.go +++ b/internal/test/spec_readinessProbe_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,17 +22,17 @@ package test import ( "log" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" ) var _ = Describe("Setting Kubegres spec 'readinessProbe'", func() { @@ -42,10 +42,10 @@ var _ = Describe("Setting Kubegres spec 'readinessProbe'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -107,8 +107,8 @@ type SpecReadinessProbeTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecReadinessProbeTest) whenKubernetesIsUpdated() { @@ -144,7 +144,7 @@ func (r *SpecReadinessProbeTest) givenReadinessProbe2() *v12.Probe { } func (r *SpecReadinessProbeTest) givenNewKubegresSpecIsSetTo(readinessProbe *v12.Probe, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Probe.ReadinessProbe = readinessProbe r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -189,14 +189,14 @@ func (r *SpecReadinessProbeTest) thenStatefulSetStatesShouldBe(expectedProbe *v1 kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecReadinessProbeTest) thenDeployedKubegresSpecShouldBeSetTo(expectedProbe *v12.Probe) { diff --git a/test/spec_replica_test.go b/internal/test/spec_replica_test.go similarity index 88% rename from test/spec_replica_test.go rename to internal/test/spec_replica_test.go index 221c827..fb1d0cf 100644 --- a/test/spec_replica_test.go +++ b/internal/test/spec_replica_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -40,10 +40,10 @@ var _ = Describe("Setting Kubegres spec 'replica'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -215,17 +215,17 @@ type SpecReplicaTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecReplicaTest) givenNewKubegresSpecIsSetToNil() { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = nil } func (r *SpecReplicaTest) givenNewKubegresSpecIsSetTo(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -251,7 +251,7 @@ func (r *SpecReplicaTest) whenKubernetesIsUpdated() { } func (r *SpecReplicaTest) thenErrorEventShouldBeLogged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.replicas' is undefined. Please set a value otherwise this operator cannot work correctly.", @@ -263,7 +263,7 @@ func (r *SpecReplicaTest) thenErrorEventShouldBeLogged() { } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecReplicaTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) bool { @@ -279,14 +279,14 @@ func (r *SpecReplicaTest) thenPodsStatesShouldBe(nbrePrimary, nbreReplicas int) pods.NbreDeployedPrimary == nbrePrimary && pods.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecReplicaTest) thenDeployedKubegresSpecShouldBeSetTo(specNbreReplicas int32) { diff --git a/test/spec_resource_test.go b/internal/test/spec_resource_test.go similarity index 89% rename from test/spec_resource_test.go rename to internal/test/spec_resource_test.go index cbeb9b2..3eeae93 100644 --- a/test/spec_resource_test.go +++ b/internal/test/spec_resource_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,18 +22,18 @@ package test import ( "log" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" ) var _ = Describe("Setting Kubegres spec 'resource'", func() { @@ -43,10 +43,10 @@ var _ = Describe("Setting Kubegres spec 'resource'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -129,8 +129,8 @@ type SpecResourceTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecResourceTest) whenKubernetesIsUpdated() { @@ -151,13 +151,13 @@ func (r *SpecResourceTest) givenResources(cpuLimit, memLimit, cpuReq, memReq str } func (r *SpecResourceTest) givenNewKubegresSpecIsWithoutResources(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Resources = v12.ResourceRequirements{} r.kubegresResource.Spec.Replicas = &specNbreReplicas } func (r *SpecResourceTest) givenNewKubegresSpecIsSetTo(resources v12.ResourceRequirements, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Resources = resources r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -203,14 +203,14 @@ func (r *SpecResourceTest) thenStatefulSetStatesShouldBeWithoutResources(nbrePri kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecResourceTest) thenStatefulSetStatesShouldBe(expectedResources v12.ResourceRequirements, nbrePrimary, nbreReplicas int) bool { @@ -236,14 +236,14 @@ func (r *SpecResourceTest) thenStatefulSetStatesShouldBe(expectedResources v12.R kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecResourceTest) thenDeployedKubegresSpecShouldWithoutResource() { diff --git a/test/spec_securityContext_test.go b/internal/test/spec_securityContext_test.go similarity index 88% rename from test/spec_securityContext_test.go rename to internal/test/spec_securityContext_test.go index 534b09b..a859bc8 100644 --- a/test/spec_securityContext_test.go +++ b/internal/test/spec_securityContext_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -22,19 +22,19 @@ package test import ( "log" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/utils/pointer" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" ) var _ = Describe("Setting Kubegres spec 'securityContext'", func() { @@ -42,12 +42,12 @@ var _ = Describe("Setting Kubegres spec 'securityContext'", func() { var test = SpecsecurityContextTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -130,8 +130,8 @@ type SpecsecurityContextTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecsecurityContextTest) givensecurityContext1() *v12.PodSecurityContext { @@ -151,13 +151,13 @@ func (r *SpecsecurityContextTest) givensecurityContext2() *v12.PodSecurityContex } func (r *SpecsecurityContextTest) givenNewKubegresSpecIsWithoutsecurityContext(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.SecurityContext = &v12.PodSecurityContext{} r.kubegresResource.Spec.Replicas = &specNbreReplicas } func (r *SpecsecurityContextTest) givenNewKubegresSpecIsSetTo(securityContext *v12.PodSecurityContext, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.SecurityContext = securityContext r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -207,14 +207,14 @@ func (r *SpecsecurityContextTest) thenStatefulSetStatesShouldBeWithoutsecurityCo kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecsecurityContextTest) thenStatefulSetStatesShouldBe(expectedSecurityContext *v12.PodSecurityContext, nbrePrimary, nbreReplicas int) bool { @@ -242,14 +242,14 @@ func (r *SpecsecurityContextTest) thenStatefulSetStatesShouldBe(expectedSecurity kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecsecurityContextTest) thenDeployedKubegresSpecShouldWithoutsecurityContext() { diff --git a/test/spec_tolerations_test.go b/internal/test/spec_tolerations_test.go similarity index 88% rename from test/spec_tolerations_test.go rename to internal/test/spec_tolerations_test.go index 4d6dcc6..4b67ec4 100644 --- a/test/spec_tolerations_test.go +++ b/internal/test/spec_tolerations_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -21,15 +21,15 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "time" ) @@ -38,12 +38,12 @@ var _ = Describe("Setting Kubegres spec 'scheduler.tolerations'", func() { var test = SpecTolerationsTest{} BeforeEach(func() { - //Skip("Temporarily skipping test") + Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -126,8 +126,8 @@ type SpecTolerationsTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecTolerationsTest) givenToleration1() v12.Toleration { @@ -147,13 +147,13 @@ func (r *SpecTolerationsTest) givenToleration2() v12.Toleration { } func (r *SpecTolerationsTest) givenNewKubegresSpecIsWithoutTolerations(specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Scheduler.Tolerations = nil r.kubegresResource.Spec.Replicas = &specNbreReplicas } func (r *SpecTolerationsTest) givenNewKubegresSpecIsSetTo(toleration v12.Toleration, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Scheduler.Tolerations = []v12.Toleration{toleration} r.kubegresResource.Spec.Replicas = &specNbreReplicas } @@ -202,14 +202,14 @@ func (r *SpecTolerationsTest) thenStatefulSetStatesShouldBeWithoutTolerations(nb kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecTolerationsTest) thenStatefulSetStatesShouldBe(expectedToleration v12.Toleration, nbrePrimary, nbreReplicas int) bool { @@ -240,14 +240,14 @@ func (r *SpecTolerationsTest) thenStatefulSetStatesShouldBe(expectedToleration v kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSets check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecTolerationsTest) thenDeployedKubegresSpecShouldWithoutTolerations() { diff --git a/test/spec_volumeAndVolumeMount_test.go b/internal/test/spec_volumeAndVolumeMount_test.go similarity index 93% rename from test/spec_volumeAndVolumeMount_test.go rename to internal/test/spec_volumeAndVolumeMount_test.go index 909c435..8fc8fc9 100644 --- a/test/spec_volumeAndVolumeMount_test.go +++ b/internal/test/spec_volumeAndVolumeMount_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -20,17 +20,17 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" ) @@ -42,10 +42,10 @@ var _ = Describe("Setting Kubegres specs 'volume.volume' and 'volume.volumeMount BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -243,8 +243,8 @@ type SpecVolumeAndVolumeMountTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecVolumeAndVolumeMountTest) givenVolumeWithMemory(volumeName, memoryQuantity string) v12.Volume { @@ -285,7 +285,7 @@ func (r *SpecVolumeAndVolumeMountTest) givenNewKubegresSpecIsSetTo( customVolumeMounts []v12.VolumeMount, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Volume.Volumes = append(r.kubegresResource.Spec.Volume.Volumes, customVolumes...) r.kubegresResource.Spec.Volume.VolumeMounts = append(r.kubegresResource.Spec.Volume.VolumeMounts, customVolumeMounts...) r.kubegresResource.Spec.Replicas = &specNbreReplicas @@ -380,7 +380,7 @@ func (r *SpecVolumeAndVolumeMountTest) whenKubernetesIsUpdated() { } func (r *SpecVolumeAndVolumeMountTest) thenErrorEventShouldBeLoggedAboutVolumeName() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.Volume.Volumes' has an entry with a volume name " + @@ -394,11 +394,11 @@ func (r *SpecVolumeAndVolumeMountTest) thenErrorEventShouldBeLoggedAboutVolumeNa } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeAndVolumeMountTest) thenErrorEventShouldBeLoggedAboutVolumeMountName() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.Volume.VolumeMounts' has an entry with a volume name " + @@ -412,11 +412,11 @@ func (r *SpecVolumeAndVolumeMountTest) thenErrorEventShouldBeLoggedAboutVolumeMo } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeAndVolumeMountTest) thenErrorEventShouldBeLoggedAboutVolumeMountPath() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.Volume.VolumeMounts' has an entry with a 'mountPath' value " + @@ -430,7 +430,7 @@ func (r *SpecVolumeAndVolumeMountTest) thenErrorEventShouldBeLoggedAboutVolumeMo } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeAndVolumeMountTest) thenStatefulSetsStatesShouldBe( @@ -486,14 +486,14 @@ func (r *SpecVolumeAndVolumeMountTest) thenStatefulSetsStatesShouldBe( kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSet check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeAndVolumeMountTest) thenDeployedKubegresSpecShouldBeSetTo( diff --git a/test/spec_volumeClaimTemplates_test.go b/internal/test/spec_volumeClaimTemplates_test.go similarity index 93% rename from test/spec_volumeClaimTemplates_test.go rename to internal/test/spec_volumeClaimTemplates_test.go index 70652e7..85b6ccb 100644 --- a/test/spec_volumeClaimTemplates_test.go +++ b/internal/test/spec_volumeClaimTemplates_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -20,17 +20,17 @@ limitations under the License. package test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" v12 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/testcases" + "reactive-tech.io/kubegres/internal/controller/ctx" + resourceConfigs2 "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/testcases" "reflect" "time" ) @@ -42,10 +42,10 @@ var _ = Describe("Setting Kubegres spec 'volume.volumeClaimTemplates'", func() { BeforeEach(func() { //Skip("Temporarily skipping test") - namespace := resourceConfigs.DefaultNamespace - test.resourceRetriever = util.CreateTestResourceRetriever(k8sClientTest, namespace) - test.resourceCreator = util.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) - test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs.KubegresResourceName) + namespace := resourceConfigs2.DefaultNamespace + test.resourceRetriever = util2.CreateTestResourceRetriever(k8sClientTest, namespace) + test.resourceCreator = util2.CreateTestResourceCreator(k8sClientTest, test.resourceRetriever, namespace) + test.dbQueryTestCases = testcases.InitDbQueryTestCases(test.resourceCreator, resourceConfigs2.KubegresResourceName) }) AfterEach(func() { @@ -198,8 +198,8 @@ type SpecVolumeClaimTemplatesTest struct { keepCreatedResourcesForNextTest bool kubegresResource *postgresv1.Kubegres dbQueryTestCases testcases.DbQueryTestCases - resourceCreator util.TestResourceCreator - resourceRetriever util.TestResourceRetriever + resourceCreator util2.TestResourceCreator + resourceRetriever util2.TestResourceRetriever } func (r *SpecVolumeClaimTemplatesTest) givenVolumeClaimTemplate(volumeName, volumeSize string) postgresv1.VolumeClaimTemplate { @@ -234,7 +234,7 @@ func (r *SpecVolumeClaimTemplatesTest) givenNewKubegresSpecIsSetTo( customVolumeMounts []v12.VolumeMount, specNbreReplicas int32) { - r.kubegresResource = resourceConfigs.LoadKubegresYaml() + r.kubegresResource = resourceConfigs2.LoadKubegresYaml() r.kubegresResource.Spec.Volume.VolumeMounts = append(r.kubegresResource.Spec.Volume.VolumeMounts, customVolumeMounts...) r.kubegresResource.Spec.Volume.VolumeClaimTemplates = append(r.kubegresResource.Spec.Volume.VolumeClaimTemplates, customVolumeClaims...) r.kubegresResource.Spec.Replicas = &specNbreReplicas @@ -333,7 +333,7 @@ func (r *SpecVolumeClaimTemplatesTest) whenKubernetesIsUpdated() { // func (r *SpecVolumeClaimTemplatesTest) thenErrorEventShouldBeLoggedAboutVolumeClaimTemplateName() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.Volume.VolumeClaimTemplates' has an entry with a volume name " + @@ -347,11 +347,11 @@ func (r *SpecVolumeClaimTemplatesTest) thenErrorEventShouldBeLoggedAboutVolumeCl } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeClaimTemplatesTest) thenErrorEventShouldBeLoggedAboutVolumeMountName() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec the value of 'spec.Volume.VolumeMounts' has an entry with a volume name " + @@ -365,11 +365,11 @@ func (r *SpecVolumeClaimTemplatesTest) thenErrorEventShouldBeLoggedAboutVolumeMo } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeClaimTemplatesTest) thenErrorEventShouldBeLoggedAboutVolumeClaimTemplateSpecChanged() { - expectedErrorEvent := util.EventRecord{ + expectedErrorEvent := util2.EventRecord{ Eventtype: v12.EventTypeWarning, Reason: "SpecCheckErr", Message: "In the Resources Spec, the array 'spec.Volume.VolumeClaimTemplates' has changed. Kubernetes does not " + @@ -382,7 +382,7 @@ func (r *SpecVolumeClaimTemplatesTest) thenErrorEventShouldBeLoggedAboutVolumeCl } return eventRecorderTest.CheckEventExist(expectedErrorEvent) - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeClaimTemplatesTest) thenStatefulSetsStatesShouldBe( @@ -441,14 +441,14 @@ func (r *SpecVolumeClaimTemplatesTest) thenStatefulSetsStatesShouldBe( kubegresResources.NbreDeployedPrimary == nbrePrimary && kubegresResources.NbreDeployedReplicas == nbreReplicas { - time.Sleep(resourceConfigs.TestRetryInterval) + time.Sleep(resourceConfigs2.TestRetryInterval) log.Println("Deployed and Ready StatefulSet check successful") return true } return false - }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) + }, resourceConfigs2.TestTimeout, resourceConfigs2.TestRetryInterval).Should(BeTrue()) } func (r *SpecVolumeClaimTemplatesTest) thenDeployedKubegresSpecShouldBeSetTo( diff --git a/test/suite_test.go b/internal/test/suite_test.go similarity index 82% rename from test/suite_test.go rename to internal/test/suite_test.go index bf26f82..941a755 100644 --- a/test/suite_test.go +++ b/internal/test/suite_test.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,19 +24,18 @@ import ( "k8s.io/client-go/tools/record" "log" "path/filepath" - "reactive-tech.io/kubegres/controllers" - "reactive-tech.io/kubegres/test/util" - "reactive-tech.io/kubegres/test/util/kindcluster" + "reactive-tech.io/kubegres/internal/controller" + util2 "reactive-tech.io/kubegres/internal/test/util" + "reactive-tech.io/kubegres/internal/test/util/kindcluster" ctrl "sigs.k8s.io/controller-runtime" "testing" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" @@ -52,17 +51,15 @@ var kindCluster kindcluster.KindTestClusterUtil // var cfgTest *rest.Config var k8sClientTest client.Client var testEnv *envtest.Environment -var eventRecorderTest util.MockEventRecorderTestUtil +var eventRecorderTest util2.MockEventRecorderTestUtil func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) + RunSpecs(t, "Controller Suite") } -var _ = BeforeSuite(func(done Done) { +var _ = BeforeSuite(func() { kindCluster.StartCluster() @@ -73,7 +70,7 @@ var _ = BeforeSuite(func(done Done) { By("bootstrapping test environment") useExistingCluster := true testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, + CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, ErrorIfCRDPathMissing: true, UseExistingCluster: &useExistingCluster, } @@ -81,6 +78,7 @@ var _ = BeforeSuite(func(done Done) { cfg, err := testEnv.Start() Expect(err).ToNot(HaveOccurred()) Expect(cfg).ToNot(BeNil()) + cfg.Timeout = 2 * time.Hour err = postgresv1.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) @@ -96,10 +94,10 @@ var _ = BeforeSuite(func(done Done) { }) Expect(err).ToNot(HaveOccurred()) - mockLogger := util.CreateMockLogger() - eventRecorderTest = util.MockEventRecorderTestUtil{} + mockLogger := util2.CreateMockLogger() + eventRecorderTest = util2.MockEventRecorderTestUtil{} - err = (&controllers.KubegresReconciler{ + err = (&controller.KubegresReconciler{ Client: k8sManager.GetClient(), Logger: mockLogger, Scheme: k8sManager.GetScheme(), @@ -123,8 +121,7 @@ var _ = BeforeSuite(func(done Done) { log.Print("END OF: BeforeSuite") - close(done) -}, 180) +}) var _ = AfterSuite(func() { diff --git a/test/util/DbConnectionTestUtil.go b/internal/test/util/DbConnectionTestUtil.go similarity index 98% rename from test/util/DbConnectionTestUtil.go rename to internal/test/util/DbConnectionTestUtil.go index df97e2b..b3990ff 100644 --- a/test/util/DbConnectionTestUtil.go +++ b/internal/test/util/DbConnectionTestUtil.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -26,7 +26,7 @@ import ( _ "github.com/lib/pq" "k8s.io/apimachinery/pkg/runtime" "log" - "reactive-tech.io/kubegres/test/resourceConfigs" + "reactive-tech.io/kubegres/internal/test/resourceConfigs" "strconv" ) diff --git a/test/util/MockEventRecorderTestUtil.go b/internal/test/util/MockEventRecorderTestUtil.go similarity index 96% rename from test/util/MockEventRecorderTestUtil.go rename to internal/test/util/MockEventRecorderTestUtil.go index fc9cd7a..c5b5c7c 100644 --- a/test/util/MockEventRecorderTestUtil.go +++ b/internal/test/util/MockEventRecorderTestUtil.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "log" - log2 "reactive-tech.io/kubegres/controllers/ctx/log" + log2 "reactive-tech.io/kubegres/internal/controller/ctx/log" ) type MockEventRecorderTestUtil struct { diff --git a/test/util/MockLogger.go b/internal/test/util/MockLogger.go similarity index 95% rename from test/util/MockLogger.go rename to internal/test/util/MockLogger.go index d11b0b2..b3ccb21 100644 --- a/test/util/MockLogger.go +++ b/internal/test/util/MockLogger.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,7 +23,7 @@ package util import ( "github.com/go-logr/logr" "log" - log2 "reactive-tech.io/kubegres/controllers/ctx/log" + log2 "reactive-tech.io/kubegres/internal/controller/ctx/log" "strings" ) diff --git a/test/util/TestResourceCreator.go b/internal/test/util/TestResourceCreator.go similarity index 77% rename from test/util/TestResourceCreator.go rename to internal/test/util/TestResourceCreator.go index 5be3e23..cb3adda 100644 --- a/test/util/TestResourceCreator.go +++ b/internal/test/util/TestResourceCreator.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/types" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - resourceConfigs2 "reactive-tech.io/kubegres/test/resourceConfigs" + "reactive-tech.io/kubegres/internal/test/resourceConfigs" "sigs.k8s.io/controller-runtime/pkg/client" "strconv" "time" @@ -46,7 +46,7 @@ func CreateTestResourceCreator(k8sClient client.Client, namespace string) TestResourceCreator { if namespace == "" { - namespace = resourceConfigs2.DefaultNamespace + namespace = resourceConfigs.DefaultNamespace } resourceCreator := TestResourceCreator{client: k8sClient, resourceRetriever: resourceRetriever, namespace: namespace} @@ -82,70 +82,70 @@ func (r *TestResourceCreator) UpdateResource(resourceToUpdate client.Object, res func (r *TestResourceCreator) CreateSecret() { existingResource := v1.Secret{} - resourceToCreate := resourceConfigs2.LoadSecretYaml() + resourceToCreate := resourceConfigs.LoadSecretYaml() resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Secret", resourceConfigs2.SecretResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Secret", resourceConfigs.SecretResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateBackUpPvc() { existingResource := v1.PersistentVolumeClaim{} - resourceToCreate := resourceConfigs2.LoadBackUpPvcYaml() + resourceToCreate := resourceConfigs.LoadBackUpPvcYaml() resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("BackUp PVC", resourceConfigs2.BackUpPvcResourceName, &existingResource, resourceToCreate) + r.createResourceFromYaml("BackUp PVC", resourceConfigs.BackUpPvcResourceName, &existingResource, resourceToCreate) } func (r *TestResourceCreator) CreateBackUpPvc2() { existingResource := v1.PersistentVolumeClaim{} - resourceToCreate := resourceConfigs2.LoadBackUpPvcYaml() - resourceToCreate.Name = resourceConfigs2.BackUpPvcResourceName2 + resourceToCreate := resourceConfigs.LoadBackUpPvcYaml() + resourceToCreate.Name = resourceConfigs.BackUpPvcResourceName2 resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("BackUp PVC 2", resourceConfigs2.BackUpPvcResourceName2, &existingResource, resourceToCreate) + r.createResourceFromYaml("BackUp PVC 2", resourceConfigs.BackUpPvcResourceName2, &existingResource, resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapEmpty() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapEmptyYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapEmptyYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap empty", resourceConfigs2.CustomConfigMapEmptyResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap empty", resourceConfigs.CustomConfigMapEmptyResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapWithAllConfigs() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapWithAllConfigsYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapWithAllConfigsYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap with all configs", resourceConfigs2.CustomConfigMapWithAllConfigsResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap with all configs", resourceConfigs.CustomConfigMapWithAllConfigsResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapWithBackupDatabaseScript() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapWithBackupDatabaseScriptYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap with backup database script", resourceConfigs2.CustomConfigMapWithBackupDatabaseScriptResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap with backup database script", resourceConfigs.CustomConfigMapWithBackupDatabaseScriptResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapWithPgHbaConf() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapWithPgHbaConfYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapWithPgHbaConfYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap with pg-hba configuration resource", resourceConfigs2.CustomConfigMapWithPgHbaConfResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap with pg-hba configuration resource", resourceConfigs.CustomConfigMapWithPgHbaConfResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapWithPostgresConf() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapWithPostgresConfYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapWithPostgresConfYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap with postgres conf", resourceConfigs2.CustomConfigMapWithPostgresConfResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap with postgres conf", resourceConfigs.CustomConfigMapWithPostgresConfResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapWithPostgresConfAndWalLevelSetToLogical() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapWithPostgresConfAndWalLevelSetToLogicalYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapWithPostgresConfAndWalLevelSetToLogicalYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap with postgres conf and wal_level=logical", resourceConfigs2.CustomConfigMapWithPostgresConfAndWalLevelSetToLogicalResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap with postgres conf and wal_level=logical", resourceConfigs.CustomConfigMapWithPostgresConfAndWalLevelSetToLogicalResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateNamespace() { - if r.namespace == resourceConfigs2.DefaultNamespace { + if r.namespace == resourceConfigs.DefaultNamespace { return } @@ -159,21 +159,21 @@ func (r *TestResourceCreator) CreateNamespace() { resourceToCreate.Name = r.namespace resourceToCreate.Labels = make(map[string]string) resourceToCreate.Labels["name"] = r.namespace - r.createResourceFromYaml("Custom Namespace", resourceConfigs2.CustomConfigMapWithPrimaryInitScriptResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom Namespace", resourceConfigs.CustomConfigMapWithPrimaryInitScriptResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateConfigMapWithPrimaryInitScript() { existingResource := v1.ConfigMap{} - resourceToCreate := resourceConfigs2.LoadCustomConfigMapYaml(resourceConfigs2.CustomConfigMapWithPrimaryInitScriptYamlFile) + resourceToCreate := resourceConfigs.LoadCustomConfigMapYaml(resourceConfigs.CustomConfigMapWithPrimaryInitScriptYamlFile) resourceToCreate.Namespace = r.namespace - r.createResourceFromYaml("Custom ConfigMap with primary init script", resourceConfigs2.CustomConfigMapWithPrimaryInitScriptResourceName, &existingResource, &resourceToCreate) + r.createResourceFromYaml("Custom ConfigMap with primary init script", resourceConfigs.CustomConfigMapWithPrimaryInitScriptResourceName, &existingResource, &resourceToCreate) } func (r *TestResourceCreator) CreateServiceToSqlQueryDb(kubegresName string, nodePort int, isPrimaryDb bool) (runtime.Object, error) { existingResource := v1.Service{} serviceResourceName := r.resourceRetriever.GetServiceNameAllowingToSqlQueryDb(kubegresName, isPrimaryDb) resourceToCreate := r.loadYamlServiceToSqlQueryDb(isPrimaryDb) - resourceToCreate.Spec.Ports[0].Port = resourceConfigs2.DbPort + resourceToCreate.Spec.Ports[0].Port = resourceConfigs.DbPort resourceToCreate.Spec.Ports[0].NodePort = int32(nodePort) resourceToCreate.Namespace = r.namespace resourceToCreate.Name = serviceResourceName @@ -255,9 +255,9 @@ func (r *TestResourceCreator) doesArrayContain(valueToSearch string, resourceNam func (r *TestResourceCreator) loadYamlServiceToSqlQueryDb(isPrimaryDb bool) v1.Service { if isPrimaryDb { - return resourceConfigs2.LoadYamlServiceToSqlQueryPrimaryDb() + return resourceConfigs.LoadYamlServiceToSqlQueryPrimaryDb() } - return resourceConfigs2.LoadYamlServiceToSqlQueryReplicaDb() + return resourceConfigs.LoadYamlServiceToSqlQueryReplicaDb() } func (r *TestResourceCreator) doesNamespaceExist() bool { diff --git a/test/util/TestResourceModifier.go b/internal/test/util/TestResourceModifier.go similarity index 100% rename from test/util/TestResourceModifier.go rename to internal/test/util/TestResourceModifier.go diff --git a/test/util/TestResourceRetriever.go b/internal/test/util/TestResourceRetriever.go similarity index 98% rename from test/util/TestResourceRetriever.go rename to internal/test/util/TestResourceRetriever.go index f94e8e1..735a805 100644 --- a/test/util/TestResourceRetriever.go +++ b/internal/test/util/TestResourceRetriever.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -30,8 +30,8 @@ import ( "k8s.io/apimachinery/pkg/types" "log" postgresv1 "reactive-tech.io/kubegres/api/v1" - "reactive-tech.io/kubegres/controllers/ctx" - "reactive-tech.io/kubegres/test/resourceConfigs" + "reactive-tech.io/kubegres/internal/controller/ctx" + "reactive-tech.io/kubegres/internal/test/resourceConfigs" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/util/kindcluster/KindTestClusterUtil.go b/internal/test/util/kindcluster/KindTestClusterUtil.go similarity index 98% rename from test/util/kindcluster/KindTestClusterUtil.go rename to internal/test/util/kindcluster/KindTestClusterUtil.go index b76eb3d..8f1c609 100644 --- a/test/util/kindcluster/KindTestClusterUtil.go +++ b/internal/test/util/kindcluster/KindTestClusterUtil.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -166,7 +166,7 @@ func (r *KindTestClusterUtil) getClusterConfigFilePath() string { } func (r *KindTestClusterUtil) getMakeFilePath() string { - fileAbsolutePath, err := filepath.Abs("../Makefile") + fileAbsolutePath, err := filepath.Abs("../../Makefile") if err != nil { log.Fatal("Error while trying to get the absolute-path of 'MakeFile': ", err) } diff --git a/test/util/kindcluster/createCluster.sh b/internal/test/util/kindcluster/createCluster.sh similarity index 100% rename from test/util/kindcluster/createCluster.sh rename to internal/test/util/kindcluster/createCluster.sh diff --git a/test/util/kindcluster/kind-cluster-config.yaml b/internal/test/util/kindcluster/kind-cluster-config.yaml similarity index 100% rename from test/util/kindcluster/kind-cluster-config.yaml rename to internal/test/util/kindcluster/kind-cluster-config.yaml diff --git a/test/util/testcases/DbQueryTestCases.go b/internal/test/util/testcases/DbQueryTestCases.go similarity index 71% rename from test/util/testcases/DbQueryTestCases.go rename to internal/test/util/testcases/DbQueryTestCases.go index d511364..c0dca33 100644 --- a/test/util/testcases/DbQueryTestCases.go +++ b/internal/test/util/testcases/DbQueryTestCases.go @@ -1,5 +1,5 @@ /* -Copyright 2021 Reactive Tech Limited. +Copyright 2023 Reactive Tech Limited. "Reactive Tech Limited" is a company located in England, United Kingdom. https://www.reactive-tech.io @@ -23,23 +23,23 @@ package testcases import ( . "github.com/onsi/gomega" "log" - "reactive-tech.io/kubegres/test/resourceConfigs" - "reactive-tech.io/kubegres/test/util" + "reactive-tech.io/kubegres/internal/test/resourceConfigs" + util2 "reactive-tech.io/kubegres/internal/test/util" ) type DbQueryTestCases struct { - connectionPrimaryDb util.DbConnectionDbUtil - connectionReplicaDb util.DbConnectionDbUtil + connectionPrimaryDb util2.DbConnectionDbUtil + connectionReplicaDb util2.DbConnectionDbUtil } -func InitDbQueryTestCases(resourceCreator util.TestResourceCreator, kubegresName string) DbQueryTestCases { +func InitDbQueryTestCases(resourceCreator util2.TestResourceCreator, kubegresName string) DbQueryTestCases { return InitDbQueryTestCasesWithNodePorts(resourceCreator, kubegresName, resourceConfigs.ServiceToSqlQueryPrimaryDbNodePort, resourceConfigs.ServiceToSqlQueryReplicaDbNodePort) } -func InitDbQueryTestCasesWithNodePorts(resourceCreator util.TestResourceCreator, kubegresName string, primaryServiceNodePort, replicaServiceNodePort int) DbQueryTestCases { +func InitDbQueryTestCasesWithNodePorts(resourceCreator util2.TestResourceCreator, kubegresName string, primaryServiceNodePort, replicaServiceNodePort int) DbQueryTestCases { return DbQueryTestCases{ - connectionPrimaryDb: util.InitDbConnectionDbUtil(resourceCreator, kubegresName, primaryServiceNodePort, true), - connectionReplicaDb: util.InitDbConnectionDbUtil(resourceCreator, kubegresName, replicaServiceNodePort, false), + connectionPrimaryDb: util2.InitDbConnectionDbUtil(resourceCreator, kubegresName, primaryServiceNodePort, true), + connectionReplicaDb: util2.InitDbConnectionDbUtil(resourceCreator, kubegresName, replicaServiceNodePort, false), } } @@ -76,7 +76,7 @@ func (r *DbQueryTestCases) ThenWeCanSqlQueryReplicaDb() { }, resourceConfigs.TestTimeout, resourceConfigs.TestRetryInterval).Should(BeTrue()) } -func (r *DbQueryTestCases) isLastInsertedUserInDb(users []util.AccountUser) bool { +func (r *DbQueryTestCases) isLastInsertedUserInDb(users []util2.AccountUser) bool { for _, user := range users { if user.UserId == r.connectionPrimaryDb.LastInsertedUserId { return true diff --git a/kubegres.yaml b/kubegres.yaml index 278fac0..38c4e33 100644 --- a/kubegres.yaml +++ b/kubegres.yaml @@ -2,6 +2,12 @@ apiVersion: v1 kind: Namespace metadata: labels: + app.kubernetes.io/component: manager + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: system + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: namespace + app.kubernetes.io/part-of: kubegres control-plane: controller-manager name: kubegres-system --- @@ -9,8 +15,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: kubegres.kubegres.reactive-tech.io spec: group: kubegres.reactive-tech.io @@ -27,10 +32,14 @@ spec: description: Kubegres is the Schema for the kubegres 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 @@ -58,16 +67,26 @@ spec: type: object env: items: - description: EnvVar represents an environment variable present in a Container. + description: EnvVar represents an environment variable present in + a Container. properties: name: description: Name of the environment variable. Must be a C_IDENTIFIER. type: string value: - description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' + description: 'Variable references $(VAR_NAME) are expanded using + the previously defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows for escaping + the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the + string literal "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable exists or + not. Defaults to "".' type: string valueFrom: - description: Source for the environment variable's value. Cannot be used if value is not empty. + description: Source for the environment variable's value. Cannot + be used if value is not empty. properties: configMapKeyRef: description: Selects a key of a ConfigMap. @@ -76,39 +95,51 @@ spec: description: The key to select. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: - description: Specify whether the ConfigMap or its key must be defined + description: Specify whether the ConfigMap or its key + must be defined type: boolean required: - key type: object x-kubernetes-map-type: atomic fieldRef: - description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, + status.podIP, status.podIPs.' properties: apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + description: Version of the schema the FieldPath is + written in terms of, defaults to "v1". type: string fieldPath: - description: Path of the field to select in the specified API version. + description: Path of the field to select in the specified + API version. type: string required: - fieldPath type: object x-kubernetes-map-type: atomic resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' properties: containerName: - description: 'Container name: required for volumes, optional for env vars' + description: 'Container name: required for volumes, + optional for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format of the exposed resources, defaults to "1" + description: Specifies the output format of the exposed + resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: @@ -122,13 +153,16 @@ spec: description: Selects a key of a secret in the pod's namespace properties: key: - description: The key of the secret to select from. Must be a valid secret key. + description: The key of the secret to select from. Must + be a valid secret key. type: string name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: - description: Specify whether the Secret or its key must be defined + description: Specify whether the Secret or its key must + be defined type: boolean required: - key @@ -150,10 +184,12 @@ spec: type: string imagePullSecrets: items: - description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. + description: LocalObjectReference contains enough information to + let you locate the referenced object inside the same namespace. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object x-kubernetes-map-type: atomic @@ -164,30 +200,45 @@ spec: probe: properties: livenessProbe: - description: Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. + description: Probe describes a health check to be performed against + a container to determine whether it is alive or ready to receive + traffic. properties: exec: description: Exec specifies the action to take. properties: command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit + status of 0 is treated as live/healthy and non-zero + is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + description: Minimum consecutive failures for the probe to + be considered failed after having succeeded. Defaults to + 3. Minimum value is 1. format: int32 type: integer grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. format: int32 type: integer service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + description: "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is + defined by gRPC." type: string required: - port @@ -196,15 +247,21 @@ spec: description: HTTPGet specifies the http request to perform. properties: host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. type: string httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. + description: Custom headers to set in the request. HTTP + allows repeated headers. items: - description: HTTPHeader describes a custom header to be used in HTTP probes + description: HTTPHeader describes a custom header to + be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will be + canonicalized upon output, so case-variant names + will be understood as the same header. type: string value: description: The header field value @@ -221,75 +278,117 @@ spec: anyOf: - type: integer - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + description: Name or number of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. + description: Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: 'Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + description: Minimum consecutive successes for the probe to + be considered successful after having failed. Defaults to + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving a TCP port. + description: TCPSocket specifies an action involving a TCP + port. properties: host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' + description: 'Optional: Host name to connect to, defaults + to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + description: Number or name of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + description: Optional duration in seconds the pod needs to + terminate gracefully upon probe failure. The grace period + is the duration in seconds after the processes running in + the pod are sent a termination signal and the time when + the processes are forcibly halted with a kill signal. Set + this value longer than the expected cleanup time for your + process. If this value is nil, the pod's terminationGracePeriodSeconds + will be used. Otherwise, this value overrides the value + provided by the pod spec. Value must be non-negative integer. + The value zero indicates stop immediately via the kill signal + (no opportunity to shut down). This is a beta field and + requires enabling ProbeTerminationGracePeriod feature gate. + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object readinessProbe: - description: Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic. + description: Probe describes a health check to be performed against + a container to determine whether it is alive or ready to receive + traffic. properties: exec: description: Exec specifies the action to take. properties: command: - description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + description: Command is the command line to execute inside + the container, the working directory for the command is + root ('/') in the container's filesystem. The command + is simply exec'd, it is not run inside a shell, so traditional + shell instructions ('|', etc) won't work. To use a shell, + you need to explicitly call out to that shell. Exit + status of 0 is treated as live/healthy and non-zero + is unhealthy. items: type: string type: array type: object failureThreshold: - description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + description: Minimum consecutive failures for the probe to + be considered failed after having succeeded. Defaults to + 3. Minimum value is 1. format: int32 type: integer grpc: - description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + description: GRPC specifies an action involving a GRPC port. properties: port: - description: Port number of the gRPC service. Number must be in the range 1 to 65535. + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. format: int32 type: integer service: - description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + description: "Service is the name of the service to place + in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + \n If this is not specified, the default behavior is + defined by gRPC." type: string required: - port @@ -298,15 +397,21 @@ spec: description: HTTPGet specifies the http request to perform. properties: host: - description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + description: Host name to connect to, defaults to the + pod IP. You probably want to set "Host" in httpHeaders + instead. type: string httpHeaders: - description: Custom headers to set in the request. HTTP allows repeated headers. + description: Custom headers to set in the request. HTTP + allows repeated headers. items: - description: HTTPHeader describes a custom header to be used in HTTP probes + description: HTTPHeader describes a custom header to + be used in HTTP probes properties: name: - description: The header field name + description: The header field name. This will be + canonicalized upon output, so case-variant names + will be understood as the same header. type: string value: description: The header field value @@ -323,47 +428,74 @@ spec: anyOf: - type: integer - type: string - description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + description: Name or number of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true scheme: - description: Scheme to use for connecting to the host. Defaults to HTTP. + description: Scheme to use for connecting to the host. + Defaults to HTTP. type: string required: - port type: object initialDelaySeconds: - description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: 'Number of seconds after the container has started + before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer periodSeconds: - description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + description: How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. format: int32 type: integer successThreshold: - description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + description: Minimum consecutive successes for the probe to + be considered successful after having failed. Defaults to + 1. Must be 1 for liveness and startup. Minimum value is + 1. format: int32 type: integer tcpSocket: - description: TCPSocket specifies an action involving a TCP port. + description: TCPSocket specifies an action involving a TCP + port. properties: host: - description: 'Optional: Host name to connect to, defaults to the pod IP.' + description: 'Optional: Host name to connect to, defaults + to the pod IP.' type: string port: anyOf: - type: integer - type: string - description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + description: Number or name of the port to access on the + container. Number must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. x-kubernetes-int-or-string: true required: - port type: object terminationGracePeriodSeconds: - description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + description: Optional duration in seconds the pod needs to + terminate gracefully upon probe failure. The grace period + is the duration in seconds after the processes running in + the pod are sent a termination signal and the time when + the processes are forcibly halted with a kill signal. Set + this value longer than the expected cleanup time for your + process. If this value is nil, the pod's terminationGracePeriodSeconds + will be used. Otherwise, this value overrides the value + provided by the pod spec. Value must be non-negative integer. + The value zero indicates stop immediately via the kill signal + (no opportunity to shut down). This is a beta field and + requires enabling ProbeTerminationGracePeriod feature gate. + Minimum value is 1. spec.terminationGracePeriodSeconds is + used if unset. format: int64 type: integer timeoutSeconds: - description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + description: 'Number of seconds after which the probe times + out. Defaults to 1 second. Minimum value is 1. More info: + https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' format: int32 type: integer type: object @@ -374,6 +506,27 @@ spec: resources: description: ResourceRequirements describes the compute resource requirements. properties: + claims: + description: "Claims lists the names of resources, defined in + spec.resourceClaims, that are used by this container. \n This + is an alpha field and requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can only be set + for containers." + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims + of the Pod where this field is used. It makes that resource + available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -381,7 +534,8 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -390,7 +544,11 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object scheduler: @@ -399,29 +557,61 @@ spec: description: Affinity is a group of affinity scheduling rules. properties: nodeAffinity: - description: Describes node affinity scheduling rules for the pod. + description: Describes node affinity scheduling rules for + the pod. properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. + description: The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node matches the corresponding matchExpressions; + the node(s) with the highest sum are the most preferred. items: - description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects + (i.e. is also a no-op). properties: preference: - description: A node selector term, associated with the corresponding weight. + description: A node selector term, associated with + the corresponding weight. properties: matchExpressions: - description: A list of node selector requirements by node's labels. + description: A list of node selector requirements + by node's labels. items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A node selector requirement is + a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: The label key that the selector applies to. + description: The label key that the selector + applies to. type: string operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. type: string values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If the + operator is Exists or DoesNotExist, + the values array must be empty. If the + operator is Gt or Lt, the values array + must have a single element, which will + be interpreted as an integer. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -431,18 +621,35 @@ spec: type: object type: array matchFields: - description: A list of node selector requirements by node's fields. + description: A list of node selector requirements + by node's fields. items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A node selector requirement is + a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: The label key that the selector applies to. + description: The label key that the selector + applies to. type: string operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. type: string values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If the + operator is Exists or DoesNotExist, + the values array must be empty. If the + operator is Gt or Lt, the values array + must have a single element, which will + be interpreted as an integer. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -454,7 +661,8 @@ spec: type: object x-kubernetes-map-type: atomic weight: - description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + description: Weight associated with matching the + corresponding nodeSelectorTerm, in the range 1-100. format: int32 type: integer required: @@ -463,26 +671,53 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. + description: If the affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the affinity requirements + specified by this field cease to be met at some point + during pod execution (e.g. due to an update), the system + may or may not try to eventually evict the pod from + its node. properties: nodeSelectorTerms: - description: Required. A list of node selector terms. The terms are ORed. + description: Required. A list of node selector terms. + The terms are ORed. items: - description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. + description: A null or empty node selector term + matches no objects. The requirements of them are + ANDed. The TopologySelectorTerm type implements + a subset of the NodeSelectorTerm. properties: matchExpressions: - description: A list of node selector requirements by node's labels. + description: A list of node selector requirements + by node's labels. items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A node selector requirement is + a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: The label key that the selector applies to. + description: The label key that the selector + applies to. type: string operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. type: string values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If the + operator is Exists or DoesNotExist, + the values array must be empty. If the + operator is Gt or Lt, the values array + must have a single element, which will + be interpreted as an integer. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -492,18 +727,35 @@ spec: type: object type: array matchFields: - description: A list of node selector requirements by node's fields. + description: A list of node selector requirements + by node's fields. items: - description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A node selector requirement is + a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: The label key that the selector applies to. + description: The label key that the selector + applies to. type: string operator: - description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + description: Represents a key's relationship + to a set of values. Valid operators + are In, NotIn, Exists, DoesNotExist. + Gt, and Lt. type: string values: - description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + description: An array of string values. + If the operator is In or NotIn, the + values array must be non-empty. If the + operator is Exists or DoesNotExist, + the values array must be empty. If the + operator is Gt or Lt, the values array + must have a single element, which will + be interpreted as an integer. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -521,32 +773,65 @@ spec: x-kubernetes-map-type: atomic type: object podAffinity: - description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). + description: Describes pod affinity scheduling rules (e.g. + co-locate this pod in the same node, zone, etc. as some + other pod(s)). properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. + description: The scheduler will prefer to schedule pods + to nodes that satisfy the affinity expressions specified + by this field, but it may choose a node that violates + one or more of the expressions. The node that is most + preferred is the one with the greatest sum of weights, + i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node has pods which matches the corresponding + podAffinityTerm; the node(s) with the highest sum are + the most preferred. items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) properties: podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. + description: Required. A pod affinity term, associated + with the corresponding weight. properties: labelSelector: - description: A label query over a set of resources, in this case pods. + description: A label query over a set of resources, + in this case pods. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key + that the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -558,26 +843,53 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by + this field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key + that the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -589,23 +901,42 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + description: namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected + by namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace". items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the + pods matching the labelSelector in the specified + namespaces, where co-located is defined as + running on a node whose value of the label + with key topologyKey matches that of any node + on which any of the selected pods is running. + Empty topologyKey is not allowed. type: string required: - topologyKey type: object weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + description: weight associated with matching the + corresponding podAffinityTerm, in the range 1-100. format: int32 type: integer required: @@ -614,26 +945,56 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. + description: If the affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the affinity requirements + specified by this field cease to be met at some point + during pod execution (e.g. due to a pod label update), + the system may or may not try to eventually evict the + pod from its node. When there are multiple elements, + the lists of nodes corresponding to each podAffinityTerm + are intersected, i.e. all terms must be satisfied. items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not + co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any node + on which a pod of the set of pods is running properties: labelSelector: - description: A label query over a set of resources, in this case pods. + description: A label query over a set of resources, + in this case pods. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that + the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. items: type: string type: array @@ -645,26 +1006,52 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that + the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. items: type: string type: array @@ -676,17 +1063,33 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string required: - topologyKey @@ -694,32 +1097,65 @@ spec: type: array type: object podAntiAffinity: - description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). + description: Describes pod anti-affinity scheduling rules + (e.g. avoid putting this pod in the same node, zone, etc. + as some other pod(s)). properties: preferredDuringSchedulingIgnoredDuringExecution: - description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. + description: The scheduler will prefer to schedule pods + to nodes that satisfy the anti-affinity expressions + specified by this field, but it may choose a node that + violates one or more of the expressions. The node that + is most preferred is the one with the greatest sum of + weights, i.e. for each node that meets all of the scheduling + requirements (resource request, requiredDuringScheduling + anti-affinity expressions, etc.), compute a sum by iterating + through the elements of this field and adding "weight" + to the sum if the node has pods which matches the corresponding + podAffinityTerm; the node(s) with the highest sum are + the most preferred. items: - description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred + node(s) properties: podAffinityTerm: - description: Required. A pod affinity term, associated with the corresponding weight. + description: Required. A pod affinity term, associated + with the corresponding weight. properties: labelSelector: - description: A label query over a set of resources, in this case pods. + description: A label query over a set of resources, + in this case pods. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key + that the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -731,26 +1167,53 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by + this field and the ones listed in the namespaces + field. null selector and null or empty namespaces + list means "this pod's namespace". An empty + selector ({}) matches all namespaces. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key + that the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -762,23 +1225,42 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + description: namespaces specifies a static list + of namespace names that the term applies to. + The term is applied to the union of the namespaces + listed in this field and the ones selected + by namespaceSelector. null or empty namespaces + list and null namespaceSelector means "this + pod's namespace". items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the + pods matching the labelSelector in the specified + namespaces, where co-located is defined as + running on a node whose value of the label + with key topologyKey matches that of any node + on which any of the selected pods is running. + Empty topologyKey is not allowed. type: string required: - topologyKey type: object weight: - description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + description: weight associated with matching the + corresponding podAffinityTerm, in the range 1-100. format: int32 type: integer required: @@ -787,26 +1269,56 @@ spec: type: object type: array requiredDuringSchedulingIgnoredDuringExecution: - description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. + description: If the anti-affinity requirements specified + by this field are not met at scheduling time, the pod + will not be scheduled onto the node. If the anti-affinity + requirements specified by this field cease to be met + at some point during pod execution (e.g. due to a pod + label update), the system may or may not try to eventually + evict the pod from its node. When there are multiple + elements, the lists of nodes corresponding to each podAffinityTerm + are intersected, i.e. all terms must be satisfied. items: - description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not + co-located (anti-affinity) with, where co-located + is defined as running on a node whose value of the + label with key matches that of any node + on which a pod of the set of pods is running properties: labelSelector: - description: A label query over a set of resources, in this case pods. + description: A label query over a set of resources, + in this case pods. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that + the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. items: type: string type: array @@ -818,26 +1330,52 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaceSelector: - description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + description: A label query over the set of namespaces + that the term applies to. The term is applied + to the union of the namespaces selected by this + field and the ones listed in the namespaces field. + null selector and null or empty namespaces list + means "this pod's namespace". An empty selector + ({}) matches all namespaces. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that + the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. items: type: string type: array @@ -849,17 +1387,33 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic namespaces: - description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + description: namespaces specifies a static list + of namespace names that the term applies to. The + term is applied to the union of the namespaces + listed in this field and the ones selected by + namespaceSelector. null or empty namespaces list + and null namespaceSelector means "this pod's namespace". items: type: string type: array topologyKey: - description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. type: string required: - topologyKey @@ -869,84 +1423,166 @@ spec: type: object tolerations: items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . properties: effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, allowed + values are NoSchedule, PreferNoSchedule and NoExecute. type: string key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. type: string operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + description: Operator represents a key's relationship to + the value. Valid operators are Exists and Equal. Defaults + to Equal. Exists is equivalent to wildcard for value, + so that a pod can tolerate all taints of a particular + category. type: string tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the taint + forever (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. format: int64 type: integer value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. type: string type: object type: array type: object securityContext: - description: PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext. + description: PodSecurityContext holds pod-level security attributes + and common container settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values + of PodSecurityContext. properties: fsGroup: - description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows." + description: "A special supplemental group that applies to all + containers in a pod. Some volume types allow the Kubelet to + change the ownership of that volume to be owned by the pod: + \n 1. The owning GID will be the FSGroup 2. The setgid bit is + set (new files created in the volume will be owned by FSGroup) + 3. The permission bits are OR'd with rw-rw---- \n If unset, + the Kubelet will not modify the ownership and permissions of + any volume. Note that this field cannot be set when spec.os.name + is windows." format: int64 type: integer fsGroupChangePolicy: - description: 'fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. Note that this field cannot be set when spec.os.name is windows.' + description: 'fsGroupChangePolicy defines behavior of changing + ownership and permission of the volume before being exposed + inside Pod. This field will only apply to volume types which + support fsGroup based ownership(and permissions). It will have + no effect on ephemeral volume types such as: secret, configmaps + and emptydir. Valid values are "OnRootMismatch" and "Always". + If not specified, "Always" is used. Note that this field cannot + be set when spec.os.name is windows.' type: string runAsGroup: - description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. + description: The GID to run the entrypoint of the container process. + Uses runtime default if unset. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. format: int64 type: integer runAsNonRoot: - description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + description: Indicates that the container must run as a non-root + user. If true, the Kubelet will validate the image at runtime + to ensure that it does not run as UID 0 (root) and fail to start + the container if it does. If unset or false, no such validation + will be performed. May also be set in SecurityContext. If set + in both SecurityContext and PodSecurityContext, the value specified + in SecurityContext takes precedence. type: boolean runAsUser: - description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. + description: The UID to run the entrypoint of the container process. + Defaults to user specified in image metadata if unspecified. + May also be set in SecurityContext. If set in both SecurityContext + and PodSecurityContext, the value specified in SecurityContext + takes precedence for that container. Note that this field cannot + be set when spec.os.name is windows. format: int64 type: integer seLinuxOptions: - description: The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. + description: The SELinux context to be applied to all containers. + If unspecified, the container runtime will allocate a random + SELinux context for each container. May also be set in SecurityContext. If + set in both SecurityContext and PodSecurityContext, the value + specified in SecurityContext takes precedence for that container. + Note that this field cannot be set when spec.os.name is windows. properties: level: - description: Level is SELinux level label that applies to the container. + description: Level is SELinux level label that applies to + the container. type: string role: - description: Role is a SELinux role label that applies to the container. + description: Role is a SELinux role label that applies to + the container. type: string type: - description: Type is a SELinux type label that applies to the container. + description: Type is a SELinux type label that applies to + the container. type: string user: - description: User is a SELinux user label that applies to the container. + description: User is a SELinux user label that applies to + the container. type: string type: object seccompProfile: - description: The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. + description: The seccomp options to use by the containers in this + pod. Note that this field cannot be set when spec.os.name is + windows. properties: localhostProfile: - description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". + description: localhostProfile indicates a profile defined + in a file on the node should be used. The profile must be + preconfigured on the node to work. Must be a descending + path, relative to the kubelet's configured seccomp profile + location. Must be set if type is "Localhost". Must NOT be + set for any other type. type: string type: - description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." + description: "type indicates which kind of seccomp profile + will be applied. Valid options are: \n Localhost - a profile + defined in a file on the node should be used. RuntimeDefault + - the container runtime default profile should be used. + Unconfined - no profile should be applied." type: string required: - type type: object supplementalGroups: - description: A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container. Note that this field cannot be set when spec.os.name is windows. + description: A list of groups applied to the first process run + in each container, in addition to the container's primary GID, + the fsGroup (if specified), and group memberships defined in + the container image for the uid of the container process. If + unspecified, no additional groups are added to any container. + Note that group memberships defined in the container image for + the uid of the container process are still effective, even if + they are not included in this list. Note that this field cannot + be set when spec.os.name is windows. items: format: int64 type: integer type: array sysctls: - description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows. + description: Sysctls hold a list of namespaced sysctls used for + the pod. Pods with unsupported sysctls (by the container runtime) + might fail to launch. Note that this field cannot be set when + spec.os.name is windows. items: description: Sysctl defines a kernel parameter to be set properties: @@ -962,19 +1598,36 @@ spec: type: object type: array windowsOptions: - description: The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. + description: The Windows specific settings applied to all containers. + If unspecified, the options within a container's SecurityContext + will be used. If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes precedence. Note + that this field cannot be set when spec.os.name is linux. properties: gmsaCredentialSpec: - description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. + description: GMSACredentialSpec is where the GMSA admission + webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential spec named by + the GMSACredentialSpecName field. type: string gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the GMSA credential spec to use. + description: GMSACredentialSpecName is the name of the GMSA + credential spec to use. type: string hostProcess: - description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. + description: HostProcess determines if a container should + be run as a 'Host Process' container. All of a Pod's containers + must have the same effective HostProcess value (it is not + allowed to have a mix of HostProcess containers and non-HostProcess + containers). In addition, if HostProcess is true then HostNetwork + must also be set to true. type: boolean runAsUserName: - description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + description: The UserName in Windows to run the entrypoint + of the container process. Defaults to the user specified + in image metadata if unspecified. May also be set in PodSecurityContext. + If set in both SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. type: string type: object type: object @@ -986,24 +1639,42 @@ spec: name: type: string spec: - description: PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes + description: PersistentVolumeClaimSpec describes the common + attributes of storage devices and allows a Source for + provider-specific attributes properties: accessModes: - description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: 'accessModes contains the desired access + modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' + description: 'dataSource field can be used to specify + either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) If the provisioner + or an external controller can support the specified + data source, it will create a new volume based on + the contents of the specified data source. When the + AnyVolumeDataSource feature gate is enabled, dataSource + contents will be copied to dataSourceRef, and dataSourceRef + contents will be copied to dataSource when dataSourceRef.namespace + is not specified. If the namespace is specified, then + dataSourceRef will not be copied to dataSource.' properties: apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: - description: Kind is the type of resource being referenced + description: Kind is the type of resource being + referenced type: string name: - description: Name is the name of resource being referenced + description: Name is the name of resource being + referenced type: string required: - kind @@ -1011,25 +1682,96 @@ spec: type: object x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' + description: 'dataSourceRef specifies the object from + which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty + API group (non core object) or a PersistentVolumeClaim + object. When this field is specified, volume binding + will only succeed if the type of the specified object + matches some installed volume populator or dynamic + provisioner. This field will replace the functionality + of the dataSource field and as such if both fields + are non-empty, they must have the same value. For + backwards compatibility, when namespace isn''t specified + in dataSourceRef, both fields (dataSource and dataSourceRef) + will be set to the same value automatically if one + of them is empty and the other is non-empty. When + namespace is specified in dataSourceRef, dataSource + isn''t set to the same value and must be empty. There + are three important differences between dataSource + and dataSourceRef: * While dataSource only allows + two specific types of objects, dataSourceRef allows + any non-core object, as well as PersistentVolumeClaim + objects. * While dataSource ignores disallowed values + (dropping them), dataSourceRef preserves all values, + and generates an error if a disallowed value is specified. + * While dataSource only allows local objects, dataSourceRef + allows objects in any namespaces. (Beta) Using this + field requires the AnyVolumeDataSource feature gate + to be enabled. (Alpha) Using the namespace field of + dataSourceRef requires the CrossNamespaceVolumeDataSource + feature gate to be enabled.' properties: apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string kind: - description: Kind is the type of resource being referenced + description: Kind is the type of resource being + referenced type: string name: - description: Name is the name of resource being referenced + description: Name is the name of resource being + referenced + type: string + namespace: + description: Namespace is the namespace of resource + being referenced Note that when a namespace is + specified, a gateway.networking.k8s.io/ReferenceGrant + object is required in the referent namespace to + allow that namespace's owner to accept the reference. + See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource + feature gate to be enabled. type: string required: - kind - name type: object - x-kubernetes-map-type: atomic resources: - description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'resources represents the minimum resources + the volume should have. If RecoverVolumeExpansionFailure + feature is enabled users are allowed to specify resource + requirements that are lower than previous value but + must still be higher than capacity recorded in the + status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: + claims: + description: "Claims lists the names of resources, + defined in spec.resourceClaims, that are used + by this container. \n This is an alpha field and + requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can + only be set for containers." + items: + description: ResourceClaim references one entry + in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one + entry in pod.spec.resourceClaims of the + Pod where this field is used. It makes that + resource available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -1037,7 +1779,8 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -1046,25 +1789,42 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: 'Requests describes the minimum amount + of compute resources required. If Requests is + omitted for a container, it defaults to Limits + if that is explicitly specified, otherwise to + an implementation-defined value. Requests cannot + exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: - description: selector is a label query over volumes to consider for binding. + description: selector is a label query over volumes + to consider for binding. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key that the + selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. items: type: string type: array @@ -1076,43 +1836,64 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic storageClassName: - description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'storageClassName is the name of the StorageClass + required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. + description: volumeMode defines what type of volume + is required by the claim. Value of Filesystem is implied + when not included in claim spec. type: string volumeName: - description: volumeName is the binding reference to the PersistentVolume backing this claim. + description: volumeName is the binding reference to + the PersistentVolume backing this claim. type: string type: object type: object type: array volumeMounts: items: - description: VolumeMount describes a mounting of a Volume within a container. + description: VolumeMount describes a mounting of a Volume within + a container. properties: mountPath: - description: Path within the container at which the volume should be mounted. Must not contain ':'. + description: Path within the container at which the volume + should be mounted. Must not contain ':'. type: string mountPropagation: - description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. + description: mountPropagation determines how mounts are + propagated from the host to container and the other way + around. When not set, MountPropagationNone is used. This + field is beta in 1.10. type: string name: description: This must match the Name of a Volume. type: string readOnly: - description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. + description: Mounted read-only if true, read-write otherwise + (false or unspecified). Defaults to false. type: boolean subPath: - description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + description: Path within the volume from which the container's + volume should be mounted. Defaults to "" (volume's root). type: string subPathExpr: - description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. + description: Expanded path within the volume from which + the container's volume should be mounted. Behaves similarly + to SubPath but environment variable references $(VAR_NAME) + are expanded using the container's environment. Defaults + to "" (volume's root). SubPathExpr and SubPath are mutually + exclusive. type: string required: - mountPath @@ -1121,60 +1902,92 @@ spec: type: array volumes: items: - description: Volume represents a named volume in a pod that may be accessed by any container in the pod. + description: Volume represents a named volume in a pod that + may be accessed by any container in the pod. properties: awsElasticBlockStore: - description: 'awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'awsElasticBlockStore represents an AWS Disk + resource that is attached to a kubelet''s host machine + and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' properties: fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' + description: 'fsType is the filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + TODO: how do we prevent errors in the filesystem from + compromising the machine' type: string partition: - description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' + description: 'partition is the partition in the volume + that you want to mount. If omitted, the default is + to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume + partition for /dev/sda is "0" (or you can leave the + property empty).' format: int32 type: integer readOnly: - description: 'readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'readOnly value true will force the readOnly + setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: boolean volumeID: - description: 'volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + description: 'volumeID is unique ID of the persistent + disk resource in AWS (Amazon EBS volume). More info: + https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' type: string required: - volumeID type: object azureDisk: - description: azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + description: azureDisk represents an Azure Data Disk mount + on the host and bind mount to the pod. properties: cachingMode: - description: 'cachingMode is the Host Caching mode: None, Read Only, Read Write.' + description: 'cachingMode is the Host Caching mode: + None, Read Only, Read Write.' type: string diskName: - description: diskName is the Name of the data disk in the blob storage + description: diskName is the Name of the data disk in + the blob storage type: string diskURI: - description: diskURI is the URI of data disk in the blob storage + description: diskURI is the URI of data disk in the + blob storage type: string fsType: - description: fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is Filesystem type to mount. Must + be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. type: string kind: - description: 'kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' + description: 'kind expected values are Shared: multiple + blob disks per storage account Dedicated: single + blob disk per storage account Managed: azure managed + data disk (only in managed availability set). defaults + to shared' type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + description: readOnly Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting in VolumeMounts. type: boolean required: - diskName - diskURI type: object azureFile: - description: azureFile represents an Azure File Service mount on the host and bind mount to the pod. + description: azureFile represents an Azure File Service + mount on the host and bind mount to the pod. properties: readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + description: readOnly defaults to false (read/write). + ReadOnly here will force the ReadOnly setting in VolumeMounts. type: boolean secretName: - description: secretName is the name of secret that contains Azure Storage Account Name and Key + description: secretName is the name of secret that + contains Azure Storage Account Name and Key type: string shareName: description: shareName is the azure share Name @@ -1184,80 +1997,134 @@ spec: - shareName type: object cephfs: - description: cephFS represents a Ceph FS mount on the host that shares a pod's lifetime + description: cephFS represents a Ceph FS mount on the host + that shares a pod's lifetime properties: monitors: - description: 'monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'monitors is Required: Monitors is a collection + of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' items: type: string type: array path: - description: 'path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /' + description: 'path is Optional: Used as the mounted + root, rather than the full Ceph tree, default is /' type: string readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'readOnly is Optional: Defaults to false + (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: boolean secretFile: - description: 'secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'secretFile is Optional: SecretFile is + the path to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string secretRef: - description: 'secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'secretRef is Optional: SecretRef is reference + to the authentication secret for User, default is + empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic user: - description: 'user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + description: 'user is optional: User is the rados user + name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' type: string required: - monitors type: object cinder: - description: 'cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'cinder represents a cinder volume attached + and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' properties: fsType: - description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string readOnly: - description: 'readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'readOnly defaults to false (read/write). + ReadOnly here will force the ReadOnly setting in VolumeMounts. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: boolean secretRef: - description: 'secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.' + description: 'secretRef is optional: points to a secret + object containing parameters used to connect to OpenStack.' properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic volumeID: - description: 'volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + description: 'volumeID used to identify the volume in + cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' type: string required: - volumeID type: object configMap: - description: configMap represents a configMap that should populate this volume + description: configMap represents a configMap that should + populate this volume properties: defaultMode: - description: 'defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'defaultMode is optional: mode bits used + to set permissions on created files by default. Must + be an octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for mode + bits. Defaults to 0644. Directories within the path + are not affected by this setting. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' format: int32 type: integer items: - description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + description: items if unspecified, each key-value pair + in the Data field of the referenced ConfigMap will + be projected into the volume as a file whose name + is the key and content is the value. If specified, + the listed keys will be projected into the specified + paths, and unlisted keys will not be present. If a + key is specified which is not present in the ConfigMap, + the volume setup will error unless it is marked optional. + Paths must be relative and may not contain the '..' + path or start with '..'. items: - description: Maps a string key to a path within a volume. + description: Maps a string key to a path within a + volume. properties: key: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'mode is Optional: mode bits used + to set permissions on this file. Must be an + octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both octal + and decimal values, JSON requires decimal values + for mode bits. If not specified, the volume + defaultMode will be used. This might be in conflict + with other options that affect the file mode, + like fsGroup, and the result can be other mode + bits set.' format: int32 type: integer path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + description: path is the relative path of the + file to map the key to. May not be an absolute + path. May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -1265,84 +2132,139 @@ spec: type: object type: array name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' type: string optional: - description: optional specify whether the ConfigMap or its keys must be defined + description: optional specify whether the ConfigMap + or its keys must be defined type: boolean type: object x-kubernetes-map-type: atomic csi: - description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). + description: csi (Container Storage Interface) represents + ephemeral storage that is handled by certain external + CSI drivers (Beta feature). properties: driver: - description: driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. + description: driver is the name of the CSI driver that + handles this volume. Consult with your admin for the + correct name as registered in the cluster. type: string fsType: - description: fsType to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. + description: fsType to mount. Ex. "ext4", "xfs", "ntfs". + If not provided, the empty value is passed to the + associated CSI driver which will determine the default + filesystem to apply. type: string nodePublishSecretRef: - description: nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. + description: nodePublishSecretRef is a reference to + the secret object containing sensitive information + to pass to the CSI driver to complete the CSI NodePublishVolume + and NodeUnpublishVolume calls. This field is optional, + and may be empty if no secret is required. If the + secret object contains more than one secret, all secret + references are passed. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic readOnly: - description: readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). + description: readOnly specifies a read-only configuration + for the volume. Defaults to false (read/write). type: boolean volumeAttributes: additionalProperties: type: string - description: volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. + description: volumeAttributes stores driver-specific + properties that are passed to the CSI driver. Consult + your driver's documentation for supported values. type: object required: - driver type: object downwardAPI: - description: downwardAPI represents downward API about the pod that should populate this volume + description: downwardAPI represents downward API about the + pod that should populate this volume properties: defaultMode: - description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'Optional: mode bits to use on created + files by default. Must be a Optional: mode bits used + to set permissions on created files by default. Must + be an octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for mode + bits. Defaults to 0644. Directories within the path + are not affected by this setting. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' format: int32 type: integer items: - description: Items is a list of downward API volume file + description: Items is a list of downward API volume + file items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field + description: DownwardAPIVolumeFile represents information + to create the file containing the pod field properties: fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' + description: 'Required: Selects a field of the + pod: only annotations, labels, name and namespace + are supported.' properties: apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + description: Version of the schema the FieldPath + is written in terms of, defaults to "v1". type: string fieldPath: - description: Path of the field to select in the specified API version. + description: Path of the field to select in + the specified API version. type: string required: - fieldPath type: object x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'Optional: mode bits used to set + permissions on this file, must be an octal value + between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal + values, JSON requires decimal values for mode + bits. If not specified, the volume defaultMode + will be used. This might be in conflict with + other options that affect the file mode, like + fsGroup, and the result can be other mode bits + set.' format: int32 type: integer path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' + description: 'Required: Path is the relative + path name of the file to be created. Must not + be absolute or contain the ''..'' path. Must + be utf-8 encoded. The first item of the relative + path must not start with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' + description: 'Selects a resource of the container: + only resources limits and requests (limits.cpu, + limits.memory, requests.cpu and requests.memory) + are currently supported.' properties: containerName: - description: 'Container name: required for volumes, optional for env vars' + description: 'Container name: required for + volumes, optional for env vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format of the exposed resources, defaults to "1" + description: Specifies the output format of + the exposed resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: @@ -1358,47 +2280,124 @@ spec: type: array type: object emptyDir: - description: 'emptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: 'emptyDir represents a temporary directory + that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' properties: medium: - description: 'medium represents what type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + description: 'medium represents what type of storage + medium should back this directory. The default is + "" which means to use the node''s default medium. + Must be an empty string (default) or Memory. More + info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' type: string sizeLimit: anyOf: - type: integer - type: string - description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + description: 'sizeLimit is the total amount of local + storage required for this EmptyDir volume. The size + limit is also applicable for memory medium. The maximum + usage on memory medium EmptyDir would be the minimum + value between the SizeLimit specified here and the + sum of memory limits of all containers in a pod. The + default is nil which means that the limit is undefined. + More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true type: object ephemeral: - description: "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time." + description: "ephemeral represents a volume that is handled + by a cluster storage driver. The volume's lifecycle is + tied to the pod that defines it - it will be created before + the pod starts, and deleted when the pod is removed. \n + Use this if: a) the volume is only needed while the pod + runs, b) features of normal volumes like restoring from + snapshot or capacity tracking are needed, c) the storage + driver is specified through a storage class, and d) the + storage driver supports dynamic volume provisioning through + a PersistentVolumeClaim (see EphemeralVolumeSource for + more information on the connection between this volume + type and PersistentVolumeClaim). \n Use PersistentVolumeClaim + or one of the vendor-specific APIs for volumes that persist + for longer than the lifecycle of an individual pod. \n + Use CSI for light-weight local ephemeral volumes if the + CSI driver is meant to be used that way - see the documentation + of the driver for more information. \n A pod can use both + types of ephemeral volumes and persistent volumes at the + same time." properties: volumeClaimTemplate: - description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." + description: "Will be used to create a stand-alone PVC + to provision the volume. The pod in which this EphemeralVolumeSource + is embedded will be the owner of the PVC, i.e. the + PVC will be deleted together with the pod. The name + of the PVC will be `-` where + `` is the name from the `PodSpec.Volumes` + array entry. Pod validation will reject the pod if + the concatenated name is not valid for a PVC (for + example, too long). \n An existing PVC with that name + that is not owned by the pod will *not* be used for + the pod to avoid using an unrelated volume by mistake. + Starting the pod is then blocked until the unrelated + PVC is removed. If such a pre-created PVC is meant + to be used by the pod, the PVC has to updated with + an owner reference to the pod once the pod exists. + Normally this should not be necessary, but it may + be useful when manually reconstructing a broken cluster. + \n This field is read-only and no changes will be + made by Kubernetes to the PVC after it has been created. + \n Required, must not be nil." properties: metadata: - description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. + description: May contain labels and annotations + that will be copied into the PVC when creating + it. No other fields are allowed and will be rejected + during validation. type: object spec: - description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. + description: The specification for the PersistentVolumeClaim. + The entire content is copied unchanged into the + PVC that gets created from this template. The + same fields as in a PersistentVolumeClaim are + also valid here. properties: accessModes: - description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + description: 'accessModes contains the desired + access modes the volume should have. More + info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' items: type: string type: array dataSource: - description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the AnyVolumeDataSource feature gate is enabled, this field will always have the same contents as the DataSourceRef field.' + description: 'dataSource field can be used to + specify either: * An existing VolumeSnapshot + object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller + can support the specified data source, it + will create a new volume based on the contents + of the specified data source. When the AnyVolumeDataSource + feature gate is enabled, dataSource contents + will be copied to dataSourceRef, and dataSourceRef + contents will be copied to dataSource when + dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef + will not be copied to dataSource.' properties: apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + description: APIGroup is the group for the + resource being referenced. If APIGroup + is not specified, the specified Kind must + be in the core API group. For any other + third-party types, APIGroup is required. type: string kind: - description: Kind is the type of resource being referenced + description: Kind is the type of resource + being referenced type: string name: - description: Name is the name of resource being referenced + description: Name is the name of resource + being referenced type: string required: - kind @@ -1406,25 +2405,106 @@ spec: type: object x-kubernetes-map-type: atomic dataSourceRef: - description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any local object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the DataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, both fields (DataSource and DataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. There are two important differences between DataSource and DataSourceRef: * While DataSource only allows two specific types of objects, DataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While DataSource ignores disallowed values (dropping them), DataSourceRef preserves all values, and generates an error if a disallowed value is specified. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.' + description: 'dataSourceRef specifies the object + from which to populate the volume with data, + if a non-empty volume is desired. This may + be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding + will only succeed if the type of the specified + object matches some installed volume populator + or dynamic provisioner. This field will replace + the functionality of the dataSource field + and as such if both fields are non-empty, + they must have the same value. For backwards + compatibility, when namespace isn''t specified + in dataSourceRef, both fields (dataSource + and dataSourceRef) will be set to the same + value automatically if one of them is empty + and the other is non-empty. When namespace + is specified in dataSourceRef, dataSource + isn''t set to the same value and must be empty. + There are three important differences between + dataSource and dataSourceRef: * While dataSource + only allows two specific types of objects, + dataSourceRef allows any non-core object, + as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values + (dropping them), dataSourceRef preserves all + values, and generates an error if a disallowed + value is specified. * While dataSource only + allows local objects, dataSourceRef allows + objects in any namespaces. (Beta) Using this + field requires the AnyVolumeDataSource feature + gate to be enabled. (Alpha) Using the namespace + field of dataSourceRef requires the CrossNamespaceVolumeDataSource + feature gate to be enabled.' properties: apiGroup: - description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + description: APIGroup is the group for the + resource being referenced. If APIGroup + is not specified, the specified Kind must + be in the core API group. For any other + third-party types, APIGroup is required. type: string kind: - description: Kind is the type of resource being referenced + description: Kind is the type of resource + being referenced type: string name: - description: Name is the name of resource being referenced + description: Name is the name of resource + being referenced + type: string + namespace: + description: Namespace is the namespace + of resource being referenced Note that + when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant + object is required in the referent namespace + to allow that namespace's owner to accept + the reference. See the ReferenceGrant + documentation for details. (Alpha) This + field requires the CrossNamespaceVolumeDataSource + feature gate to be enabled. type: string required: - kind - name type: object - x-kubernetes-map-type: atomic resources: - description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + description: 'resources represents the minimum + resources the volume should have. If RecoverVolumeExpansionFailure + feature is enabled users are allowed to specify + resource requirements that are lower than + previous value but must still be higher than + capacity recorded in the status field of the + claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' properties: + claims: + description: "Claims lists the names of + resources, defined in spec.resourceClaims, + that are used by this container. \n This + is an alpha field and requires enabling + the DynamicResourceAllocation feature + gate. \n This field is immutable. It can + only be set for containers." + items: + description: ResourceClaim references + one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name + of one entry in pod.spec.resourceClaims + of the Pod where this field is used. + It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -1432,7 +2512,9 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: 'Limits describes the maximum + amount of compute resources allowed. More + info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object requests: additionalProperties: @@ -1441,25 +2523,48 @@ spec: - type: string pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true - description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + description: 'Requests describes the minimum + amount of compute resources required. + If Requests is omitted for a container, + it defaults to Limits if that is explicitly + specified, otherwise to an implementation-defined + value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' type: object type: object selector: - description: selector is a label query over volumes to consider for binding. + description: selector is a label query over + volumes to consider for binding. properties: matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + description: matchExpressions is a list + of label selector requirements. The requirements + are ANDed. items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + description: A label selector requirement + is a selector that contains values, + a key, and an operator that relates + the key and values. properties: key: - description: key is the label key that the selector applies to. + description: key is the label key + that the selector applies to. type: string operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: operator represents a + key's relationship to a set of values. + Valid operators are In, NotIn, Exists + and DoesNotExist. type: string values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + description: values is an array of + string values. If the operator is + In or NotIn, the values array must + be non-empty. If the operator is + Exists or DoesNotExist, the values + array must be empty. This array + is replaced during a strategic merge + patch. items: type: string type: array @@ -1471,18 +2576,29 @@ spec: matchLabels: additionalProperties: type: string - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator + is "In", and the values array contains + only "value". The requirements are ANDed. type: object type: object x-kubernetes-map-type: atomic storageClassName: - description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + description: 'storageClassName is the name of + the StorageClass required by the claim. More + info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' type: string volumeMode: - description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. + description: volumeMode defines what type of + volume is required by the claim. Value of + Filesystem is implied when not included in + claim spec. type: string volumeName: - description: volumeName is the binding reference to the PersistentVolume backing this claim. + description: volumeName is the binding reference + to the PersistentVolume backing this claim. type: string type: object required: @@ -1490,51 +2606,77 @@ spec: type: object type: object fc: - description: fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. + description: fc represents a Fibre Channel resource that + is attached to a kubelet's host machine and then exposed + to the pod. properties: fsType: - description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' + description: 'fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. TODO: how do we prevent + errors in the filesystem from compromising the machine' type: string lun: description: 'lun is Optional: FC target lun number' format: int32 type: integer readOnly: - description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: 'readOnly is Optional: Defaults to false + (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts.' type: boolean targetWWNs: - description: 'targetWWNs is Optional: FC target worldwide names (WWNs)' + description: 'targetWWNs is Optional: FC target worldwide + names (WWNs)' items: type: string type: array wwids: - description: 'wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' + description: 'wwids Optional: FC volume world wide identifiers + (wwids) Either wwids or combination of targetWWNs + and lun must be set, but not both simultaneously.' items: type: string type: array type: object flexVolume: - description: flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. + description: flexVolume represents a generic volume resource + that is provisioned/attached using an exec based plugin. properties: driver: - description: driver is the name of the driver to use for this volume. + description: driver is the name of the driver to use + for this volume. type: string fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + description: fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". The default filesystem + depends on FlexVolume script. type: string options: additionalProperties: type: string - description: 'options is Optional: this field holds extra command options if any.' + description: 'options is Optional: this field holds + extra command options if any.' type: object readOnly: - description: 'readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' + description: 'readOnly is Optional: defaults to false + (read/write). ReadOnly here will force the ReadOnly + setting in VolumeMounts.' type: boolean secretRef: - description: 'secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' + description: 'secretRef is Optional: secretRef is reference + to the secret object containing sensitive information + to pass to the plugin scripts. This may be empty if + no secret object is specified. If the secret object + contains more than one secret, all secrets are passed + to the plugin scripts.' properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic @@ -1542,120 +2684,191 @@ spec: - driver type: object flocker: - description: flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running + description: flocker represents a Flocker volume attached + to a kubelet's host machine. This depends on the Flocker + control service being running properties: datasetName: - description: datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated + description: datasetName is Name of the dataset stored + as metadata -> name on the dataset for Flocker should + be considered as deprecated type: string datasetUUID: - description: datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset + description: datasetUUID is the UUID of the dataset. + This is unique identifier of a Flocker dataset type: string type: object gcePersistentDisk: - description: 'gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'gcePersistentDisk represents a GCE Disk resource + that is attached to a kubelet''s host machine and then + exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' properties: fsType: - description: 'fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' + description: 'fsType is filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + TODO: how do we prevent errors in the filesystem from + compromising the machine' type: string partition: - description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'partition is the partition in the volume + that you want to mount. If omitted, the default is + to mount by volume name. Examples: For volume /dev/sda1, + you specify the partition as "1". Similarly, the volume + partition for /dev/sda is "0" (or you can leave the + property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' format: int32 type: integer pdName: - description: 'pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'pdName is unique name of the PD resource + in GCE. Used to identify the disk in GCE. More info: + https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: string readOnly: - description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + description: 'readOnly here will force the ReadOnly + setting in VolumeMounts. Defaults to false. More info: + https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' type: boolean required: - pdName type: object gitRepo: - description: 'gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' + description: 'gitRepo represents a git repository at a particular + revision. DEPRECATED: GitRepo is deprecated. To provision + a container with a git repo, mount an EmptyDir into an + InitContainer that clones the repo using git, then mount + the EmptyDir into the Pod''s container.' properties: directory: - description: directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + description: directory is the target directory name. + Must not contain or start with '..'. If '.' is supplied, + the volume directory will be the git repository. Otherwise, + if specified, the volume will contain the git repository + in the subdirectory with the given name. type: string repository: description: repository is the URL type: string revision: - description: revision is the commit hash for the specified revision. + description: revision is the commit hash for the specified + revision. type: string required: - repository type: object glusterfs: - description: 'glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + description: 'glusterfs represents a Glusterfs mount on + the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' properties: endpoints: - description: 'endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: 'endpoints is the endpoint name that details + Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string path: - description: 'path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: 'path is the Glusterfs volume path. More + info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: string readOnly: - description: 'readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + description: 'readOnly here will force the Glusterfs + volume to be mounted with read-only permissions. Defaults + to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' type: boolean required: - endpoints - path type: object hostPath: - description: 'hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' + description: 'hostPath represents a pre-existing file or + directory on the host machine that is directly exposed + to the container. This is generally used for system agents + or other privileged things that are allowed to see the + host machine. Most containers will NOT need this. More + info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + --- TODO(jonesdl) We need to restrict who can use host + directory mounts and who can/can not mount host directories + as read/write.' properties: path: - description: 'path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: 'path of the directory on the host. If + the path is a symlink, it will follow the link to + the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string type: - description: 'type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + description: 'type for HostPath Volume Defaults to "" + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' type: string required: - path type: object iscsi: - description: 'iscsi represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + description: 'iscsi represents an ISCSI Disk resource that + is attached to a kubelet''s host machine and then exposed + to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' properties: chapAuthDiscovery: - description: chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication + description: chapAuthDiscovery defines whether support + iSCSI Discovery CHAP authentication type: boolean chapAuthSession: - description: chapAuthSession defines whether support iSCSI Session CHAP authentication + description: chapAuthSession defines whether support + iSCSI Session CHAP authentication type: boolean fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' + description: 'fsType is the filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi + TODO: how do we prevent errors in the filesystem from + compromising the machine' type: string initiatorName: - description: initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. + description: initiatorName is the custom iSCSI Initiator + Name. If initiatorName is specified with iscsiInterface + simultaneously, new iSCSI interface : will be created for the connection. type: string iqn: description: iqn is the target iSCSI Qualified Name. type: string iscsiInterface: - description: iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). + description: iscsiInterface is the interface Name that + uses an iSCSI transport. Defaults to 'default' (tcp). type: string lun: description: lun represents iSCSI Target Lun number. format: int32 type: integer portals: - description: portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). + description: portals is the iSCSI Target Portal List. + The portal is either an IP or ip_addr:port if the + port is other than default (typically TCP ports 860 + and 3260). items: type: string type: array readOnly: - description: readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + description: readOnly here will force the ReadOnly setting + in VolumeMounts. Defaults to false. type: boolean secretRef: - description: secretRef is the CHAP Secret for iSCSI target and initiator authentication + description: secretRef is the CHAP Secret for iSCSI + target and initiator authentication properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic targetPortal: - description: targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). + description: targetPortal is iSCSI Target Portal. The + Portal is either an IP or ip_addr:port if the port + is other than default (typically TCP ports 860 and + 3260). type: string required: - iqn @@ -1663,92 +2876,153 @@ spec: - targetPortal type: object name: - description: 'name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + description: 'name of the volume. Must be a DNS_LABEL and + unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' type: string nfs: - description: 'nfs represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: 'nfs represents an NFS mount on the host that + shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' properties: path: - description: 'path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: 'path that is exported by the NFS server. + More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string readOnly: - description: 'readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: 'readOnly here will force the NFS export + to be mounted with read-only permissions. Defaults + to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: boolean server: - description: 'server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + description: 'server is the hostname or IP address of + the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' type: string required: - path - server type: object persistentVolumeClaim: - description: 'persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: 'persistentVolumeClaimVolumeSource represents + a reference to a PersistentVolumeClaim in the same namespace. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' properties: claimName: - description: 'claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + description: 'claimName is the name of a PersistentVolumeClaim + in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' type: string readOnly: - description: readOnly Will force the ReadOnly setting in VolumeMounts. Default false. + description: readOnly Will force the ReadOnly setting + in VolumeMounts. Default false. type: boolean required: - claimName type: object photonPersistentDisk: - description: photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine + description: photonPersistentDisk represents a PhotonController + persistent disk attached and mounted on kubelets host + machine properties: fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. type: string pdID: - description: pdID is the ID that identifies Photon Controller persistent disk + description: pdID is the ID that identifies Photon Controller + persistent disk type: string required: - pdID type: object portworxVolume: - description: portworxVolume represents a portworx volume attached and mounted on kubelets host machine + description: portworxVolume represents a portworx volume + attached and mounted on kubelets host machine properties: fsType: - description: fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. + description: fSType represents the filesystem type to + mount Must be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs". Implicitly inferred + to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + description: readOnly defaults to false (read/write). + ReadOnly here will force the ReadOnly setting in VolumeMounts. type: boolean volumeID: - description: volumeID uniquely identifies a Portworx volume + description: volumeID uniquely identifies a Portworx + volume type: string required: - volumeID type: object projected: - description: projected items for all in one resources secrets, configmaps, and downward API + description: projected items for all in one resources secrets, + configmaps, and downward API properties: defaultMode: - description: defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. + description: defaultMode are the mode bits used to set + permissions on created files by default. Must be an + octal value between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both octal and decimal + values, JSON requires decimal values for mode bits. + Directories within the path are not affected by this + setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result + can be other mode bits set. format: int32 type: integer sources: description: sources is the list of volume projections items: - description: Projection that may be projected along with other supported volume types + description: Projection that may be projected along + with other supported volume types properties: configMap: - description: configMap information about the configMap data to project + description: configMap information about the configMap + data to project properties: items: - description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + description: items if unspecified, each key-value + pair in the Data field of the referenced + ConfigMap will be projected into the volume + as a file whose name is the key and content + is the value. If specified, the listed keys + will be projected into the specified paths, + and unlisted keys will not be present. If + a key is specified which is not present + in the ConfigMap, the volume setup will + error unless it is marked optional. Paths + must be relative and may not contain the + '..' path or start with '..'. items: - description: Maps a string key to a path within a volume. + description: Maps a string key to a path + within a volume. properties: key: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'mode is Optional: mode + bits used to set permissions on this + file. Must be an octal value between + 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal + and decimal values, JSON requires + decimal values for mode bits. If not + specified, the volume defaultMode + will be used. This might be in conflict + with other options that affect the + file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + description: path is the relative path + of the file to map the key to. May + not be an absolute path. May not contain + the path element '..'. May not start + with the string '..'. type: string required: - key @@ -1756,56 +3030,94 @@ spec: type: object type: array name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' type: string optional: - description: optional specify whether the ConfigMap or its keys must be defined + description: optional specify whether the + ConfigMap or its keys must be defined type: boolean type: object x-kubernetes-map-type: atomic downwardAPI: - description: downwardAPI information about the downwardAPI data to project + description: downwardAPI information about the + downwardAPI data to project properties: items: - description: Items is a list of DownwardAPIVolume file + description: Items is a list of DownwardAPIVolume + file items: - description: DownwardAPIVolumeFile represents information to create the file containing the pod field + description: DownwardAPIVolumeFile represents + information to create the file containing + the pod field properties: fieldRef: - description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' + description: 'Required: Selects a field + of the pod: only annotations, labels, + name and namespace are supported.' properties: apiVersion: - description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + description: Version of the schema + the FieldPath is written in terms + of, defaults to "v1". type: string fieldPath: - description: Path of the field to select in the specified API version. + description: Path of the field to + select in the specified API version. type: string required: - fieldPath type: object x-kubernetes-map-type: atomic mode: - description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'Optional: mode bits used + to set permissions on this file, must + be an octal value between 0000 and + 0777 or a decimal value between 0 + and 511. YAML accepts both octal and + decimal values, JSON requires decimal + values for mode bits. If not specified, + the volume defaultMode will be used. + This might be in conflict with other + options that affect the file mode, + like fsGroup, and the result can be + other mode bits set.' format: int32 type: integer path: - description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' + description: 'Required: Path is the + relative path name of the file to + be created. Must not be absolute or + contain the ''..'' path. Must be utf-8 + encoded. The first item of the relative + path must not start with ''..''' type: string resourceFieldRef: - description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' + description: 'Selects a resource of + the container: only resources limits + and requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) + are currently supported.' properties: containerName: - description: 'Container name: required for volumes, optional for env vars' + description: 'Container name: required + for volumes, optional for env + vars' type: string divisor: anyOf: - type: integer - type: string - description: Specifies the output format of the exposed resources, defaults to "1" + description: Specifies the output + format of the exposed resources, + defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: - description: 'Required: resource to select' + description: 'Required: resource + to select' type: string required: - resource @@ -1817,22 +3129,50 @@ spec: type: array type: object secret: - description: secret information about the secret data to project + description: secret information about the secret + data to project properties: items: - description: items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + description: items if unspecified, each key-value + pair in the Data field of the referenced + Secret will be projected into the volume + as a file whose name is the key and content + is the value. If specified, the listed keys + will be projected into the specified paths, + and unlisted keys will not be present. If + a key is specified which is not present + in the Secret, the volume setup will error + unless it is marked optional. Paths must + be relative and may not contain the '..' + path or start with '..'. items: - description: Maps a string key to a path within a volume. + description: Maps a string key to a path + within a volume. properties: key: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'mode is Optional: mode + bits used to set permissions on this + file. Must be an octal value between + 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal + and decimal values, JSON requires + decimal values for mode bits. If not + specified, the volume defaultMode + will be used. This might be in conflict + with other options that affect the + file mode, like fsGroup, and the result + can be other mode bits set.' format: int32 type: integer path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + description: path is the relative path + of the file to map the key to. May + not be an absolute path. May not contain + the path element '..'. May not start + with the string '..'. type: string required: - key @@ -1840,25 +3180,46 @@ spec: type: object type: array name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' type: string optional: - description: optional field specify whether the Secret or its key must be defined + description: optional field specify whether + the Secret or its key must be defined type: boolean type: object x-kubernetes-map-type: atomic serviceAccountToken: - description: serviceAccountToken is information about the serviceAccountToken data to project + description: serviceAccountToken is information + about the serviceAccountToken data to project properties: audience: - description: audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. + description: audience is the intended audience + of the token. A recipient of a token must + identify itself with an identifier specified + in the audience of the token, and otherwise + should reject the token. The audience defaults + to the identifier of the apiserver. type: string expirationSeconds: - description: expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. + description: expirationSeconds is the requested + duration of validity of the service account + token. As the token approaches expiration, + the kubelet volume plugin will proactively + rotate the service account token. The kubelet + will start trying to rotate the token if + the token is older than 80 percent of its + time to live or if the token is older than + 24 hours.Defaults to 1 hour and must be + at least 10 minutes. format: int64 type: integer path: - description: path is the path relative to the mount point of the file to project the token into. + description: path is the path relative to + the mount point of the file to project the + token into. type: string required: - path @@ -1867,105 +3228,152 @@ spec: type: array type: object quobyte: - description: quobyte represents a Quobyte mount on the host that shares a pod's lifetime + description: quobyte represents a Quobyte mount on the host + that shares a pod's lifetime properties: group: - description: group to map volume access to Default is no group + description: group to map volume access to Default is + no group type: string readOnly: - description: readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. + description: readOnly here will force the Quobyte volume + to be mounted with read-only permissions. Defaults + to false. type: boolean registry: - description: registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes + description: registry represents a single or multiple + Quobyte Registry services specified as a string as + host:port pair (multiple entries are separated with + commas) which acts as the central registry for volumes type: string tenant: - description: tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin + description: tenant owning the given Quobyte volume + in the Backend Used with dynamically provisioned Quobyte + volumes, value is set by the plugin type: string user: - description: user to map volume access to Defaults to serivceaccount user + description: user to map volume access to Defaults to + serivceaccount user type: string volume: - description: volume is a string that references an already created Quobyte volume by name. + description: volume is a string that references an already + created Quobyte volume by name. type: string required: - registry - volume type: object rbd: - description: 'rbd represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + description: 'rbd represents a Rados Block Device mount + on the host that shares a pod''s lifetime. More info: + https://examples.k8s.io/volumes/rbd/README.md' properties: fsType: - description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' + description: 'fsType is the filesystem type of the volume + that you want to mount. Tip: Ensure that the filesystem + type is supported by the host operating system. Examples: + "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" + if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd + TODO: how do we prevent errors in the filesystem from + compromising the machine' type: string image: - description: 'image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'image is the rados image name. More info: + https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string keyring: - description: 'keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'keyring is the path to key ring for RBDUser. + Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string monitors: - description: 'monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'monitors is a collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' items: type: string type: array pool: - description: 'pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'pool is the rados pool name. Default is + rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string readOnly: - description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'readOnly here will force the ReadOnly + setting in VolumeMounts. Defaults to false. More info: + https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: boolean secretRef: - description: 'secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'secretRef is name of the authentication + secret for RBDUser. If provided overrides keyring. + Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic user: - description: 'user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + description: 'user is the rados user name. Default is + admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' type: string required: - image - monitors type: object scaleIO: - description: scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. + description: scaleIO represents a ScaleIO persistent volume + attached and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". + description: fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". type: string gateway: - description: gateway is the host address of the ScaleIO API Gateway. + description: gateway is the host address of the ScaleIO + API Gateway. type: string protectionDomain: - description: protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. + description: protectionDomain is the name of the ScaleIO + Protection Domain for the configured storage. type: string readOnly: - description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + description: readOnly Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. + description: secretRef references to the secret for + ScaleIO user and other sensitive information. If this + is not provided, Login operation will fail. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic sslEnabled: - description: sslEnabled Flag enable/disable SSL communication with Gateway, default false + description: sslEnabled Flag enable/disable SSL communication + with Gateway, default false type: boolean storageMode: - description: storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. + description: storageMode indicates whether the storage + for a volume should be ThickProvisioned or ThinProvisioned. + Default is ThinProvisioned. type: string storagePool: - description: storagePool is the ScaleIO Storage Pool associated with the protection domain. + description: storagePool is the ScaleIO Storage Pool + associated with the protection domain. type: string system: - description: system is the name of the storage system as configured in ScaleIO. + description: system is the name of the storage system + as configured in ScaleIO. type: string volumeName: - description: volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source. + description: volumeName is the name of a volume already + created in the ScaleIO system that is associated with + this volume source. type: string required: - gateway @@ -1973,26 +3381,58 @@ spec: - system type: object secret: - description: 'secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: 'secret represents a secret that should populate + this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' properties: defaultMode: - description: 'defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'defaultMode is Optional: mode bits used + to set permissions on created files by default. Must + be an octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both octal and + decimal values, JSON requires decimal values for mode + bits. Defaults to 0644. Directories within the path + are not affected by this setting. This might be in + conflict with other options that affect the file mode, + like fsGroup, and the result can be other mode bits + set.' format: int32 type: integer items: - description: items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + description: items If unspecified, each key-value pair + in the Data field of the referenced Secret will be + projected into the volume as a file whose name is + the key and content is the value. If specified, the + listed keys will be projected into the specified paths, + and unlisted keys will not be present. If a key is + specified which is not present in the Secret, the + volume setup will error unless it is marked optional. + Paths must be relative and may not contain the '..' + path or start with '..'. items: - description: Maps a string key to a path within a volume. + description: Maps a string key to a path within a + volume. properties: key: description: key is the key to project. type: string mode: - description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + description: 'mode is Optional: mode bits used + to set permissions on this file. Must be an + octal value between 0000 and 0777 or a decimal + value between 0 and 511. YAML accepts both octal + and decimal values, JSON requires decimal values + for mode bits. If not specified, the volume + defaultMode will be used. This might be in conflict + with other options that affect the file mode, + like fsGroup, and the result can be other mode + bits set.' format: int32 type: integer path: - description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + description: path is the relative path of the + file to map the key to. May not be an absolute + path. May not contain the path element '..'. + May not start with the string '..'. type: string required: - key @@ -2000,50 +3440,78 @@ spec: type: object type: array optional: - description: optional field specify whether the Secret or its keys must be defined + description: optional field specify whether the Secret + or its keys must be defined type: boolean secretName: - description: 'secretName is the name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + description: 'secretName is the name of the secret in + the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' type: string type: object storageos: - description: storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. + description: storageOS represents a StorageOS volume attached + and mounted on Kubernetes nodes. properties: fsType: - description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is the filesystem type to mount. + Must be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. type: string readOnly: - description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + description: readOnly defaults to false (read/write). + ReadOnly here will force the ReadOnly setting in VolumeMounts. type: boolean secretRef: - description: secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. + description: secretRef specifies the secret to use for + obtaining the StorageOS API credentials. If not specified, + default values will be attempted. properties: name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' type: string type: object x-kubernetes-map-type: atomic volumeName: - description: volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. + description: volumeName is the human-readable name of + the StorageOS volume. Volume names are only unique + within a namespace. type: string volumeNamespace: - description: volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. + description: volumeNamespace specifies the scope of + the volume within StorageOS. If no namespace is specified + then the Pod's namespace will be used. This allows + the Kubernetes name scoping to be mirrored within + StorageOS for tighter integration. Set VolumeName + to any name to override the default behaviour. Set + to "default" if you are not using namespaces within + StorageOS. Namespaces that do not pre-exist within + StorageOS will be created. type: string type: object vsphereVolume: - description: vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine + description: vsphereVolume represents a vSphere volume attached + and mounted on kubelets host machine properties: fsType: - description: fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + description: fsType is filesystem type to mount. Must + be a filesystem type supported by the host operating + system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred + to be "ext4" if unspecified. type: string storagePolicyID: - description: storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. + description: storagePolicyID is the storage Policy Based + Management (SPBM) profile ID associated with the StoragePolicyName. type: string storagePolicyName: - description: storagePolicyName is the storage Policy Based Management (SPBM) profile name. + description: storagePolicyName is the storage Policy + Based Management (SPBM) profile name. type: string volumePath: - description: volumePath is the path that identifies vSphere volume vmdk + description: volumePath is the path that identifies + vSphere volume vmdk type: string required: - volumePath @@ -2124,12 +3592,26 @@ spec: apiVersion: v1 kind: ServiceAccount metadata: + labels: + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: controller-manager-sa + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: serviceaccount + app.kubernetes.io/part-of: kubegres name: kubegres-controller-manager namespace: kubegres-system --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: + labels: + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: leader-election-role + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: role + app.kubernetes.io/part-of: kubegres name: kubegres-leader-election-role namespace: kubegres-system rules: @@ -2168,7 +3650,6 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - creationTimestamp: null name: kubegres-manager-role rules: - apiGroups: @@ -2293,6 +3774,13 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: metrics-reader + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: clusterrole + app.kubernetes.io/part-of: kubegres name: kubegres-metrics-reader rules: - nonResourceURLs: @@ -2303,6 +3791,13 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: + labels: + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: proxy-role + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: clusterrole + app.kubernetes.io/part-of: kubegres name: kubegres-proxy-role rules: - apiGroups: @@ -2321,6 +3816,13 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: + labels: + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: leader-election-rolebinding + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: rolebinding + app.kubernetes.io/part-of: kubegres name: kubegres-leader-election-rolebinding namespace: kubegres-system roleRef: @@ -2335,6 +3837,13 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: + labels: + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: manager-rolebinding + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: clusterrolebinding + app.kubernetes.io/part-of: kubegres name: kubegres-manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io @@ -2348,6 +3857,13 @@ subjects: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: + labels: + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: proxy-rolebinding + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: clusterrolebinding + app.kubernetes.io/part-of: kubegres name: kubegres-proxy-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io @@ -2359,38 +3875,15 @@ subjects: namespace: kubegres-system --- apiVersion: v1 -data: - controller_manager_config.yaml: | - apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 - kind: ControllerManagerConfig - health: - healthProbeBindAddress: :8081 - metrics: - bindAddress: 127.0.0.1:8080 - webhook: - port: 9443 - leaderElection: - leaderElect: true - resourceName: d5ccd92e.reactive-tech.io - # leaderElectionReleaseOnCancel defines if the leader should step down volume - # when the Manager ends. This requires the binary to immediately end when the - # Manager is stopped, otherwise, this setting is unsafe. Setting this significantly - # speeds up voluntary leader transitions as the new leader don't have to wait - # LeaseDuration time first. - # In the default scaffold provided, the program ends immediately after - # the manager stops, so would be fine to enable this option. However, - # if you are doing or is intended to do any operation such as perform cleanups - # after the manager stops then its usage might be unsafe. - # leaderElectionReleaseOnCancel: true -kind: ConfigMap -metadata: - name: kubegres-manager-config - namespace: kubegres-system ---- -apiVersion: v1 kind: Service metadata: labels: + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: controller-manager-metrics-service + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: service + app.kubernetes.io/part-of: kubegres control-plane: controller-manager name: kubegres-controller-manager-metrics-service namespace: kubegres-system @@ -2407,6 +3900,12 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: + app.kubernetes.io/component: manager + app.kubernetes.io/created-by: kubegres + app.kubernetes.io/instance: controller-manager + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: deployment + app.kubernetes.io/part-of: kubegres control-plane: controller-manager name: kubegres-controller-manager namespace: kubegres-system @@ -2428,7 +3927,7 @@ spec: - --upstream=http://127.0.0.1:8080/ - --logtostderr=true - --v=0 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1 name: kube-rbac-proxy ports: - containerPort: 8443 @@ -2452,7 +3951,7 @@ spec: - --leader-elect command: - /manager - image: reactivetechio/kubegres:1.16 + image: reactivetechio/kubegres:1.17 livenessProbe: httpGet: path: /healthz