From 34ea968e166d27045b7dea7140df1ad673447fd0 Mon Sep 17 00:00:00 2001 From: trampfox Date: Tue, 16 Jul 2024 16:45:53 +0200 Subject: [PATCH 01/34] fix(cloudfunctions): switch to the new required api Signed-off-by: trampfox --- config/cloudfunctions/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cloudfunctions/config.go b/config/cloudfunctions/config.go index 884826c80..4a69bea0c 100644 --- a/config/cloudfunctions/config.go +++ b/config/cloudfunctions/config.go @@ -22,7 +22,7 @@ func Configure(p *config.Provider) { Schema["build_environment_variables"].Elem = schema.TypeString r.TerraformResource. Schema["environment_variables"].Elem = schema.TypeString - config.MarkAsRequired(r.TerraformResource, "region") + r.MarkAsRequired("region") }) p.AddResourceConfigurator("google_cloudfunctions_function_iam_binding", func(r *config.Resource) { From 608b6767115a4abb685e079cc7f52e6f0ff4dcd2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Sep 2024 00:23:14 +0000 Subject: [PATCH 02/34] Update alpine Docker tag to v3.20.3 --- cluster/images/provider-gcp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/images/provider-gcp/Dockerfile b/cluster/images/provider-gcp/Dockerfile index 2db772e91..a478cc86a 100644 --- a/cluster/images/provider-gcp/Dockerfile +++ b/cluster/images/provider-gcp/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.20.2 +FROM alpine:3.20.3 RUN apk --no-cache add ca-certificates bash ARG TARGETOS From b4e80d49a3714bfd26aaf6662c6a89ddcb114c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Thu, 12 Sep 2024 15:33:39 +0300 Subject: [PATCH 03/34] Bump upjet to the commit 3afbb77 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 832624f32..78221c8be 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( dario.cat/mergo v1.0.0 github.com/crossplane/crossplane-runtime v1.16.0-rc.2.0.20240510094504-3f697876fa57 github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 - github.com/crossplane/upjet v1.4.1-0.20240822141623-2e361ad3b6e6 + github.com/crossplane/upjet v1.4.1-0.20240911184956-3afbb7796d46 github.com/hashicorp/terraform-json v0.22.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/hashicorp/terraform-provider-google v1.20.1-0.20240729180617-5093dfd2a5ea diff --git a/go.sum b/go.sum index 6ad8359f7..5cb96ba68 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/crossplane/crossplane-runtime v1.16.0-rc.2.0.20240510094504-3f697876f github.com/crossplane/crossplane-runtime v1.16.0-rc.2.0.20240510094504-3f697876fa57/go.mod h1:Pz2tdGVMF6KDGzHZOkvKro0nKc8EzK0sb/nSA7pH4Dc= github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 h1:HigXs5tEQxWz0fcj8hzbU2UAZgEM7wPe0XRFOsrtF8Y= github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79/go.mod h1:+e4OaFlOcmr0JvINHl/yvEYBrZawzTgj6pQumOH1SS0= -github.com/crossplane/upjet v1.4.1-0.20240822141623-2e361ad3b6e6 h1:JHLCgoJOmfzEtBbuoxdRNv58kQwiiV+L7HKZJYugN1c= -github.com/crossplane/upjet v1.4.1-0.20240822141623-2e361ad3b6e6/go.mod h1:wkdZf/Cvhr6PI30VdHIOjg4dX39Z5uijqnLWFk5PbGM= +github.com/crossplane/upjet v1.4.1-0.20240911184956-3afbb7796d46 h1:2IH1YPTBrNmBj0Z1OCjEBTrQCuRaLutZbWLaswFeCFQ= +github.com/crossplane/upjet v1.4.1-0.20240911184956-3afbb7796d46/go.mod h1:wkdZf/Cvhr6PI30VdHIOjg4dX39Z5uijqnLWFk5PbGM= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/dave/jennifer v1.4.1 h1:XyqG6cn5RQsTj3qlWQTKlRGAyrTcsk1kUmWdZBzRjDw= From e943896df59acb7553d33a0e0ea01dcf2bc19567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Fri, 20 Sep 2024 16:34:40 +0300 Subject: [PATCH 04/34] Add cleanupexamples tool to subpackages build process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- cluster/images/provider-gcp/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cluster/images/provider-gcp/Makefile b/cluster/images/provider-gcp/Makefile index 3fccb545d..683f30d96 100755 --- a/cluster/images/provider-gcp/Makefile +++ b/cluster/images/provider-gcp/Makefile @@ -56,7 +56,10 @@ ifeq (-,$(findstring -,$(VERSION))) endif BUILD_ONLY ?= false STORE_PACKAGES ?= "" +XPKG_CLEANUP_EXAMPLES_VERSION ?= v0.12.1 batch-process: $(UP) + @rm -rf $(WORK_DIR)/xpkg-cleaned-examples + @GOOS=$(HOSTOS) GOARCH=$(TARGETARCH) go run github.com/upbound/uptest/cmd/cleanupexamples@$(XPKG_CLEANUP_EXAMPLES_VERSION) $(ROOT_DIR)/examples $(WORK_DIR)/xpkg-cleaned-examples || $(FAIL) @$(INFO) Batch processing smaller provider packages for: "$(SUBPACKAGES)" @mkdir -p "$(XPKG_OUTPUT_DIR)/$(PLATFORM)" && \ $(UP) xpkg batch --smaller-providers "$$(tr ' ' ',' <<< "$(SUBPACKAGES)")" \ @@ -69,7 +72,7 @@ batch-process: $(UP) --output-dir $(XPKG_OUTPUT_DIR) \ --store-packages "$(STORE_PACKAGES)" \ --build-only=$(BUILD_ONLY) \ - --examples-root $(ROOT_DIR)/examples \ + --examples-root $(WORK_DIR)/xpkg-cleaned-examples \ --examples-group-override monolith=* --examples-group-override config=providerconfig \ --auth-ext $(XPKG_DIR)/auth.yaml \ --crd-root $(XPKG_DIR)/crds \ @@ -80,3 +83,4 @@ batch-process: $(UP) --concurrency $(CONCURRENCY) \ --push-retry 10 || $(FAIL) @$(OK) Done processing smaller provider packages for: "$(SUBPACKAGES)" + @rm -rf $(WORK_DIR)/xpkg-cleaned-examples From 65d3e87c1db9e5e72c1d95c6a6e835823cde7fa6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:51:56 +0000 Subject: [PATCH 05/34] Update dependency ubuntu to v24 --- .github/workflows/scan.yml | 2 +- .github/workflows/stale.yml | 2 +- .github/workflows/uptest-all.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index 87f2dcb68..8ac40c424 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -26,7 +26,7 @@ env: jobs: setup-vars: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: supported_releases_number: ${{ steps.setup.outputs.supported_releases_number }} images: ${{ steps.setup.outputs.images }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 23dd3c812..6289cfba0 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ permissions: jobs: stale: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9 with: diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index a4f89d256..e3ec6bb57 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -14,7 +14,7 @@ env: jobs: detect-api-groups: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 outputs: api_groups: ${{ steps.api-groups.outputs.list }} steps: @@ -38,7 +38,7 @@ jobs: echo "list=${OUTPUT}" >> $GITHUB_OUTPUT uptest: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: detect-api-groups strategy: fail-fast: false @@ -136,7 +136,7 @@ jobs: kubectl delete managed --all report: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: uptest if: always() env: From 96df70373455eaebad37bfd755c8476baac3f95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergen=20Yal=C3=A7=C4=B1n?= Date: Fri, 27 Sep 2024 12:55:09 +0300 Subject: [PATCH 06/34] Use different parameters name for auth and config group overrides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sergen Yalçın --- Makefile | 6 ++++++ cluster/images/provider-gcp/Makefile | 4 ++-- package/crossplane.yaml.tmpl | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b148860fe..d10c115a2 100644 --- a/Makefile +++ b/Makefile @@ -118,6 +118,12 @@ export XPKG_REG_ORGS_NO_PROMOTE := $(XPKG_REG_ORGS_NO_PROMOTE) export XPKG_DIR := $(XPKG_DIR) export XPKG_IGNORE := $(XPKG_IGNORE) +CONFIG_CRD_GROUP = $(PROVIDER_NAME) +PROVIDER_AUTH_GROUP = $(PROVIDER_NAME) + +export CONFIG_CRD_GROUP := $(CONFIG_CRD_GROUP) +export PROVIDER_AUTH_GROUP := $(PROVIDER_AUTH_GROUP) + -include build/makelib/xpkg.mk # ==================================================================================== diff --git a/cluster/images/provider-gcp/Makefile b/cluster/images/provider-gcp/Makefile index 683f30d96..4fac2ec65 100755 --- a/cluster/images/provider-gcp/Makefile +++ b/cluster/images/provider-gcp/Makefile @@ -77,9 +77,9 @@ batch-process: $(UP) --auth-ext $(XPKG_DIR)/auth.yaml \ --crd-root $(XPKG_DIR)/crds \ --ignore $(XPKG_IGNORE) \ - --crd-group-override monolith=* --crd-group-override config=$(PROVIDER_NAME) \ + --crd-group-override monolith=* --crd-group-override config=$(CONFIG_CRD_GROUP) \ --package-metadata-template $(XPKG_DIR)/crossplane.yaml.tmpl \ - --template-var XpkgRegOrg=$(XPKG_REG_ORGS) --template-var DepConstraint="$(DEP_CONSTRAINT)" --template-var ProviderName=$(PROVIDER_NAME) \ + --template-var XpkgRegOrg=$(XPKG_REG_ORGS) --template-var DepConstraint="$(DEP_CONSTRAINT)" --template-var ProviderName=$(PROVIDER_NAME) --template-var ProviderAuthGroup=$(PROVIDER_AUTH_GROUP) \ --concurrency $(CONCURRENCY) \ --push-retry 10 || $(FAIL) @$(OK) Done processing smaller provider packages for: "$(SUBPACKAGES)" diff --git a/package/crossplane.yaml.tmpl b/package/crossplane.yaml.tmpl index 7c0197e06..8a605d4c9 100644 --- a/package/crossplane.yaml.tmpl +++ b/package/crossplane.yaml.tmpl @@ -26,7 +26,7 @@ metadata: If you encounter an issue please reach out on support@upbound.io email address. This is a subpackage for the {{ .Service }} API group. friendly-name.meta.crossplane.io: Provider GCP ({{ .Service }}) - auth.upbound.io/group: {{ .ProviderName }}.upbound.io + auth.upbound.io/group: {{ .ProviderAuthGroup }}.upbound.io spec: {{ if ne .Service "monolith" }} crossplane: From 1e02d8b20c52c0102e89e20e08e2e159a5be4bd3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 08:03:47 +0000 Subject: [PATCH 07/34] Update docker/setup-buildx-action digest to c47758b --- .github/workflows/uptest-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index a4f89d256..740d4df67 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -53,7 +53,7 @@ jobs: platforms: all - name: Setup Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3 with: version: ${{ env.DOCKER_BUILDX_VERSION }} install: true From 2baaaaa2b7419fec797b72eb72b845f6c901ec7f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:11:27 +0000 Subject: [PATCH 08/34] Update actions/checkout digest to eef6144 --- .github/workflows/uptest-all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index 0d75f4bbd..1e4c9641e 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -19,7 +19,7 @@ jobs: api_groups: ${{ steps.api-groups.outputs.list }} steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: submodules: true - name: Detect Api Groups @@ -59,7 +59,7 @@ jobs: install: true - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: submodules: true @@ -143,7 +143,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: submodules: true - name: Manual Intervention Report From fb846fb5067d602d51ac157615cf237e3ca906e2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:33:31 +0000 Subject: [PATCH 09/34] Update actions/upload-artifact digest to 604373d --- .github/workflows/uptest-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index 1e4c9641e..33f530c9b 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -125,7 +125,7 @@ jobs: - name: Upload Cluster Dump if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4 + uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4 with: name: cluster-dump-gcp path: ./_output/cluster-dump From 96773c5e608d402efa2788fe7619083cbe18804c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:33:57 +0000 Subject: [PATCH 10/34] Update actions/cache digest to 3624ceb --- .github/workflows/uptest-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index 1e4c9641e..aa23bc337 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -76,14 +76,14 @@ jobs: run: echo "cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-uptest-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-uptest- - name: Cache Go Dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 + uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} From 49152f71ed16643d26d97e0e84a478a93729df57 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 17:10:53 +0000 Subject: [PATCH 11/34] Update actions/upload-artifact digest to b4b15b8 --- .github/workflows/uptest-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index 93718e5a8..4974330cc 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -125,7 +125,7 @@ jobs: - name: Upload Cluster Dump if: always() - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 with: name: cluster-dump-gcp path: ./_output/cluster-dump From 7f2b7eb269ed606d3cbe9bb9591d77b255dc5426 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:12:14 +0000 Subject: [PATCH 12/34] Update actions/cache digest to 6849a64 --- .github/workflows/uptest-all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index 4974330cc..f28953d5e 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -76,14 +76,14 @@ jobs: run: echo "cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-uptest-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-uptest- - name: Cache Go Dependencies - uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4 + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} From f8fddc01b2129aefe35b32e1b9908968f0211bdd Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 9 Oct 2024 11:10:47 +0200 Subject: [PATCH 13/34] Update Upjet to v1.4.1-0.20241007154751-5cdf36996e4a This includes PR 441 which fixes scraping of Refs which contains lists. See upjet v1.4.1-0.20241007154751-5cdf36996e4a Signed-off-by: Rickard von Essen --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 78221c8be..c3f463ca6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( dario.cat/mergo v1.0.0 github.com/crossplane/crossplane-runtime v1.16.0-rc.2.0.20240510094504-3f697876fa57 github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 - github.com/crossplane/upjet v1.4.1-0.20240911184956-3afbb7796d46 + github.com/crossplane/upjet v1.4.1-0.20241007154751-5cdf36996e4a github.com/hashicorp/terraform-json v0.22.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 github.com/hashicorp/terraform-provider-google v1.20.1-0.20240729180617-5093dfd2a5ea diff --git a/go.sum b/go.sum index 5cb96ba68..68adb3945 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/crossplane/crossplane-runtime v1.16.0-rc.2.0.20240510094504-3f697876f github.com/crossplane/crossplane-runtime v1.16.0-rc.2.0.20240510094504-3f697876fa57/go.mod h1:Pz2tdGVMF6KDGzHZOkvKro0nKc8EzK0sb/nSA7pH4Dc= github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 h1:HigXs5tEQxWz0fcj8hzbU2UAZgEM7wPe0XRFOsrtF8Y= github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79/go.mod h1:+e4OaFlOcmr0JvINHl/yvEYBrZawzTgj6pQumOH1SS0= -github.com/crossplane/upjet v1.4.1-0.20240911184956-3afbb7796d46 h1:2IH1YPTBrNmBj0Z1OCjEBTrQCuRaLutZbWLaswFeCFQ= -github.com/crossplane/upjet v1.4.1-0.20240911184956-3afbb7796d46/go.mod h1:wkdZf/Cvhr6PI30VdHIOjg4dX39Z5uijqnLWFk5PbGM= +github.com/crossplane/upjet v1.4.1-0.20241007154751-5cdf36996e4a h1:XC/M8NTYAQi9D8ixoSZEg2+BAJPDBx6fTeexdMtHyk0= +github.com/crossplane/upjet v1.4.1-0.20241007154751-5cdf36996e4a/go.mod h1:wkdZf/Cvhr6PI30VdHIOjg4dX39Z5uijqnLWFk5PbGM= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/dave/jennifer v1.4.1 h1:XyqG6cn5RQsTj3qlWQTKlRGAyrTcsk1kUmWdZBzRjDw= From fca66b0259260fadb5a0b0ed232cf1b7f2988f71 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 9 Oct 2024 11:15:01 +0200 Subject: [PATCH 14/34] Regenerated resources Signed-off-by: Rickard von Essen --- .../v1beta2/zz_appconnection_types.go | 20 ++ .../v1beta2/zz_generated.deepcopy.go | 24 ++ .../v1beta2/zz_generated.resolvers.go | 39 +++ .../v1beta2/zz_generated.deepcopy.go | 48 +++ .../v1beta2/zz_generated.resolvers.go | 97 ++++++ .../v1beta2/zz_policy_types.go | 36 ++ .../v1beta1/zz_certificatemapentry_types.go | 25 +- .../v1beta1/zz_generated.deepcopy.go | 24 ++ .../v1beta1/zz_generated.resolvers.go | 43 ++- .../v1beta2/zz_certificate_types.go | 40 +++ .../v1beta2/zz_generated.deepcopy.go | 48 +++ .../v1beta2/zz_generated.resolvers.go | 115 +++++++ .../cloudrun/v1beta2/zz_generated.deepcopy.go | 48 +++ .../v1beta2/zz_generated.resolvers.go | 107 ++++++ apis/cloudrun/v1beta2/zz_v2job_types.go | 20 ++ apis/cloudrun/v1beta2/zz_v2service_types.go | 20 ++ apis/compute/v1beta1/zz_generated.deepcopy.go | 48 +++ .../compute/v1beta1/zz_generated.resolvers.go | 78 +++++ .../compute/v1beta1/zz_instancegroup_types.go | 20 ++ .../zz_interconnectattachment_types.go | 20 ++ apis/compute/v1beta2/zz_generated.deepcopy.go | 72 ++++ .../compute/v1beta2/zz_generated.resolvers.go | 128 +++++++ .../v1beta2/zz_instancetemplate_types.go | 20 ++ apis/compute/v1beta2/zz_routernat_types.go | 40 +++ .../osconfig/v1beta2/zz_generated.deepcopy.go | 25 ++ .../v1beta2/zz_generated.resolvers.go | 73 ++++ .../v1beta2/zz_patchdeployment_types.go | 20 ++ config/provider-metadata.yaml | 113 +++++++ .../beyondcorp/v1beta2/appconnection.yaml | 4 +- .../binaryauthorization/v1beta2/policy.yaml | 4 +- .../v1beta1/certificatemapentry.yaml | 16 +- .../v1beta2/certificate.yaml | 12 +- .../compute/v1beta2/instancetemplate.yaml | 4 +- ...ondcorp.gcp.upbound.io_appconnections.yaml | 158 +++++++++ ...authorization.gcp.upbound.io_policies.yaml | 316 ++++++++++++++++++ ....gcp.upbound.io_certificatemapentries.yaml | 163 ++++++++- ...temanager.gcp.upbound.io_certificates.yaml | 316 ++++++++++++++++++ .../crds/cloudrun.gcp.upbound.io_v2jobs.yaml | 158 +++++++++ .../cloudrun.gcp.upbound.io_v2services.yaml | 158 +++++++++ ...compute.gcp.upbound.io_instancegroups.yaml | 156 +++++++++ ...pute.gcp.upbound.io_instancetemplates.yaml | 158 +++++++++ ...cp.upbound.io_interconnectattachments.yaml | 156 +++++++++ .../compute.gcp.upbound.io_routernats.yaml | 314 +++++++++++++++++ ...onfig.gcp.upbound.io_patchdeployments.yaml | 158 +++++++++ 44 files changed, 3633 insertions(+), 29 deletions(-) create mode 100644 apis/certificatemanager/v1beta2/zz_generated.resolvers.go create mode 100644 apis/osconfig/v1beta2/zz_generated.resolvers.go diff --git a/apis/beyondcorp/v1beta2/zz_appconnection_types.go b/apis/beyondcorp/v1beta2/zz_appconnection_types.go index c5fce9c5c..98b80a7e8 100755 --- a/apis/beyondcorp/v1beta2/zz_appconnection_types.go +++ b/apis/beyondcorp/v1beta2/zz_appconnection_types.go @@ -20,8 +20,18 @@ type AppConnectionInitParameters struct { ApplicationEndpoint *ApplicationEndpointInitParameters `json:"applicationEndpoint,omitempty" tf:"application_endpoint,omitempty"` // List of AppConnectors that are authorised to be associated with this AppConnection + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/beyondcorp/v1beta2.AppConnector + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() Connectors []*string `json:"connectors,omitempty" tf:"connectors,omitempty"` + // References to AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsRefs []v1.Reference `json:"connectorsRefs,omitempty" tf:"-"` + + // Selector for a list of AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsSelector *v1.Selector `json:"connectorsSelector,omitempty" tf:"-"` + // An arbitrary user-provided name for the AppConnection. DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` @@ -104,9 +114,19 @@ type AppConnectionParameters struct { ApplicationEndpoint *ApplicationEndpointParameters `json:"applicationEndpoint,omitempty" tf:"application_endpoint,omitempty"` // List of AppConnectors that are authorised to be associated with this AppConnection + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/beyondcorp/v1beta2.AppConnector + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional Connectors []*string `json:"connectors,omitempty" tf:"connectors,omitempty"` + // References to AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsRefs []v1.Reference `json:"connectorsRefs,omitempty" tf:"-"` + + // Selector for a list of AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsSelector *v1.Selector `json:"connectorsSelector,omitempty" tf:"-"` + // An arbitrary user-provided name for the AppConnection. // +kubebuilder:validation:Optional DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` diff --git a/apis/beyondcorp/v1beta2/zz_generated.deepcopy.go b/apis/beyondcorp/v1beta2/zz_generated.deepcopy.go index 44ca4450e..8f5517f71 100644 --- a/apis/beyondcorp/v1beta2/zz_generated.deepcopy.go +++ b/apis/beyondcorp/v1beta2/zz_generated.deepcopy.go @@ -59,6 +59,18 @@ func (in *AppConnectionInitParameters) DeepCopyInto(out *AppConnectionInitParame } } } + if in.ConnectorsRefs != nil { + in, out := &in.ConnectorsRefs, &out.ConnectorsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConnectorsSelector != nil { + in, out := &in.ConnectorsSelector, &out.ConnectorsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DisplayName != nil { in, out := &in.DisplayName, &out.DisplayName *out = new(string) @@ -282,6 +294,18 @@ func (in *AppConnectionParameters) DeepCopyInto(out *AppConnectionParameters) { } } } + if in.ConnectorsRefs != nil { + in, out := &in.ConnectorsRefs, &out.ConnectorsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConnectorsSelector != nil { + in, out := &in.ConnectorsSelector, &out.ConnectorsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DisplayName != nil { in, out := &in.DisplayName, &out.DisplayName *out = new(string) diff --git a/apis/beyondcorp/v1beta2/zz_generated.resolvers.go b/apis/beyondcorp/v1beta2/zz_generated.resolvers.go index 254d8c4a3..6a2fce598 100644 --- a/apis/beyondcorp/v1beta2/zz_generated.resolvers.go +++ b/apis/beyondcorp/v1beta2/zz_generated.resolvers.go @@ -24,7 +24,27 @@ func (mg *AppConnection) ResolveReferences( // ResolveReferences of this AppConn r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("beyondcorp.gcp.upbound.io", "v1beta2", "AppConnector", "AppConnectorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Connectors), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.ConnectorsRefs, + Selector: mg.Spec.ForProvider.ConnectorsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Connectors") + } + mg.Spec.ForProvider.Connectors = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.ConnectorsRefs = mrsp.ResolvedReferences if mg.Spec.ForProvider.Gateway != nil { { @@ -47,6 +67,25 @@ func (mg *AppConnection) ResolveReferences( // ResolveReferences of this AppConn mg.Spec.ForProvider.Gateway.AppGatewayRef = rsp.ResolvedReference } + { + m, l, err = apisresolver.GetManagedResource("beyondcorp.gcp.upbound.io", "v1beta2", "AppConnector", "AppConnectorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Connectors), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.ConnectorsRefs, + Selector: mg.Spec.InitProvider.ConnectorsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Connectors") + } + mg.Spec.InitProvider.Connectors = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.ConnectorsRefs = mrsp.ResolvedReferences + if mg.Spec.InitProvider.Gateway != nil { { m, l, err = apisresolver.GetManagedResource("beyondcorp.gcp.upbound.io", "v1beta1", "AppGateway", "AppGatewayList") diff --git a/apis/binaryauthorization/v1beta2/zz_generated.deepcopy.go b/apis/binaryauthorization/v1beta2/zz_generated.deepcopy.go index c80294b9a..341753974 100644 --- a/apis/binaryauthorization/v1beta2/zz_generated.deepcopy.go +++ b/apis/binaryauthorization/v1beta2/zz_generated.deepcopy.go @@ -397,6 +397,18 @@ func (in *ClusterAdmissionRulesInitParameters) DeepCopyInto(out *ClusterAdmissio } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAdmissionRulesInitParameters. @@ -479,6 +491,18 @@ func (in *ClusterAdmissionRulesParameters) DeepCopyInto(out *ClusterAdmissionRul } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAdmissionRulesParameters. @@ -515,6 +539,18 @@ func (in *DefaultAdmissionRuleInitParameters) DeepCopyInto(out *DefaultAdmission } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultAdmissionRuleInitParameters. @@ -587,6 +623,18 @@ func (in *DefaultAdmissionRuleParameters) DeepCopyInto(out *DefaultAdmissionRule } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultAdmissionRuleParameters. diff --git a/apis/binaryauthorization/v1beta2/zz_generated.resolvers.go b/apis/binaryauthorization/v1beta2/zz_generated.resolvers.go index cea7c5624..5184f4710 100644 --- a/apis/binaryauthorization/v1beta2/zz_generated.resolvers.go +++ b/apis/binaryauthorization/v1beta2/zz_generated.resolvers.go @@ -71,3 +71,100 @@ func (mg *Attestor) ResolveReferences(ctx context.Context, c client.Reader) erro return nil } + +// ResolveReferences of this Policy. +func (mg *Policy) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var mrsp reference.MultiResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.ClusterAdmissionRules); i3++ { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs, + Selector: mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBy") + } + mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + if mg.Spec.ForProvider.DefaultAdmissionRule != nil { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.DefaultAdmissionRule.RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.DefaultAdmissionRule.RequireAttestationsByRefs, + Selector: mg.Spec.ForProvider.DefaultAdmissionRule.RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DefaultAdmissionRule.RequireAttestationsBy") + } + mg.Spec.ForProvider.DefaultAdmissionRule.RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.DefaultAdmissionRule.RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.ClusterAdmissionRules); i3++ { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs, + Selector: mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBy") + } + mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + if mg.Spec.InitProvider.DefaultAdmissionRule != nil { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.DefaultAdmissionRule.RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.DefaultAdmissionRule.RequireAttestationsByRefs, + Selector: mg.Spec.InitProvider.DefaultAdmissionRule.RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DefaultAdmissionRule.RequireAttestationsBy") + } + mg.Spec.InitProvider.DefaultAdmissionRule.RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.DefaultAdmissionRule.RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + + return nil +} diff --git a/apis/binaryauthorization/v1beta2/zz_policy_types.go b/apis/binaryauthorization/v1beta2/zz_policy_types.go index 3b9281988..05a21a48e 100755 --- a/apis/binaryauthorization/v1beta2/zz_policy_types.go +++ b/apis/binaryauthorization/v1beta2/zz_policy_types.go @@ -62,8 +62,17 @@ type ClusterAdmissionRulesInitParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type ClusterAdmissionRulesObservation struct { @@ -115,9 +124,18 @@ type ClusterAdmissionRulesParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +kubebuilder:validation:Optional // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type DefaultAdmissionRuleInitParameters struct { @@ -138,8 +156,17 @@ type DefaultAdmissionRuleInitParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type DefaultAdmissionRuleObservation struct { @@ -184,9 +211,18 @@ type DefaultAdmissionRuleParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +kubebuilder:validation:Optional // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type PolicyInitParameters struct { diff --git a/apis/certificatemanager/v1beta1/zz_certificatemapentry_types.go b/apis/certificatemanager/v1beta1/zz_certificatemapentry_types.go index 63def50a0..4438a38c7 100755 --- a/apis/certificatemanager/v1beta1/zz_certificatemapentry_types.go +++ b/apis/certificatemanager/v1beta1/zz_certificatemapentry_types.go @@ -18,8 +18,18 @@ type CertificateMapEntryInitParameters struct { // A set of Certificates defines for the given hostname. // There can be defined up to fifteen certificates in each Certificate Map Entry. // Each certificate must match pattern projects//locations//certificates/*. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta2.Certificate + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() Certificates []*string `json:"certificates,omitempty" tf:"certificates,omitempty"` + // References to Certificate in certificatemanager to populate certificates. + // +kubebuilder:validation:Optional + CertificatesRefs []v1.Reference `json:"certificatesRefs,omitempty" tf:"-"` + + // Selector for a list of Certificate in certificatemanager to populate certificates. + // +kubebuilder:validation:Optional + CertificatesSelector *v1.Selector `json:"certificatesSelector,omitempty" tf:"-"` + // A human-readable description of the resource. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -104,9 +114,19 @@ type CertificateMapEntryParameters struct { // A set of Certificates defines for the given hostname. // There can be defined up to fifteen certificates in each Certificate Map Entry. // Each certificate must match pattern projects//locations//certificates/*. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta2.Certificate + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional Certificates []*string `json:"certificates,omitempty" tf:"certificates,omitempty"` + // References to Certificate in certificatemanager to populate certificates. + // +kubebuilder:validation:Optional + CertificatesRefs []v1.Reference `json:"certificatesRefs,omitempty" tf:"-"` + + // Selector for a list of Certificate in certificatemanager to populate certificates. + // +kubebuilder:validation:Optional + CertificatesSelector *v1.Selector `json:"certificatesSelector,omitempty" tf:"-"` + // A human-readable description of the resource. // +kubebuilder:validation:Optional Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -183,9 +203,8 @@ type CertificateMapEntryStatus struct { type CertificateMapEntry struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.certificates) || (has(self.initProvider) && has(self.initProvider.certificates))",message="spec.forProvider.certificates is a required parameter" - Spec CertificateMapEntrySpec `json:"spec"` - Status CertificateMapEntryStatus `json:"status,omitempty"` + Spec CertificateMapEntrySpec `json:"spec"` + Status CertificateMapEntryStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go b/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go index 136dfa4e0..4115b78b8 100644 --- a/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go +++ b/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go @@ -265,6 +265,18 @@ func (in *CertificateMapEntryInitParameters) DeepCopyInto(out *CertificateMapEnt } } } + if in.CertificatesRefs != nil { + in, out := &in.CertificatesRefs, &out.CertificatesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CertificatesSelector != nil { + in, out := &in.CertificatesSelector, &out.CertificatesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) @@ -478,6 +490,18 @@ func (in *CertificateMapEntryParameters) DeepCopyInto(out *CertificateMapEntryPa } } } + if in.CertificatesRefs != nil { + in, out := &in.CertificatesRefs, &out.CertificatesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CertificatesSelector != nil { + in, out := &in.CertificatesSelector, &out.CertificatesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) diff --git a/apis/certificatemanager/v1beta1/zz_generated.resolvers.go b/apis/certificatemanager/v1beta1/zz_generated.resolvers.go index 79eaca2ba..d9d03ae39 100644 --- a/apis/certificatemanager/v1beta1/zz_generated.resolvers.go +++ b/apis/certificatemanager/v1beta1/zz_generated.resolvers.go @@ -9,8 +9,10 @@ package v1beta1 import ( "context" reference "github.com/crossplane/crossplane-runtime/pkg/reference" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + resource "github.com/crossplane/upjet/pkg/resource" errors "github.com/pkg/errors" + + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" apisresolver "github.com/upbound/provider-gcp/internal/apis" client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -22,7 +24,27 @@ func (mg *CertificateMapEntry) ResolveReferences( // ResolveReferences of this C r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta2", "Certificate", "CertificateList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Certificates), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.CertificatesRefs, + Selector: mg.Spec.ForProvider.CertificatesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Certificates") + } + mg.Spec.ForProvider.Certificates = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.CertificatesRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "CertificateMap", "CertificateMapList") if err != nil { @@ -42,6 +64,25 @@ func (mg *CertificateMapEntry) ResolveReferences( // ResolveReferences of this C } mg.Spec.ForProvider.Map = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.MapRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta2", "Certificate", "CertificateList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Certificates), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.CertificatesRefs, + Selector: mg.Spec.InitProvider.CertificatesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Certificates") + } + mg.Spec.InitProvider.Certificates = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.CertificatesRefs = mrsp.ResolvedReferences return nil } diff --git a/apis/certificatemanager/v1beta2/zz_certificate_types.go b/apis/certificatemanager/v1beta2/zz_certificate_types.go index cdd8bd6e6..5d374a52f 100755 --- a/apis/certificatemanager/v1beta2/zz_certificate_types.go +++ b/apis/certificatemanager/v1beta2/zz_certificate_types.go @@ -178,12 +178,32 @@ type CertificateParameters struct { type ManagedInitParameters struct { // Authorizations that will be used for performing domain authorization. Either issuanceConfig or dnsAuthorizations should be specificed, but not both. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() DNSAuthorizations []*string `json:"dnsAuthorizations,omitempty" tf:"dns_authorizations,omitempty"` + // References to DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsRefs []v1.Reference `json:"dnsAuthorizationsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsSelector *v1.Selector `json:"dnsAuthorizationsSelector,omitempty" tf:"-"` + // The domains for which a managed SSL certificate will be generated. // Wildcard domains are only supported with DNS challenge resolution + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("domain",false) Domains []*string `json:"domains,omitempty" tf:"domains,omitempty"` + // References to DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsRefs []v1.Reference `json:"domainsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsSelector *v1.Selector `json:"domainsSelector,omitempty" tf:"-"` + // The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. // If this field is not set, the certificates will instead be publicly signed as documented at https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa. // Either issuanceConfig or dnsAuthorizations should be specificed, but not both. @@ -223,14 +243,34 @@ type ManagedObservation struct { type ManagedParameters struct { // Authorizations that will be used for performing domain authorization. Either issuanceConfig or dnsAuthorizations should be specificed, but not both. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional DNSAuthorizations []*string `json:"dnsAuthorizations,omitempty" tf:"dns_authorizations,omitempty"` + // References to DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsRefs []v1.Reference `json:"dnsAuthorizationsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsSelector *v1.Selector `json:"dnsAuthorizationsSelector,omitempty" tf:"-"` + // The domains for which a managed SSL certificate will be generated. // Wildcard domains are only supported with DNS challenge resolution + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("domain",false) // +kubebuilder:validation:Optional Domains []*string `json:"domains,omitempty" tf:"domains,omitempty"` + // References to DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsRefs []v1.Reference `json:"domainsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsSelector *v1.Selector `json:"domainsSelector,omitempty" tf:"-"` + // The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. // If this field is not set, the certificates will instead be publicly signed as documented at https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa. // Either issuanceConfig or dnsAuthorizations should be specificed, but not both. diff --git a/apis/certificatemanager/v1beta2/zz_generated.deepcopy.go b/apis/certificatemanager/v1beta2/zz_generated.deepcopy.go index 03358b854..c80f0d917 100644 --- a/apis/certificatemanager/v1beta2/zz_generated.deepcopy.go +++ b/apis/certificatemanager/v1beta2/zz_generated.deepcopy.go @@ -401,6 +401,18 @@ func (in *ManagedInitParameters) DeepCopyInto(out *ManagedInitParameters) { } } } + if in.DNSAuthorizationsRefs != nil { + in, out := &in.DNSAuthorizationsRefs, &out.DNSAuthorizationsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DNSAuthorizationsSelector != nil { + in, out := &in.DNSAuthorizationsSelector, &out.DNSAuthorizationsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Domains != nil { in, out := &in.Domains, &out.Domains *out = make([]*string, len(*in)) @@ -412,6 +424,18 @@ func (in *ManagedInitParameters) DeepCopyInto(out *ManagedInitParameters) { } } } + if in.DomainsRefs != nil { + in, out := &in.DomainsRefs, &out.DomainsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DomainsSelector != nil { + in, out := &in.DomainsSelector, &out.DomainsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.IssuanceConfig != nil { in, out := &in.IssuanceConfig, &out.IssuanceConfig *out = new(string) @@ -504,6 +528,18 @@ func (in *ManagedParameters) DeepCopyInto(out *ManagedParameters) { } } } + if in.DNSAuthorizationsRefs != nil { + in, out := &in.DNSAuthorizationsRefs, &out.DNSAuthorizationsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DNSAuthorizationsSelector != nil { + in, out := &in.DNSAuthorizationsSelector, &out.DNSAuthorizationsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Domains != nil { in, out := &in.Domains, &out.Domains *out = make([]*string, len(*in)) @@ -515,6 +551,18 @@ func (in *ManagedParameters) DeepCopyInto(out *ManagedParameters) { } } } + if in.DomainsRefs != nil { + in, out := &in.DomainsRefs, &out.DomainsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DomainsSelector != nil { + in, out := &in.DomainsSelector, &out.DomainsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.IssuanceConfig != nil { in, out := &in.IssuanceConfig, &out.IssuanceConfig *out = new(string) diff --git a/apis/certificatemanager/v1beta2/zz_generated.resolvers.go b/apis/certificatemanager/v1beta2/zz_generated.resolvers.go new file mode 100644 index 000000000..1e8b599b8 --- /dev/null +++ b/apis/certificatemanager/v1beta2/zz_generated.resolvers.go @@ -0,0 +1,115 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 +// Code generated by angryjet. DO NOT EDIT. +// Code transformed by upjet. DO NOT EDIT. + +package v1beta2 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" + errors "github.com/pkg/errors" + + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + apisresolver "github.com/upbound/provider-gcp/internal/apis" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +func (mg *Certificate) ResolveReferences( // ResolveReferences of this Certificate. + ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var mrsp reference.MultiResolutionResponse + var err error + + if mg.Spec.ForProvider.Managed != nil { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Managed.DNSAuthorizations), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.Managed.DNSAuthorizationsRefs, + Selector: mg.Spec.ForProvider.Managed.DNSAuthorizationsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Managed.DNSAuthorizations") + } + mg.Spec.ForProvider.Managed.DNSAuthorizations = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Managed.DNSAuthorizationsRefs = mrsp.ResolvedReferences + + } + if mg.Spec.ForProvider.Managed != nil { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Managed.Domains), + Extract: resource.ExtractParamPath("domain", false), + References: mg.Spec.ForProvider.Managed.DomainsRefs, + Selector: mg.Spec.ForProvider.Managed.DomainsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Managed.Domains") + } + mg.Spec.ForProvider.Managed.Domains = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Managed.DomainsRefs = mrsp.ResolvedReferences + + } + if mg.Spec.InitProvider.Managed != nil { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Managed.DNSAuthorizations), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.Managed.DNSAuthorizationsRefs, + Selector: mg.Spec.InitProvider.Managed.DNSAuthorizationsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Managed.DNSAuthorizations") + } + mg.Spec.InitProvider.Managed.DNSAuthorizations = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Managed.DNSAuthorizationsRefs = mrsp.ResolvedReferences + + } + if mg.Spec.InitProvider.Managed != nil { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Managed.Domains), + Extract: resource.ExtractParamPath("domain", false), + References: mg.Spec.InitProvider.Managed.DomainsRefs, + Selector: mg.Spec.InitProvider.Managed.DomainsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Managed.Domains") + } + mg.Spec.InitProvider.Managed.Domains = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Managed.DomainsRefs = mrsp.ResolvedReferences + + } + + return nil +} diff --git a/apis/cloudrun/v1beta2/zz_generated.deepcopy.go b/apis/cloudrun/v1beta2/zz_generated.deepcopy.go index b536ca61e..47bf8790c 100644 --- a/apis/cloudrun/v1beta2/zz_generated.deepcopy.go +++ b/apis/cloudrun/v1beta2/zz_generated.deepcopy.go @@ -102,6 +102,18 @@ func (in *CloudSQLInstanceInitParameters) DeepCopyInto(out *CloudSQLInstanceInit } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSQLInstanceInitParameters. @@ -154,6 +166,18 @@ func (in *CloudSQLInstanceParameters) DeepCopyInto(out *CloudSQLInstanceParamete } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSQLInstanceParameters. @@ -10665,6 +10689,18 @@ func (in *VolumesCloudSQLInstanceInitParameters) DeepCopyInto(out *VolumesCloudS } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumesCloudSQLInstanceInitParameters. @@ -10717,6 +10753,18 @@ func (in *VolumesCloudSQLInstanceParameters) DeepCopyInto(out *VolumesCloudSQLIn } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumesCloudSQLInstanceParameters. diff --git a/apis/cloudrun/v1beta2/zz_generated.resolvers.go b/apis/cloudrun/v1beta2/zz_generated.resolvers.go index 6893f6467..5e51929c4 100644 --- a/apis/cloudrun/v1beta2/zz_generated.resolvers.go +++ b/apis/cloudrun/v1beta2/zz_generated.resolvers.go @@ -9,6 +9,7 @@ package v1beta2 import ( "context" reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" errors "github.com/pkg/errors" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" @@ -379,6 +380,7 @@ func (mg *V2Job) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error if mg.Spec.ForProvider.Template != nil { @@ -412,6 +414,33 @@ func (mg *V2Job) ResolveReferences(ctx context.Context, c client.Reader) error { } } } + if mg.Spec.ForProvider.Template != nil { + if mg.Spec.ForProvider.Template.Template != nil { + for i5 := 0; i5 < len(mg.Spec.ForProvider.Template.Template.Volumes); i5++ { + if mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance != nil { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance.Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance.InstancesRefs, + Selector: mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance.Instances") + } + mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Template.Template.Volumes[i5].CloudSQLInstance.InstancesRefs = mrsp.ResolvedReferences + + } + } + } + } if mg.Spec.ForProvider.Template != nil { if mg.Spec.ForProvider.Template.Template != nil { for i5 := 0; i5 < len(mg.Spec.ForProvider.Template.Template.Volumes); i5++ { @@ -470,6 +499,33 @@ func (mg *V2Job) ResolveReferences(ctx context.Context, c client.Reader) error { } } } + if mg.Spec.InitProvider.Template != nil { + if mg.Spec.InitProvider.Template.Template != nil { + for i5 := 0; i5 < len(mg.Spec.InitProvider.Template.Template.Volumes); i5++ { + if mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance != nil { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance.Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance.InstancesRefs, + Selector: mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance.Instances") + } + mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Template.Template.Volumes[i5].CloudSQLInstance.InstancesRefs = mrsp.ResolvedReferences + + } + } + } + } if mg.Spec.InitProvider.Template != nil { if mg.Spec.InitProvider.Template.Template != nil { for i5 := 0; i5 < len(mg.Spec.InitProvider.Template.Template.Volumes); i5++ { @@ -508,6 +564,7 @@ func (mg *V2Service) ResolveReferences(ctx context.Context, c client.Reader) err r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error if mg.Spec.ForProvider.Template != nil { @@ -539,6 +596,31 @@ func (mg *V2Service) ResolveReferences(ctx context.Context, c client.Reader) err } } } + if mg.Spec.ForProvider.Template != nil { + for i4 := 0; i4 < len(mg.Spec.ForProvider.Template.Volumes); i4++ { + if mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance != nil { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance.Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance.InstancesRefs, + Selector: mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance.Instances") + } + mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Template.Volumes[i4].CloudSQLInstance.InstancesRefs = mrsp.ResolvedReferences + + } + } + } if mg.Spec.ForProvider.Template != nil { for i4 := 0; i4 < len(mg.Spec.ForProvider.Template.Volumes); i4++ { if mg.Spec.ForProvider.Template.Volumes[i4].Gcs != nil { @@ -618,6 +700,31 @@ func (mg *V2Service) ResolveReferences(ctx context.Context, c client.Reader) err } } } + if mg.Spec.InitProvider.Template != nil { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Template.Volumes); i4++ { + if mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance != nil { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance.Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance.InstancesRefs, + Selector: mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance.Instances") + } + mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Template.Volumes[i4].CloudSQLInstance.InstancesRefs = mrsp.ResolvedReferences + + } + } + } if mg.Spec.InitProvider.Template != nil { for i4 := 0; i4 < len(mg.Spec.InitProvider.Template.Volumes); i4++ { if mg.Spec.InitProvider.Template.Volumes[i4].Gcs != nil { diff --git a/apis/cloudrun/v1beta2/zz_v2job_types.go b/apis/cloudrun/v1beta2/zz_v2job_types.go index 75c99b5fe..3ae619e57 100755 --- a/apis/cloudrun/v1beta2/zz_v2job_types.go +++ b/apis/cloudrun/v1beta2/zz_v2job_types.go @@ -45,7 +45,17 @@ type BinaryAuthorizationParameters struct { type CloudSQLInstanceInitParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type CloudSQLInstanceObservation struct { @@ -57,8 +67,18 @@ type CloudSQLInstanceObservation struct { type CloudSQLInstanceParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) // +kubebuilder:validation:Optional Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type ContainersEnvInitParameters struct { diff --git a/apis/cloudrun/v1beta2/zz_v2service_types.go b/apis/cloudrun/v1beta2/zz_v2service_types.go index 28c605701..ad78cf5ce 100755 --- a/apis/cloudrun/v1beta2/zz_v2service_types.go +++ b/apis/cloudrun/v1beta2/zz_v2service_types.go @@ -1825,8 +1825,18 @@ type VPCAccessNetworkInterfacesParameters struct { type VolumesCloudSQLInstanceInitParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) // +listType=set Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type VolumesCloudSQLInstanceObservation struct { @@ -1839,9 +1849,19 @@ type VolumesCloudSQLInstanceObservation struct { type VolumesCloudSQLInstanceParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) // +kubebuilder:validation:Optional // +listType=set Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type VolumesSecretItemsInitParameters struct { diff --git a/apis/compute/v1beta1/zz_generated.deepcopy.go b/apis/compute/v1beta1/zz_generated.deepcopy.go index 883528cc3..734dc72ca 100644 --- a/apis/compute/v1beta1/zz_generated.deepcopy.go +++ b/apis/compute/v1beta1/zz_generated.deepcopy.go @@ -23665,6 +23665,18 @@ func (in *InstanceGroupInitParameters) DeepCopyInto(out *InstanceGroupInitParame } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.NamedPort != nil { in, out := &in.NamedPort, &out.NamedPort *out = make([]NamedPortInitParameters, len(*in)) @@ -24654,6 +24666,18 @@ func (in *InstanceGroupParameters) DeepCopyInto(out *InstanceGroupParameters) { } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.NamedPort != nil { in, out := &in.NamedPort, &out.NamedPort *out = make([]NamedPortParameters, len(*in)) @@ -29301,6 +29325,18 @@ func (in *InterconnectAttachmentInitParameters) DeepCopyInto(out *InterconnectAt } } } + if in.IpsecInternalAddressesRefs != nil { + in, out := &in.IpsecInternalAddressesRefs, &out.IpsecInternalAddressesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.IpsecInternalAddressesSelector != nil { + in, out := &in.IpsecInternalAddressesSelector, &out.IpsecInternalAddressesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Mtu != nil { in, out := &in.Mtu, &out.Mtu *out = new(string) @@ -29614,6 +29650,18 @@ func (in *InterconnectAttachmentParameters) DeepCopyInto(out *InterconnectAttach } } } + if in.IpsecInternalAddressesRefs != nil { + in, out := &in.IpsecInternalAddressesRefs, &out.IpsecInternalAddressesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.IpsecInternalAddressesSelector != nil { + in, out := &in.IpsecInternalAddressesSelector, &out.IpsecInternalAddressesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Mtu != nil { in, out := &in.Mtu, &out.Mtu *out = new(string) diff --git a/apis/compute/v1beta1/zz_generated.resolvers.go b/apis/compute/v1beta1/zz_generated.resolvers.go index c3a0cdec4..f2a491047 100644 --- a/apis/compute/v1beta1/zz_generated.resolvers.go +++ b/apis/compute/v1beta1/zz_generated.resolvers.go @@ -1881,7 +1881,27 @@ func (mg *InstanceGroup) ResolveReferences(ctx context.Context, c client.Reader) r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Instance", "InstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Instances), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.InstancesRefs, + Selector: mg.Spec.ForProvider.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Instances") + } + mg.Spec.ForProvider.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.InstancesRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") if err != nil { @@ -1901,6 +1921,25 @@ func (mg *InstanceGroup) ResolveReferences(ctx context.Context, c client.Reader) } mg.Spec.ForProvider.Network = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.NetworkRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Instance", "InstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Instances), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.InstancesRefs, + Selector: mg.Spec.InitProvider.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Instances") + } + mg.Spec.InitProvider.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.InstancesRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") if err != nil { @@ -2298,7 +2337,27 @@ func (mg *InterconnectAttachment) ResolveReferences(ctx context.Context, c clien r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.IpsecInternalAddresses), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.ForProvider.IpsecInternalAddressesRefs, + Selector: mg.Spec.ForProvider.IpsecInternalAddressesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.IpsecInternalAddresses") + } + mg.Spec.ForProvider.IpsecInternalAddresses = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.IpsecInternalAddressesRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Router", "RouterList") if err != nil { @@ -2318,6 +2377,25 @@ func (mg *InterconnectAttachment) ResolveReferences(ctx context.Context, c clien } mg.Spec.ForProvider.Router = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.RouterRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.IpsecInternalAddresses), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.InitProvider.IpsecInternalAddressesRefs, + Selector: mg.Spec.InitProvider.IpsecInternalAddressesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.IpsecInternalAddresses") + } + mg.Spec.InitProvider.IpsecInternalAddresses = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.IpsecInternalAddressesRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Router", "RouterList") if err != nil { diff --git a/apis/compute/v1beta1/zz_instancegroup_types.go b/apis/compute/v1beta1/zz_instancegroup_types.go index 67aa096e9..925c5b8fa 100755 --- a/apis/compute/v1beta1/zz_instancegroup_types.go +++ b/apis/compute/v1beta1/zz_instancegroup_types.go @@ -21,9 +21,19 @@ type InstanceGroupInitParameters struct { // The list of instances in the group, in self_link format. // When adding instances they must all be in the same network and zone as the instance group. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Instance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +listType=set Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + // References to Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` + // The named port configuration. See the section below // for details on configuration. Structure is documented below. NamedPort []NamedPortInitParameters `json:"namedPort,omitempty" tf:"named_port,omitempty"` @@ -96,10 +106,20 @@ type InstanceGroupParameters struct { // The list of instances in the group, in self_link format. // When adding instances they must all be in the same network and zone as the instance group. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Instance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional // +listType=set Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + // References to Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` + // The named port configuration. See the section below // for details on configuration. Structure is documented below. // +kubebuilder:validation:Optional diff --git a/apis/compute/v1beta1/zz_interconnectattachment_types.go b/apis/compute/v1beta1/zz_interconnectattachment_types.go index 8d9db8ebf..eb8618873 100755 --- a/apis/compute/v1beta1/zz_interconnectattachment_types.go +++ b/apis/compute/v1beta1/zz_interconnectattachment_types.go @@ -72,8 +72,18 @@ type InterconnectAttachmentInitParameters struct { // encryption option as IPSEC, later on when creating HA VPN gateway on this // interconnect attachment, the HA VPN gateway's IP address will be // allocated from regional external IP address pool. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) IpsecInternalAddresses []*string `json:"ipsecInternalAddresses,omitempty" tf:"ipsec_internal_addresses,omitempty"` + // References to Address in compute to populate ipsecInternalAddresses. + // +kubebuilder:validation:Optional + IpsecInternalAddressesRefs []v1.Reference `json:"ipsecInternalAddressesRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate ipsecInternalAddresses. + // +kubebuilder:validation:Optional + IpsecInternalAddressesSelector *v1.Selector `json:"ipsecInternalAddressesSelector,omitempty" tf:"-"` + // Maximum Transmission Unit (MTU), in bytes, of packets passing through // this interconnect attachment. Currently, only 1440 and 1500 are allowed. If not specified, the value will default to 1440. Mtu *string `json:"mtu,omitempty" tf:"mtu,omitempty"` @@ -339,9 +349,19 @@ type InterconnectAttachmentParameters struct { // encryption option as IPSEC, later on when creating HA VPN gateway on this // interconnect attachment, the HA VPN gateway's IP address will be // allocated from regional external IP address pool. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +kubebuilder:validation:Optional IpsecInternalAddresses []*string `json:"ipsecInternalAddresses,omitempty" tf:"ipsec_internal_addresses,omitempty"` + // References to Address in compute to populate ipsecInternalAddresses. + // +kubebuilder:validation:Optional + IpsecInternalAddressesRefs []v1.Reference `json:"ipsecInternalAddressesRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate ipsecInternalAddresses. + // +kubebuilder:validation:Optional + IpsecInternalAddressesSelector *v1.Selector `json:"ipsecInternalAddressesSelector,omitempty" tf:"-"` + // Maximum Transmission Unit (MTU), in bytes, of packets passing through // this interconnect attachment. Currently, only 1440 and 1500 are allowed. If not specified, the value will default to 1440. // +kubebuilder:validation:Optional diff --git a/apis/compute/v1beta2/zz_generated.deepcopy.go b/apis/compute/v1beta2/zz_generated.deepcopy.go index 1f1232223..0396c7015 100644 --- a/apis/compute/v1beta2/zz_generated.deepcopy.go +++ b/apis/compute/v1beta2/zz_generated.deepcopy.go @@ -192,6 +192,18 @@ func (in *ActionInitParameters) DeepCopyInto(out *ActionInitParameters) { } } } + if in.SourceNATActiveIpsRefs != nil { + in, out := &in.SourceNATActiveIpsRefs, &out.SourceNATActiveIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SourceNATActiveIpsSelector != nil { + in, out := &in.SourceNATActiveIpsSelector, &out.SourceNATActiveIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.SourceNATDrainIps != nil { in, out := &in.SourceNATDrainIps, &out.SourceNATDrainIps *out = make([]*string, len(*in)) @@ -266,6 +278,18 @@ func (in *ActionParameters) DeepCopyInto(out *ActionParameters) { } } } + if in.SourceNATActiveIpsRefs != nil { + in, out := &in.SourceNATActiveIpsRefs, &out.SourceNATActiveIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SourceNATActiveIpsSelector != nil { + in, out := &in.SourceNATActiveIpsSelector, &out.SourceNATActiveIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.SourceNATDrainIps != nil { in, out := &in.SourceNATDrainIps, &out.SourceNATDrainIps *out = make([]*string, len(*in)) @@ -21407,6 +21431,18 @@ func (in *InstanceTemplateDiskInitParameters) DeepCopyInto(out *InstanceTemplate } } } + if in.ResourcePoliciesRefs != nil { + in, out := &in.ResourcePoliciesRefs, &out.ResourcePoliciesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourcePoliciesSelector != nil { + in, out := &in.ResourcePoliciesSelector, &out.ResourcePoliciesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Source != nil { in, out := &in.Source, &out.Source *out = new(string) @@ -21693,6 +21729,18 @@ func (in *InstanceTemplateDiskParameters) DeepCopyInto(out *InstanceTemplateDisk } } } + if in.ResourcePoliciesRefs != nil { + in, out := &in.ResourcePoliciesRefs, &out.ResourcePoliciesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourcePoliciesSelector != nil { + in, out := &in.ResourcePoliciesSelector, &out.ResourcePoliciesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Source != nil { in, out := &in.Source, &out.Source *out = new(string) @@ -49857,6 +49905,18 @@ func (in *RouterNATInitParameters) DeepCopyInto(out *RouterNATInitParameters) { } } } + if in.NATIpsRefs != nil { + in, out := &in.NATIpsRefs, &out.NATIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NATIpsSelector != nil { + in, out := &in.NATIpsSelector, &out.NATIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Project != nil { in, out := &in.Project, &out.Project *out = new(string) @@ -50243,6 +50303,18 @@ func (in *RouterNATParameters) DeepCopyInto(out *RouterNATParameters) { } } } + if in.NATIpsRefs != nil { + in, out := &in.NATIpsRefs, &out.NATIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NATIpsSelector != nil { + in, out := &in.NATIpsSelector, &out.NATIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Project != nil { in, out := &in.Project, &out.Project *out = new(string) diff --git a/apis/compute/v1beta2/zz_generated.resolvers.go b/apis/compute/v1beta2/zz_generated.resolvers.go index dc59372d0..5c181eabd 100644 --- a/apis/compute/v1beta2/zz_generated.resolvers.go +++ b/apis/compute/v1beta2/zz_generated.resolvers.go @@ -1421,8 +1421,30 @@ func (mg *InstanceTemplate) ResolveReferences(ctx context.Context, c client.Read r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + for i3 := 0; i3 < len(mg.Spec.ForProvider.Disk); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "ResourcePolicy", "ResourcePolicyList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Disk[i3].ResourcePolicies), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.Disk[i3].ResourcePoliciesRefs, + Selector: mg.Spec.ForProvider.Disk[i3].ResourcePoliciesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Disk[i3].ResourcePolicies") + } + mg.Spec.ForProvider.Disk[i3].ResourcePolicies = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Disk[i3].ResourcePoliciesRefs = mrsp.ResolvedReferences + + } for i3 := 0; i3 < len(mg.Spec.ForProvider.Disk); i3++ { { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Disk", "DiskList") @@ -1506,6 +1528,27 @@ func (mg *InstanceTemplate) ResolveReferences(ctx context.Context, c client.Read mg.Spec.ForProvider.ServiceAccount.Email = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.ServiceAccount.EmailRef = rsp.ResolvedReference + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Disk); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "ResourcePolicy", "ResourcePolicyList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Disk[i3].ResourcePolicies), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.Disk[i3].ResourcePoliciesRefs, + Selector: mg.Spec.InitProvider.Disk[i3].ResourcePoliciesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Disk[i3].ResourcePolicies") + } + mg.Spec.InitProvider.Disk[i3].ResourcePolicies = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Disk[i3].ResourcePoliciesRefs = mrsp.ResolvedReferences + } for i3 := 0; i3 < len(mg.Spec.InitProvider.Disk); i3++ { { @@ -3264,7 +3307,27 @@ func (mg *RouterNAT) ResolveReferences(ctx context.Context, c client.Reader) err r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.NATIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.ForProvider.NATIpsRefs, + Selector: mg.Spec.ForProvider.NATIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.NATIps") + } + mg.Spec.ForProvider.NATIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.NATIpsRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Router", "RouterList") if err != nil { @@ -3285,6 +3348,29 @@ func (mg *RouterNAT) ResolveReferences(ctx context.Context, c client.Reader) err mg.Spec.ForProvider.Router = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.RouterRef = rsp.ResolvedReference + for i3 := 0; i3 < len(mg.Spec.ForProvider.Rules); i3++ { + if mg.Spec.ForProvider.Rules[i3].Action != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Rules[i3].Action.SourceNATActiveIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.ForProvider.Rules[i3].Action.SourceNATActiveIpsRefs, + Selector: mg.Spec.ForProvider.Rules[i3].Action.SourceNATActiveIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Rules[i3].Action.SourceNATActiveIps") + } + mg.Spec.ForProvider.Rules[i3].Action.SourceNATActiveIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Rules[i3].Action.SourceNATActiveIpsRefs = mrsp.ResolvedReferences + + } + } for i3 := 0; i3 < len(mg.Spec.ForProvider.Subnetwork); i3++ { { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") @@ -3306,6 +3392,48 @@ func (mg *RouterNAT) ResolveReferences(ctx context.Context, c client.Reader) err mg.Spec.ForProvider.Subnetwork[i3].NameRef = rsp.ResolvedReference } + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.NATIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.InitProvider.NATIpsRefs, + Selector: mg.Spec.InitProvider.NATIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.NATIps") + } + mg.Spec.InitProvider.NATIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.NATIpsRefs = mrsp.ResolvedReferences + + for i3 := 0; i3 < len(mg.Spec.InitProvider.Rules); i3++ { + if mg.Spec.InitProvider.Rules[i3].Action != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Rules[i3].Action.SourceNATActiveIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.InitProvider.Rules[i3].Action.SourceNATActiveIpsRefs, + Selector: mg.Spec.InitProvider.Rules[i3].Action.SourceNATActiveIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Rules[i3].Action.SourceNATActiveIps") + } + mg.Spec.InitProvider.Rules[i3].Action.SourceNATActiveIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Rules[i3].Action.SourceNATActiveIpsRefs = mrsp.ResolvedReferences + + } + } for i3 := 0; i3 < len(mg.Spec.InitProvider.Subnetwork); i3++ { { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") diff --git a/apis/compute/v1beta2/zz_instancetemplate_types.go b/apis/compute/v1beta2/zz_instancetemplate_types.go index dac63831e..c05dfc311 100755 --- a/apis/compute/v1beta2/zz_instancetemplate_types.go +++ b/apis/compute/v1beta2/zz_instancetemplate_types.go @@ -236,8 +236,18 @@ type InstanceTemplateDiskInitParameters struct { ResourceManagerTags map[string]*string `json:"resourceManagerTags,omitempty" tf:"resource_manager_tags,omitempty"` // - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.ResourcePolicy + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() ResourcePolicies []*string `json:"resourcePolicies,omitempty" tf:"resource_policies,omitempty"` + // References to ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesRefs []v1.Reference `json:"resourcePoliciesRefs,omitempty" tf:"-"` + + // Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesSelector *v1.Selector `json:"resourcePoliciesSelector,omitempty" tf:"-"` + // The name (not self_link) // of the disk (such as those managed by google_compute_disk) to attach. // ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. @@ -441,9 +451,19 @@ type InstanceTemplateDiskParameters struct { ResourceManagerTags map[string]*string `json:"resourceManagerTags,omitempty" tf:"resource_manager_tags,omitempty"` // - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.ResourcePolicy + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional ResourcePolicies []*string `json:"resourcePolicies,omitempty" tf:"resource_policies,omitempty"` + // References to ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesRefs []v1.Reference `json:"resourcePoliciesRefs,omitempty" tf:"-"` + + // Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesSelector *v1.Selector `json:"resourcePoliciesSelector,omitempty" tf:"-"` + // The name (not self_link) // of the disk (such as those managed by google_compute_disk) to attach. // ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. diff --git a/apis/compute/v1beta2/zz_routernat_types.go b/apis/compute/v1beta2/zz_routernat_types.go index 11cf845e9..ffed45276 100755 --- a/apis/compute/v1beta2/zz_routernat_types.go +++ b/apis/compute/v1beta2/zz_routernat_types.go @@ -18,9 +18,19 @@ type ActionInitParameters struct { // A list of URLs of the IP resources used for this NAT rule. // These IP addresses must be valid static external IP addresses assigned to the project. // This field is used for public NAT. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +listType=set SourceNATActiveIps []*string `json:"sourceNatActiveIps,omitempty" tf:"source_nat_active_ips,omitempty"` + // References to Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsRefs []v1.Reference `json:"sourceNatActiveIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsSelector *v1.Selector `json:"sourceNatActiveIpsSelector,omitempty" tf:"-"` + // A list of URLs of the IP resources to be drained. // These IPs must be valid static external IPs that have been assigned to the NAT. // These IPs should be used for updating/patching a NAT rule only. @@ -50,10 +60,20 @@ type ActionParameters struct { // A list of URLs of the IP resources used for this NAT rule. // These IP addresses must be valid static external IP addresses assigned to the project. // This field is used for public NAT. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +kubebuilder:validation:Optional // +listType=set SourceNATActiveIps []*string `json:"sourceNatActiveIps,omitempty" tf:"source_nat_active_ips,omitempty"` + // References to Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsRefs []v1.Reference `json:"sourceNatActiveIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsSelector *v1.Selector `json:"sourceNatActiveIpsSelector,omitempty" tf:"-"` + // A list of URLs of the IP resources to be drained. // These IPs must be valid static external IPs that have been assigned to the NAT. // These IPs should be used for updating/patching a NAT rule only. @@ -116,9 +136,19 @@ type RouterNATInitParameters struct { // Self-links of NAT IPs. Only valid if natIpAllocateOption // is set to MANUAL_ONLY. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +listType=set NATIps []*string `json:"natIps,omitempty" tf:"nat_ips,omitempty"` + // References to Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsRefs []v1.Reference `json:"natIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsSelector *v1.Selector `json:"natIpsSelector,omitempty" tf:"-"` + // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. Project *string `json:"project,omitempty" tf:"project,omitempty"` @@ -363,10 +393,20 @@ type RouterNATParameters struct { // Self-links of NAT IPs. Only valid if natIpAllocateOption // is set to MANUAL_ONLY. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +kubebuilder:validation:Optional // +listType=set NATIps []*string `json:"natIps,omitempty" tf:"nat_ips,omitempty"` + // References to Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsRefs []v1.Reference `json:"natIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsSelector *v1.Selector `json:"natIpsSelector,omitempty" tf:"-"` + // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. // +kubebuilder:validation:Optional diff --git a/apis/osconfig/v1beta2/zz_generated.deepcopy.go b/apis/osconfig/v1beta2/zz_generated.deepcopy.go index 6e8e58210..52986a5f8 100644 --- a/apis/osconfig/v1beta2/zz_generated.deepcopy.go +++ b/apis/osconfig/v1beta2/zz_generated.deepcopy.go @@ -9,6 +9,7 @@ package v1beta2 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -3802,6 +3803,18 @@ func (in *PatchDeploymentInstanceFilterInitParameters) DeepCopyInto(out *PatchDe } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Zones != nil { in, out := &in.Zones, &out.Zones *out = make([]*string, len(*in)) @@ -3922,6 +3935,18 @@ func (in *PatchDeploymentInstanceFilterParameters) DeepCopyInto(out *PatchDeploy } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Zones != nil { in, out := &in.Zones, &out.Zones *out = make([]*string, len(*in)) diff --git a/apis/osconfig/v1beta2/zz_generated.resolvers.go b/apis/osconfig/v1beta2/zz_generated.resolvers.go new file mode 100644 index 000000000..5ed1ac075 --- /dev/null +++ b/apis/osconfig/v1beta2/zz_generated.resolvers.go @@ -0,0 +1,73 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 +// Code generated by angryjet. DO NOT EDIT. +// Code transformed by upjet. DO NOT EDIT. + +package v1beta2 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" + errors "github.com/pkg/errors" + + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + apisresolver "github.com/upbound/provider-gcp/internal/apis" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +func (mg *PatchDeployment) ResolveReferences( // ResolveReferences of this PatchDeployment. + ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var mrsp reference.MultiResolutionResponse + var err error + + if mg.Spec.ForProvider.InstanceFilter != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Instance", "InstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.InstanceFilter.Instances), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.InstanceFilter.InstancesRefs, + Selector: mg.Spec.ForProvider.InstanceFilter.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.InstanceFilter.Instances") + } + mg.Spec.ForProvider.InstanceFilter.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.InstanceFilter.InstancesRefs = mrsp.ResolvedReferences + + } + if mg.Spec.InitProvider.InstanceFilter != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Instance", "InstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.InstanceFilter.Instances), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.InstanceFilter.InstancesRefs, + Selector: mg.Spec.InitProvider.InstanceFilter.InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.InstanceFilter.Instances") + } + mg.Spec.InitProvider.InstanceFilter.Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.InstanceFilter.InstancesRefs = mrsp.ResolvedReferences + + } + + return nil +} diff --git a/apis/osconfig/v1beta2/zz_patchdeployment_types.go b/apis/osconfig/v1beta2/zz_patchdeployment_types.go index 2825467dd..156ee5bd8 100755 --- a/apis/osconfig/v1beta2/zz_patchdeployment_types.go +++ b/apis/osconfig/v1beta2/zz_patchdeployment_types.go @@ -598,8 +598,18 @@ type PatchDeploymentInstanceFilterInitParameters struct { // Targets any of the VM instances specified. Instances are specified by their URI in the form zones/{{zone}}/instances/{{instance_name}}, // projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}}, or // https://www.googleapis.com/compute/v1/projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Instance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + // References to Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` + // Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. Zones []*string `json:"zones,omitempty" tf:"zones,omitempty"` } @@ -645,9 +655,19 @@ type PatchDeploymentInstanceFilterParameters struct { // Targets any of the VM instances specified. Instances are specified by their URI in the form zones/{{zone}}/instances/{{instance_name}}, // projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}}, or // https://www.googleapis.com/compute/v1/projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Instance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + // References to Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` + // Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. // +kubebuilder:validation:Optional Zones []*string `json:"zones,omitempty" tf:"zones,omitempty"` diff --git a/config/provider-metadata.yaml b/config/provider-metadata.yaml index 62f2814d6..fb89c711e 100644 --- a/config/provider-metadata.yaml +++ b/config/provider-metadata.yaml @@ -962,6 +962,8 @@ resources: "group_key": "${trimprefix(google_cloud_identity_group.group.id, \"groups/\")}", "organization_id": "123456789" } + references: + access_levels: google_access_context_manager_access_level.access_level_id_for_user_access_binding.name dependencies: google_access_context_manager_access_level.access_level_id_for_user_access_binding: |- { @@ -1167,6 +1169,7 @@ resources: "title": "%s" } references: + status.access_levels: google_access_context_manager_access_level.access-level.name status.ingress_policies.ingress_from.sources.access_level: google_access_context_manager_access_level.test-access.name dependencies: google_access_context_manager_access_level.access-level: |- @@ -10857,6 +10860,8 @@ resources: "name": "my-app-connection", "type": "TCP_PROXY" } + references: + connectors: google_beyondcorp_app_connector.app_connector.id dependencies: google_beyondcorp_app_connector.app_connector: |- { @@ -10902,6 +10907,7 @@ resources: "type": "TCP_PROXY" } references: + connectors: google_beyondcorp_app_connector.app_connector.id gateway.app_gateway: google_beyondcorp_app_gateway.app_gateway.id dependencies: google_beyondcorp_app_connector.app_connector: |- @@ -16283,6 +16289,7 @@ resources: ] } references: + all_updates_rule.monitoring_notification_channels: google_monitoring_notification_channel.notification_channel.id billing_account: data.google_billing_account.account.id dependencies: google_monitoring_notification_channel.notification_channel: |- @@ -16948,6 +16955,8 @@ resources: } ] } + references: + cluster_admission_rules.require_attestations_by: google_binary_authorization_attestor.attestor.name dependencies: google_binary_authorization_attestor.attestor: |- { @@ -16985,6 +16994,8 @@ resources: ], "global_policy_evaluation_mode": "ENABLE" } + references: + default_admission_rule.require_attestations_by: google_binary_authorization_attestor.attestor.name dependencies: google_binary_authorization_attestor.attestor: |- { @@ -17329,6 +17340,9 @@ resources: "name": "dns-cert", "scope": "EDGE_CACHE" } + references: + managed.dns_authorizations: google_certificate_manager_dns_authorization.instance.id + managed.domains: google_certificate_manager_dns_authorization.instance.domain dependencies: google_certificate_manager_dns_authorization.instance: |- { @@ -17593,6 +17607,9 @@ resources: "name": "dns-cert", "scope": "ALL_REGIONS" } + references: + managed.dns_authorizations: google_certificate_manager_dns_authorization.instance.id + managed.domains: google_certificate_manager_dns_authorization.instance.domain dependencies: google_certificate_manager_dns_authorization.instance: |- { @@ -17623,6 +17640,9 @@ resources: ], "name": "dns-cert" } + references: + managed.dns_authorizations: google_certificate_manager_dns_authorization.instance.id + managed.domains: google_certificate_manager_dns_authorization.instance.domain dependencies: google_certificate_manager_dns_authorization.instance: |- { @@ -18051,6 +18071,7 @@ resources: "name": "cert-map-entry" } references: + certificates: google_certificate_manager_certificate.certificate.id map: google_certificate_manager_certificate_map.certificate_map.name dependencies: google_certificate_manager_certificate.certificate: |- @@ -19624,6 +19645,8 @@ resources: } ] } + references: + lifecycle.ignore_changes: metadata.0.annotations - name: default manifest: |- { @@ -19714,6 +19737,7 @@ resources: ] } references: + lifecycle.ignore_changes: metadata[0].annotations["run.googleapis.com/launch-stage"] provider: google-beta argumentDocs: autoscaling.knative.dev/maxScale: |- @@ -20500,6 +20524,8 @@ resources: } ] } + references: + lifecycle.ignore_changes: launch_stage - name: default manifest: |- { @@ -20558,6 +20584,7 @@ resources: } references: template.template.containers.env.value_source.secret_key_ref.secret: google_secret_manager_secret.secret.secret_id + template.template.volumes.cloud_sql_instance.instances: google_sql_database_instance.instance.connection_name dependencies: google_secret_manager_secret.secret: |- { @@ -21469,6 +21496,7 @@ resources: } references: template.containers.env.value_source.secret_key_ref.secret: google_secret_manager_secret.secret.secret_id + template.volumes.cloud_sql_instance.instances: google_sql_database_instance.instance.connection_name dependencies: google_secret_manager_secret.secret: |- { @@ -30854,6 +30882,8 @@ resources: ], "name": "backend-service" } + references: + health_checks: google_compute_http_health_check.default.id dependencies: google_compute_http_health_check.default: |- { @@ -30889,6 +30919,8 @@ resources: ], "name": "backend-service" } + references: + health_checks: google_compute_http_health_check.default.id dependencies: google_compute_http_health_check.default: |- { @@ -30962,6 +30994,8 @@ resources: ], "name": "backend-service" } + references: + health_checks: google_compute_http_health_check.default.id dependencies: google_compute_http_health_check.default: |- { @@ -30997,6 +31031,8 @@ resources: ], "name": "backend-service" } + references: + health_checks: google_compute_http_health_check.default.id dependencies: google_compute_http_health_check.default: |- { @@ -31017,6 +31053,7 @@ resources: "provider": "${google-beta}" } references: + health_checks: google_compute_health_check.health_check.id provider: google-beta dependencies: google_compute_health_check.health_check: |- @@ -31067,6 +31104,7 @@ resources: "session_affinity": "HTTP_COOKIE" } references: + health_checks: google_compute_health_check.health_check.id provider: google-beta dependencies: google_compute_health_check.health_check: |- @@ -31126,6 +31164,8 @@ resources: "load_balancing_scheme": "EXTERNAL_MANAGED", "name": "backend-service" } + references: + health_checks: google_compute_health_check.default.id dependencies: google_compute_health_check.default: |- { @@ -33038,6 +33078,7 @@ resources: } references: firewall_policy: google_compute_firewall_policy.default.name + match.dest_address_groups: google_network_security_address_group.basic_global_networksecurity_address_group.id dependencies: google_compute_firewall_policy.default: |- { @@ -38189,6 +38230,8 @@ resources: ], "zone": "us-central1-a" } + references: + instances: google_compute_instance.test.id - name: staging_group manifest: |- { @@ -38213,6 +38256,8 @@ resources: ], "zone": "us-central1-c" } + references: + instances: google_compute_instance.staging_vm.id dependencies: google_compute_backend_service.staging_service: |- { @@ -38332,6 +38377,7 @@ resources: } references: auto_healing_policies.health_check: google_compute_health_check.autohealing.id + target_pools: google_compute_target_pool.appserver.id version.instance_template: google_compute_instance_template.appserver.self_link_unique dependencies: google_compute_health_check.autohealing: |- @@ -38863,6 +38909,7 @@ resources: ] } references: + disk.resource_policies: google_compute_resource_policy.daily_backup.id disk.source: google_compute_disk.foobar.name service_account.email: google_service_account.default.email dependencies: @@ -39568,6 +39615,7 @@ resources: "type": "PARTNER" } references: + ipsec_internal_addresses: google_compute_address.address.self_link router: google_compute_router.router.id dependencies: google_compute_address.address: |- @@ -40315,6 +40363,10 @@ resources: "${google_compute_subnetwork.default.self_link}" ] } + references: + producer_accept_lists: google_project.accepted_producer_project.project_id + producer_reject_lists: google_project.rejected_producer_project.project_id + subnetworks: google_compute_subnetwork.default.self_link dependencies: google_compute_network.default: |- { @@ -40356,6 +40408,7 @@ resources: } references: provider: google-beta + subnetworks: google_compute_subnetwork.default.id dependencies: google_compute_instance.default: |- { @@ -41026,6 +41079,7 @@ resources: } references: firewall_policy: google_compute_network_firewall_policy.basic_network_firewall_policy.name + match.src_address_groups: google_network_security_address_group.basic_global_networksecurity_address_group.id dependencies: google_compute_network.basic_network: |- { @@ -43016,6 +43070,8 @@ resources: "region": "us-central1", "session_affinity": "CLIENT_IP" } + references: + health_checks: google_compute_health_check.default.id dependencies: google_compute_health_check.default: |- { @@ -43066,6 +43122,7 @@ resources: "region": "us-central1" } references: + health_checks: google_compute_region_health_check.default.id provider: google-beta dependencies: google_compute_region_health_check.default: |- @@ -43091,6 +43148,8 @@ resources: "protocol": "HTTP", "region": "us-central1" } + references: + health_checks: google_compute_health_check.health_check.id dependencies: google_compute_health_check.health_check: |- { @@ -43114,6 +43173,7 @@ resources: "region": "us-central1" } references: + health_checks: google_compute_region_health_check.health_check.id provider: google-beta dependencies: google_compute_region_health_check.health_check: |- @@ -43139,6 +43199,8 @@ resources: "protocol": "TCP", "region": "us-central1" } + references: + health_checks: google_compute_region_health_check.health_check.id dependencies: google_compute_region_health_check.health_check: |- { @@ -43188,6 +43250,8 @@ resources: "region": "us-central1", "session_affinity": "HTTP_COOKIE" } + references: + health_checks: google_compute_health_check.health_check.id dependencies: google_compute_health_check.health_check: |- { @@ -43219,6 +43283,7 @@ resources: } references: backend.group: google_compute_region_instance_group_manager.rigm.instance_group + health_checks: google_compute_region_health_check.default.id dependencies: google_compute_instance_template.instance_template: |- { @@ -43301,6 +43366,7 @@ resources: "session_affinity": "CLIENT_IP" } references: + health_checks: google_compute_region_health_check.health_check.id provider: google-beta dependencies: google_compute_region_health_check.health_check: |- @@ -45201,6 +45267,7 @@ resources: } references: auto_healing_policies.health_check: google_compute_health_check.autohealing.id + target_pools: google_compute_target_pool.appserver.id version.instance_template: google_compute_instance_template.appserver.self_link_unique dependencies: google_compute_health_check.autohealing: |- @@ -45454,6 +45521,7 @@ resources: ] } references: + disk.resource_policies: google_compute_resource_policy.daily_backup.id disk.source: google_compute_region_disk.foobar.self_link service_account.email: google_service_account.default.email dependencies: @@ -46664,6 +46732,7 @@ resources: } references: firewall_policy: google_compute_region_network_firewall_policy.basic_regional_network_firewall_policy.name + match.src_address_groups: google_network_security_address_group.basic_regional_networksecurity_address_group.id dependencies: google_compute_network.basic_network: |- { @@ -48056,6 +48125,7 @@ resources: "url_map": "${google_compute_region_url_map.default.id}" } references: + ssl_certificates: google_compute_region_ssl_certificate.default.id url_map: google_compute_region_url_map.default.id dependencies: google_compute_region_backend_service.default: |- @@ -48130,6 +48200,7 @@ resources: references: provider: google-beta server_tls_policy: google_network_security_server_tls_policy.default.id + ssl_certificates: google_compute_region_ssl_certificate.default.id url_map: google_compute_region_url_map.default.id dependencies: google_certificate_manager_trust_config.default: |- @@ -52093,8 +52164,10 @@ resources: ] } references: + nat_ips: google_compute_address.addr1.self_link region: google_compute_router.router.region router: google_compute_router.router.name + rules.action.source_nat_active_ips: google_compute_address.addr2.self_link subnetwork.name: google_compute_subnetwork.subnet.id dependencies: google_compute_address.addr1: |- @@ -52169,6 +52242,7 @@ resources: provider: google-beta region: google_compute_router.router.region router: google_compute_router.router.name + rules.action.source_nat_active_ranges: google_compute_subnetwork.subnet.self_link subnetwork.name: google_compute_subnetwork.subnet.id dependencies: google_compute_network.net: |- @@ -52648,6 +52722,8 @@ resources: "router": "${google_compute_router.router.name}" } references: + export_policies: google_compute_router_route_policy.rp-export.name + import_policies: google_compute_router_route_policy.rp-import.name interface: google_compute_router_interface.router_interface.name provider: google-beta region: google_compute_router.router.region @@ -53979,6 +54055,7 @@ resources: "target_service": "${google_compute_forwarding_rule.psc_ilb_target_service.id}" } references: + nat_subnets: google_compute_subnetwork.psc_ilb_nat.id target_service: google_compute_forwarding_rule.psc_ilb_target_service.id dependencies: google_compute_address.psc_ilb_consumer_address: |- @@ -54073,6 +54150,7 @@ resources: "target_service": "${google_compute_forwarding_rule.psc_ilb_target_service.id}" } references: + nat_subnets: google_compute_subnetwork.psc_ilb_nat.id target_service: google_compute_forwarding_rule.psc_ilb_target_service.id dependencies: google_compute_address.psc_ilb_consumer_address: |- @@ -54161,6 +54239,7 @@ resources: } references: consumer_accept_lists.network_url: google_compute_network.psc_ilb_consumer_network.self_link + nat_subnets: google_compute_subnetwork.psc_ilb_nat.id target_service: google_compute_forwarding_rule.psc_ilb_target_service.id dependencies: google_compute_address.psc_ilb_consumer_address: |- @@ -54269,6 +54348,7 @@ resources: "target_service": "${google_compute_forwarding_rule.psc_ilb_target_service.id}" } references: + nat_subnets: google_compute_subnetwork.psc_ilb_nat.id target_service: google_compute_forwarding_rule.psc_ilb_target_service.id dependencies: google_compute_forwarding_rule.psc_ilb_target_service: |- @@ -55730,6 +55810,7 @@ resources: "url_map": "${google_compute_url_map.default.id}" } references: + ssl_certificates: google_compute_ssl_certificate.default.id url_map: google_compute_url_map.default.id dependencies: google_compute_backend_service.default: |- @@ -55794,6 +55875,7 @@ resources: "url_map": "${google_compute_url_map.default.id}" } references: + ssl_certificates: google_compute_ssl_certificate.default.id url_map: google_compute_url_map.default.id dependencies: google_compute_backend_service.default: |- @@ -55862,6 +55944,7 @@ resources: references: provider: google-beta server_tls_policy: google_network_security_server_tls_policy.default.id + ssl_certificates: google_compute_ssl_certificate.default.id url_map: google_compute_url_map.default.id dependencies: google_certificate_manager_trust_config.default: |- @@ -56351,6 +56434,8 @@ resources: ], "name": "instance-pool" } + references: + health_checks: google_compute_http_health_check.default.name dependencies: google_compute_http_health_check.default: |- { @@ -56413,6 +56498,7 @@ resources: } references: backend_service: google_compute_backend_service.default.id + ssl_certificates: google_compute_ssl_certificate.default.id dependencies: google_compute_backend_service.default: |- { @@ -81339,6 +81425,7 @@ resources: "location": "${google_discovery_engine_data_store.test_data_store.location}" } references: + data_store_ids: google_discovery_engine_data_store.test_data_store.data_store_id location: google_discovery_engine_data_store.test_data_store.location dependencies: google_discovery_engine_data_store.test_data_store: |- @@ -81632,6 +81719,7 @@ resources: ] } references: + data_store_ids: google_discovery_engine_data_store.basic.data_store_id location: google_discovery_engine_data_store.basic.location dependencies: google_discovery_engine_data_store.basic: |- @@ -82370,6 +82458,7 @@ resources: } references: managed_zone: google_dns_managed_zone.prod.name + rrdatas: google_compute_instance.frontend.network_interface[0].access_config[0].nat_ip dependencies: google_compute_instance.frontend: |- { @@ -82967,6 +83056,7 @@ resources: "version": "${google_document_ai_processor.processor.id}/processorVersions/stable" } references: + lifecycle.ignore_changes: version processor: google_document_ai_processor.processor.id dependencies: google_document_ai_processor.processor: |- @@ -87643,6 +87733,8 @@ resources: "project": "my-project-name", "ruleset_name": "projects/my-project-name/rulesets/${google_firebaserules_ruleset.firestore.name}" } + references: + lifecycle.replace_triggered_by: google_firebaserules_ruleset.firestore dependencies: google_firebaserules_ruleset.firestore: |- { @@ -87674,6 +87766,7 @@ resources: "ruleset_name": "projects/my-project-name/rulesets/${google_firebaserules_ruleset.storage.name}" } references: + lifecycle.replace_triggered_by: google_firebaserules_ruleset.storage provider: google-beta dependencies: google_firebase_storage_bucket.bucket: |- @@ -109696,6 +109789,7 @@ resources: } references: network: google_compute_network.producer_net.id + psc_config.subnetworks: google_compute_subnetwork.producer_subnet.id dependencies: google_compute_network.producer_net: |- { @@ -113869,6 +113963,7 @@ resources: "type": "SECURE_WEB_GATEWAY" } references: + certificate_urls: google_certificate_manager_certificate.default.id gateway_security_policy: google_network_security_gateway_security_policy.default.id network: google_compute_network.default.id subnetwork: google_compute_subnetwork.default.id @@ -113948,6 +114043,7 @@ resources: "type": "SECURE_WEB_GATEWAY" } references: + certificate_urls: google_certificate_manager_certificate.default.id gateway_security_policy: google_network_security_gateway_security_policy.default.id network: google_compute_network.default.id subnetwork: google_compute_subnetwork.default.id @@ -114027,6 +114123,7 @@ resources: "type": "SECURE_WEB_GATEWAY" } references: + certificate_urls: google_certificate_manager_certificate.default.id gateway_security_policy: google_network_security_gateway_security_policy.default.id network: google_compute_network.default.id subnetwork: google_compute_subnetwork.default.id @@ -114825,6 +114922,7 @@ resources: ] } references: + meshes: google_network_services_mesh.default.id provider: google-beta dependencies: google_network_services_mesh.default: |- @@ -115240,6 +115338,7 @@ resources: } references: extension_chains.extensions.service: google_compute_region_backend_service.callouts_backend.self_link + forwarding_rules: google_compute_forwarding_rule.default.self_link dependencies: google_compute_firewall.fw_iap: |- { @@ -115699,6 +115798,7 @@ resources: } references: extension_chains.extensions.service: google_compute_region_backend_service.callouts_backend.self_link + forwarding_rules: google_compute_forwarding_rule.default.self_link dependencies: google_compute_firewall.fw_iap: |- { @@ -116510,6 +116610,7 @@ resources: ] } references: + meshes: google_network_services_mesh.default.id provider: google-beta rules.action.destinations.service_name: google_compute_backend_service.default.id dependencies: @@ -116573,6 +116674,7 @@ resources: ] } references: + gateways: google_network_services_gateway.default.id provider: google-beta rules.action.destinations.service_name: google_compute_backend_service.default.id dependencies: @@ -116794,6 +116896,7 @@ resources: ] } references: + meshes: google_network_services_mesh.default.id provider: google-beta rules.action.destinations.service_name: google_compute_backend_service.default.id dependencies: @@ -116857,6 +116960,7 @@ resources: ] } references: + gateways: google_network_services_gateway.default.id provider: google-beta rules.action.destinations.service_name: google_compute_backend_service.default.id dependencies: @@ -118779,6 +118883,7 @@ resources: "provider": "${google-beta}" } references: + assignment.instances: google_compute_instance.foobar.id provider: google-beta dependencies: google_compute_instance.foobar: |- @@ -119960,6 +120065,8 @@ resources: } ] } + references: + instance_filter.instances: google_compute_instance.foobar.id dependencies: google_compute_instance.foobar: |- { @@ -131286,6 +131393,7 @@ resources: } references: network: google_compute_network.peering_network.id + reserved_peering_ranges: google_compute_global_address.private_ip_alloc.name dependencies: google_compute_global_address.private_ip_alloc: |- { @@ -135646,6 +135754,7 @@ resources: "region": "us-central1" } references: + dedicated_serving_endpoint.private_service_connect_config.project_allowlist: data.google_project.project.number provider: google - name: featureonlinestore manifest: |- @@ -135869,6 +135978,7 @@ resources: references: feature_online_store: google_vertex_ai_feature_online_store.featureonlinestore.name feature_registry_source.feature_groups.feature_group_id: google_vertex_ai_feature_group.sample_feature_group.name + feature_registry_source.feature_groups.feature_ids: google_vertex_ai_feature_group_feature.sample_feature.name dependencies: google_bigquery_dataset.sample_dataset: |- { @@ -135967,6 +136077,7 @@ resources: references: feature_online_store: google_vertex_ai_feature_online_store.featureonlinestore.name feature_registry_source.feature_groups.feature_group_id: google_vertex_ai_feature_group.sample_feature_group.name + feature_registry_source.feature_groups.feature_ids: google_vertex_ai_feature_group_feature.sample_feature.name feature_registry_source.project_number: data.google_project.test_project.number project: google_project.project.project_id dependencies: @@ -137173,6 +137284,8 @@ resources: ], "region": "us-central1" } + references: + private_service_connect_config.project_allowlist: data.google_project.project.number - name: index_endpoint manifest: |- { diff --git a/examples-generated/beyondcorp/v1beta2/appconnection.yaml b/examples-generated/beyondcorp/v1beta2/appconnection.yaml index c8e5ed111..5b901566b 100644 --- a/examples-generated/beyondcorp/v1beta2/appconnection.yaml +++ b/examples-generated/beyondcorp/v1beta2/appconnection.yaml @@ -11,8 +11,8 @@ spec: applicationEndpoint: - host: foo-host port: 8080 - connectors: - - ${google_beyondcorp_app_connector.app_connector.id} + connectorsRefs: + - name: app_connector name: my-app-connection type: TCP_PROXY diff --git a/examples-generated/binaryauthorization/v1beta2/policy.yaml b/examples-generated/binaryauthorization/v1beta2/policy.yaml index a0927fed1..58749d40c 100644 --- a/examples-generated/binaryauthorization/v1beta2/policy.yaml +++ b/examples-generated/binaryauthorization/v1beta2/policy.yaml @@ -14,8 +14,8 @@ spec: - cluster: us-central1-a.prod-cluster enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG evaluationMode: REQUIRE_ATTESTATION - requireAttestationsBy: - - ${google_binary_authorization_attestor.attestor.name} + requireAttestationsByRefs: + - name: attestor defaultAdmissionRule: - enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG evaluationMode: ALWAYS_ALLOW diff --git a/examples-generated/certificatemanager/v1beta1/certificatemapentry.yaml b/examples-generated/certificatemanager/v1beta1/certificatemapentry.yaml index 38e03fc20..bfc0f104b 100644 --- a/examples-generated/certificatemanager/v1beta1/certificatemapentry.yaml +++ b/examples-generated/certificatemanager/v1beta1/certificatemapentry.yaml @@ -8,8 +8,8 @@ metadata: name: default spec: forProvider: - certificates: - - ${google_certificate_manager_certificate.certificate.id} + certificatesRefs: + - name: certificate description: My acceptance test certificate map entry labels: acc-test: true @@ -33,12 +33,12 @@ spec: forProvider: description: The default cert managed: - - dnsAuthorizations: - - ${google_certificate_manager_dns_authorization.instance.id} - - ${google_certificate_manager_dns_authorization.instance2.id} - domains: - - ${google_certificate_manager_dns_authorization.instance.domain} - - ${google_certificate_manager_dns_authorization.instance2.domain} + - dnsAuthorizationsRefs: + - name: instance + - name: instance2 + domainsRefs: + - name: instance + - name: instance2 scope: DEFAULT --- diff --git a/examples-generated/certificatemanager/v1beta2/certificate.yaml b/examples-generated/certificatemanager/v1beta2/certificate.yaml index 9edd93339..0fb2f3329 100644 --- a/examples-generated/certificatemanager/v1beta2/certificate.yaml +++ b/examples-generated/certificatemanager/v1beta2/certificate.yaml @@ -12,12 +12,12 @@ spec: labels: env: test managed: - - dnsAuthorizations: - - ${google_certificate_manager_dns_authorization.instance.id} - - ${google_certificate_manager_dns_authorization.instance2.id} - domains: - - ${google_certificate_manager_dns_authorization.instance.domain} - - ${google_certificate_manager_dns_authorization.instance2.domain} + - dnsAuthorizationsRefs: + - name: instance + - name: instance2 + domainsRefs: + - name: instance + - name: instance2 scope: EDGE_CACHE --- diff --git a/examples-generated/compute/v1beta2/instancetemplate.yaml b/examples-generated/compute/v1beta2/instancetemplate.yaml index 888e720f8..89c8ef6af 100644 --- a/examples-generated/compute/v1beta2/instancetemplate.yaml +++ b/examples-generated/compute/v1beta2/instancetemplate.yaml @@ -13,8 +13,8 @@ spec: disk: - autoDelete: true boot: true - resourcePolicies: - - ${google_compute_resource_policy.daily_backup.id} + resourcePoliciesRefs: + - name: daily_backup sourceImage: debian-cloud/debian-11 - autoDelete: false boot: false diff --git a/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml b/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml index 9a59e9528..66085f769 100644 --- a/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml +++ b/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml @@ -781,6 +781,85 @@ spec: items: type: string type: array + connectorsRefs: + description: References to AppConnector in beyondcorp to populate + connectors. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + connectorsSelector: + description: Selector for a list of AppConnector in beyondcorp + to populate connectors. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object displayName: description: An arbitrary user-provided name for the AppConnection. type: string @@ -931,6 +1010,85 @@ spec: items: type: string type: array + connectorsRefs: + description: References to AppConnector in beyondcorp to populate + connectors. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + connectorsSelector: + description: Selector for a list of AppConnector in beyondcorp + to populate connectors. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object displayName: description: An arbitrary user-provided name for the AppConnection. type: string diff --git a/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml b/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml index d8c0b4607..6357044cb 100644 --- a/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml +++ b/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml @@ -751,6 +751,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array defaultAdmissionRule: @@ -783,6 +862,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object description: description: A descriptive comment. @@ -867,6 +1025,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array defaultAdmissionRule: @@ -899,6 +1136,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object description: description: A descriptive comment. diff --git a/package/crds/certificatemanager.gcp.upbound.io_certificatemapentries.yaml b/package/crds/certificatemanager.gcp.upbound.io_certificatemapentries.yaml index 587b717f6..a0c0b8e0b 100644 --- a/package/crds/certificatemanager.gcp.upbound.io_certificatemapentries.yaml +++ b/package/crds/certificatemanager.gcp.upbound.io_certificatemapentries.yaml @@ -82,6 +82,85 @@ spec: items: type: string type: array + certificatesRefs: + description: References to Certificate in certificatemanager to + populate certificates. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + certificatesSelector: + description: Selector for a list of Certificate in certificatemanager + to populate certificates. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object description: description: A human-readable description of the resource. type: string @@ -211,6 +290,85 @@ spec: items: type: string type: array + certificatesRefs: + description: References to Certificate in certificatemanager to + populate certificates. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + certificatesSelector: + description: Selector for a list of Certificate in certificatemanager + to populate certificates. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object description: description: A human-readable description of the resource. type: string @@ -406,11 +564,6 @@ spec: required: - forProvider type: object - x-kubernetes-validations: - - message: spec.forProvider.certificates is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.certificates) - || (has(self.initProvider) && has(self.initProvider.certificates))' status: description: CertificateMapEntryStatus defines the observed state of CertificateMapEntry. properties: diff --git a/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml b/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml index b475c61e8..638be98b5 100644 --- a/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml +++ b/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml @@ -821,6 +821,85 @@ spec: items: type: string type: array + dnsAuthorizationsRefs: + description: References to DNSAuthorization in certificatemanager + to populate dnsAuthorizations. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + dnsAuthorizationsSelector: + description: Selector for a list of DNSAuthorization in certificatemanager + to populate dnsAuthorizations. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object domains: description: |- The domains for which a managed SSL certificate will be generated. @@ -828,6 +907,85 @@ spec: items: type: string type: array + domainsRefs: + description: References to DNSAuthorization in certificatemanager + to populate domains. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + domainsSelector: + description: Selector for a list of DNSAuthorization in certificatemanager + to populate domains. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object issuanceConfig: description: |- The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. @@ -961,6 +1119,85 @@ spec: items: type: string type: array + dnsAuthorizationsRefs: + description: References to DNSAuthorization in certificatemanager + to populate dnsAuthorizations. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + dnsAuthorizationsSelector: + description: Selector for a list of DNSAuthorization in certificatemanager + to populate dnsAuthorizations. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object domains: description: |- The domains for which a managed SSL certificate will be generated. @@ -968,6 +1205,85 @@ spec: items: type: string type: array + domainsRefs: + description: References to DNSAuthorization in certificatemanager + to populate domains. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + domainsSelector: + description: Selector for a list of DNSAuthorization in certificatemanager + to populate domains. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object issuanceConfig: description: |- The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. diff --git a/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml b/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml index 6062865c2..c3f4412cf 100644 --- a/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml +++ b/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml @@ -2539,6 +2539,85 @@ spec: items: type: string type: array + instancesRefs: + description: References to DatabaseInstance + in sql to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object + with matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object name: description: Volume's name. @@ -3101,6 +3180,85 @@ spec: items: type: string type: array + instancesRefs: + description: References to DatabaseInstance + in sql to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object + with matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object name: description: Volume's name. diff --git a/package/crds/cloudrun.gcp.upbound.io_v2services.yaml b/package/crds/cloudrun.gcp.upbound.io_v2services.yaml index 209532e75..5c0d61988 100644 --- a/package/crds/cloudrun.gcp.upbound.io_v2services.yaml +++ b/package/crds/cloudrun.gcp.upbound.io_v2services.yaml @@ -3740,6 +3740,85 @@ spec: type: string type: array x-kubernetes-list-type: set + instancesRefs: + description: References to DatabaseInstance in sql + to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with + matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object gcs: description: |- @@ -4632,6 +4711,85 @@ spec: type: string type: array x-kubernetes-list-type: set + instancesRefs: + description: References to DatabaseInstance in sql + to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with + matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object gcs: description: |- diff --git a/package/crds/compute.gcp.upbound.io_instancegroups.yaml b/package/crds/compute.gcp.upbound.io_instancegroups.yaml index b4eb13877..ecc0897fb 100644 --- a/package/crds/compute.gcp.upbound.io_instancegroups.yaml +++ b/package/crds/compute.gcp.upbound.io_instancegroups.yaml @@ -86,6 +86,84 @@ spec: type: string type: array x-kubernetes-list-type: set + instancesRefs: + description: References to Instance in compute to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of Instance in compute to populate + instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object namedPort: description: |- The named port configuration. See the section below @@ -219,6 +297,84 @@ spec: type: string type: array x-kubernetes-list-type: set + instancesRefs: + description: References to Instance in compute to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of Instance in compute to populate + instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object namedPort: description: |- The named port configuration. See the section below diff --git a/package/crds/compute.gcp.upbound.io_instancetemplates.yaml b/package/crds/compute.gcp.upbound.io_instancetemplates.yaml index 966ce6223..bd0bb6718 100644 --- a/package/crds/compute.gcp.upbound.io_instancetemplates.yaml +++ b/package/crds/compute.gcp.upbound.io_instancetemplates.yaml @@ -3056,6 +3056,85 @@ spec: items: type: string type: array + resourcePoliciesRefs: + description: References to ResourcePolicy in compute to + populate resourcePolicies. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + resourcePoliciesSelector: + description: Selector for a list of ResourcePolicy in compute + to populate resourcePolicies. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object source: description: |- The name (not self_link) @@ -3973,6 +4052,85 @@ spec: items: type: string type: array + resourcePoliciesRefs: + description: References to ResourcePolicy in compute to + populate resourcePolicies. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + resourcePoliciesSelector: + description: Selector for a list of ResourcePolicy in compute + to populate resourcePolicies. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object source: description: |- The name (not self_link) diff --git a/package/crds/compute.gcp.upbound.io_interconnectattachments.yaml b/package/crds/compute.gcp.upbound.io_interconnectattachments.yaml index 7f5d30ed9..74ab65318 100644 --- a/package/crds/compute.gcp.upbound.io_interconnectattachments.yaml +++ b/package/crds/compute.gcp.upbound.io_interconnectattachments.yaml @@ -143,6 +143,84 @@ spec: items: type: string type: array + ipsecInternalAddressesRefs: + description: References to Address in compute to populate ipsecInternalAddresses. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + ipsecInternalAddressesSelector: + description: Selector for a list of Address in compute to populate + ipsecInternalAddresses. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object mtu: description: |- Maximum Transmission Unit (MTU), in bytes, of packets passing through @@ -352,6 +430,84 @@ spec: items: type: string type: array + ipsecInternalAddressesRefs: + description: References to Address in compute to populate ipsecInternalAddresses. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + ipsecInternalAddressesSelector: + description: Selector for a list of Address in compute to populate + ipsecInternalAddresses. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object mtu: description: |- Maximum Transmission Unit (MTU), in bytes, of packets passing through diff --git a/package/crds/compute.gcp.upbound.io_routernats.yaml b/package/crds/compute.gcp.upbound.io_routernats.yaml index 17bcdce0d..77fc7959e 100644 --- a/package/crds/compute.gcp.upbound.io_routernats.yaml +++ b/package/crds/compute.gcp.upbound.io_routernats.yaml @@ -1327,6 +1327,84 @@ spec: type: string type: array x-kubernetes-list-type: set + natIpsRefs: + description: References to Address in compute to populate natIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + natIpsSelector: + description: Selector for a list of Address in compute to populate + natIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object project: description: |- The ID of the project in which the resource belongs. @@ -1433,6 +1511,85 @@ spec: type: string type: array x-kubernetes-list-type: set + sourceNatActiveIpsRefs: + description: References to Address in compute to populate + sourceNatActiveIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + sourceNatActiveIpsSelector: + description: Selector for a list of Address in compute + to populate sourceNatActiveIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with + matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object sourceNatDrainIps: description: |- A list of URLs of the IP resources to be drained. @@ -1702,6 +1859,84 @@ spec: type: string type: array x-kubernetes-list-type: set + natIpsRefs: + description: References to Address in compute to populate natIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + natIpsSelector: + description: Selector for a list of Address in compute to populate + natIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object project: description: |- The ID of the project in which the resource belongs. @@ -1727,6 +1962,85 @@ spec: type: string type: array x-kubernetes-list-type: set + sourceNatActiveIpsRefs: + description: References to Address in compute to populate + sourceNatActiveIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + sourceNatActiveIpsSelector: + description: Selector for a list of Address in compute + to populate sourceNatActiveIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with + matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object sourceNatDrainIps: description: |- A list of URLs of the IP resources to be drained. diff --git a/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml b/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml index 474ba66fc..76e08e0c0 100644 --- a/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml +++ b/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml @@ -2199,6 +2199,85 @@ spec: items: type: string type: array + instancesRefs: + description: References to Instance in compute to populate + instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of Instance in compute to + populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object zones: description: Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. @@ -2723,6 +2802,85 @@ spec: items: type: string type: array + instancesRefs: + description: References to Instance in compute to populate + instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of Instance in compute to + populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object zones: description: Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. From 9456c735227aa54d6587760b0236850dc0b88b5d Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 9 Oct 2024 12:03:43 +0200 Subject: [PATCH 15/34] Update examples Signed-off-by: Rickard von Essen --- .../beyondcorp/v1beta2/appconnection.yaml | 10 +-- .../binaryauthorization/v1beta2/policy.yaml | 12 +-- .../v1beta1/certificatemapentry.yaml | 16 ++-- .../v1beta2/certificate.yaml | 34 +++++++-- .../compute/v1beta2/instancetemplate.yaml | 74 ++++++++++++++++++- 5 files changed, 115 insertions(+), 31 deletions(-) diff --git a/examples/beyondcorp/v1beta2/appconnection.yaml b/examples/beyondcorp/v1beta2/appconnection.yaml index f37ece311..5eee4849d 100644 --- a/examples/beyondcorp/v1beta2/appconnection.yaml +++ b/examples/beyondcorp/v1beta2/appconnection.yaml @@ -14,10 +14,10 @@ metadata: spec: forProvider: applicationEndpoint: - host: foo-host + - host: foo-host port: 8080 - connectors: - - projects/${project.project_id}/locations/us-central1/appConnectors/app-connector + connectorsRefs: + - name: app_connector gateway: appGateway: app-gateway name: my-app-connection @@ -37,8 +37,8 @@ metadata: spec: forProvider: principalInfo: - serviceAccount: - emailSelector: + - serviceAccount: + - emailSelector: matchLabels: testing.upbound.io/example-name: service_account region: us-central1 diff --git a/examples/binaryauthorization/v1beta2/policy.yaml b/examples/binaryauthorization/v1beta2/policy.yaml index ffe0a5cf2..015cf5bae 100644 --- a/examples/binaryauthorization/v1beta2/policy.yaml +++ b/examples/binaryauthorization/v1beta2/policy.yaml @@ -18,10 +18,10 @@ spec: - cluster: us-central1-a.prod-cluster enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG evaluationMode: REQUIRE_ATTESTATION - requireAttestationsBy: - - attestor + requireAttestationsByRefs: + - name: attestor defaultAdmissionRule: - enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG + - enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG evaluationMode: ALWAYS_ALLOW --- @@ -37,7 +37,7 @@ metadata: spec: forProvider: attestationAuthorityNote: - noteReferenceSelector: + - noteReferenceSelector: matchLabels: testing.upbound.io/example-name: note @@ -54,5 +54,5 @@ metadata: spec: forProvider: attestationAuthority: - hint: - humanReadableName: My attestor + - hint: + - humanReadableName: My attestor diff --git a/examples/certificatemanager/v1beta1/certificatemapentry.yaml b/examples/certificatemanager/v1beta1/certificatemapentry.yaml index 4237274db..5f7695d99 100644 --- a/examples/certificatemanager/v1beta1/certificatemapentry.yaml +++ b/examples/certificatemanager/v1beta1/certificatemapentry.yaml @@ -13,8 +13,8 @@ metadata: name: default spec: forProvider: - certificates: - - projects/official-provider-testing/locations/global/certificates/certificate + certificatesRefs: + - name: certificate description: My acceptance test certificate map entry labels: acc-test: "true" @@ -39,12 +39,12 @@ spec: forProvider: description: The default cert managed: - - dnsAuthorizations: - - projects/official-provider-testing/locations/global/dnsAuthorizations/instance - - projects/official-provider-testing/locations/global/dnsAuthorizations/instance2 - domains: - - subdomain2.hashicorptest.com - - subdomain.hashicorptest.com + - dnsAuthorizationsRefs: + - name: instance + - name: instance2 + domainsRefs: + - name: instance + - name: instance2 scope: DEFAULT --- diff --git a/examples/certificatemanager/v1beta2/certificate.yaml b/examples/certificatemanager/v1beta2/certificate.yaml index 1865baf98..afdc14f15 100644 --- a/examples/certificatemanager/v1beta2/certificate.yaml +++ b/examples/certificatemanager/v1beta2/certificate.yaml @@ -7,8 +7,7 @@ kind: Certificate metadata: annotations: meta.upbound.io/example-id: certificatemanager/v1beta2/certificate - upjet.upbound.io/manual-intervention: Certificate requires a real DNS authorization - ID + upjet.upbound.io/manual-intervention: Certificate requires a real DNS authorization ID labels: testing.upbound.io/example-name: default name: default @@ -16,11 +15,15 @@ spec: forProvider: description: The default cert location: global + labels: + env: test managed: - dnsAuthorizations: - - projects/official-provider-testing/locations/global/dnsAuthorizations/default - domains: - - subdomain.hashicorptest.com + - dnsAuthorizationsRefs: + - name: instance + - name: instance2 + domainsRefs: + - name: instance + - name: instance2 scope: DEFAULT --- @@ -31,9 +34,24 @@ metadata: annotations: meta.upbound.io/example-id: certificatemanager/v1beta2/certificate labels: - testing.upbound.io/example-name: default - name: default + testing.upbound.io/example-name: instance + name: instance spec: forProvider: description: The default dnss domain: subdomain.hashicorptest.com + +--- + +apiVersion: certificatemanager.gcp.upbound.io/v1beta1 +kind: DNSAuthorization +metadata: + annotations: + meta.upbound.io/example-id: certificatemanager/v1beta2/certificate + labels: + testing.upbound.io/example-name: instance2 + name: instance2 +spec: + forProvider: + description: The default dnss + domain: subdomain2.hashicorptest.com diff --git a/examples/compute/v1beta2/instancetemplate.yaml b/examples/compute/v1beta2/instancetemplate.yaml index 372b47e23..1c862eda5 100644 --- a/examples/compute/v1beta2/instancetemplate.yaml +++ b/examples/compute/v1beta2/instancetemplate.yaml @@ -17,18 +17,84 @@ spec: disk: - autoDelete: false boot: true + resourcePoliciesRefs: + - name: daily_backup sourceImage: debian-cloud/debian-11 + - autoDelete: false + boot: false + sourceSelector: + matchLabels: + testing.upbound.io/example-name: foobar instanceDescription: Description assigned to instances labels: - environment: dev + foo: bar machineType: e2-medium metadata: - environment: dev + foo: bar + name: appserver-template networkInterface: - - network: default + - networkSelector: + matchLabels: + testing.upbound.io/example-name: example scheduling: - automaticRestart: true + - automaticRestart: true onHostMaintenance: MIGRATE + serviceAccount: + - emailSelector: + matchLabels: + testing.upbound.io/example-name: default + scopes: + - cloud-platform tags: - foo - bar + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: Disk +metadata: + annotations: + meta.upbound.io/example-id: compute/v1beta2/instancetemplate + labels: + testing.upbound.io/example-name: foobar + name: foobar +spec: + forProvider: + image: debian-12-bookworm-v20240910 + size: 10 + type: pd-ssd + zone: us-central1-a + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: ResourcePolicy +metadata: + annotations: + meta.upbound.io/example-id: compute/v1beta2/instancetemplate + labels: + testing.upbound.io/example-name: daily_backup + name: daily-backup +spec: + forProvider: + region: us-central1 + snapshotSchedulePolicy: + - schedule: + - dailySchedule: + - daysInCycle: 1 + startTime: "04:00" + +--- + +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: ServiceAccount +metadata: + annotations: + meta.upbound.io/example-id: compute/v1beta2/instancetemplate + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + displayName: Service Account From 8003724038c55d2d4584f812eef7610d919af1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Tue, 22 Oct 2024 21:50:53 +0300 Subject: [PATCH 16/34] Backport api changes from v1beta2 to v1beta1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- .../v1beta1/zz_appconnection_types.go | 20 ++ .../v1beta1/zz_generated.deepcopy.go | 24 ++ .../v1beta1/zz_generated.resolvers.go | 39 +++ .../v1beta1/zz_generated.deepcopy.go | 48 +++ .../v1beta1/zz_generated.resolvers.go | 97 ++++++ .../v1beta1/zz_policy_types.go | 36 ++ .../v1beta1/zz_certificate_types.go | 40 +++ .../v1beta1/zz_generated.deepcopy.go | 48 +++ .../v1beta1/zz_generated.resolvers.go | 99 +++++- .../cloudrun/v1beta1/zz_generated.deepcopy.go | 48 +++ .../v1beta1/zz_generated.resolvers.go | 107 ++++++ apis/cloudrun/v1beta1/zz_v2job_types.go | 20 ++ apis/cloudrun/v1beta1/zz_v2service_types.go | 20 ++ apis/compute/v1beta1/zz_generated.deepcopy.go | 72 ++++ .../compute/v1beta1/zz_generated.resolvers.go | 128 +++++++ .../v1beta1/zz_instancetemplate_types.go | 20 ++ apis/compute/v1beta1/zz_routernat_types.go | 40 +++ .../osconfig/v1beta1/zz_generated.deepcopy.go | 25 ++ .../v1beta1/zz_generated.resolvers.go | 73 ++++ .../v1beta1/zz_patchdeployment_types.go | 20 ++ ...ondcorp.gcp.upbound.io_appconnections.yaml | 158 +++++++++ ...authorization.gcp.upbound.io_policies.yaml | 316 ++++++++++++++++++ ...temanager.gcp.upbound.io_certificates.yaml | 316 ++++++++++++++++++ .../crds/cloudrun.gcp.upbound.io_v2jobs.yaml | 162 +++++++++ .../cloudrun.gcp.upbound.io_v2services.yaml | 158 +++++++++ ...pute.gcp.upbound.io_instancetemplates.yaml | 158 +++++++++ .../compute.gcp.upbound.io_routernats.yaml | 314 +++++++++++++++++ ...onfig.gcp.upbound.io_patchdeployments.yaml | 158 +++++++++ 28 files changed, 2763 insertions(+), 1 deletion(-) create mode 100644 apis/osconfig/v1beta1/zz_generated.resolvers.go diff --git a/apis/beyondcorp/v1beta1/zz_appconnection_types.go b/apis/beyondcorp/v1beta1/zz_appconnection_types.go index ae96eb422..80d84ec27 100755 --- a/apis/beyondcorp/v1beta1/zz_appconnection_types.go +++ b/apis/beyondcorp/v1beta1/zz_appconnection_types.go @@ -20,8 +20,18 @@ type AppConnectionInitParameters struct { ApplicationEndpoint []ApplicationEndpointInitParameters `json:"applicationEndpoint,omitempty" tf:"application_endpoint,omitempty"` // List of AppConnectors that are authorised to be associated with this AppConnection + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/beyondcorp/v1beta2.AppConnector + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() Connectors []*string `json:"connectors,omitempty" tf:"connectors,omitempty"` + // References to AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsRefs []v1.Reference `json:"connectorsRefs,omitempty" tf:"-"` + + // Selector for a list of AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsSelector *v1.Selector `json:"connectorsSelector,omitempty" tf:"-"` + // An arbitrary user-provided name for the AppConnection. DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` @@ -104,9 +114,19 @@ type AppConnectionParameters struct { ApplicationEndpoint []ApplicationEndpointParameters `json:"applicationEndpoint,omitempty" tf:"application_endpoint,omitempty"` // List of AppConnectors that are authorised to be associated with this AppConnection + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/beyondcorp/v1beta2.AppConnector + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional Connectors []*string `json:"connectors,omitempty" tf:"connectors,omitempty"` + // References to AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsRefs []v1.Reference `json:"connectorsRefs,omitempty" tf:"-"` + + // Selector for a list of AppConnector in beyondcorp to populate connectors. + // +kubebuilder:validation:Optional + ConnectorsSelector *v1.Selector `json:"connectorsSelector,omitempty" tf:"-"` + // An arbitrary user-provided name for the AppConnection. // +kubebuilder:validation:Optional DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` diff --git a/apis/beyondcorp/v1beta1/zz_generated.deepcopy.go b/apis/beyondcorp/v1beta1/zz_generated.deepcopy.go index 771c30ce5..acf6071e3 100644 --- a/apis/beyondcorp/v1beta1/zz_generated.deepcopy.go +++ b/apis/beyondcorp/v1beta1/zz_generated.deepcopy.go @@ -116,6 +116,18 @@ func (in *AppConnectionInitParameters) DeepCopyInto(out *AppConnectionInitParame } } } + if in.ConnectorsRefs != nil { + in, out := &in.ConnectorsRefs, &out.ConnectorsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConnectorsSelector != nil { + in, out := &in.ConnectorsSelector, &out.ConnectorsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DisplayName != nil { in, out := &in.DisplayName, &out.DisplayName *out = new(string) @@ -347,6 +359,18 @@ func (in *AppConnectionParameters) DeepCopyInto(out *AppConnectionParameters) { } } } + if in.ConnectorsRefs != nil { + in, out := &in.ConnectorsRefs, &out.ConnectorsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConnectorsSelector != nil { + in, out := &in.ConnectorsSelector, &out.ConnectorsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.DisplayName != nil { in, out := &in.DisplayName, &out.DisplayName *out = new(string) diff --git a/apis/beyondcorp/v1beta1/zz_generated.resolvers.go b/apis/beyondcorp/v1beta1/zz_generated.resolvers.go index caf6bdda3..3be091667 100644 --- a/apis/beyondcorp/v1beta1/zz_generated.resolvers.go +++ b/apis/beyondcorp/v1beta1/zz_generated.resolvers.go @@ -24,7 +24,27 @@ func (mg *AppConnection) ResolveReferences( // ResolveReferences of this AppConn r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("beyondcorp.gcp.upbound.io", "v1beta2", "AppConnector", "AppConnectorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Connectors), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.ConnectorsRefs, + Selector: mg.Spec.ForProvider.ConnectorsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Connectors") + } + mg.Spec.ForProvider.Connectors = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.ConnectorsRefs = mrsp.ResolvedReferences for i3 := 0; i3 < len(mg.Spec.ForProvider.Gateway); i3++ { { @@ -47,6 +67,25 @@ func (mg *AppConnection) ResolveReferences( // ResolveReferences of this AppConn mg.Spec.ForProvider.Gateway[i3].AppGatewayRef = rsp.ResolvedReference } + { + m, l, err = apisresolver.GetManagedResource("beyondcorp.gcp.upbound.io", "v1beta2", "AppConnector", "AppConnectorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Connectors), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.ConnectorsRefs, + Selector: mg.Spec.InitProvider.ConnectorsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Connectors") + } + mg.Spec.InitProvider.Connectors = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.ConnectorsRefs = mrsp.ResolvedReferences + for i3 := 0; i3 < len(mg.Spec.InitProvider.Gateway); i3++ { { m, l, err = apisresolver.GetManagedResource("beyondcorp.gcp.upbound.io", "v1beta1", "AppGateway", "AppGatewayList") diff --git a/apis/binaryauthorization/v1beta1/zz_generated.deepcopy.go b/apis/binaryauthorization/v1beta1/zz_generated.deepcopy.go index fc6f292d7..d82f2ba86 100644 --- a/apis/binaryauthorization/v1beta1/zz_generated.deepcopy.go +++ b/apis/binaryauthorization/v1beta1/zz_generated.deepcopy.go @@ -403,6 +403,18 @@ func (in *ClusterAdmissionRulesInitParameters) DeepCopyInto(out *ClusterAdmissio } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAdmissionRulesInitParameters. @@ -485,6 +497,18 @@ func (in *ClusterAdmissionRulesParameters) DeepCopyInto(out *ClusterAdmissionRul } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAdmissionRulesParameters. @@ -521,6 +545,18 @@ func (in *DefaultAdmissionRuleInitParameters) DeepCopyInto(out *DefaultAdmission } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultAdmissionRuleInitParameters. @@ -593,6 +629,18 @@ func (in *DefaultAdmissionRuleParameters) DeepCopyInto(out *DefaultAdmissionRule } } } + if in.RequireAttestationsByRefs != nil { + in, out := &in.RequireAttestationsByRefs, &out.RequireAttestationsByRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequireAttestationsBySelector != nil { + in, out := &in.RequireAttestationsBySelector, &out.RequireAttestationsBySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultAdmissionRuleParameters. diff --git a/apis/binaryauthorization/v1beta1/zz_generated.resolvers.go b/apis/binaryauthorization/v1beta1/zz_generated.resolvers.go index 3bddb9c34..97f85fdd5 100644 --- a/apis/binaryauthorization/v1beta1/zz_generated.resolvers.go +++ b/apis/binaryauthorization/v1beta1/zz_generated.resolvers.go @@ -71,3 +71,100 @@ func (mg *Attestor) ResolveReferences(ctx context.Context, c client.Reader) erro return nil } + +// ResolveReferences of this Policy. +func (mg *Policy) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var mrsp reference.MultiResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.ClusterAdmissionRules); i3++ { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs, + Selector: mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBy") + } + mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.ForProvider.DefaultAdmissionRule); i3++ { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.DefaultAdmissionRule[i3].RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.ForProvider.DefaultAdmissionRule[i3].RequireAttestationsByRefs, + Selector: mg.Spec.ForProvider.DefaultAdmissionRule[i3].RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.DefaultAdmissionRule[i3].RequireAttestationsBy") + } + mg.Spec.ForProvider.DefaultAdmissionRule[i3].RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.DefaultAdmissionRule[i3].RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.ClusterAdmissionRules); i3++ { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs, + Selector: mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBy") + } + mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.ClusterAdmissionRules[i3].RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.DefaultAdmissionRule); i3++ { + { + m, l, err = apisresolver.GetManagedResource("binaryauthorization.gcp.upbound.io", "v1beta2", "Attestor", "AttestorList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.DefaultAdmissionRule[i3].RequireAttestationsBy), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.DefaultAdmissionRule[i3].RequireAttestationsByRefs, + Selector: mg.Spec.InitProvider.DefaultAdmissionRule[i3].RequireAttestationsBySelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DefaultAdmissionRule[i3].RequireAttestationsBy") + } + mg.Spec.InitProvider.DefaultAdmissionRule[i3].RequireAttestationsBy = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.DefaultAdmissionRule[i3].RequireAttestationsByRefs = mrsp.ResolvedReferences + + } + + return nil +} diff --git a/apis/binaryauthorization/v1beta1/zz_policy_types.go b/apis/binaryauthorization/v1beta1/zz_policy_types.go index c167cb23c..5917061e4 100755 --- a/apis/binaryauthorization/v1beta1/zz_policy_types.go +++ b/apis/binaryauthorization/v1beta1/zz_policy_types.go @@ -62,8 +62,17 @@ type ClusterAdmissionRulesInitParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type ClusterAdmissionRulesObservation struct { @@ -115,9 +124,18 @@ type ClusterAdmissionRulesParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +kubebuilder:validation:Optional // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type DefaultAdmissionRuleInitParameters struct { @@ -138,8 +156,17 @@ type DefaultAdmissionRuleInitParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type DefaultAdmissionRuleObservation struct { @@ -184,9 +211,18 @@ type DefaultAdmissionRuleParameters struct { // request must be able to read the attestor resource. // Note: this field must be non-empty when the evaluation_mode field // specifies REQUIRE_ATTESTATION, otherwise it must be empty. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/binaryauthorization/v1beta2.Attestor // +kubebuilder:validation:Optional // +listType=set RequireAttestationsBy []*string `json:"requireAttestationsBy,omitempty" tf:"require_attestations_by,omitempty"` + + // References to Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsByRefs []v1.Reference `json:"requireAttestationsByRefs,omitempty" tf:"-"` + + // Selector for a list of Attestor in binaryauthorization to populate requireAttestationsBy. + // +kubebuilder:validation:Optional + RequireAttestationsBySelector *v1.Selector `json:"requireAttestationsBySelector,omitempty" tf:"-"` } type PolicyInitParameters struct { diff --git a/apis/certificatemanager/v1beta1/zz_certificate_types.go b/apis/certificatemanager/v1beta1/zz_certificate_types.go index 8096fcfc6..31c0c5581 100755 --- a/apis/certificatemanager/v1beta1/zz_certificate_types.go +++ b/apis/certificatemanager/v1beta1/zz_certificate_types.go @@ -178,12 +178,32 @@ type CertificateParameters struct { type ManagedInitParameters struct { // Authorizations that will be used for performing domain authorization. Either issuanceConfig or dnsAuthorizations should be specificed, but not both. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() DNSAuthorizations []*string `json:"dnsAuthorizations,omitempty" tf:"dns_authorizations,omitempty"` + // References to DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsRefs []v1.Reference `json:"dnsAuthorizationsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsSelector *v1.Selector `json:"dnsAuthorizationsSelector,omitempty" tf:"-"` + // The domains for which a managed SSL certificate will be generated. // Wildcard domains are only supported with DNS challenge resolution + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("domain",false) Domains []*string `json:"domains,omitempty" tf:"domains,omitempty"` + // References to DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsRefs []v1.Reference `json:"domainsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsSelector *v1.Selector `json:"domainsSelector,omitempty" tf:"-"` + // The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. // If this field is not set, the certificates will instead be publicly signed as documented at https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa. // Either issuanceConfig or dnsAuthorizations should be specificed, but not both. @@ -223,14 +243,34 @@ type ManagedObservation struct { type ManagedParameters struct { // Authorizations that will be used for performing domain authorization. Either issuanceConfig or dnsAuthorizations should be specificed, but not both. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional DNSAuthorizations []*string `json:"dnsAuthorizations,omitempty" tf:"dns_authorizations,omitempty"` + // References to DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsRefs []v1.Reference `json:"dnsAuthorizationsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate dnsAuthorizations. + // +kubebuilder:validation:Optional + DNSAuthorizationsSelector *v1.Selector `json:"dnsAuthorizationsSelector,omitempty" tf:"-"` + // The domains for which a managed SSL certificate will be generated. // Wildcard domains are only supported with DNS challenge resolution + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/certificatemanager/v1beta1.DNSAuthorization + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("domain",false) // +kubebuilder:validation:Optional Domains []*string `json:"domains,omitempty" tf:"domains,omitempty"` + // References to DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsRefs []v1.Reference `json:"domainsRefs,omitempty" tf:"-"` + + // Selector for a list of DNSAuthorization in certificatemanager to populate domains. + // +kubebuilder:validation:Optional + DomainsSelector *v1.Selector `json:"domainsSelector,omitempty" tf:"-"` + // The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. // If this field is not set, the certificates will instead be publicly signed as documented at https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa. // Either issuanceConfig or dnsAuthorizations should be specificed, but not both. diff --git a/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go b/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go index 4115b78b8..d7636430f 100644 --- a/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go +++ b/apis/certificatemanager/v1beta1/zz_generated.deepcopy.go @@ -1544,6 +1544,18 @@ func (in *ManagedInitParameters) DeepCopyInto(out *ManagedInitParameters) { } } } + if in.DNSAuthorizationsRefs != nil { + in, out := &in.DNSAuthorizationsRefs, &out.DNSAuthorizationsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DNSAuthorizationsSelector != nil { + in, out := &in.DNSAuthorizationsSelector, &out.DNSAuthorizationsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Domains != nil { in, out := &in.Domains, &out.Domains *out = make([]*string, len(*in)) @@ -1555,6 +1567,18 @@ func (in *ManagedInitParameters) DeepCopyInto(out *ManagedInitParameters) { } } } + if in.DomainsRefs != nil { + in, out := &in.DomainsRefs, &out.DomainsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DomainsSelector != nil { + in, out := &in.DomainsSelector, &out.DomainsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.IssuanceConfig != nil { in, out := &in.IssuanceConfig, &out.IssuanceConfig *out = new(string) @@ -1647,6 +1671,18 @@ func (in *ManagedParameters) DeepCopyInto(out *ManagedParameters) { } } } + if in.DNSAuthorizationsRefs != nil { + in, out := &in.DNSAuthorizationsRefs, &out.DNSAuthorizationsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DNSAuthorizationsSelector != nil { + in, out := &in.DNSAuthorizationsSelector, &out.DNSAuthorizationsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Domains != nil { in, out := &in.Domains, &out.Domains *out = make([]*string, len(*in)) @@ -1658,6 +1694,18 @@ func (in *ManagedParameters) DeepCopyInto(out *ManagedParameters) { } } } + if in.DomainsRefs != nil { + in, out := &in.DomainsRefs, &out.DomainsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DomainsSelector != nil { + in, out := &in.DomainsSelector, &out.DomainsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.IssuanceConfig != nil { in, out := &in.IssuanceConfig, &out.IssuanceConfig *out = new(string) diff --git a/apis/certificatemanager/v1beta1/zz_generated.resolvers.go b/apis/certificatemanager/v1beta1/zz_generated.resolvers.go index d9d03ae39..320d8c939 100644 --- a/apis/certificatemanager/v1beta1/zz_generated.resolvers.go +++ b/apis/certificatemanager/v1beta1/zz_generated.resolvers.go @@ -17,12 +17,109 @@ import ( client "sigs.k8s.io/controller-runtime/pkg/client" ) -func (mg *CertificateMapEntry) ResolveReferences( // ResolveReferences of this CertificateMapEntry. +func (mg *Certificate) ResolveReferences( // ResolveReferences of this Certificate. ctx context.Context, c client.Reader) error { var m xpresource.Managed var l xpresource.ManagedList r := reference.NewAPIResolver(c, mg) + var mrsp reference.MultiResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.Managed); i3++ { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Managed[i3].DNSAuthorizations), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.Managed[i3].DNSAuthorizationsRefs, + Selector: mg.Spec.ForProvider.Managed[i3].DNSAuthorizationsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Managed[i3].DNSAuthorizations") + } + mg.Spec.ForProvider.Managed[i3].DNSAuthorizations = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Managed[i3].DNSAuthorizationsRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.ForProvider.Managed); i3++ { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Managed[i3].Domains), + Extract: resource.ExtractParamPath("domain", false), + References: mg.Spec.ForProvider.Managed[i3].DomainsRefs, + Selector: mg.Spec.ForProvider.Managed[i3].DomainsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Managed[i3].Domains") + } + mg.Spec.ForProvider.Managed[i3].Domains = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Managed[i3].DomainsRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Managed); i3++ { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Managed[i3].DNSAuthorizations), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.Managed[i3].DNSAuthorizationsRefs, + Selector: mg.Spec.InitProvider.Managed[i3].DNSAuthorizationsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Managed[i3].DNSAuthorizations") + } + mg.Spec.InitProvider.Managed[i3].DNSAuthorizations = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Managed[i3].DNSAuthorizationsRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Managed); i3++ { + { + m, l, err = apisresolver.GetManagedResource("certificatemanager.gcp.upbound.io", "v1beta1", "DNSAuthorization", "DNSAuthorizationList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Managed[i3].Domains), + Extract: resource.ExtractParamPath("domain", false), + References: mg.Spec.InitProvider.Managed[i3].DomainsRefs, + Selector: mg.Spec.InitProvider.Managed[i3].DomainsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Managed[i3].Domains") + } + mg.Spec.InitProvider.Managed[i3].Domains = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Managed[i3].DomainsRefs = mrsp.ResolvedReferences + + } + + return nil +} + +// ResolveReferences of this CertificateMapEntry. +func (mg *CertificateMapEntry) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + var rsp reference.ResolutionResponse var mrsp reference.MultiResolutionResponse var err error diff --git a/apis/cloudrun/v1beta1/zz_generated.deepcopy.go b/apis/cloudrun/v1beta1/zz_generated.deepcopy.go index f24b19246..07fc83e6e 100644 --- a/apis/cloudrun/v1beta1/zz_generated.deepcopy.go +++ b/apis/cloudrun/v1beta1/zz_generated.deepcopy.go @@ -102,6 +102,18 @@ func (in *CloudSQLInstanceInitParameters) DeepCopyInto(out *CloudSQLInstanceInit } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSQLInstanceInitParameters. @@ -154,6 +166,18 @@ func (in *CloudSQLInstanceParameters) DeepCopyInto(out *CloudSQLInstanceParamete } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSQLInstanceParameters. @@ -10965,6 +10989,18 @@ func (in *VolumesCloudSQLInstanceInitParameters) DeepCopyInto(out *VolumesCloudS } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumesCloudSQLInstanceInitParameters. @@ -11017,6 +11053,18 @@ func (in *VolumesCloudSQLInstanceParameters) DeepCopyInto(out *VolumesCloudSQLIn } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumesCloudSQLInstanceParameters. diff --git a/apis/cloudrun/v1beta1/zz_generated.resolvers.go b/apis/cloudrun/v1beta1/zz_generated.resolvers.go index b446fa6e5..004c68826 100644 --- a/apis/cloudrun/v1beta1/zz_generated.resolvers.go +++ b/apis/cloudrun/v1beta1/zz_generated.resolvers.go @@ -9,6 +9,7 @@ package v1beta1 import ( "context" reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" errors "github.com/pkg/errors" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" @@ -379,6 +380,7 @@ func (mg *V2Job) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error for i3 := 0; i3 < len(mg.Spec.ForProvider.Template); i3++ { @@ -412,6 +414,33 @@ func (mg *V2Job) ResolveReferences(ctx context.Context, c client.Reader) error { } } } + for i3 := 0; i3 < len(mg.Spec.ForProvider.Template); i3++ { + for i4 := 0; i4 < len(mg.Spec.ForProvider.Template[i3].Template); i4++ { + for i5 := 0; i5 < len(mg.Spec.ForProvider.Template[i3].Template[i4].Volumes); i5++ { + for i6 := 0; i6 < len(mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance); i6++ { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].InstancesRefs, + Selector: mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].Instances") + } + mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].InstancesRefs = mrsp.ResolvedReferences + + } + } + } + } for i3 := 0; i3 < len(mg.Spec.ForProvider.Template); i3++ { for i4 := 0; i4 < len(mg.Spec.ForProvider.Template[i3].Template); i4++ { for i5 := 0; i5 < len(mg.Spec.ForProvider.Template[i3].Template[i4].Volumes); i5++ { @@ -470,6 +499,33 @@ func (mg *V2Job) ResolveReferences(ctx context.Context, c client.Reader) error { } } } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Template); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Template[i3].Template); i4++ { + for i5 := 0; i5 < len(mg.Spec.InitProvider.Template[i3].Template[i4].Volumes); i5++ { + for i6 := 0; i6 < len(mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance); i6++ { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].InstancesRefs, + Selector: mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].Instances") + } + mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Template[i3].Template[i4].Volumes[i5].CloudSQLInstance[i6].InstancesRefs = mrsp.ResolvedReferences + + } + } + } + } for i3 := 0; i3 < len(mg.Spec.InitProvider.Template); i3++ { for i4 := 0; i4 < len(mg.Spec.InitProvider.Template[i3].Template); i4++ { for i5 := 0; i5 < len(mg.Spec.InitProvider.Template[i3].Template[i4].Volumes); i5++ { @@ -508,6 +564,7 @@ func (mg *V2Service) ResolveReferences(ctx context.Context, c client.Reader) err r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error for i3 := 0; i3 < len(mg.Spec.ForProvider.Template); i3++ { @@ -539,6 +596,31 @@ func (mg *V2Service) ResolveReferences(ctx context.Context, c client.Reader) err } } } + for i3 := 0; i3 < len(mg.Spec.ForProvider.Template); i3++ { + for i4 := 0; i4 < len(mg.Spec.ForProvider.Template[i3].Volumes); i4++ { + for i5 := 0; i5 < len(mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance); i5++ { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].InstancesRefs, + Selector: mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].Instances") + } + mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].InstancesRefs = mrsp.ResolvedReferences + + } + } + } for i3 := 0; i3 < len(mg.Spec.ForProvider.Template); i3++ { for i4 := 0; i4 < len(mg.Spec.ForProvider.Template[i3].Volumes); i4++ { for i5 := 0; i5 < len(mg.Spec.ForProvider.Template[i3].Volumes[i4].Gcs); i5++ { @@ -618,6 +700,31 @@ func (mg *V2Service) ResolveReferences(ctx context.Context, c client.Reader) err } } } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Template); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Template[i3].Volumes); i4++ { + for i5 := 0; i5 < len(mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance); i5++ { + { + m, l, err = apisresolver.GetManagedResource("sql.gcp.upbound.io", "v1beta2", "DatabaseInstance", "DatabaseInstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].Instances), + Extract: resource.ExtractParamPath("connection_name", true), + References: mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].InstancesRefs, + Selector: mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].Instances") + } + mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Template[i3].Volumes[i4].CloudSQLInstance[i5].InstancesRefs = mrsp.ResolvedReferences + + } + } + } for i3 := 0; i3 < len(mg.Spec.InitProvider.Template); i3++ { for i4 := 0; i4 < len(mg.Spec.InitProvider.Template[i3].Volumes); i4++ { for i5 := 0; i5 < len(mg.Spec.InitProvider.Template[i3].Volumes[i4].Gcs); i5++ { diff --git a/apis/cloudrun/v1beta1/zz_v2job_types.go b/apis/cloudrun/v1beta1/zz_v2job_types.go index 76af017b5..602969b0e 100755 --- a/apis/cloudrun/v1beta1/zz_v2job_types.go +++ b/apis/cloudrun/v1beta1/zz_v2job_types.go @@ -45,7 +45,17 @@ type BinaryAuthorizationParameters struct { type CloudSQLInstanceInitParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type CloudSQLInstanceObservation struct { @@ -57,8 +67,18 @@ type CloudSQLInstanceObservation struct { type CloudSQLInstanceParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) // +kubebuilder:validation:Optional Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type ContainersEnvInitParameters struct { diff --git a/apis/cloudrun/v1beta1/zz_v2service_types.go b/apis/cloudrun/v1beta1/zz_v2service_types.go index 8396cb9ff..398c27899 100755 --- a/apis/cloudrun/v1beta1/zz_v2service_types.go +++ b/apis/cloudrun/v1beta1/zz_v2service_types.go @@ -1822,8 +1822,18 @@ type VPCAccessNetworkInterfacesParameters struct { type VolumesCloudSQLInstanceInitParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) // +listType=set Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type VolumesCloudSQLInstanceObservation struct { @@ -1836,9 +1846,19 @@ type VolumesCloudSQLInstanceObservation struct { type VolumesCloudSQLInstanceParameters struct { // The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/sql/v1beta2.DatabaseInstance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("connection_name",true) // +kubebuilder:validation:Optional // +listType=set Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + + // References to DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of DatabaseInstance in sql to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` } type VolumesSecretItemsInitParameters struct { diff --git a/apis/compute/v1beta1/zz_generated.deepcopy.go b/apis/compute/v1beta1/zz_generated.deepcopy.go index 734dc72ca..dc3cd219f 100644 --- a/apis/compute/v1beta1/zz_generated.deepcopy.go +++ b/apis/compute/v1beta1/zz_generated.deepcopy.go @@ -192,6 +192,18 @@ func (in *ActionInitParameters) DeepCopyInto(out *ActionInitParameters) { } } } + if in.SourceNATActiveIpsRefs != nil { + in, out := &in.SourceNATActiveIpsRefs, &out.SourceNATActiveIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SourceNATActiveIpsSelector != nil { + in, out := &in.SourceNATActiveIpsSelector, &out.SourceNATActiveIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.SourceNATDrainIps != nil { in, out := &in.SourceNATDrainIps, &out.SourceNATDrainIps *out = make([]*string, len(*in)) @@ -266,6 +278,18 @@ func (in *ActionParameters) DeepCopyInto(out *ActionParameters) { } } } + if in.SourceNATActiveIpsRefs != nil { + in, out := &in.SourceNATActiveIpsRefs, &out.SourceNATActiveIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SourceNATActiveIpsSelector != nil { + in, out := &in.SourceNATActiveIpsSelector, &out.SourceNATActiveIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.SourceNATDrainIps != nil { in, out := &in.SourceNATDrainIps, &out.SourceNATDrainIps *out = make([]*string, len(*in)) @@ -26520,6 +26544,18 @@ func (in *InstanceTemplateDiskInitParameters) DeepCopyInto(out *InstanceTemplate } } } + if in.ResourcePoliciesRefs != nil { + in, out := &in.ResourcePoliciesRefs, &out.ResourcePoliciesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourcePoliciesSelector != nil { + in, out := &in.ResourcePoliciesSelector, &out.ResourcePoliciesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Source != nil { in, out := &in.Source, &out.Source *out = new(string) @@ -26818,6 +26854,18 @@ func (in *InstanceTemplateDiskParameters) DeepCopyInto(out *InstanceTemplateDisk } } } + if in.ResourcePoliciesRefs != nil { + in, out := &in.ResourcePoliciesRefs, &out.ResourcePoliciesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ResourcePoliciesSelector != nil { + in, out := &in.ResourcePoliciesSelector, &out.ResourcePoliciesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Source != nil { in, out := &in.Source, &out.Source *out = new(string) @@ -61647,6 +61695,18 @@ func (in *RouterNATInitParameters) DeepCopyInto(out *RouterNATInitParameters) { } } } + if in.NATIpsRefs != nil { + in, out := &in.NATIpsRefs, &out.NATIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NATIpsSelector != nil { + in, out := &in.NATIpsSelector, &out.NATIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Project != nil { in, out := &in.Project, &out.Project *out = new(string) @@ -62037,6 +62097,18 @@ func (in *RouterNATParameters) DeepCopyInto(out *RouterNATParameters) { } } } + if in.NATIpsRefs != nil { + in, out := &in.NATIpsRefs, &out.NATIpsRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NATIpsSelector != nil { + in, out := &in.NATIpsSelector, &out.NATIpsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Project != nil { in, out := &in.Project, &out.Project *out = new(string) diff --git a/apis/compute/v1beta1/zz_generated.resolvers.go b/apis/compute/v1beta1/zz_generated.resolvers.go index f2a491047..f043d29da 100644 --- a/apis/compute/v1beta1/zz_generated.resolvers.go +++ b/apis/compute/v1beta1/zz_generated.resolvers.go @@ -2156,8 +2156,30 @@ func (mg *InstanceTemplate) ResolveReferences(ctx context.Context, c client.Read r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + for i3 := 0; i3 < len(mg.Spec.ForProvider.Disk); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "ResourcePolicy", "ResourcePolicyList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Disk[i3].ResourcePolicies), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.Disk[i3].ResourcePoliciesRefs, + Selector: mg.Spec.ForProvider.Disk[i3].ResourcePoliciesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Disk[i3].ResourcePolicies") + } + mg.Spec.ForProvider.Disk[i3].ResourcePolicies = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Disk[i3].ResourcePoliciesRefs = mrsp.ResolvedReferences + + } for i3 := 0; i3 < len(mg.Spec.ForProvider.Disk); i3++ { { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Disk", "DiskList") @@ -2241,6 +2263,27 @@ func (mg *InstanceTemplate) ResolveReferences(ctx context.Context, c client.Read mg.Spec.ForProvider.ServiceAccount[i3].Email = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.ServiceAccount[i3].EmailRef = rsp.ResolvedReference + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Disk); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "ResourcePolicy", "ResourcePolicyList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Disk[i3].ResourcePolicies), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.Disk[i3].ResourcePoliciesRefs, + Selector: mg.Spec.InitProvider.Disk[i3].ResourcePoliciesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Disk[i3].ResourcePolicies") + } + mg.Spec.InitProvider.Disk[i3].ResourcePolicies = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Disk[i3].ResourcePoliciesRefs = mrsp.ResolvedReferences + } for i3 := 0; i3 < len(mg.Spec.InitProvider.Disk); i3++ { { @@ -5100,7 +5143,27 @@ func (mg *RouterNAT) ResolveReferences(ctx context.Context, c client.Reader) err r := reference.NewAPIResolver(c, mg) var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse var err error + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.NATIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.ForProvider.NATIpsRefs, + Selector: mg.Spec.ForProvider.NATIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.NATIps") + } + mg.Spec.ForProvider.NATIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.NATIpsRefs = mrsp.ResolvedReferences { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Router", "RouterList") if err != nil { @@ -5121,6 +5184,29 @@ func (mg *RouterNAT) ResolveReferences(ctx context.Context, c client.Reader) err mg.Spec.ForProvider.Router = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.RouterRef = rsp.ResolvedReference + for i3 := 0; i3 < len(mg.Spec.ForProvider.Rules); i3++ { + for i4 := 0; i4 < len(mg.Spec.ForProvider.Rules[i3].Action); i4++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.Rules[i3].Action[i4].SourceNATActiveIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.ForProvider.Rules[i3].Action[i4].SourceNATActiveIpsRefs, + Selector: mg.Spec.ForProvider.Rules[i3].Action[i4].SourceNATActiveIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Rules[i3].Action[i4].SourceNATActiveIps") + } + mg.Spec.ForProvider.Rules[i3].Action[i4].SourceNATActiveIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.Rules[i3].Action[i4].SourceNATActiveIpsRefs = mrsp.ResolvedReferences + + } + } for i3 := 0; i3 < len(mg.Spec.ForProvider.Subnetwork); i3++ { { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Subnetwork", "SubnetworkList") @@ -5142,6 +5228,48 @@ func (mg *RouterNAT) ResolveReferences(ctx context.Context, c client.Reader) err mg.Spec.ForProvider.Subnetwork[i3].NameRef = rsp.ResolvedReference } + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.NATIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.InitProvider.NATIpsRefs, + Selector: mg.Spec.InitProvider.NATIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.NATIps") + } + mg.Spec.InitProvider.NATIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.NATIpsRefs = mrsp.ResolvedReferences + + for i3 := 0; i3 < len(mg.Spec.InitProvider.Rules); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Rules[i3].Action); i4++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Address", "AddressList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.Rules[i3].Action[i4].SourceNATActiveIps), + Extract: resource.ExtractParamPath("self_link", true), + References: mg.Spec.InitProvider.Rules[i3].Action[i4].SourceNATActiveIpsRefs, + Selector: mg.Spec.InitProvider.Rules[i3].Action[i4].SourceNATActiveIpsSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Rules[i3].Action[i4].SourceNATActiveIps") + } + mg.Spec.InitProvider.Rules[i3].Action[i4].SourceNATActiveIps = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.Rules[i3].Action[i4].SourceNATActiveIpsRefs = mrsp.ResolvedReferences + + } + } for i3 := 0; i3 < len(mg.Spec.InitProvider.Subnetwork); i3++ { { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Subnetwork", "SubnetworkList") diff --git a/apis/compute/v1beta1/zz_instancetemplate_types.go b/apis/compute/v1beta1/zz_instancetemplate_types.go index dfe8ccc8b..827ff8269 100755 --- a/apis/compute/v1beta1/zz_instancetemplate_types.go +++ b/apis/compute/v1beta1/zz_instancetemplate_types.go @@ -236,8 +236,18 @@ type InstanceTemplateDiskInitParameters struct { ResourceManagerTags map[string]*string `json:"resourceManagerTags,omitempty" tf:"resource_manager_tags,omitempty"` // - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.ResourcePolicy + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() ResourcePolicies []*string `json:"resourcePolicies,omitempty" tf:"resource_policies,omitempty"` + // References to ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesRefs []v1.Reference `json:"resourcePoliciesRefs,omitempty" tf:"-"` + + // Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesSelector *v1.Selector `json:"resourcePoliciesSelector,omitempty" tf:"-"` + // The name (not self_link) // of the disk (such as those managed by google_compute_disk) to attach. // ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. @@ -441,9 +451,19 @@ type InstanceTemplateDiskParameters struct { ResourceManagerTags map[string]*string `json:"resourceManagerTags,omitempty" tf:"resource_manager_tags,omitempty"` // - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.ResourcePolicy + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional ResourcePolicies []*string `json:"resourcePolicies,omitempty" tf:"resource_policies,omitempty"` + // References to ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesRefs []v1.Reference `json:"resourcePoliciesRefs,omitempty" tf:"-"` + + // Selector for a list of ResourcePolicy in compute to populate resourcePolicies. + // +kubebuilder:validation:Optional + ResourcePoliciesSelector *v1.Selector `json:"resourcePoliciesSelector,omitempty" tf:"-"` + // The name (not self_link) // of the disk (such as those managed by google_compute_disk) to attach. // ~> Note: Either source, source_image, or source_snapshot is required in a disk block unless the disk type is local-ssd. Check the API docs for details. diff --git a/apis/compute/v1beta1/zz_routernat_types.go b/apis/compute/v1beta1/zz_routernat_types.go index 6b9c2bd72..d27a7ea88 100755 --- a/apis/compute/v1beta1/zz_routernat_types.go +++ b/apis/compute/v1beta1/zz_routernat_types.go @@ -18,9 +18,19 @@ type ActionInitParameters struct { // A list of URLs of the IP resources used for this NAT rule. // These IP addresses must be valid static external IP addresses assigned to the project. // This field is used for public NAT. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +listType=set SourceNATActiveIps []*string `json:"sourceNatActiveIps,omitempty" tf:"source_nat_active_ips,omitempty"` + // References to Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsRefs []v1.Reference `json:"sourceNatActiveIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsSelector *v1.Selector `json:"sourceNatActiveIpsSelector,omitempty" tf:"-"` + // A list of URLs of the IP resources to be drained. // These IPs must be valid static external IPs that have been assigned to the NAT. // These IPs should be used for updating/patching a NAT rule only. @@ -50,10 +60,20 @@ type ActionParameters struct { // A list of URLs of the IP resources used for this NAT rule. // These IP addresses must be valid static external IP addresses assigned to the project. // This field is used for public NAT. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +kubebuilder:validation:Optional // +listType=set SourceNATActiveIps []*string `json:"sourceNatActiveIps,omitempty" tf:"source_nat_active_ips,omitempty"` + // References to Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsRefs []v1.Reference `json:"sourceNatActiveIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate sourceNatActiveIps. + // +kubebuilder:validation:Optional + SourceNATActiveIpsSelector *v1.Selector `json:"sourceNatActiveIpsSelector,omitempty" tf:"-"` + // A list of URLs of the IP resources to be drained. // These IPs must be valid static external IPs that have been assigned to the NAT. // These IPs should be used for updating/patching a NAT rule only. @@ -116,9 +136,19 @@ type RouterNATInitParameters struct { // Self-links of NAT IPs. Only valid if natIpAllocateOption // is set to MANUAL_ONLY. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +listType=set NATIps []*string `json:"natIps,omitempty" tf:"nat_ips,omitempty"` + // References to Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsRefs []v1.Reference `json:"natIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsSelector *v1.Selector `json:"natIpsSelector,omitempty" tf:"-"` + // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. Project *string `json:"project,omitempty" tf:"project,omitempty"` @@ -363,10 +393,20 @@ type RouterNATParameters struct { // Self-links of NAT IPs. Only valid if natIpAllocateOption // is set to MANUAL_ONLY. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Address + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("self_link",true) // +kubebuilder:validation:Optional // +listType=set NATIps []*string `json:"natIps,omitempty" tf:"nat_ips,omitempty"` + // References to Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsRefs []v1.Reference `json:"natIpsRefs,omitempty" tf:"-"` + + // Selector for a list of Address in compute to populate natIps. + // +kubebuilder:validation:Optional + NATIpsSelector *v1.Selector `json:"natIpsSelector,omitempty" tf:"-"` + // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. // +kubebuilder:validation:Optional diff --git a/apis/osconfig/v1beta1/zz_generated.deepcopy.go b/apis/osconfig/v1beta1/zz_generated.deepcopy.go index 325388b36..c664836a1 100644 --- a/apis/osconfig/v1beta1/zz_generated.deepcopy.go +++ b/apis/osconfig/v1beta1/zz_generated.deepcopy.go @@ -9,6 +9,7 @@ package v1beta1 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -3944,6 +3945,18 @@ func (in *PatchDeploymentInstanceFilterInitParameters) DeepCopyInto(out *PatchDe } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Zones != nil { in, out := &in.Zones, &out.Zones *out = make([]*string, len(*in)) @@ -4064,6 +4077,18 @@ func (in *PatchDeploymentInstanceFilterParameters) DeepCopyInto(out *PatchDeploy } } } + if in.InstancesRefs != nil { + in, out := &in.InstancesRefs, &out.InstancesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstancesSelector != nil { + in, out := &in.InstancesSelector, &out.InstancesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.Zones != nil { in, out := &in.Zones, &out.Zones *out = make([]*string, len(*in)) diff --git a/apis/osconfig/v1beta1/zz_generated.resolvers.go b/apis/osconfig/v1beta1/zz_generated.resolvers.go new file mode 100644 index 000000000..80fae2434 --- /dev/null +++ b/apis/osconfig/v1beta1/zz_generated.resolvers.go @@ -0,0 +1,73 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 +// Code generated by angryjet. DO NOT EDIT. +// Code transformed by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" + errors "github.com/pkg/errors" + + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + apisresolver "github.com/upbound/provider-gcp/internal/apis" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +func (mg *PatchDeployment) ResolveReferences( // ResolveReferences of this PatchDeployment. + ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var mrsp reference.MultiResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.InstanceFilter); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Instance", "InstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.InstanceFilter[i3].Instances), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.InstanceFilter[i3].InstancesRefs, + Selector: mg.Spec.ForProvider.InstanceFilter[i3].InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.InstanceFilter[i3].Instances") + } + mg.Spec.ForProvider.InstanceFilter[i3].Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.InstanceFilter[i3].InstancesRefs = mrsp.ResolvedReferences + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.InstanceFilter); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Instance", "InstanceList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.InstanceFilter[i3].Instances), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.InstanceFilter[i3].InstancesRefs, + Selector: mg.Spec.InitProvider.InstanceFilter[i3].InstancesSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.InstanceFilter[i3].Instances") + } + mg.Spec.InitProvider.InstanceFilter[i3].Instances = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.InstanceFilter[i3].InstancesRefs = mrsp.ResolvedReferences + + } + + return nil +} diff --git a/apis/osconfig/v1beta1/zz_patchdeployment_types.go b/apis/osconfig/v1beta1/zz_patchdeployment_types.go index e9b513ceb..69c4f133a 100755 --- a/apis/osconfig/v1beta1/zz_patchdeployment_types.go +++ b/apis/osconfig/v1beta1/zz_patchdeployment_types.go @@ -598,8 +598,18 @@ type PatchDeploymentInstanceFilterInitParameters struct { // Targets any of the VM instances specified. Instances are specified by their URI in the form zones/{{zone}}/instances/{{instance_name}}, // projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}}, or // https://www.googleapis.com/compute/v1/projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Instance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + // References to Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` + // Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. Zones []*string `json:"zones,omitempty" tf:"zones,omitempty"` } @@ -645,9 +655,19 @@ type PatchDeploymentInstanceFilterParameters struct { // Targets any of the VM instances specified. Instances are specified by their URI in the form zones/{{zone}}/instances/{{instance_name}}, // projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}}, or // https://www.googleapis.com/compute/v1/projects/{{project_id}}/zones/{{zone}}/instances/{{instance_name}} + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Instance + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional Instances []*string `json:"instances,omitempty" tf:"instances,omitempty"` + // References to Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesRefs []v1.Reference `json:"instancesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in compute to populate instances. + // +kubebuilder:validation:Optional + InstancesSelector *v1.Selector `json:"instancesSelector,omitempty" tf:"-"` + // Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. // +kubebuilder:validation:Optional Zones []*string `json:"zones,omitempty" tf:"zones,omitempty"` diff --git a/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml b/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml index 66085f769..299d2173f 100644 --- a/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml +++ b/package/crds/beyondcorp.gcp.upbound.io_appconnections.yaml @@ -95,6 +95,85 @@ spec: items: type: string type: array + connectorsRefs: + description: References to AppConnector in beyondcorp to populate + connectors. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + connectorsSelector: + description: Selector for a list of AppConnector in beyondcorp + to populate connectors. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object displayName: description: An arbitrary user-provided name for the AppConnection. type: string @@ -249,6 +328,85 @@ spec: items: type: string type: array + connectorsRefs: + description: References to AppConnector in beyondcorp to populate + connectors. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + connectorsSelector: + description: Selector for a list of AppConnector in beyondcorp + to populate connectors. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object displayName: description: An arbitrary user-provided name for the AppConnection. type: string diff --git a/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml b/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml index 6357044cb..adc086c75 100644 --- a/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml +++ b/package/crds/binaryauthorization.gcp.upbound.io_policies.yaml @@ -127,6 +127,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array defaultAdmissionRule: @@ -160,6 +239,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array description: @@ -245,6 +403,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array defaultAdmissionRule: @@ -278,6 +515,85 @@ spec: type: string type: array x-kubernetes-list-type: set + requireAttestationsByRefs: + description: References to Attestor in binaryauthorization + to populate requireAttestationsBy. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + requireAttestationsBySelector: + description: Selector for a list of Attestor in binaryauthorization + to populate requireAttestationsBy. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array description: diff --git a/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml b/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml index 638be98b5..f3d946fb5 100644 --- a/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml +++ b/package/crds/certificatemanager.gcp.upbound.io_certificates.yaml @@ -104,6 +104,85 @@ spec: items: type: string type: array + dnsAuthorizationsRefs: + description: References to DNSAuthorization in certificatemanager + to populate dnsAuthorizations. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + dnsAuthorizationsSelector: + description: Selector for a list of DNSAuthorization in + certificatemanager to populate dnsAuthorizations. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object domains: description: |- The domains for which a managed SSL certificate will be generated. @@ -111,6 +190,85 @@ spec: items: type: string type: array + domainsRefs: + description: References to DNSAuthorization in certificatemanager + to populate domains. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + domainsSelector: + description: Selector for a list of DNSAuthorization in + certificatemanager to populate domains. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object issuanceConfig: description: |- The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. @@ -248,6 +406,85 @@ spec: items: type: string type: array + dnsAuthorizationsRefs: + description: References to DNSAuthorization in certificatemanager + to populate dnsAuthorizations. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + dnsAuthorizationsSelector: + description: Selector for a list of DNSAuthorization in + certificatemanager to populate dnsAuthorizations. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object domains: description: |- The domains for which a managed SSL certificate will be generated. @@ -255,6 +492,85 @@ spec: items: type: string type: array + domainsRefs: + description: References to DNSAuthorization in certificatemanager + to populate domains. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + domainsSelector: + description: Selector for a list of DNSAuthorization in + certificatemanager to populate domains. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object issuanceConfig: description: |- The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format projects//locations//certificateIssuanceConfigs/*. diff --git a/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml b/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml index c3f4412cf..7f02b7220 100644 --- a/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml +++ b/package/crds/cloudrun.gcp.upbound.io_v2jobs.yaml @@ -475,6 +475,87 @@ spec: items: type: string type: array + instancesRefs: + description: References to DatabaseInstance + in sql to populate instances. + items: + description: A Reference to a named + object. + properties: + name: + description: Name of the referenced + object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an + object with matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array name: @@ -1069,6 +1150,87 @@ spec: items: type: string type: array + instancesRefs: + description: References to DatabaseInstance + in sql to populate instances. + items: + description: A Reference to a named + object. + properties: + name: + description: Name of the referenced + object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an + object with matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array name: diff --git a/package/crds/cloudrun.gcp.upbound.io_v2services.yaml b/package/crds/cloudrun.gcp.upbound.io_v2services.yaml index 5c0d61988..4c04ad45a 100644 --- a/package/crds/cloudrun.gcp.upbound.io_v2services.yaml +++ b/package/crds/cloudrun.gcp.upbound.io_v2services.yaml @@ -696,6 +696,85 @@ spec: type: string type: array x-kubernetes-list-type: set + instancesRefs: + description: References to DatabaseInstance + in sql to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object + with matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array gcs: @@ -1639,6 +1718,85 @@ spec: type: string type: array x-kubernetes-list-type: set + instancesRefs: + description: References to DatabaseInstance + in sql to populate instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of DatabaseInstance + in sql to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object + with matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array gcs: diff --git a/package/crds/compute.gcp.upbound.io_instancetemplates.yaml b/package/crds/compute.gcp.upbound.io_instancetemplates.yaml index bd0bb6718..60195befd 100644 --- a/package/crds/compute.gcp.upbound.io_instancetemplates.yaml +++ b/package/crds/compute.gcp.upbound.io_instancetemplates.yaml @@ -217,6 +217,85 @@ spec: items: type: string type: array + resourcePoliciesRefs: + description: References to ResourcePolicy in compute to + populate resourcePolicies. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + resourcePoliciesSelector: + description: Selector for a list of ResourcePolicy in compute + to populate resourcePolicies. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object source: description: |- The name (not self_link) @@ -1161,6 +1240,85 @@ spec: items: type: string type: array + resourcePoliciesRefs: + description: References to ResourcePolicy in compute to + populate resourcePolicies. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + resourcePoliciesSelector: + description: Selector for a list of ResourcePolicy in compute + to populate resourcePolicies. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object source: description: |- The name (not self_link) diff --git a/package/crds/compute.gcp.upbound.io_routernats.yaml b/package/crds/compute.gcp.upbound.io_routernats.yaml index 77fc7959e..03e971928 100644 --- a/package/crds/compute.gcp.upbound.io_routernats.yaml +++ b/package/crds/compute.gcp.upbound.io_routernats.yaml @@ -156,6 +156,84 @@ spec: type: string type: array x-kubernetes-list-type: set + natIpsRefs: + description: References to Address in compute to populate natIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + natIpsSelector: + description: Selector for a list of Address in compute to populate + natIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object project: description: |- The ID of the project in which the resource belongs. @@ -263,6 +341,85 @@ spec: type: string type: array x-kubernetes-list-type: set + sourceNatActiveIpsRefs: + description: References to Address in compute to populate + sourceNatActiveIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + sourceNatActiveIpsSelector: + description: Selector for a list of Address in compute + to populate sourceNatActiveIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with + matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object sourceNatDrainIps: description: |- A list of URLs of the IP resources to be drained. @@ -535,6 +692,84 @@ spec: type: string type: array x-kubernetes-list-type: set + natIpsRefs: + description: References to Address in compute to populate natIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + natIpsSelector: + description: Selector for a list of Address in compute to populate + natIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object project: description: |- The ID of the project in which the resource belongs. @@ -561,6 +796,85 @@ spec: type: string type: array x-kubernetes-list-type: set + sourceNatActiveIpsRefs: + description: References to Address in compute to populate + sourceNatActiveIps. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + sourceNatActiveIpsSelector: + description: Selector for a list of Address in compute + to populate sourceNatActiveIps. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with + matching labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object sourceNatDrainIps: description: |- A list of URLs of the IP resources to be drained. diff --git a/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml b/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml index 76e08e0c0..73e0e0c37 100644 --- a/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml +++ b/package/crds/osconfig.gcp.upbound.io_patchdeployments.yaml @@ -124,6 +124,85 @@ spec: items: type: string type: array + instancesRefs: + description: References to Instance in compute to populate + instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of Instance in compute + to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object zones: description: Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. @@ -715,6 +794,85 @@ spec: items: type: string type: array + instancesRefs: + description: References to Instance in compute to populate + instances. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + instancesSelector: + description: Selector for a list of Instance in compute + to populate instances. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object zones: description: Targets VM instances in ANY of these zones. Leave empty to target VM instances in any zone. From 48a623b792bb49caa40d5ea0760f8c21fbc77e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Tue, 22 Oct 2024 23:19:35 +0300 Subject: [PATCH 17/34] Fix changed example manifests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- examples/binaryauthorization/v1beta2/policy.yaml | 8 ++++---- examples/certificatemanager/v1beta2/certificate.yaml | 2 +- examples/compute/v1beta2/instancetemplate.yaml | 12 +++++------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/examples/binaryauthorization/v1beta2/policy.yaml b/examples/binaryauthorization/v1beta2/policy.yaml index 015cf5bae..bc4bacafa 100644 --- a/examples/binaryauthorization/v1beta2/policy.yaml +++ b/examples/binaryauthorization/v1beta2/policy.yaml @@ -21,7 +21,7 @@ spec: requireAttestationsByRefs: - name: attestor defaultAdmissionRule: - - enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG + enforcementMode: ENFORCED_BLOCK_AND_AUDIT_LOG evaluationMode: ALWAYS_ALLOW --- @@ -37,7 +37,7 @@ metadata: spec: forProvider: attestationAuthorityNote: - - noteReferenceSelector: + noteReferenceSelector: matchLabels: testing.upbound.io/example-name: note @@ -54,5 +54,5 @@ metadata: spec: forProvider: attestationAuthority: - - hint: - - humanReadableName: My attestor + hint: + humanReadableName: My attestor diff --git a/examples/certificatemanager/v1beta2/certificate.yaml b/examples/certificatemanager/v1beta2/certificate.yaml index afdc14f15..4211a63ca 100644 --- a/examples/certificatemanager/v1beta2/certificate.yaml +++ b/examples/certificatemanager/v1beta2/certificate.yaml @@ -18,7 +18,7 @@ spec: labels: env: test managed: - - dnsAuthorizationsRefs: + dnsAuthorizationsRefs: - name: instance - name: instance2 domainsRefs: diff --git a/examples/compute/v1beta2/instancetemplate.yaml b/examples/compute/v1beta2/instancetemplate.yaml index 1c862eda5..fdd268194 100644 --- a/examples/compute/v1beta2/instancetemplate.yaml +++ b/examples/compute/v1beta2/instancetemplate.yaml @@ -18,7 +18,7 @@ spec: - autoDelete: false boot: true resourcePoliciesRefs: - - name: daily_backup + - name: daily-backup sourceImage: debian-cloud/debian-11 - autoDelete: false boot: false @@ -33,14 +33,12 @@ spec: foo: bar name: appserver-template networkInterface: - - networkSelector: - matchLabels: - testing.upbound.io/example-name: example + - network: default scheduling: - - automaticRestart: true + automaticRestart: true onHostMaintenance: MIGRATE serviceAccount: - - emailSelector: + emailSelector: matchLabels: testing.upbound.io/example-name: default scopes: @@ -68,7 +66,7 @@ spec: --- -apiVersion: compute.gcp.upbound.io/v1beta2 +apiVersion: compute.gcp.upbound.io/v1beta1 kind: ResourcePolicy metadata: annotations: From dd961bc52a9b06ffd05e38b8defa1bde46da88dd Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Thu, 26 Sep 2024 12:29:02 +0000 Subject: [PATCH 18/34] feat(networkconnectivity): add Service Connection Policy support This adds support for google_network_connectivity_service_connection_policy Terraform resource, see https://registry.terraform.io/providers/hashicorp/google/5.39.1/docs/resources/network_connectivity_service_connection_policy Signed-off-by: Rickard von Essen --- .../v1beta1/zz_generated.conversion_hubs.go | 3 + .../v1beta1/zz_generated.deepcopy.go | 711 ++++++++++++++ .../v1beta1/zz_generated.managed.go | 60 ++ .../v1beta1/zz_generated.managedlist.go | 9 + .../v1beta1/zz_generated.resolvers.go | 99 +- .../zz_serviceconnectionpolicy_terraformed.go | 129 +++ .../zz_serviceconnectionpolicy_types.go | 340 +++++++ config/externalname.go | 2 + config/generated.lst | 2 +- config/networkconnectivity/config.go | 17 + .../v1beta1/serviceconnectionpolicy.yaml | 52 ++ .../v1beta1/serviceconnectionpolicy.yaml | 52 ++ .../serviceconnectionpolicy/zz_controller.go | 92 ++ internal/controller/zz_monolith_setup.go | 2 + .../zz_networkconnectivity_setup.go | 2 + ....upbound.io_serviceconnectionpolicies.yaml | 870 ++++++++++++++++++ 16 files changed, 2438 insertions(+), 4 deletions(-) create mode 100755 apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go create mode 100755 apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go create mode 100644 config/networkconnectivity/config.go create mode 100644 examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml create mode 100644 examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml create mode 100755 internal/controller/networkconnectivity/serviceconnectionpolicy/zz_controller.go create mode 100644 package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml diff --git a/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go b/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go index d9bd77a5c..d971844b5 100755 --- a/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.conversion_hubs.go @@ -8,3 +8,6 @@ package v1beta1 // Hub marks this type as a conversion hub. func (tr *Hub) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *ServiceConnectionPolicy) Hub() {} diff --git a/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go b/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go index 58dabf376..557fb90d5 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.deepcopy.go @@ -13,6 +13,154 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInfoInitParameters) DeepCopyInto(out *ErrorInfoInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInfoInitParameters. +func (in *ErrorInfoInitParameters) DeepCopy() *ErrorInfoInitParameters { + if in == nil { + return nil + } + out := new(ErrorInfoInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInfoObservation) DeepCopyInto(out *ErrorInfoObservation) { + *out = *in + if in.Domain != nil { + in, out := &in.Domain, &out.Domain + *out = new(string) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInfoObservation. +func (in *ErrorInfoObservation) DeepCopy() *ErrorInfoObservation { + if in == nil { + return nil + } + out := new(ErrorInfoObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInfoParameters) DeepCopyInto(out *ErrorInfoParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInfoParameters. +func (in *ErrorInfoParameters) DeepCopy() *ErrorInfoParameters { + if in == nil { + return nil + } + out := new(ErrorInfoParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorInitParameters) DeepCopyInto(out *ErrorInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorInitParameters. +func (in *ErrorInitParameters) DeepCopy() *ErrorInitParameters { + if in == nil { + return nil + } + out := new(ErrorInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorObservation) DeepCopyInto(out *ErrorObservation) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(float64) + **out = **in + } + if in.Details != nil { + in, out := &in.Details, &out.Details + *out = make([]map[string]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + } + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorObservation. +func (in *ErrorObservation) DeepCopy() *ErrorObservation { + if in == nil { + return nil + } + out := new(ErrorObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ErrorParameters) DeepCopyInto(out *ErrorParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ErrorParameters. +func (in *ErrorParameters) DeepCopy() *ErrorParameters { + if in == nil { + return nil + } + out := new(ErrorParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Hub) DeepCopyInto(out *Hub) { *out = *in @@ -784,6 +932,213 @@ func (in *LinkedVPNTunnelsParameters) DeepCopy() *LinkedVPNTunnelsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigInitParameters) DeepCopyInto(out *PscConfigInitParameters) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.SubnetworksRefs != nil { + in, out := &in.SubnetworksRefs, &out.SubnetworksRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SubnetworksSelector != nil { + in, out := &in.SubnetworksSelector, &out.SubnetworksSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigInitParameters. +func (in *PscConfigInitParameters) DeepCopy() *PscConfigInitParameters { + if in == nil { + return nil + } + out := new(PscConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigObservation) DeepCopyInto(out *PscConfigObservation) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigObservation. +func (in *PscConfigObservation) DeepCopy() *PscConfigObservation { + if in == nil { + return nil + } + out := new(PscConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfigParameters) DeepCopyInto(out *PscConfigParameters) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.SubnetworksRefs != nil { + in, out := &in.SubnetworksRefs, &out.SubnetworksRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SubnetworksSelector != nil { + in, out := &in.SubnetworksSelector, &out.SubnetworksSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigParameters. +func (in *PscConfigParameters) DeepCopy() *PscConfigParameters { + if in == nil { + return nil + } + out := new(PscConfigParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsInitParameters) DeepCopyInto(out *PscConnectionsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsInitParameters. +func (in *PscConnectionsInitParameters) DeepCopy() *PscConnectionsInitParameters { + if in == nil { + return nil + } + out := new(PscConnectionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsObservation) DeepCopyInto(out *PscConnectionsObservation) { + *out = *in + if in.ConsumerAddress != nil { + in, out := &in.ConsumerAddress, &out.ConsumerAddress + *out = new(string) + **out = **in + } + if in.ConsumerForwardingRule != nil { + in, out := &in.ConsumerForwardingRule, &out.ConsumerForwardingRule + *out = new(string) + **out = **in + } + if in.ConsumerTargetProject != nil { + in, out := &in.ConsumerTargetProject, &out.ConsumerTargetProject + *out = new(string) + **out = **in + } + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(ErrorObservation) + (*in).DeepCopyInto(*out) + } + if in.ErrorInfo != nil { + in, out := &in.ErrorInfo, &out.ErrorInfo + *out = new(ErrorInfoObservation) + (*in).DeepCopyInto(*out) + } + if in.ErrorType != nil { + in, out := &in.ErrorType, &out.ErrorType + *out = new(string) + **out = **in + } + if in.GceOperation != nil { + in, out := &in.GceOperation, &out.GceOperation + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsObservation. +func (in *PscConnectionsObservation) DeepCopy() *PscConnectionsObservation { + if in == nil { + return nil + } + out := new(PscConnectionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnectionsParameters) DeepCopyInto(out *PscConnectionsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsParameters. +func (in *PscConnectionsParameters) DeepCopy() *PscConnectionsParameters { + if in == nil { + return nil + } + out := new(PscConnectionsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RoutingVpcsInitParameters) DeepCopyInto(out *RoutingVpcsInitParameters) { *out = *in @@ -834,6 +1189,362 @@ func (in *RoutingVpcsParameters) DeepCopy() *RoutingVpcsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicy) DeepCopyInto(out *ServiceConnectionPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicy. +func (in *ServiceConnectionPolicy) DeepCopy() *ServiceConnectionPolicy { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceConnectionPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyInitParameters) DeepCopyInto(out *ServiceConnectionPolicyInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfigInitParameters) + (*in).DeepCopyInto(*out) + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyInitParameters. +func (in *ServiceConnectionPolicyInitParameters) DeepCopy() *ServiceConnectionPolicyInitParameters { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyList) DeepCopyInto(out *ServiceConnectionPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceConnectionPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyList. +func (in *ServiceConnectionPolicyList) DeepCopy() *ServiceConnectionPolicyList { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceConnectionPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyObservation) DeepCopyInto(out *ServiceConnectionPolicyObservation) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EffectiveLabels != nil { + in, out := &in.EffectiveLabels, &out.EffectiveLabels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Infrastructure != nil { + in, out := &in.Infrastructure, &out.Infrastructure + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfigObservation) + (*in).DeepCopyInto(*out) + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnectionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } + if in.TerraformLabels != nil { + in, out := &in.TerraformLabels, &out.TerraformLabels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyObservation. +func (in *ServiceConnectionPolicyObservation) DeepCopy() *ServiceConnectionPolicyObservation { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyParameters) DeepCopyInto(out *ServiceConnectionPolicyParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfigParameters) + (*in).DeepCopyInto(*out) + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyParameters. +func (in *ServiceConnectionPolicyParameters) DeepCopy() *ServiceConnectionPolicyParameters { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicySpec) DeepCopyInto(out *ServiceConnectionPolicySpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicySpec. +func (in *ServiceConnectionPolicySpec) DeepCopy() *ServiceConnectionPolicySpec { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicyStatus) DeepCopyInto(out *ServiceConnectionPolicyStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicyStatus. +func (in *ServiceConnectionPolicyStatus) DeepCopy() *ServiceConnectionPolicyStatus { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Spoke) DeepCopyInto(out *Spoke) { *out = *in diff --git a/apis/networkconnectivity/v1beta1/zz_generated.managed.go b/apis/networkconnectivity/v1beta1/zz_generated.managed.go index c7c0c4555..efb952b6e 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.managed.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.managed.go @@ -67,6 +67,66 @@ func (mg *Hub) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ServiceConnectionPolicy. +func (mg *ServiceConnectionPolicy) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Spoke. func (mg *Spoke) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go b/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go index 2c4966994..37a910f89 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.managedlist.go @@ -16,6 +16,15 @@ func (l *HubList) GetItems() []resource.Managed { return items } +// GetItems of this ServiceConnectionPolicyList. +func (l *ServiceConnectionPolicyList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this SpokeList. func (l *SpokeList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go b/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go index a21218ee1..cd5c9b7f4 100644 --- a/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go +++ b/apis/networkconnectivity/v1beta1/zz_generated.resolvers.go @@ -13,12 +13,105 @@ import ( errors "github.com/pkg/errors" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - client "sigs.k8s.io/controller-runtime/pkg/client" - - // ResolveReferences of this Spoke. apisresolver "github.com/upbound/provider-gcp/internal/apis" + client "sigs.k8s.io/controller-runtime/pkg/client" ) +func (mg *ServiceConnectionPolicy) ResolveReferences( // ResolveReferences of this ServiceConnectionPolicy. + ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var mrsp reference.MultiResolutionResponse + var err error + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.NetworkRef, + Selector: mg.Spec.ForProvider.NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Network") + } + mg.Spec.ForProvider.Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.NetworkRef = rsp.ResolvedReference + + if mg.Spec.ForProvider.PscConfig != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.ForProvider.PscConfig.Subnetworks), + Extract: resource.ExtractResourceID(), + References: mg.Spec.ForProvider.PscConfig.SubnetworksRefs, + Selector: mg.Spec.ForProvider.PscConfig.SubnetworksSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PscConfig.Subnetworks") + } + mg.Spec.ForProvider.PscConfig.Subnetworks = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.ForProvider.PscConfig.SubnetworksRefs = mrsp.ResolvedReferences + + } + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.NetworkRef, + Selector: mg.Spec.InitProvider.NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Network") + } + mg.Spec.InitProvider.Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.NetworkRef = rsp.ResolvedReference + + if mg.Spec.InitProvider.PscConfig != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromPtrValues(mg.Spec.InitProvider.PscConfig.Subnetworks), + Extract: resource.ExtractResourceID(), + References: mg.Spec.InitProvider.PscConfig.SubnetworksRefs, + Selector: mg.Spec.InitProvider.PscConfig.SubnetworksSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.PscConfig.Subnetworks") + } + mg.Spec.InitProvider.PscConfig.Subnetworks = reference.ToPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.PscConfig.SubnetworksRefs = mrsp.ResolvedReferences + + } + + return nil +} + +// ResolveReferences of this Spoke. func (mg *Spoke) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed var l xpresource.ManagedList diff --git a/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go new file mode 100755 index 000000000..9f3513341 --- /dev/null +++ b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this ServiceConnectionPolicy +func (mg *ServiceConnectionPolicy) GetTerraformResourceType() string { + return "google_network_connectivity_service_connection_policy" +} + +// GetConnectionDetailsMapping for this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this ServiceConnectionPolicy +func (tr *ServiceConnectionPolicy) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this ServiceConnectionPolicy using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ServiceConnectionPolicy) LateInitialize(attrs []byte) (bool, error) { + params := &ServiceConnectionPolicyParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *ServiceConnectionPolicy) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go new file mode 100755 index 000000000..8f41fc038 --- /dev/null +++ b/apis/networkconnectivity/v1beta1/zz_serviceconnectionpolicy_types.go @@ -0,0 +1,340 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ErrorInfoInitParameters struct { +} + +type ErrorInfoObservation struct { + + // The logical grouping to which the "reason" belongs. + Domain *string `json:"domain,omitempty" tf:"domain,omitempty"` + + // Additional structured details about this error. + // +mapType=granular + Metadata map[string]*string `json:"metadata,omitempty" tf:"metadata,omitempty"` + + // The reason of the error. + Reason *string `json:"reason,omitempty" tf:"reason,omitempty"` +} + +type ErrorInfoParameters struct { +} + +type ErrorInitParameters struct { +} + +type ErrorObservation struct { + + // The status code, which should be an enum value of [google.rpc.Code][]. + Code *float64 `json:"code,omitempty" tf:"code,omitempty"` + + // (Output) + // A list of messages that carry the error details. + Details []map[string]*string `json:"details,omitempty" tf:"details,omitempty"` + + // A developer-facing error message. + Message *string `json:"message,omitempty" tf:"message,omitempty"` +} + +type ErrorParameters struct { +} + +type PscConfigInitParameters struct { + + // Max number of PSC connections for this policy. + Limit *string `json:"limit,omitempty" tf:"limit,omitempty"` + + // IDs of the subnetworks or fully qualified identifiers for the subnetworks + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + Subnetworks []*string `json:"subnetworks,omitempty" tf:"subnetworks,omitempty"` + + // References to Subnetwork in compute to populate subnetworks. + // +kubebuilder:validation:Optional + SubnetworksRefs []v1.Reference `json:"subnetworksRefs,omitempty" tf:"-"` + + // Selector for a list of Subnetwork in compute to populate subnetworks. + // +kubebuilder:validation:Optional + SubnetworksSelector *v1.Selector `json:"subnetworksSelector,omitempty" tf:"-"` +} + +type PscConfigObservation struct { + + // Max number of PSC connections for this policy. + Limit *string `json:"limit,omitempty" tf:"limit,omitempty"` + + // IDs of the subnetworks or fully qualified identifiers for the subnetworks + Subnetworks []*string `json:"subnetworks,omitempty" tf:"subnetworks,omitempty"` +} + +type PscConfigParameters struct { + + // Max number of PSC connections for this policy. + // +kubebuilder:validation:Optional + Limit *string `json:"limit,omitempty" tf:"limit,omitempty"` + + // IDs of the subnetworks or fully qualified identifiers for the subnetworks + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + Subnetworks []*string `json:"subnetworks,omitempty" tf:"subnetworks,omitempty"` + + // References to Subnetwork in compute to populate subnetworks. + // +kubebuilder:validation:Optional + SubnetworksRefs []v1.Reference `json:"subnetworksRefs,omitempty" tf:"-"` + + // Selector for a list of Subnetwork in compute to populate subnetworks. + // +kubebuilder:validation:Optional + SubnetworksSelector *v1.Selector `json:"subnetworksSelector,omitempty" tf:"-"` +} + +type PscConnectionsInitParameters struct { +} + +type PscConnectionsObservation struct { + + // The resource reference of the consumer address. + ConsumerAddress *string `json:"consumerAddress,omitempty" tf:"consumer_address,omitempty"` + + // The resource reference of the PSC Forwarding Rule within the consumer VPC. + ConsumerForwardingRule *string `json:"consumerForwardingRule,omitempty" tf:"consumer_forwarding_rule,omitempty"` + + // The project where the PSC connection is created. + ConsumerTargetProject *string `json:"consumerTargetProject,omitempty" tf:"consumer_target_project,omitempty"` + + // The most recent error during operating this connection. + // Structure is documented below. + Error *ErrorObservation `json:"error,omitempty" tf:"error,omitempty"` + + // The error info for the latest error during operating this connection. + // Structure is documented below. + ErrorInfo *ErrorInfoObservation `json:"errorInfo,omitempty" tf:"error_info,omitempty"` + + // The error type indicates whether the error is consumer facing, producer + // facing or system internal. + // Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE. + ErrorType *string `json:"errorType,omitempty" tf:"error_type,omitempty"` + + // The last Compute Engine operation to setup PSC connection. + GceOperation *string `json:"gceOperation,omitempty" tf:"gce_operation,omitempty"` + + // The PSC connection id of the PSC forwarding rule. + PscConnectionID *string `json:"pscConnectionId,omitempty" tf:"psc_connection_id,omitempty"` + + // The state of the PSC connection. + // Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED. + State *string `json:"state,omitempty" tf:"state,omitempty"` +} + +type PscConnectionsParameters struct { +} + +type ServiceConnectionPolicyInitParameters struct { + + // Free-text description of the resource. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User-defined labels. + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + // Structure is documented below. + PscConfig *PscConfigInitParameters `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + // It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + ServiceClass *string `json:"serviceClass,omitempty" tf:"service_class,omitempty"` +} + +type ServiceConnectionPolicyObservation struct { + + // The timestamp when the resource was created. + CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` + + // Free-text description of the resource. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // for all of the labels present on the resource. + // +mapType=granular + EffectiveLabels map[string]*string `json:"effectiveLabels,omitempty" tf:"effective_labels,omitempty"` + + // The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty" tf:"etag,omitempty"` + + // an identifier for the resource with format projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The type of underlying resources used to create the connection. + Infrastructure *string `json:"infrastructure,omitempty" tf:"infrastructure,omitempty"` + + // User-defined labels. + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location of the ServiceConnectionPolicy. + Location *string `json:"location,omitempty" tf:"location,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + // Structure is documented below. + PscConfig *PscConfigObservation `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` + + // Information about each Private Service Connect connection. + // Structure is documented below. + PscConnections []PscConnectionsObservation `json:"pscConnections,omitempty" tf:"psc_connections,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + // It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + ServiceClass *string `json:"serviceClass,omitempty" tf:"service_class,omitempty"` + + // The combination of labels configured directly on the resource + // and default labels configured on the provider. + // +mapType=granular + TerraformLabels map[string]*string `json:"terraformLabels,omitempty" tf:"terraform_labels,omitempty"` + + // The timestamp when the resource was updated. + UpdateTime *string `json:"updateTime,omitempty" tf:"update_time,omitempty"` +} + +type ServiceConnectionPolicyParameters struct { + + // Free-text description of the resource. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User-defined labels. + // +kubebuilder:validation:Optional + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location of the ServiceConnectionPolicy. + // +kubebuilder:validation:Required + Location *string `json:"location" tf:"location,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + // +kubebuilder:validation:Optional + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + // Structure is documented below. + // +kubebuilder:validation:Optional + PscConfig *PscConfigParameters `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + // It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + // +kubebuilder:validation:Optional + ServiceClass *string `json:"serviceClass,omitempty" tf:"service_class,omitempty"` +} + +// ServiceConnectionPolicySpec defines the desired state of ServiceConnectionPolicy +type ServiceConnectionPolicySpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ServiceConnectionPolicyParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider ServiceConnectionPolicyInitParameters `json:"initProvider,omitempty"` +} + +// ServiceConnectionPolicyStatus defines the observed state of ServiceConnectionPolicy. +type ServiceConnectionPolicyStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ServiceConnectionPolicyObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// ServiceConnectionPolicy is the Schema for the ServiceConnectionPolicys API. Manage Service Connection Policies. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp} +type ServiceConnectionPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.serviceClass) || (has(self.initProvider) && has(self.initProvider.serviceClass))",message="spec.forProvider.serviceClass is a required parameter" + Spec ServiceConnectionPolicySpec `json:"spec"` + Status ServiceConnectionPolicyStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ServiceConnectionPolicyList contains a list of ServiceConnectionPolicys +type ServiceConnectionPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ServiceConnectionPolicy `json:"items"` +} + +// Repository type metadata. +var ( + ServiceConnectionPolicy_Kind = "ServiceConnectionPolicy" + ServiceConnectionPolicy_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ServiceConnectionPolicy_Kind}.String() + ServiceConnectionPolicy_KindAPIVersion = ServiceConnectionPolicy_Kind + "." + CRDGroupVersion.String() + ServiceConnectionPolicy_GroupVersionKind = CRDGroupVersion.WithKind(ServiceConnectionPolicy_Kind) +) + +func init() { + SchemeBuilder.Register(&ServiceConnectionPolicy{}, &ServiceConnectionPolicyList{}) +} diff --git a/config/externalname.go b/config/externalname.go index 67a143088..c7dfb478e 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -622,6 +622,8 @@ var terraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ "google_network_connectivity_hub": config.IdentifierFromProvider, // Spoke can be imported using {{location}}/{{name}} "google_network_connectivity_spoke": config.IdentifierFromProvider, + // ServiceConnectionPolicy can be imported using projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}} + "google_network_connectivity_service_connection_policy": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/serviceConnectionPolicies/{{ .external_name }}"), // mlengine // diff --git a/config/generated.lst b/config/generated.lst index 308619073..7e6231495 100644 --- a/config/generated.lst +++ b/config/generated.lst @@ -1 +1 @@ -["google_access_context_manager_access_level","google_access_context_manager_access_level_condition","google_access_context_manager_access_policy","google_access_context_manager_access_policy_iam_member","google_access_context_manager_service_perimeter","google_access_context_manager_service_perimeter_resource","google_active_directory_domain","google_alloydb_backup","google_alloydb_cluster","google_alloydb_instance","google_apigee_addons_config","google_apigee_endpoint_attachment","google_apigee_envgroup","google_apigee_envgroup_attachment","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_instance_attachment","google_apigee_nat_address","google_apigee_organization","google_apigee_sync_authorization","google_app_engine_application","google_app_engine_application_url_dispatch_rules","google_app_engine_firewall_rule","google_app_engine_service_network_settings","google_app_engine_standard_app_version","google_artifact_registry_repository","google_artifact_registry_repository_iam_member","google_beyondcorp_app_connection","google_beyondcorp_app_connector","google_beyondcorp_app_gateway","google_bigquery_analytics_hub_data_exchange","google_bigquery_analytics_hub_data_exchange_iam_member","google_bigquery_analytics_hub_listing","google_bigquery_connection","google_bigquery_data_transfer_config","google_bigquery_dataset","google_bigquery_dataset_access","google_bigquery_dataset_iam_binding","google_bigquery_dataset_iam_member","google_bigquery_dataset_iam_policy","google_bigquery_job","google_bigquery_reservation","google_bigquery_reservation_assignment","google_bigquery_routine","google_bigquery_table","google_bigquery_table_iam_binding","google_bigquery_table_iam_member","google_bigquery_table_iam_policy","google_bigtable_app_profile","google_bigtable_gc_policy","google_bigtable_instance","google_bigtable_instance_iam_binding","google_bigtable_instance_iam_member","google_bigtable_instance_iam_policy","google_bigtable_table","google_bigtable_table_iam_binding","google_bigtable_table_iam_member","google_bigtable_table_iam_policy","google_binary_authorization_attestor","google_binary_authorization_policy","google_certificate_manager_certificate","google_certificate_manager_certificate_map","google_certificate_manager_certificate_map_entry","google_certificate_manager_dns_authorization","google_cloud_ids_endpoint","google_cloud_run_domain_mapping","google_cloud_run_service","google_cloud_run_service_iam_member","google_cloud_run_v2_job","google_cloud_run_v2_service","google_cloud_scheduler_job","google_cloud_tasks_queue","google_cloudbuild_trigger","google_cloudbuild_worker_pool","google_cloudfunctions2_function","google_cloudfunctions_function","google_cloudfunctions_function_iam_member","google_composer_environment","google_compute_address","google_compute_attached_disk","google_compute_autoscaler","google_compute_backend_bucket","google_compute_backend_bucket_signed_url_key","google_compute_backend_service","google_compute_backend_service_signed_url_key","google_compute_disk","google_compute_disk_iam_member","google_compute_disk_resource_policy_attachment","google_compute_external_vpn_gateway","google_compute_firewall","google_compute_firewall_policy","google_compute_firewall_policy_association","google_compute_firewall_policy_rule","google_compute_forwarding_rule","google_compute_global_address","google_compute_global_forwarding_rule","google_compute_global_network_endpoint","google_compute_global_network_endpoint_group","google_compute_ha_vpn_gateway","google_compute_health_check","google_compute_http_health_check","google_compute_https_health_check","google_compute_image","google_compute_image_iam_member","google_compute_instance","google_compute_instance_from_template","google_compute_instance_group","google_compute_instance_group_manager","google_compute_instance_group_named_port","google_compute_instance_iam_member","google_compute_instance_template","google_compute_interconnect_attachment","google_compute_managed_ssl_certificate","google_compute_network","google_compute_network_endpoint","google_compute_network_endpoint_group","google_compute_network_firewall_policy","google_compute_network_firewall_policy_association","google_compute_network_peering","google_compute_network_peering_routes_config","google_compute_node_group","google_compute_node_template","google_compute_packet_mirroring","google_compute_per_instance_config","google_compute_project_default_network_tier","google_compute_project_metadata","google_compute_project_metadata_item","google_compute_region_autoscaler","google_compute_region_backend_service","google_compute_region_disk","google_compute_region_disk_iam_member","google_compute_region_disk_resource_policy_attachment","google_compute_region_health_check","google_compute_region_instance_group_manager","google_compute_region_network_endpoint","google_compute_region_network_endpoint_group","google_compute_region_network_firewall_policy","google_compute_region_network_firewall_policy_association","google_compute_region_per_instance_config","google_compute_region_ssl_certificate","google_compute_region_target_http_proxy","google_compute_region_target_https_proxy","google_compute_region_target_tcp_proxy","google_compute_region_url_map","google_compute_reservation","google_compute_resource_policy","google_compute_route","google_compute_router","google_compute_router_interface","google_compute_router_nat","google_compute_router_peer","google_compute_security_policy","google_compute_service_attachment","google_compute_shared_vpc_host_project","google_compute_shared_vpc_service_project","google_compute_snapshot","google_compute_snapshot_iam_member","google_compute_ssl_certificate","google_compute_ssl_policy","google_compute_subnetwork","google_compute_subnetwork_iam_member","google_compute_target_grpc_proxy","google_compute_target_http_proxy","google_compute_target_https_proxy","google_compute_target_instance","google_compute_target_pool","google_compute_target_ssl_proxy","google_compute_target_tcp_proxy","google_compute_url_map","google_compute_vpn_gateway","google_compute_vpn_tunnel","google_container_analysis_note","google_container_attached_cluster","google_container_aws_cluster","google_container_aws_node_pool","google_container_azure_client","google_container_azure_cluster","google_container_azure_node_pool","google_container_cluster","google_container_node_pool","google_container_registry","google_data_catalog_entry","google_data_catalog_entry_group","google_data_catalog_tag","google_data_catalog_tag_template","google_data_fusion_instance","google_data_loss_prevention_deidentify_template","google_data_loss_prevention_inspect_template","google_data_loss_prevention_job_trigger","google_data_loss_prevention_stored_info_type","google_dataflow_job","google_dataplex_asset","google_dataplex_lake","google_dataplex_zone","google_dataproc_autoscaling_policy","google_dataproc_cluster","google_dataproc_job","google_dataproc_metastore_service","google_dataproc_workflow_template","google_datastore_index","google_datastream_connection_profile","google_datastream_private_connection","google_dialogflow_cx_agent","google_dialogflow_cx_entity_type","google_dialogflow_cx_environment","google_dialogflow_cx_flow","google_dialogflow_cx_intent","google_dialogflow_cx_page","google_dialogflow_cx_version","google_dialogflow_cx_webhook","google_dns_managed_zone","google_dns_managed_zone_iam_member","google_dns_policy","google_dns_record_set","google_document_ai_processor","google_essential_contacts_contact","google_eventarc_channel","google_eventarc_google_channel_config","google_eventarc_trigger","google_filestore_backup","google_filestore_instance","google_filestore_snapshot","google_firebaserules_release","google_firebaserules_ruleset","google_folder","google_folder_iam_member","google_gke_backup_backup_plan","google_gke_hub_membership","google_gke_hub_membership_iam_member","google_healthcare_consent_store","google_healthcare_dataset","google_healthcare_dataset_iam_member","google_iam_workload_identity_pool","google_iam_workload_identity_pool_provider","google_iap_app_engine_service_iam_member","google_iap_app_engine_version_iam_member","google_iap_tunnel_iam_member","google_iap_web_backend_service_iam_member","google_iap_web_iam_member","google_iap_web_type_app_engine_iam_member","google_iap_web_type_compute_iam_member","google_identity_platform_default_supported_idp_config","google_identity_platform_inbound_saml_config","google_identity_platform_oauth_idp_config","google_identity_platform_project_default_config","google_identity_platform_tenant","google_identity_platform_tenant_default_supported_idp_config","google_identity_platform_tenant_inbound_saml_config","google_identity_platform_tenant_oauth_idp_config","google_kms_crypto_key","google_kms_crypto_key_iam_member","google_kms_crypto_key_version","google_kms_key_ring","google_kms_key_ring_iam_member","google_kms_key_ring_import_job","google_kms_secret_ciphertext","google_logging_folder_bucket_config","google_logging_folder_exclusion","google_logging_folder_sink","google_logging_log_view","google_logging_metric","google_logging_project_bucket_config","google_logging_project_exclusion","google_logging_project_sink","google_memcache_instance","google_ml_engine_model","google_monitoring_alert_policy","google_monitoring_custom_service","google_monitoring_dashboard","google_monitoring_group","google_monitoring_metric_descriptor","google_monitoring_notification_channel","google_monitoring_service","google_monitoring_slo","google_monitoring_uptime_check_config","google_network_connectivity_hub","google_network_connectivity_spoke","google_network_management_connectivity_test","google_notebooks_environment","google_notebooks_instance","google_notebooks_instance_iam_member","google_notebooks_runtime","google_notebooks_runtime_iam_member","google_org_policy_policy","google_organization_iam_audit_config","google_organization_iam_custom_role","google_organization_iam_member","google_os_config_os_policy_assignment","google_os_config_patch_deployment","google_os_login_ssh_public_key","google_privateca_ca_pool","google_privateca_ca_pool_iam_member","google_privateca_certificate","google_privateca_certificate_authority","google_privateca_certificate_template","google_privateca_certificate_template_iam_member","google_project","google_project_default_service_accounts","google_project_iam_audit_config","google_project_iam_custom_role","google_project_iam_member","google_project_service","google_project_usage_export_bucket","google_pubsub_lite_reservation","google_pubsub_lite_subscription","google_pubsub_lite_topic","google_pubsub_schema","google_pubsub_subscription","google_pubsub_subscription_iam_member","google_pubsub_topic","google_pubsub_topic_iam_member","google_redis_instance","google_secret_manager_secret","google_secret_manager_secret_iam_member","google_secret_manager_secret_version","google_service_account","google_service_account_iam_member","google_service_account_key","google_service_networking_connection","google_service_networking_peered_dns_domain","google_sourcerepo_repository","google_sourcerepo_repository_iam_member","google_spanner_database","google_spanner_database_iam_member","google_spanner_instance","google_spanner_instance_iam_member","google_sql_database","google_sql_database_instance","google_sql_source_representation_instance","google_sql_ssl_cert","google_sql_user","google_storage_bucket","google_storage_bucket_access_control","google_storage_bucket_acl","google_storage_bucket_iam_member","google_storage_bucket_object","google_storage_default_object_access_control","google_storage_default_object_acl","google_storage_hmac_key","google_storage_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","google_tags_tag_binding","google_tags_tag_key","google_tags_tag_value","google_tpu_node","google_vertex_ai_dataset","google_vertex_ai_featurestore","google_vertex_ai_featurestore_entitytype","google_vertex_ai_tensorboard","google_vpc_access_connector","google_workflows_workflow"] \ No newline at end of file +["google_access_context_manager_access_level","google_access_context_manager_access_level_condition","google_access_context_manager_access_policy","google_access_context_manager_access_policy_iam_member","google_access_context_manager_service_perimeter","google_access_context_manager_service_perimeter_resource","google_active_directory_domain","google_alloydb_backup","google_alloydb_cluster","google_alloydb_instance","google_apigee_addons_config","google_apigee_endpoint_attachment","google_apigee_envgroup","google_apigee_envgroup_attachment","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_instance_attachment","google_apigee_nat_address","google_apigee_organization","google_apigee_sync_authorization","google_app_engine_application","google_app_engine_application_url_dispatch_rules","google_app_engine_firewall_rule","google_app_engine_service_network_settings","google_app_engine_standard_app_version","google_artifact_registry_repository","google_artifact_registry_repository_iam_member","google_beyondcorp_app_connection","google_beyondcorp_app_connector","google_beyondcorp_app_gateway","google_bigquery_analytics_hub_data_exchange","google_bigquery_analytics_hub_data_exchange_iam_member","google_bigquery_analytics_hub_listing","google_bigquery_connection","google_bigquery_data_transfer_config","google_bigquery_dataset","google_bigquery_dataset_access","google_bigquery_dataset_iam_binding","google_bigquery_dataset_iam_member","google_bigquery_dataset_iam_policy","google_bigquery_job","google_bigquery_reservation","google_bigquery_reservation_assignment","google_bigquery_routine","google_bigquery_table","google_bigquery_table_iam_binding","google_bigquery_table_iam_member","google_bigquery_table_iam_policy","google_bigtable_app_profile","google_bigtable_gc_policy","google_bigtable_instance","google_bigtable_instance_iam_binding","google_bigtable_instance_iam_member","google_bigtable_instance_iam_policy","google_bigtable_table","google_bigtable_table_iam_binding","google_bigtable_table_iam_member","google_bigtable_table_iam_policy","google_binary_authorization_attestor","google_binary_authorization_policy","google_certificate_manager_certificate","google_certificate_manager_certificate_map","google_certificate_manager_certificate_map_entry","google_certificate_manager_dns_authorization","google_cloud_ids_endpoint","google_cloud_run_domain_mapping","google_cloud_run_service","google_cloud_run_service_iam_member","google_cloud_run_v2_job","google_cloud_run_v2_service","google_cloud_scheduler_job","google_cloud_tasks_queue","google_cloudbuild_trigger","google_cloudbuild_worker_pool","google_cloudfunctions2_function","google_cloudfunctions_function","google_cloudfunctions_function_iam_member","google_composer_environment","google_compute_address","google_compute_attached_disk","google_compute_autoscaler","google_compute_backend_bucket","google_compute_backend_bucket_signed_url_key","google_compute_backend_service","google_compute_backend_service_signed_url_key","google_compute_disk","google_compute_disk_iam_member","google_compute_disk_resource_policy_attachment","google_compute_external_vpn_gateway","google_compute_firewall","google_compute_firewall_policy","google_compute_firewall_policy_association","google_compute_firewall_policy_rule","google_compute_forwarding_rule","google_compute_global_address","google_compute_global_forwarding_rule","google_compute_global_network_endpoint","google_compute_global_network_endpoint_group","google_compute_ha_vpn_gateway","google_compute_health_check","google_compute_http_health_check","google_compute_https_health_check","google_compute_image","google_compute_image_iam_member","google_compute_instance","google_compute_instance_from_template","google_compute_instance_group","google_compute_instance_group_manager","google_compute_instance_group_named_port","google_compute_instance_iam_member","google_compute_instance_template","google_compute_interconnect_attachment","google_compute_managed_ssl_certificate","google_compute_network","google_compute_network_endpoint","google_compute_network_endpoint_group","google_compute_network_firewall_policy","google_compute_network_firewall_policy_association","google_compute_network_peering","google_compute_network_peering_routes_config","google_compute_node_group","google_compute_node_template","google_compute_packet_mirroring","google_compute_per_instance_config","google_compute_project_default_network_tier","google_compute_project_metadata","google_compute_project_metadata_item","google_compute_region_autoscaler","google_compute_region_backend_service","google_compute_region_disk","google_compute_region_disk_iam_member","google_compute_region_disk_resource_policy_attachment","google_compute_region_health_check","google_compute_region_instance_group_manager","google_compute_region_network_endpoint","google_compute_region_network_endpoint_group","google_compute_region_network_firewall_policy","google_compute_region_network_firewall_policy_association","google_compute_region_per_instance_config","google_compute_region_ssl_certificate","google_compute_region_target_http_proxy","google_compute_region_target_https_proxy","google_compute_region_target_tcp_proxy","google_compute_region_url_map","google_compute_reservation","google_compute_resource_policy","google_compute_route","google_compute_router","google_compute_router_interface","google_compute_router_nat","google_compute_router_peer","google_compute_security_policy","google_compute_service_attachment","google_compute_shared_vpc_host_project","google_compute_shared_vpc_service_project","google_compute_snapshot","google_compute_snapshot_iam_member","google_compute_ssl_certificate","google_compute_ssl_policy","google_compute_subnetwork","google_compute_subnetwork_iam_member","google_compute_target_grpc_proxy","google_compute_target_http_proxy","google_compute_target_https_proxy","google_compute_target_instance","google_compute_target_pool","google_compute_target_ssl_proxy","google_compute_target_tcp_proxy","google_compute_url_map","google_compute_vpn_gateway","google_compute_vpn_tunnel","google_container_analysis_note","google_container_attached_cluster","google_container_aws_cluster","google_container_aws_node_pool","google_container_azure_client","google_container_azure_cluster","google_container_azure_node_pool","google_container_cluster","google_container_node_pool","google_container_registry","google_data_catalog_entry","google_data_catalog_entry_group","google_data_catalog_tag","google_data_catalog_tag_template","google_data_fusion_instance","google_data_loss_prevention_deidentify_template","google_data_loss_prevention_inspect_template","google_data_loss_prevention_job_trigger","google_data_loss_prevention_stored_info_type","google_dataflow_job","google_dataplex_asset","google_dataplex_lake","google_dataplex_zone","google_dataproc_autoscaling_policy","google_dataproc_cluster","google_dataproc_job","google_dataproc_metastore_service","google_dataproc_workflow_template","google_datastore_index","google_datastream_connection_profile","google_datastream_private_connection","google_dialogflow_cx_agent","google_dialogflow_cx_entity_type","google_dialogflow_cx_environment","google_dialogflow_cx_flow","google_dialogflow_cx_intent","google_dialogflow_cx_page","google_dialogflow_cx_version","google_dialogflow_cx_webhook","google_dns_managed_zone","google_dns_managed_zone_iam_member","google_dns_policy","google_dns_record_set","google_document_ai_processor","google_essential_contacts_contact","google_eventarc_channel","google_eventarc_google_channel_config","google_eventarc_trigger","google_filestore_backup","google_filestore_instance","google_filestore_snapshot","google_firebaserules_release","google_firebaserules_ruleset","google_folder","google_folder_iam_member","google_gke_backup_backup_plan","google_gke_hub_membership","google_gke_hub_membership_iam_member","google_healthcare_consent_store","google_healthcare_dataset","google_healthcare_dataset_iam_member","google_iam_workload_identity_pool","google_iam_workload_identity_pool_provider","google_iap_app_engine_service_iam_member","google_iap_app_engine_version_iam_member","google_iap_tunnel_iam_member","google_iap_web_backend_service_iam_member","google_iap_web_iam_member","google_iap_web_type_app_engine_iam_member","google_iap_web_type_compute_iam_member","google_identity_platform_default_supported_idp_config","google_identity_platform_inbound_saml_config","google_identity_platform_oauth_idp_config","google_identity_platform_project_default_config","google_identity_platform_tenant","google_identity_platform_tenant_default_supported_idp_config","google_identity_platform_tenant_inbound_saml_config","google_identity_platform_tenant_oauth_idp_config","google_kms_crypto_key","google_kms_crypto_key_iam_member","google_kms_crypto_key_version","google_kms_key_ring","google_kms_key_ring_iam_member","google_kms_key_ring_import_job","google_kms_secret_ciphertext","google_logging_folder_bucket_config","google_logging_folder_exclusion","google_logging_folder_sink","google_logging_log_view","google_logging_metric","google_logging_project_bucket_config","google_logging_project_exclusion","google_logging_project_sink","google_memcache_instance","google_ml_engine_model","google_monitoring_alert_policy","google_monitoring_custom_service","google_monitoring_dashboard","google_monitoring_group","google_monitoring_metric_descriptor","google_monitoring_notification_channel","google_monitoring_service","google_monitoring_slo","google_monitoring_uptime_check_config","google_network_connectivity_hub","google_network_connectivity_service_connection_policy","google_network_connectivity_spoke","google_network_management_connectivity_test","google_notebooks_environment","google_notebooks_instance","google_notebooks_instance_iam_member","google_notebooks_runtime","google_notebooks_runtime_iam_member","google_org_policy_policy","google_organization_iam_audit_config","google_organization_iam_custom_role","google_organization_iam_member","google_os_config_os_policy_assignment","google_os_config_patch_deployment","google_os_login_ssh_public_key","google_privateca_ca_pool","google_privateca_ca_pool_iam_member","google_privateca_certificate","google_privateca_certificate_authority","google_privateca_certificate_template","google_privateca_certificate_template_iam_member","google_project","google_project_default_service_accounts","google_project_iam_audit_config","google_project_iam_custom_role","google_project_iam_member","google_project_service","google_project_usage_export_bucket","google_pubsub_lite_reservation","google_pubsub_lite_subscription","google_pubsub_lite_topic","google_pubsub_schema","google_pubsub_subscription","google_pubsub_subscription_iam_member","google_pubsub_topic","google_pubsub_topic_iam_member","google_redis_instance","google_secret_manager_secret","google_secret_manager_secret_iam_member","google_secret_manager_secret_version","google_service_account","google_service_account_iam_member","google_service_account_key","google_service_networking_connection","google_service_networking_peered_dns_domain","google_sourcerepo_repository","google_sourcerepo_repository_iam_member","google_spanner_database","google_spanner_database_iam_member","google_spanner_instance","google_spanner_instance_iam_member","google_sql_database","google_sql_database_instance","google_sql_source_representation_instance","google_sql_ssl_cert","google_sql_user","google_storage_bucket","google_storage_bucket_access_control","google_storage_bucket_acl","google_storage_bucket_iam_member","google_storage_bucket_object","google_storage_default_object_access_control","google_storage_default_object_acl","google_storage_hmac_key","google_storage_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","google_tags_tag_binding","google_tags_tag_key","google_tags_tag_value","google_tpu_node","google_vertex_ai_dataset","google_vertex_ai_featurestore","google_vertex_ai_featurestore_entitytype","google_vertex_ai_tensorboard","google_vpc_access_connector","google_workflows_workflow"] \ No newline at end of file diff --git a/config/networkconnectivity/config.go b/config/networkconnectivity/config.go new file mode 100644 index 000000000..6aaf482a8 --- /dev/null +++ b/config/networkconnectivity/config.go @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: CC0-1.0 + +package networkconnectivity + +import ( + "github.com/crossplane/upjet/pkg/config" +) + +// Configure configures individual resources by adding custom +// ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("google_network_connectivity_service_connection_policy", func(r *config.Resource) { + config.MarkAsRequired(r.TerraformResource, "region") + }) +} diff --git a/examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml b/examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml new file mode 100644 index 000000000..119ad4626 --- /dev/null +++ b/examples-generated/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml @@ -0,0 +1,52 @@ +apiVersion: networkconnectivity.gcp.upbound.io/v1beta1 +kind: ServiceConnectionPolicy +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + description: my basic service connection policy + location: us-central1 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + pscConfig: + - limit: 2 + subnetworksRefs: + - name: producer_subnet + serviceClass: my-basic-service-class + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Network +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: producer_net + name: producer-net +spec: + forProvider: + autoCreateSubnetworks: false + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: Subnetwork +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: producer_subnet + name: producer-subnet +spec: + forProvider: + ipCidrRange: 10.0.0.0/16 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 diff --git a/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml b/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml new file mode 100644 index 000000000..e1b1c8e07 --- /dev/null +++ b/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml @@ -0,0 +1,52 @@ +apiVersion: networkconnectivity.gcp.upbound.io/v1beta1 +kind: ServiceConnectionPolicy +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + description: my basic service connection policy + location: us-central1 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + pscConfig: + - limit: 2 + subnetworksRefs: + - name: producer_subnet + serviceClass: gcp-memorystore-redis + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Network +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: producer_net + name: producer-net +spec: + forProvider: + autoCreateSubnetworks: false + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: Subnetwork +metadata: + annotations: + meta.upbound.io/example-id: networkconnectivity/v1beta1/serviceconnectionpolicy + labels: + testing.upbound.io/example-name: producer_subnet + name: producer-subnet +spec: + forProvider: + ipCidrRange: 10.0.0.0/16 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 diff --git a/internal/controller/networkconnectivity/serviceconnectionpolicy/zz_controller.go b/internal/controller/networkconnectivity/serviceconnectionpolicy/zz_controller.go new file mode 100755 index 000000000..a3f1814a1 --- /dev/null +++ b/internal/controller/networkconnectivity/serviceconnectionpolicy/zz_controller.go @@ -0,0 +1,92 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package serviceconnectionpolicy + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-gcp/apis/networkconnectivity/v1beta1" + features "github.com/upbound/provider-gcp/internal/features" +) + +// Setup adds a controller that reconciles ServiceConnectionPolicy managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.ServiceConnectionPolicy_GroupVersionKind.String()) + var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.ServiceConnectionPolicy_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.ServiceConnectionPolicy_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["google_network_connectivity_service_connection_policy"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.ServiceConnectionPolicy_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1beta1.ServiceConnectionPolicy + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1beta1.ServiceConnectionPolicy{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.ServiceConnectionPolicy") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ServiceConnectionPolicyList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ServiceConnectionPolicyList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.ServiceConnectionPolicy_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.ServiceConnectionPolicy{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_monolith_setup.go b/internal/controller/zz_monolith_setup.go index 3ade62fb4..9e705b9a5 100755 --- a/internal/controller/zz_monolith_setup.go +++ b/internal/controller/zz_monolith_setup.go @@ -300,6 +300,7 @@ import ( slo "github.com/upbound/provider-gcp/internal/controller/monitoring/slo" uptimecheckconfig "github.com/upbound/provider-gcp/internal/controller/monitoring/uptimecheckconfig" hub "github.com/upbound/provider-gcp/internal/controller/networkconnectivity/hub" + serviceconnectionpolicy "github.com/upbound/provider-gcp/internal/controller/networkconnectivity/serviceconnectionpolicy" spoke "github.com/upbound/provider-gcp/internal/controller/networkconnectivity/spoke" connectivitytest "github.com/upbound/provider-gcp/internal/controller/networkmanagement/connectivitytest" environmentnotebooks "github.com/upbound/provider-gcp/internal/controller/notebooks/environment" @@ -661,6 +662,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { slo.Setup, uptimecheckconfig.Setup, hub.Setup, + serviceconnectionpolicy.Setup, spoke.Setup, connectivitytest.Setup, environmentnotebooks.Setup, diff --git a/internal/controller/zz_networkconnectivity_setup.go b/internal/controller/zz_networkconnectivity_setup.go index fe410b830..da675020d 100755 --- a/internal/controller/zz_networkconnectivity_setup.go +++ b/internal/controller/zz_networkconnectivity_setup.go @@ -10,6 +10,7 @@ import ( "github.com/crossplane/upjet/pkg/controller" hub "github.com/upbound/provider-gcp/internal/controller/networkconnectivity/hub" + serviceconnectionpolicy "github.com/upbound/provider-gcp/internal/controller/networkconnectivity/serviceconnectionpolicy" spoke "github.com/upbound/provider-gcp/internal/controller/networkconnectivity/spoke" ) @@ -18,6 +19,7 @@ import ( func Setup_networkconnectivity(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ hub.Setup, + serviceconnectionpolicy.Setup, spoke.Setup, } { if err := setup(mgr, o); err != nil { diff --git a/package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml b/package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml new file mode 100644 index 000000000..bcf22779c --- /dev/null +++ b/package/crds/networkconnectivity.gcp.upbound.io_serviceconnectionpolicies.yaml @@ -0,0 +1,870 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: serviceconnectionpolicies.networkconnectivity.gcp.upbound.io +spec: + group: networkconnectivity.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: ServiceConnectionPolicy + listKind: ServiceConnectionPolicyList + plural: serviceconnectionpolicies + singular: serviceconnectionpolicy + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: ServiceConnectionPolicy is the Schema for the ServiceConnectionPolicys + API. Manage Service Connection Policies. + 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 + 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 + type: string + metadata: + type: object + spec: + description: ServiceConnectionPolicySpec defines the desired state of + ServiceConnectionPolicy + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + description: + description: Free-text description of the resource. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels. + type: object + x-kubernetes-map-type: granular + location: + description: The location of the ServiceConnectionPolicy. + type: string + network: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + type: string + networkRef: + description: Reference to a Network in compute to populate network. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + networkSelector: + description: Selector for a Network in compute to populate network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfig: + description: |- + Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + Structure is documented below. + properties: + limit: + description: Max number of PSC connections for this policy. + type: string + subnetworks: + description: IDs of the subnetworks or fully qualified identifiers + for the subnetworks + items: + type: string + type: array + subnetworksRefs: + description: References to Subnetwork in compute to populate + subnetworks. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + subnetworksSelector: + description: Selector for a list of Subnetwork in compute + to populate subnetworks. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + serviceClass: + description: |- + The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + type: string + required: + - location + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + description: + description: Free-text description of the resource. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels. + type: object + x-kubernetes-map-type: granular + network: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + type: string + networkRef: + description: Reference to a Network in compute to populate network. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + networkSelector: + description: Selector for a Network in compute to populate network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfig: + description: |- + Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + Structure is documented below. + properties: + limit: + description: Max number of PSC connections for this policy. + type: string + subnetworks: + description: IDs of the subnetworks or fully qualified identifiers + for the subnetworks + items: + type: string + type: array + subnetworksRefs: + description: References to Subnetwork in compute to populate + subnetworks. + items: + description: A Reference to a named object. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + type: array + subnetworksSelector: + description: Selector for a list of Subnetwork in compute + to populate subnetworks. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + serviceClass: + description: |- + The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + type: string + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.serviceClass is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.serviceClass) + || (has(self.initProvider) && has(self.initProvider.serviceClass))' + status: + description: ServiceConnectionPolicyStatus defines the observed state + of ServiceConnectionPolicy. + properties: + atProvider: + properties: + createTime: + description: The timestamp when the resource was created. + type: string + description: + description: Free-text description of the resource. + type: string + effectiveLabels: + additionalProperties: + type: string + description: for all of the labels present on the resource. + type: object + x-kubernetes-map-type: granular + etag: + description: The etag is computed by the server, and may be sent + on update and delete requests to ensure the client has an up-to-date + value before proceeding. + type: string + id: + description: an identifier for the resource with format projects/{{project}}/locations/{{location}}/serviceConnectionPolicies/{{name}} + type: string + infrastructure: + description: The type of underlying resources used to create the + connection. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels. + type: object + x-kubernetes-map-type: granular + location: + description: The location of the ServiceConnectionPolicy. + type: string + network: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfig: + description: |- + Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + Structure is documented below. + properties: + limit: + description: Max number of PSC connections for this policy. + type: string + subnetworks: + description: IDs of the subnetworks or fully qualified identifiers + for the subnetworks + items: + type: string + type: array + type: object + pscConnections: + description: |- + Information about each Private Service Connect connection. + Structure is documented below. + items: + properties: + consumerAddress: + description: The resource reference of the consumer address. + type: string + consumerForwardingRule: + description: The resource reference of the PSC Forwarding + Rule within the consumer VPC. + type: string + consumerTargetProject: + description: The project where the PSC connection is created. + type: string + error: + description: |- + The most recent error during operating this connection. + Structure is documented below. + properties: + code: + description: The status code, which should be an enum + value of [google.rpc.Code][]. + type: number + details: + description: |- + (Output) + A list of messages that carry the error details. + items: + additionalProperties: + type: string + type: object + type: array + message: + description: A developer-facing error message. + type: string + type: object + errorInfo: + description: |- + The error info for the latest error during operating this connection. + Structure is documented below. + properties: + domain: + description: The logical grouping to which the "reason" + belongs. + type: string + metadata: + additionalProperties: + type: string + description: Additional structured details about this + error. + type: object + x-kubernetes-map-type: granular + reason: + description: The reason of the error. + type: string + type: object + errorType: + description: |- + The error type indicates whether the error is consumer facing, producer + facing or system internal. + Possible values are: CONNECTION_ERROR_TYPE_UNSPECIFIED, ERROR_INTERNAL, ERROR_CONSUMER_SIDE, ERROR_PRODUCER_SIDE. + type: string + gceOperation: + description: The last Compute Engine operation to setup + PSC connection. + type: string + pscConnectionId: + description: The PSC connection id of the PSC forwarding + rule. + type: string + state: + description: |- + The state of the PSC connection. + Possible values are: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, FAILED. + type: string + type: object + type: array + serviceClass: + description: |- + The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. + It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + type: string + terraformLabels: + additionalProperties: + type: string + description: |- + The combination of labels configured directly on the resource + and default labels configured on the provider. + type: object + x-kubernetes-map-type: granular + updateTime: + description: The timestamp when the resource was updated. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From d3c56a4d928c57438eaf62794648fb05e076e597 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Mon, 21 Oct 2024 14:50:52 +0200 Subject: [PATCH 19/34] Correct required attribute region -> location Signed-off-by: Rickard von Essen --- config/networkconnectivity/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/networkconnectivity/config.go b/config/networkconnectivity/config.go index 6aaf482a8..8dd5c766e 100644 --- a/config/networkconnectivity/config.go +++ b/config/networkconnectivity/config.go @@ -12,6 +12,6 @@ import ( // ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("google_network_connectivity_service_connection_policy", func(r *config.Resource) { - config.MarkAsRequired(r.TerraformResource, "region") + config.MarkAsRequired(r.TerraformResource, "location") }) -} +} \ No newline at end of file From 2df763844456d4bdd944c6efca2bbd1458482c84 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Mon, 21 Oct 2024 14:52:01 +0200 Subject: [PATCH 20/34] Fixed serviceconnectionpolicy example Signed-off-by: Rickard von Essen --- .../networkconnectivity/v1beta1/serviceconnectionpolicy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml b/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml index e1b1c8e07..49178ad6a 100644 --- a/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml +++ b/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml @@ -14,7 +14,7 @@ spec: matchLabels: testing.upbound.io/example-name: producer_net pscConfig: - - limit: 2 + limit: "2" subnetworksRefs: - name: producer_subnet serviceClass: gcp-memorystore-redis @@ -49,4 +49,4 @@ spec: networkSelector: matchLabels: testing.upbound.io/example-name: producer_net - region: us-central1 + region: us-central1 \ No newline at end of file From a5130216ecbc085b41d2194357f10886e0650a32 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Tue, 22 Oct 2024 08:48:58 +0200 Subject: [PATCH 21/34] Fixed subnetworkRef name in example Signed-off-by: Rickard von Essen --- .../networkconnectivity/v1beta1/serviceconnectionpolicy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml b/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml index 49178ad6a..cde335a1b 100644 --- a/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml +++ b/examples/networkconnectivity/v1beta1/serviceconnectionpolicy.yaml @@ -16,7 +16,7 @@ spec: pscConfig: limit: "2" subnetworksRefs: - - name: producer_subnet + - name: producer-subnet serviceClass: gcp-memorystore-redis --- @@ -49,4 +49,4 @@ spec: networkSelector: matchLabels: testing.upbound.io/example-name: producer_net - region: us-central1 \ No newline at end of file + region: us-central1 From 16de85c611d8a631e2f524631eda4c32b4e5e567 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Tue, 22 Oct 2024 09:44:12 +0200 Subject: [PATCH 22/34] Fmt Signed-off-by: Rickard von Essen --- config/networkconnectivity/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/networkconnectivity/config.go b/config/networkconnectivity/config.go index 8dd5c766e..7c2d40cb0 100644 --- a/config/networkconnectivity/config.go +++ b/config/networkconnectivity/config.go @@ -14,4 +14,4 @@ func Configure(p *config.Provider) { p.AddResourceConfigurator("google_network_connectivity_service_connection_policy", func(r *config.Resource) { config.MarkAsRequired(r.TerraformResource, "location") }) -} \ No newline at end of file +} From 5ce160a1107032f2406c8bbf5de7523ef543d036 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Wed, 23 Oct 2024 09:10:25 +0200 Subject: [PATCH 23/34] Remove redudant MarkAsRequired on location Signed-off-by: Rickard von Essen --- config/networkconnectivity/config.go | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 config/networkconnectivity/config.go diff --git a/config/networkconnectivity/config.go b/config/networkconnectivity/config.go deleted file mode 100644 index 7c2d40cb0..000000000 --- a/config/networkconnectivity/config.go +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: CC0-1.0 - -package networkconnectivity - -import ( - "github.com/crossplane/upjet/pkg/config" -) - -// Configure configures individual resources by adding custom -// ResourceConfigurators. -func Configure(p *config.Provider) { - p.AddResourceConfigurator("google_network_connectivity_service_connection_policy", func(r *config.Resource) { - config.MarkAsRequired(r.TerraformResource, "location") - }) -} From 793ee09f338e5860dc5efca0bd68431ecfad7556 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Tue, 24 Sep 2024 11:44:59 +0200 Subject: [PATCH 24/34] feat(redis): add Redis Cluster support This adds support for google_redis_cluster Terraform resource, see https://registry.terraform.io/providers/hashicorp/google/5.39.1/docs/resources/redis_cluster Signed-off-by: Rickard von Essen --- apis/redis/v1beta1/zz_cluster_terraformed.go | 129 +++ apis/redis/v1beta1/zz_cluster_types.go | 426 +++++++ .../v1beta1/zz_generated.conversion_hubs.go | 10 + apis/redis/v1beta1/zz_generated.deepcopy.go | 1006 +++++++++++++++-- apis/redis/v1beta1/zz_generated.managed.go | 60 + .../redis/v1beta1/zz_generated.managedlist.go | 9 + apis/redis/v1beta1/zz_generated.resolvers.go | 57 +- config/externalname.go | 2 + config/generated.lst | 2 +- config/redis/config.go | 46 +- examples-generated/redis/v1beta1/cluster.yaml | 78 ++ examples/redis/v1beta1/cluster.yaml | 78 ++ .../controller/redis/cluster/zz_controller.go | 92 ++ internal/controller/zz_monolith_setup.go | 2 + internal/controller/zz_redis_setup.go | 2 + .../crds/redis.gcp.upbound.io_clusters.yaml | 807 +++++++++++++ 16 files changed, 2707 insertions(+), 99 deletions(-) create mode 100755 apis/redis/v1beta1/zz_cluster_terraformed.go create mode 100755 apis/redis/v1beta1/zz_cluster_types.go create mode 100755 apis/redis/v1beta1/zz_generated.conversion_hubs.go create mode 100644 examples-generated/redis/v1beta1/cluster.yaml create mode 100644 examples/redis/v1beta1/cluster.yaml create mode 100755 internal/controller/redis/cluster/zz_controller.go create mode 100644 package/crds/redis.gcp.upbound.io_clusters.yaml diff --git a/apis/redis/v1beta1/zz_cluster_terraformed.go b/apis/redis/v1beta1/zz_cluster_terraformed.go new file mode 100755 index 000000000..32ceb38a7 --- /dev/null +++ b/apis/redis/v1beta1/zz_cluster_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Cluster +func (mg *Cluster) GetTerraformResourceType() string { + return "google_redis_cluster" +} + +// GetConnectionDetailsMapping for this Cluster +func (tr *Cluster) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Cluster +func (tr *Cluster) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this Cluster +func (tr *Cluster) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this Cluster +func (tr *Cluster) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Cluster +func (tr *Cluster) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this Cluster +func (tr *Cluster) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this Cluster +func (tr *Cluster) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this Cluster +func (tr *Cluster) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Cluster using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Cluster) LateInitialize(attrs []byte) (bool, error) { + params := &ClusterParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Cluster) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/redis/v1beta1/zz_cluster_types.go b/apis/redis/v1beta1/zz_cluster_types.go new file mode 100755 index 000000000..f0e66a5fb --- /dev/null +++ b/apis/redis/v1beta1/zz_cluster_types.go @@ -0,0 +1,426 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ClusterInitParameters struct { + + // Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + // Default value is AUTH_MODE_DISABLED. + // Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + AuthorizationMode *string `json:"authorizationMode,omitempty" tf:"authorization_mode,omitempty"` + + // The nodeType for the Redis cluster. + // If not provided, REDIS_HIGHMEM_MEDIUM will be used as default + // Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL. + NodeType *string `json:"nodeType,omitempty" tf:"node_type,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Required. Each PscConfig configures the consumer network where two + // network addresses will be designated to the cluster for client access. + // Currently, only one PscConfig is supported. + // Structure is documented below. + PscConfigs []PscConfigsInitParameters `json:"pscConfigs,omitempty" tf:"psc_configs,omitempty"` + + // Configure Redis Cluster behavior using a subset of native Redis configuration parameters. + // Please check Memorystore documentation for the list of supported parameters: + // https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations + // +mapType=granular + RedisConfigs map[string]*string `json:"redisConfigs,omitempty" tf:"redis_configs,omitempty"` + + // Optional. The number of replica nodes per shard. + ReplicaCount *float64 `json:"replicaCount,omitempty" tf:"replica_count,omitempty"` + + // Required. Number of shards for the Redis cluster. + ShardCount *float64 `json:"shardCount,omitempty" tf:"shard_count,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + // Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + // Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty" tf:"transit_encryption_mode,omitempty"` + + // Immutable. Zone distribution config for Memorystore Redis cluster. + // Structure is documented below. + ZoneDistributionConfig *ZoneDistributionConfigInitParameters `json:"zoneDistributionConfig,omitempty" tf:"zone_distribution_config,omitempty"` +} + +type ClusterObservation struct { + + // Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + // Default value is AUTH_MODE_DISABLED. + // Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + AuthorizationMode *string `json:"authorizationMode,omitempty" tf:"authorization_mode,omitempty"` + + // The timestamp associated with the cluster creation request. A timestamp in + // RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional + // digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". + CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` + + // Output only. Endpoints created on each given network, + // for Redis clients to connect to the cluster. + // Currently only one endpoint is supported. + // Structure is documented below. + DiscoveryEndpoints []DiscoveryEndpointsObservation `json:"discoveryEndpoints,omitempty" tf:"discovery_endpoints,omitempty"` + + // an identifier for the resource with format projects/{{project}}/locations/{{region}}/clusters/{{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The nodeType for the Redis cluster. + // If not provided, REDIS_HIGHMEM_MEDIUM will be used as default + // Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL. + NodeType *string `json:"nodeType,omitempty" tf:"node_type,omitempty"` + + // Output only. Redis memory precise size in GB for the entire cluster. + PreciseSizeGb *float64 `json:"preciseSizeGb,omitempty" tf:"precise_size_gb,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Required. Each PscConfig configures the consumer network where two + // network addresses will be designated to the cluster for client access. + // Currently, only one PscConfig is supported. + // Structure is documented below. + PscConfigs []PscConfigsObservation `json:"pscConfigs,omitempty" tf:"psc_configs,omitempty"` + + // Output only. PSC connections for discovery of the cluster topology and accessing the cluster. + // Structure is documented below. + PscConnections []PscConnectionsObservation `json:"pscConnections,omitempty" tf:"psc_connections,omitempty"` + + // Configure Redis Cluster behavior using a subset of native Redis configuration parameters. + // Please check Memorystore documentation for the list of supported parameters: + // https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations + // +mapType=granular + RedisConfigs map[string]*string `json:"redisConfigs,omitempty" tf:"redis_configs,omitempty"` + + // The name of the region of the Redis cluster. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Optional. The number of replica nodes per shard. + ReplicaCount *float64 `json:"replicaCount,omitempty" tf:"replica_count,omitempty"` + + // Required. Number of shards for the Redis cluster. + ShardCount *float64 `json:"shardCount,omitempty" tf:"shard_count,omitempty"` + + // Output only. Redis memory size in GB for the entire cluster. + SizeGb *float64 `json:"sizeGb,omitempty" tf:"size_gb,omitempty"` + + // The current state of this cluster. Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + State *string `json:"state,omitempty" tf:"state,omitempty"` + + // Output only. Additional information about the current state of the cluster. + // Structure is documented below. + StateInfo []StateInfoObservation `json:"stateInfo,omitempty" tf:"state_info,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + // Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + // Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty" tf:"transit_encryption_mode,omitempty"` + + // System assigned, unique identifier for the cluster. + UID *string `json:"uid,omitempty" tf:"uid,omitempty"` + + // Immutable. Zone distribution config for Memorystore Redis cluster. + // Structure is documented below. + ZoneDistributionConfig *ZoneDistributionConfigObservation `json:"zoneDistributionConfig,omitempty" tf:"zone_distribution_config,omitempty"` +} + +type ClusterParameters struct { + + // Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + // Default value is AUTH_MODE_DISABLED. + // Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + // +kubebuilder:validation:Optional + AuthorizationMode *string `json:"authorizationMode,omitempty" tf:"authorization_mode,omitempty"` + + // The nodeType for the Redis cluster. + // If not provided, REDIS_HIGHMEM_MEDIUM will be used as default + // Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL. + // +kubebuilder:validation:Optional + NodeType *string `json:"nodeType,omitempty" tf:"node_type,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + // +kubebuilder:validation:Optional + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Required. Each PscConfig configures the consumer network where two + // network addresses will be designated to the cluster for client access. + // Currently, only one PscConfig is supported. + // Structure is documented below. + // +kubebuilder:validation:Optional + PscConfigs []PscConfigsParameters `json:"pscConfigs,omitempty" tf:"psc_configs,omitempty"` + + // Configure Redis Cluster behavior using a subset of native Redis configuration parameters. + // Please check Memorystore documentation for the list of supported parameters: + // https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations + // +kubebuilder:validation:Optional + // +mapType=granular + RedisConfigs map[string]*string `json:"redisConfigs,omitempty" tf:"redis_configs,omitempty"` + + // The name of the region of the Redis cluster. + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"region,omitempty"` + + // Optional. The number of replica nodes per shard. + // +kubebuilder:validation:Optional + ReplicaCount *float64 `json:"replicaCount,omitempty" tf:"replica_count,omitempty"` + + // Required. Number of shards for the Redis cluster. + // +kubebuilder:validation:Optional + ShardCount *float64 `json:"shardCount,omitempty" tf:"shard_count,omitempty"` + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + // Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + // Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + // +kubebuilder:validation:Optional + TransitEncryptionMode *string `json:"transitEncryptionMode,omitempty" tf:"transit_encryption_mode,omitempty"` + + // Immutable. Zone distribution config for Memorystore Redis cluster. + // Structure is documented below. + // +kubebuilder:validation:Optional + ZoneDistributionConfig *ZoneDistributionConfigParameters `json:"zoneDistributionConfig,omitempty" tf:"zone_distribution_config,omitempty"` +} + +type DiscoveryEndpointsInitParameters struct { +} + +type DiscoveryEndpointsObservation struct { + + // Output only. Network address of the exposed Redis endpoint used by clients to connect to the service. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // Output only. The port number of the exposed Redis endpoint. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // Output only. Customer configuration for where the endpoint + // is created and accessed from. + // Structure is documented below. + PscConfig *PscConfigObservation `json:"pscConfig,omitempty" tf:"psc_config,omitempty"` +} + +type DiscoveryEndpointsParameters struct { +} + +type PscConfigInitParameters struct { +} + +type PscConfigObservation struct { + + // The consumer network where the IP address resides, in the form of projects/{projectId}/global/networks/{network_id}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` +} + +type PscConfigParameters struct { +} + +type PscConfigsInitParameters struct { + + // Required. The consumer network where the network address of + // the discovery endpoint will be reserved, in the form of + // projects/{network_project_id_or_number}/global/networks/{network_id}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` +} + +type PscConfigsObservation struct { + + // Required. The consumer network where the network address of + // the discovery endpoint will be reserved, in the form of + // projects/{network_project_id_or_number}/global/networks/{network_id}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` +} + +type PscConfigsParameters struct { + + // Required. The consumer network where the network address of + // the discovery endpoint will be reserved, in the form of + // projects/{network_project_id_or_number}/global/networks/{network_id}. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta1.Network + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Reference to a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkRef *v1.Reference `json:"networkRef,omitempty" tf:"-"` + + // Selector for a Network in compute to populate network. + // +kubebuilder:validation:Optional + NetworkSelector *v1.Selector `json:"networkSelector,omitempty" tf:"-"` +} + +type PscConnectionsInitParameters struct { +} + +type PscConnectionsObservation struct { + + // Output only. The IP allocated on the consumer network for the PSC forwarding rule. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // Output only. The URI of the consumer side forwarding rule. Example: projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + ForwardingRule *string `json:"forwardingRule,omitempty" tf:"forwarding_rule,omitempty"` + + // The consumer network where the IP address resides, in the form of projects/{projectId}/global/networks/{network_id}. + Network *string `json:"network,omitempty" tf:"network,omitempty"` + + // Output only. The consumer projectId where the forwarding rule is created from. + ProjectID *string `json:"projectId,omitempty" tf:"project_id,omitempty"` + + // Output only. The PSC connection id of the forwarding rule connected to the service attachment. + PscConnectionID *string `json:"pscConnectionId,omitempty" tf:"psc_connection_id,omitempty"` +} + +type PscConnectionsParameters struct { +} + +type StateInfoInitParameters struct { +} + +type StateInfoObservation struct { + + // A nested object resource + // Structure is documented below. + UpdateInfo *UpdateInfoObservation `json:"updateInfo,omitempty" tf:"update_info,omitempty"` +} + +type StateInfoParameters struct { +} + +type UpdateInfoInitParameters struct { +} + +type UpdateInfoObservation struct { + + // Target number of replica nodes per shard. + TargetReplicaCount *float64 `json:"targetReplicaCount,omitempty" tf:"target_replica_count,omitempty"` + + // Target number of shards for redis cluster. + TargetShardCount *float64 `json:"targetShardCount,omitempty" tf:"target_shard_count,omitempty"` +} + +type UpdateInfoParameters struct { +} + +type ZoneDistributionConfigInitParameters struct { + + // Immutable. The mode for zone distribution for Memorystore Redis cluster. + // If not provided, MULTI_ZONE will be used as default + // Possible values are: MULTI_ZONE, SINGLE_ZONE. + Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + + // Immutable. The zone for single zone Memorystore Redis cluster. + Zone *string `json:"zone,omitempty" tf:"zone,omitempty"` +} + +type ZoneDistributionConfigObservation struct { + + // Immutable. The mode for zone distribution for Memorystore Redis cluster. + // If not provided, MULTI_ZONE will be used as default + // Possible values are: MULTI_ZONE, SINGLE_ZONE. + Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + + // Immutable. The zone for single zone Memorystore Redis cluster. + Zone *string `json:"zone,omitempty" tf:"zone,omitempty"` +} + +type ZoneDistributionConfigParameters struct { + + // Immutable. The mode for zone distribution for Memorystore Redis cluster. + // If not provided, MULTI_ZONE will be used as default + // Possible values are: MULTI_ZONE, SINGLE_ZONE. + // +kubebuilder:validation:Optional + Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + + // Immutable. The zone for single zone Memorystore Redis cluster. + // +kubebuilder:validation:Optional + Zone *string `json:"zone,omitempty" tf:"zone,omitempty"` +} + +// ClusterSpec defines the desired state of Cluster +type ClusterSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ClusterParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider ClusterInitParameters `json:"initProvider,omitempty"` +} + +// ClusterStatus defines the observed state of Cluster. +type ClusterStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ClusterObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Cluster is the Schema for the Clusters API. A Google Cloud Redis Cluster instance. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp} +type Cluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.pscConfigs) || (has(self.initProvider) && has(self.initProvider.pscConfigs))",message="spec.forProvider.pscConfigs is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.shardCount) || (has(self.initProvider) && has(self.initProvider.shardCount))",message="spec.forProvider.shardCount is a required parameter" + Spec ClusterSpec `json:"spec"` + Status ClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClusterList contains a list of Clusters +type ClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Cluster `json:"items"` +} + +// Repository type metadata. +var ( + Cluster_Kind = "Cluster" + Cluster_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Cluster_Kind}.String() + Cluster_KindAPIVersion = Cluster_Kind + "." + CRDGroupVersion.String() + Cluster_GroupVersionKind = CRDGroupVersion.WithKind(Cluster_Kind) +) + +func init() { + SchemeBuilder.Register(&Cluster{}, &ClusterList{}) +} diff --git a/apis/redis/v1beta1/zz_generated.conversion_hubs.go b/apis/redis/v1beta1/zz_generated.conversion_hubs.go new file mode 100755 index 000000000..9f962cae0 --- /dev/null +++ b/apis/redis/v1beta1/zz_generated.conversion_hubs.go @@ -0,0 +1,10 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +// Hub marks this type as a conversion hub. +func (tr *Cluster) Hub() {} diff --git a/apis/redis/v1beta1/zz_generated.deepcopy.go b/apis/redis/v1beta1/zz_generated.deepcopy.go index 069d49bfa..fec5ad9f7 100644 --- a/apis/redis/v1beta1/zz_generated.deepcopy.go +++ b/apis/redis/v1beta1/zz_generated.deepcopy.go @@ -13,6 +13,440 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Cluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterInitParameters) DeepCopyInto(out *ClusterInitParameters) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.NodeType != nil { + in, out := &in.NodeType, &out.NodeType + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisConfigs != nil { + in, out := &in.RedisConfigs, &out.RedisConfigs + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(float64) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(float64) + **out = **in + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } + if in.ZoneDistributionConfig != nil { + in, out := &in.ZoneDistributionConfig, &out.ZoneDistributionConfig + *out = new(ZoneDistributionConfigInitParameters) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterInitParameters. +func (in *ClusterInitParameters) DeepCopy() *ClusterInitParameters { + if in == nil { + return nil + } + out := new(ClusterInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterObservation) DeepCopyInto(out *ClusterObservation) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.DiscoveryEndpoints != nil { + in, out := &in.DiscoveryEndpoints, &out.DiscoveryEndpoints + *out = make([]DiscoveryEndpointsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.NodeType != nil { + in, out := &in.NodeType, &out.NodeType + *out = new(string) + **out = **in + } + if in.PreciseSizeGb != nil { + in, out := &in.PreciseSizeGb, &out.PreciseSizeGb + *out = new(float64) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnectionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisConfigs != nil { + in, out := &in.RedisConfigs, &out.RedisConfigs + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(float64) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(float64) + **out = **in + } + if in.SizeGb != nil { + in, out := &in.SizeGb, &out.SizeGb + *out = new(float64) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.StateInfo != nil { + in, out := &in.StateInfo, &out.StateInfo + *out = make([]StateInfoObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } + if in.UID != nil { + in, out := &in.UID, &out.UID + *out = new(string) + **out = **in + } + if in.ZoneDistributionConfig != nil { + in, out := &in.ZoneDistributionConfig, &out.ZoneDistributionConfig + *out = new(ZoneDistributionConfigObservation) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterObservation. +func (in *ClusterObservation) DeepCopy() *ClusterObservation { + if in == nil { + return nil + } + out := new(ClusterObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { + *out = *in + if in.AuthorizationMode != nil { + in, out := &in.AuthorizationMode, &out.AuthorizationMode + *out = new(string) + **out = **in + } + if in.NodeType != nil { + in, out := &in.NodeType, &out.NodeType + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConfigs != nil { + in, out := &in.PscConfigs, &out.PscConfigs + *out = make([]PscConfigsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisConfigs != nil { + in, out := &in.RedisConfigs, &out.RedisConfigs + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicaCount != nil { + in, out := &in.ReplicaCount, &out.ReplicaCount + *out = new(float64) + **out = **in + } + if in.ShardCount != nil { + in, out := &in.ShardCount, &out.ShardCount + *out = new(float64) + **out = **in + } + if in.TransitEncryptionMode != nil { + in, out := &in.TransitEncryptionMode, &out.TransitEncryptionMode + *out = new(string) + **out = **in + } + if in.ZoneDistributionConfig != nil { + in, out := &in.ZoneDistributionConfig, &out.ZoneDistributionConfig + *out = new(ZoneDistributionConfigParameters) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterParameters. +func (in *ClusterParameters) DeepCopy() *ClusterParameters { + if in == nil { + return nil + } + out := new(ClusterParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { + if in == nil { + return nil + } + out := new(ClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { + if in == nil { + return nil + } + out := new(ClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryEndpointsInitParameters) DeepCopyInto(out *DiscoveryEndpointsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpointsInitParameters. +func (in *DiscoveryEndpointsInitParameters) DeepCopy() *DiscoveryEndpointsInitParameters { + if in == nil { + return nil + } + out := new(DiscoveryEndpointsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryEndpointsObservation) DeepCopyInto(out *DiscoveryEndpointsObservation) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfigObservation) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpointsObservation. +func (in *DiscoveryEndpointsObservation) DeepCopy() *DiscoveryEndpointsObservation { + if in == nil { + return nil + } + out := new(DiscoveryEndpointsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiscoveryEndpointsParameters) DeepCopyInto(out *DiscoveryEndpointsParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoveryEndpointsParameters. +func (in *DiscoveryEndpointsParameters) DeepCopy() *DiscoveryEndpointsParameters { + if in == nil { + return nil + } + out := new(DiscoveryEndpointsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Instance) DeepCopyInto(out *Instance) { *out = *in @@ -769,222 +1203,422 @@ func (in *MaintenancePolicyParameters) DeepCopyInto(out *MaintenancePolicyParame } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenancePolicyParameters. -func (in *MaintenancePolicyParameters) DeepCopy() *MaintenancePolicyParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenancePolicyParameters. +func (in *MaintenancePolicyParameters) DeepCopy() *MaintenancePolicyParameters { + if in == nil { + return nil + } + out := new(MaintenancePolicyParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceScheduleInitParameters) DeepCopyInto(out *MaintenanceScheduleInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceScheduleInitParameters. +func (in *MaintenanceScheduleInitParameters) DeepCopy() *MaintenanceScheduleInitParameters { + if in == nil { + return nil + } + out := new(MaintenanceScheduleInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceScheduleObservation) DeepCopyInto(out *MaintenanceScheduleObservation) { + *out = *in + if in.EndTime != nil { + in, out := &in.EndTime, &out.EndTime + *out = new(string) + **out = **in + } + if in.ScheduleDeadlineTime != nil { + in, out := &in.ScheduleDeadlineTime, &out.ScheduleDeadlineTime + *out = new(string) + **out = **in + } + if in.StartTime != nil { + in, out := &in.StartTime, &out.StartTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceScheduleObservation. +func (in *MaintenanceScheduleObservation) DeepCopy() *MaintenanceScheduleObservation { + if in == nil { + return nil + } + out := new(MaintenanceScheduleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MaintenanceScheduleParameters) DeepCopyInto(out *MaintenanceScheduleParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceScheduleParameters. +func (in *MaintenanceScheduleParameters) DeepCopy() *MaintenanceScheduleParameters { + if in == nil { + return nil + } + out := new(MaintenanceScheduleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodesInitParameters) DeepCopyInto(out *NodesInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesInitParameters. +func (in *NodesInitParameters) DeepCopy() *NodesInitParameters { + if in == nil { + return nil + } + out := new(NodesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodesObservation) DeepCopyInto(out *NodesObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesObservation. +func (in *NodesObservation) DeepCopy() *NodesObservation { + if in == nil { + return nil + } + out := new(NodesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodesParameters) DeepCopyInto(out *NodesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesParameters. +func (in *NodesParameters) DeepCopy() *NodesParameters { + if in == nil { + return nil + } + out := new(NodesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistenceConfigInitParameters) DeepCopyInto(out *PersistenceConfigInitParameters) { + *out = *in + if in.PersistenceMode != nil { + in, out := &in.PersistenceMode, &out.PersistenceMode + *out = new(string) + **out = **in + } + if in.RdbSnapshotPeriod != nil { + in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod + *out = new(string) + **out = **in + } + if in.RdbSnapshotStartTime != nil { + in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceConfigInitParameters. +func (in *PersistenceConfigInitParameters) DeepCopy() *PersistenceConfigInitParameters { + if in == nil { + return nil + } + out := new(PersistenceConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistenceConfigObservation) DeepCopyInto(out *PersistenceConfigObservation) { + *out = *in + if in.PersistenceMode != nil { + in, out := &in.PersistenceMode, &out.PersistenceMode + *out = new(string) + **out = **in + } + if in.RdbNextSnapshotTime != nil { + in, out := &in.RdbNextSnapshotTime, &out.RdbNextSnapshotTime + *out = new(string) + **out = **in + } + if in.RdbSnapshotPeriod != nil { + in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod + *out = new(string) + **out = **in + } + if in.RdbSnapshotStartTime != nil { + in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceConfigObservation. +func (in *PersistenceConfigObservation) DeepCopy() *PersistenceConfigObservation { + if in == nil { + return nil + } + out := new(PersistenceConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PersistenceConfigParameters) DeepCopyInto(out *PersistenceConfigParameters) { + *out = *in + if in.PersistenceMode != nil { + in, out := &in.PersistenceMode, &out.PersistenceMode + *out = new(string) + **out = **in + } + if in.RdbSnapshotPeriod != nil { + in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod + *out = new(string) + **out = **in + } + if in.RdbSnapshotStartTime != nil { + in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceConfigParameters. +func (in *PersistenceConfigParameters) DeepCopy() *PersistenceConfigParameters { if in == nil { return nil } - out := new(MaintenancePolicyParameters) + out := new(PersistenceConfigParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MaintenanceScheduleInitParameters) DeepCopyInto(out *MaintenanceScheduleInitParameters) { +func (in *PscConfigInitParameters) DeepCopyInto(out *PscConfigInitParameters) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceScheduleInitParameters. -func (in *MaintenanceScheduleInitParameters) DeepCopy() *MaintenanceScheduleInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigInitParameters. +func (in *PscConfigInitParameters) DeepCopy() *PscConfigInitParameters { if in == nil { return nil } - out := new(MaintenanceScheduleInitParameters) + out := new(PscConfigInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MaintenanceScheduleObservation) DeepCopyInto(out *MaintenanceScheduleObservation) { +func (in *PscConfigObservation) DeepCopyInto(out *PscConfigObservation) { *out = *in - if in.EndTime != nil { - in, out := &in.EndTime, &out.EndTime - *out = new(string) - **out = **in - } - if in.ScheduleDeadlineTime != nil { - in, out := &in.ScheduleDeadlineTime, &out.ScheduleDeadlineTime - *out = new(string) - **out = **in - } - if in.StartTime != nil { - in, out := &in.StartTime, &out.StartTime + if in.Network != nil { + in, out := &in.Network, &out.Network *out = new(string) **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceScheduleObservation. -func (in *MaintenanceScheduleObservation) DeepCopy() *MaintenanceScheduleObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigObservation. +func (in *PscConfigObservation) DeepCopy() *PscConfigObservation { if in == nil { return nil } - out := new(MaintenanceScheduleObservation) + out := new(PscConfigObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MaintenanceScheduleParameters) DeepCopyInto(out *MaintenanceScheduleParameters) { +func (in *PscConfigParameters) DeepCopyInto(out *PscConfigParameters) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MaintenanceScheduleParameters. -func (in *MaintenanceScheduleParameters) DeepCopy() *MaintenanceScheduleParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigParameters. +func (in *PscConfigParameters) DeepCopy() *PscConfigParameters { if in == nil { return nil } - out := new(MaintenanceScheduleParameters) + out := new(PscConfigParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodesInitParameters) DeepCopyInto(out *NodesInitParameters) { +func (in *PscConfigsInitParameters) DeepCopyInto(out *PscConfigsInitParameters) { *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesInitParameters. -func (in *NodesInitParameters) DeepCopy() *NodesInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigsInitParameters. +func (in *PscConfigsInitParameters) DeepCopy() *PscConfigsInitParameters { if in == nil { return nil } - out := new(NodesInitParameters) + out := new(PscConfigsInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodesObservation) DeepCopyInto(out *NodesObservation) { +func (in *PscConfigsObservation) DeepCopyInto(out *PscConfigsObservation) { *out = *in - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Zone != nil { - in, out := &in.Zone, &out.Zone + if in.Network != nil { + in, out := &in.Network, &out.Network *out = new(string) **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesObservation. -func (in *NodesObservation) DeepCopy() *NodesObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigsObservation. +func (in *PscConfigsObservation) DeepCopy() *PscConfigsObservation { if in == nil { return nil } - out := new(NodesObservation) + out := new(PscConfigsObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodesParameters) DeepCopyInto(out *NodesParameters) { +func (in *PscConfigsParameters) DeepCopyInto(out *PscConfigsParameters) { *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NetworkSelector != nil { + in, out := &in.NetworkSelector, &out.NetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesParameters. -func (in *NodesParameters) DeepCopy() *NodesParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfigsParameters. +func (in *PscConfigsParameters) DeepCopy() *PscConfigsParameters { if in == nil { return nil } - out := new(NodesParameters) + out := new(PscConfigsParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PersistenceConfigInitParameters) DeepCopyInto(out *PersistenceConfigInitParameters) { +func (in *PscConnectionsInitParameters) DeepCopyInto(out *PscConnectionsInitParameters) { *out = *in - if in.PersistenceMode != nil { - in, out := &in.PersistenceMode, &out.PersistenceMode - *out = new(string) - **out = **in - } - if in.RdbSnapshotPeriod != nil { - in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod - *out = new(string) - **out = **in - } - if in.RdbSnapshotStartTime != nil { - in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime - *out = new(string) - **out = **in - } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceConfigInitParameters. -func (in *PersistenceConfigInitParameters) DeepCopy() *PersistenceConfigInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsInitParameters. +func (in *PscConnectionsInitParameters) DeepCopy() *PscConnectionsInitParameters { if in == nil { return nil } - out := new(PersistenceConfigInitParameters) + out := new(PscConnectionsInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PersistenceConfigObservation) DeepCopyInto(out *PersistenceConfigObservation) { +func (in *PscConnectionsObservation) DeepCopyInto(out *PscConnectionsObservation) { *out = *in - if in.PersistenceMode != nil { - in, out := &in.PersistenceMode, &out.PersistenceMode + if in.Address != nil { + in, out := &in.Address, &out.Address *out = new(string) **out = **in } - if in.RdbNextSnapshotTime != nil { - in, out := &in.RdbNextSnapshotTime, &out.RdbNextSnapshotTime + if in.ForwardingRule != nil { + in, out := &in.ForwardingRule, &out.ForwardingRule *out = new(string) **out = **in } - if in.RdbSnapshotPeriod != nil { - in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod + if in.Network != nil { + in, out := &in.Network, &out.Network *out = new(string) **out = **in } - if in.RdbSnapshotStartTime != nil { - in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime + if in.ProjectID != nil { + in, out := &in.ProjectID, &out.ProjectID + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID *out = new(string) **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceConfigObservation. -func (in *PersistenceConfigObservation) DeepCopy() *PersistenceConfigObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsObservation. +func (in *PscConnectionsObservation) DeepCopy() *PscConnectionsObservation { if in == nil { return nil } - out := new(PersistenceConfigObservation) + out := new(PscConnectionsObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PersistenceConfigParameters) DeepCopyInto(out *PersistenceConfigParameters) { +func (in *PscConnectionsParameters) DeepCopyInto(out *PscConnectionsParameters) { *out = *in - if in.PersistenceMode != nil { - in, out := &in.PersistenceMode, &out.PersistenceMode - *out = new(string) - **out = **in - } - if in.RdbSnapshotPeriod != nil { - in, out := &in.RdbSnapshotPeriod, &out.RdbSnapshotPeriod - *out = new(string) - **out = **in - } - if in.RdbSnapshotStartTime != nil { - in, out := &in.RdbSnapshotStartTime, &out.RdbSnapshotStartTime - *out = new(string) - **out = **in - } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceConfigParameters. -func (in *PersistenceConfigParameters) DeepCopy() *PersistenceConfigParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnectionsParameters. +func (in *PscConnectionsParameters) DeepCopy() *PscConnectionsParameters { if in == nil { return nil } - out := new(PersistenceConfigParameters) + out := new(PscConnectionsParameters) in.DeepCopyInto(out) return out } @@ -1164,6 +1798,111 @@ func (in *StartTimeParameters) DeepCopy() *StartTimeParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateInfoInitParameters) DeepCopyInto(out *StateInfoInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateInfoInitParameters. +func (in *StateInfoInitParameters) DeepCopy() *StateInfoInitParameters { + if in == nil { + return nil + } + out := new(StateInfoInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateInfoObservation) DeepCopyInto(out *StateInfoObservation) { + *out = *in + if in.UpdateInfo != nil { + in, out := &in.UpdateInfo, &out.UpdateInfo + *out = new(UpdateInfoObservation) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateInfoObservation. +func (in *StateInfoObservation) DeepCopy() *StateInfoObservation { + if in == nil { + return nil + } + out := new(StateInfoObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateInfoParameters) DeepCopyInto(out *StateInfoParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateInfoParameters. +func (in *StateInfoParameters) DeepCopy() *StateInfoParameters { + if in == nil { + return nil + } + out := new(StateInfoParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateInfoInitParameters) DeepCopyInto(out *UpdateInfoInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateInfoInitParameters. +func (in *UpdateInfoInitParameters) DeepCopy() *UpdateInfoInitParameters { + if in == nil { + return nil + } + out := new(UpdateInfoInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateInfoObservation) DeepCopyInto(out *UpdateInfoObservation) { + *out = *in + if in.TargetReplicaCount != nil { + in, out := &in.TargetReplicaCount, &out.TargetReplicaCount + *out = new(float64) + **out = **in + } + if in.TargetShardCount != nil { + in, out := &in.TargetShardCount, &out.TargetShardCount + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateInfoObservation. +func (in *UpdateInfoObservation) DeepCopy() *UpdateInfoObservation { + if in == nil { + return nil + } + out := new(UpdateInfoObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateInfoParameters) DeepCopyInto(out *UpdateInfoParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateInfoParameters. +func (in *UpdateInfoParameters) DeepCopy() *UpdateInfoParameters { + if in == nil { + return nil + } + out := new(UpdateInfoParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WeeklyMaintenanceWindowInitParameters) DeepCopyInto(out *WeeklyMaintenanceWindowInitParameters) { *out = *in @@ -1249,3 +1988,78 @@ func (in *WeeklyMaintenanceWindowParameters) DeepCopy() *WeeklyMaintenanceWindow in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ZoneDistributionConfigInitParameters) DeepCopyInto(out *ZoneDistributionConfigInitParameters) { + *out = *in + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneDistributionConfigInitParameters. +func (in *ZoneDistributionConfigInitParameters) DeepCopy() *ZoneDistributionConfigInitParameters { + if in == nil { + return nil + } + out := new(ZoneDistributionConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ZoneDistributionConfigObservation) DeepCopyInto(out *ZoneDistributionConfigObservation) { + *out = *in + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneDistributionConfigObservation. +func (in *ZoneDistributionConfigObservation) DeepCopy() *ZoneDistributionConfigObservation { + if in == nil { + return nil + } + out := new(ZoneDistributionConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ZoneDistributionConfigParameters) DeepCopyInto(out *ZoneDistributionConfigParameters) { + *out = *in + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Zone != nil { + in, out := &in.Zone, &out.Zone + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZoneDistributionConfigParameters. +func (in *ZoneDistributionConfigParameters) DeepCopy() *ZoneDistributionConfigParameters { + if in == nil { + return nil + } + out := new(ZoneDistributionConfigParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/redis/v1beta1/zz_generated.managed.go b/apis/redis/v1beta1/zz_generated.managed.go index ed6281bb9..fcfa1b12b 100644 --- a/apis/redis/v1beta1/zz_generated.managed.go +++ b/apis/redis/v1beta1/zz_generated.managed.go @@ -7,6 +7,66 @@ package v1beta1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this Cluster. +func (mg *Cluster) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Cluster. +func (mg *Cluster) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Cluster. +func (mg *Cluster) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Cluster. +func (mg *Cluster) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Cluster. +func (mg *Cluster) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Cluster. +func (mg *Cluster) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Cluster. +func (mg *Cluster) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Cluster. +func (mg *Cluster) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Cluster. +func (mg *Cluster) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Cluster. +func (mg *Cluster) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Cluster. +func (mg *Cluster) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Cluster. +func (mg *Cluster) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Instance. func (mg *Instance) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/redis/v1beta1/zz_generated.managedlist.go b/apis/redis/v1beta1/zz_generated.managedlist.go index 4d2d3e8ad..ba3cdbc11 100644 --- a/apis/redis/v1beta1/zz_generated.managedlist.go +++ b/apis/redis/v1beta1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1beta1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this ClusterList. +func (l *ClusterList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this InstanceList. func (l *InstanceList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/redis/v1beta1/zz_generated.resolvers.go b/apis/redis/v1beta1/zz_generated.resolvers.go index 84a0b3716..580b88472 100644 --- a/apis/redis/v1beta1/zz_generated.resolvers.go +++ b/apis/redis/v1beta1/zz_generated.resolvers.go @@ -15,10 +15,65 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" client "sigs.k8s.io/controller-runtime/pkg/client" - // ResolveReferences of this Instance. + // ResolveReferences of this Cluster. apisresolver "github.com/upbound/provider-gcp/internal/apis" ) +func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.PscConfigs); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.PscConfigs[i3].Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.PscConfigs[i3].NetworkRef, + Selector: mg.Spec.ForProvider.PscConfigs[i3].NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PscConfigs[i3].Network") + } + mg.Spec.ForProvider.PscConfigs[i3].Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.PscConfigs[i3].NetworkRef = rsp.ResolvedReference + + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.PscConfigs); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Network", "NetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.PscConfigs[i3].Network), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.PscConfigs[i3].NetworkRef, + Selector: mg.Spec.InitProvider.PscConfigs[i3].NetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.PscConfigs[i3].Network") + } + mg.Spec.InitProvider.PscConfigs[i3].Network = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.PscConfigs[i3].NetworkRef = rsp.ResolvedReference + + } + + return nil +} + +// ResolveReferences of this Instance. func (mg *Instance) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed var l xpresource.ManagedList diff --git a/config/externalname.go b/config/externalname.go index c7dfb478e..8588db1ec 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -691,6 +691,8 @@ var terraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ // // Imported by using the following format: projects/{{project}}/locations/{{region}}/instances/{{name}} "google_redis_instance": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.region }}/instances/{{ .external_name }}"), + // Imported by using the following format: projects/{{project}}/locations/{{region}}/clusters/{{name}} + "google_redis_cluster": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.region }}/clusters/{{ .external_name }}"), // resource_manager // diff --git a/config/generated.lst b/config/generated.lst index 7e6231495..ab82fa7f4 100644 --- a/config/generated.lst +++ b/config/generated.lst @@ -1 +1 @@ -["google_access_context_manager_access_level","google_access_context_manager_access_level_condition","google_access_context_manager_access_policy","google_access_context_manager_access_policy_iam_member","google_access_context_manager_service_perimeter","google_access_context_manager_service_perimeter_resource","google_active_directory_domain","google_alloydb_backup","google_alloydb_cluster","google_alloydb_instance","google_apigee_addons_config","google_apigee_endpoint_attachment","google_apigee_envgroup","google_apigee_envgroup_attachment","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_instance_attachment","google_apigee_nat_address","google_apigee_organization","google_apigee_sync_authorization","google_app_engine_application","google_app_engine_application_url_dispatch_rules","google_app_engine_firewall_rule","google_app_engine_service_network_settings","google_app_engine_standard_app_version","google_artifact_registry_repository","google_artifact_registry_repository_iam_member","google_beyondcorp_app_connection","google_beyondcorp_app_connector","google_beyondcorp_app_gateway","google_bigquery_analytics_hub_data_exchange","google_bigquery_analytics_hub_data_exchange_iam_member","google_bigquery_analytics_hub_listing","google_bigquery_connection","google_bigquery_data_transfer_config","google_bigquery_dataset","google_bigquery_dataset_access","google_bigquery_dataset_iam_binding","google_bigquery_dataset_iam_member","google_bigquery_dataset_iam_policy","google_bigquery_job","google_bigquery_reservation","google_bigquery_reservation_assignment","google_bigquery_routine","google_bigquery_table","google_bigquery_table_iam_binding","google_bigquery_table_iam_member","google_bigquery_table_iam_policy","google_bigtable_app_profile","google_bigtable_gc_policy","google_bigtable_instance","google_bigtable_instance_iam_binding","google_bigtable_instance_iam_member","google_bigtable_instance_iam_policy","google_bigtable_table","google_bigtable_table_iam_binding","google_bigtable_table_iam_member","google_bigtable_table_iam_policy","google_binary_authorization_attestor","google_binary_authorization_policy","google_certificate_manager_certificate","google_certificate_manager_certificate_map","google_certificate_manager_certificate_map_entry","google_certificate_manager_dns_authorization","google_cloud_ids_endpoint","google_cloud_run_domain_mapping","google_cloud_run_service","google_cloud_run_service_iam_member","google_cloud_run_v2_job","google_cloud_run_v2_service","google_cloud_scheduler_job","google_cloud_tasks_queue","google_cloudbuild_trigger","google_cloudbuild_worker_pool","google_cloudfunctions2_function","google_cloudfunctions_function","google_cloudfunctions_function_iam_member","google_composer_environment","google_compute_address","google_compute_attached_disk","google_compute_autoscaler","google_compute_backend_bucket","google_compute_backend_bucket_signed_url_key","google_compute_backend_service","google_compute_backend_service_signed_url_key","google_compute_disk","google_compute_disk_iam_member","google_compute_disk_resource_policy_attachment","google_compute_external_vpn_gateway","google_compute_firewall","google_compute_firewall_policy","google_compute_firewall_policy_association","google_compute_firewall_policy_rule","google_compute_forwarding_rule","google_compute_global_address","google_compute_global_forwarding_rule","google_compute_global_network_endpoint","google_compute_global_network_endpoint_group","google_compute_ha_vpn_gateway","google_compute_health_check","google_compute_http_health_check","google_compute_https_health_check","google_compute_image","google_compute_image_iam_member","google_compute_instance","google_compute_instance_from_template","google_compute_instance_group","google_compute_instance_group_manager","google_compute_instance_group_named_port","google_compute_instance_iam_member","google_compute_instance_template","google_compute_interconnect_attachment","google_compute_managed_ssl_certificate","google_compute_network","google_compute_network_endpoint","google_compute_network_endpoint_group","google_compute_network_firewall_policy","google_compute_network_firewall_policy_association","google_compute_network_peering","google_compute_network_peering_routes_config","google_compute_node_group","google_compute_node_template","google_compute_packet_mirroring","google_compute_per_instance_config","google_compute_project_default_network_tier","google_compute_project_metadata","google_compute_project_metadata_item","google_compute_region_autoscaler","google_compute_region_backend_service","google_compute_region_disk","google_compute_region_disk_iam_member","google_compute_region_disk_resource_policy_attachment","google_compute_region_health_check","google_compute_region_instance_group_manager","google_compute_region_network_endpoint","google_compute_region_network_endpoint_group","google_compute_region_network_firewall_policy","google_compute_region_network_firewall_policy_association","google_compute_region_per_instance_config","google_compute_region_ssl_certificate","google_compute_region_target_http_proxy","google_compute_region_target_https_proxy","google_compute_region_target_tcp_proxy","google_compute_region_url_map","google_compute_reservation","google_compute_resource_policy","google_compute_route","google_compute_router","google_compute_router_interface","google_compute_router_nat","google_compute_router_peer","google_compute_security_policy","google_compute_service_attachment","google_compute_shared_vpc_host_project","google_compute_shared_vpc_service_project","google_compute_snapshot","google_compute_snapshot_iam_member","google_compute_ssl_certificate","google_compute_ssl_policy","google_compute_subnetwork","google_compute_subnetwork_iam_member","google_compute_target_grpc_proxy","google_compute_target_http_proxy","google_compute_target_https_proxy","google_compute_target_instance","google_compute_target_pool","google_compute_target_ssl_proxy","google_compute_target_tcp_proxy","google_compute_url_map","google_compute_vpn_gateway","google_compute_vpn_tunnel","google_container_analysis_note","google_container_attached_cluster","google_container_aws_cluster","google_container_aws_node_pool","google_container_azure_client","google_container_azure_cluster","google_container_azure_node_pool","google_container_cluster","google_container_node_pool","google_container_registry","google_data_catalog_entry","google_data_catalog_entry_group","google_data_catalog_tag","google_data_catalog_tag_template","google_data_fusion_instance","google_data_loss_prevention_deidentify_template","google_data_loss_prevention_inspect_template","google_data_loss_prevention_job_trigger","google_data_loss_prevention_stored_info_type","google_dataflow_job","google_dataplex_asset","google_dataplex_lake","google_dataplex_zone","google_dataproc_autoscaling_policy","google_dataproc_cluster","google_dataproc_job","google_dataproc_metastore_service","google_dataproc_workflow_template","google_datastore_index","google_datastream_connection_profile","google_datastream_private_connection","google_dialogflow_cx_agent","google_dialogflow_cx_entity_type","google_dialogflow_cx_environment","google_dialogflow_cx_flow","google_dialogflow_cx_intent","google_dialogflow_cx_page","google_dialogflow_cx_version","google_dialogflow_cx_webhook","google_dns_managed_zone","google_dns_managed_zone_iam_member","google_dns_policy","google_dns_record_set","google_document_ai_processor","google_essential_contacts_contact","google_eventarc_channel","google_eventarc_google_channel_config","google_eventarc_trigger","google_filestore_backup","google_filestore_instance","google_filestore_snapshot","google_firebaserules_release","google_firebaserules_ruleset","google_folder","google_folder_iam_member","google_gke_backup_backup_plan","google_gke_hub_membership","google_gke_hub_membership_iam_member","google_healthcare_consent_store","google_healthcare_dataset","google_healthcare_dataset_iam_member","google_iam_workload_identity_pool","google_iam_workload_identity_pool_provider","google_iap_app_engine_service_iam_member","google_iap_app_engine_version_iam_member","google_iap_tunnel_iam_member","google_iap_web_backend_service_iam_member","google_iap_web_iam_member","google_iap_web_type_app_engine_iam_member","google_iap_web_type_compute_iam_member","google_identity_platform_default_supported_idp_config","google_identity_platform_inbound_saml_config","google_identity_platform_oauth_idp_config","google_identity_platform_project_default_config","google_identity_platform_tenant","google_identity_platform_tenant_default_supported_idp_config","google_identity_platform_tenant_inbound_saml_config","google_identity_platform_tenant_oauth_idp_config","google_kms_crypto_key","google_kms_crypto_key_iam_member","google_kms_crypto_key_version","google_kms_key_ring","google_kms_key_ring_iam_member","google_kms_key_ring_import_job","google_kms_secret_ciphertext","google_logging_folder_bucket_config","google_logging_folder_exclusion","google_logging_folder_sink","google_logging_log_view","google_logging_metric","google_logging_project_bucket_config","google_logging_project_exclusion","google_logging_project_sink","google_memcache_instance","google_ml_engine_model","google_monitoring_alert_policy","google_monitoring_custom_service","google_monitoring_dashboard","google_monitoring_group","google_monitoring_metric_descriptor","google_monitoring_notification_channel","google_monitoring_service","google_monitoring_slo","google_monitoring_uptime_check_config","google_network_connectivity_hub","google_network_connectivity_service_connection_policy","google_network_connectivity_spoke","google_network_management_connectivity_test","google_notebooks_environment","google_notebooks_instance","google_notebooks_instance_iam_member","google_notebooks_runtime","google_notebooks_runtime_iam_member","google_org_policy_policy","google_organization_iam_audit_config","google_organization_iam_custom_role","google_organization_iam_member","google_os_config_os_policy_assignment","google_os_config_patch_deployment","google_os_login_ssh_public_key","google_privateca_ca_pool","google_privateca_ca_pool_iam_member","google_privateca_certificate","google_privateca_certificate_authority","google_privateca_certificate_template","google_privateca_certificate_template_iam_member","google_project","google_project_default_service_accounts","google_project_iam_audit_config","google_project_iam_custom_role","google_project_iam_member","google_project_service","google_project_usage_export_bucket","google_pubsub_lite_reservation","google_pubsub_lite_subscription","google_pubsub_lite_topic","google_pubsub_schema","google_pubsub_subscription","google_pubsub_subscription_iam_member","google_pubsub_topic","google_pubsub_topic_iam_member","google_redis_instance","google_secret_manager_secret","google_secret_manager_secret_iam_member","google_secret_manager_secret_version","google_service_account","google_service_account_iam_member","google_service_account_key","google_service_networking_connection","google_service_networking_peered_dns_domain","google_sourcerepo_repository","google_sourcerepo_repository_iam_member","google_spanner_database","google_spanner_database_iam_member","google_spanner_instance","google_spanner_instance_iam_member","google_sql_database","google_sql_database_instance","google_sql_source_representation_instance","google_sql_ssl_cert","google_sql_user","google_storage_bucket","google_storage_bucket_access_control","google_storage_bucket_acl","google_storage_bucket_iam_member","google_storage_bucket_object","google_storage_default_object_access_control","google_storage_default_object_acl","google_storage_hmac_key","google_storage_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","google_tags_tag_binding","google_tags_tag_key","google_tags_tag_value","google_tpu_node","google_vertex_ai_dataset","google_vertex_ai_featurestore","google_vertex_ai_featurestore_entitytype","google_vertex_ai_tensorboard","google_vpc_access_connector","google_workflows_workflow"] \ No newline at end of file +["google_access_context_manager_access_level","google_access_context_manager_access_level_condition","google_access_context_manager_access_policy","google_access_context_manager_access_policy_iam_member","google_access_context_manager_service_perimeter","google_access_context_manager_service_perimeter_resource","google_active_directory_domain","google_alloydb_backup","google_alloydb_cluster","google_alloydb_instance","google_apigee_addons_config","google_apigee_endpoint_attachment","google_apigee_envgroup","google_apigee_envgroup_attachment","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_instance_attachment","google_apigee_nat_address","google_apigee_organization","google_apigee_sync_authorization","google_app_engine_application","google_app_engine_application_url_dispatch_rules","google_app_engine_firewall_rule","google_app_engine_service_network_settings","google_app_engine_standard_app_version","google_artifact_registry_repository","google_artifact_registry_repository_iam_member","google_beyondcorp_app_connection","google_beyondcorp_app_connector","google_beyondcorp_app_gateway","google_bigquery_analytics_hub_data_exchange","google_bigquery_analytics_hub_data_exchange_iam_member","google_bigquery_analytics_hub_listing","google_bigquery_connection","google_bigquery_data_transfer_config","google_bigquery_dataset","google_bigquery_dataset_access","google_bigquery_dataset_iam_binding","google_bigquery_dataset_iam_member","google_bigquery_dataset_iam_policy","google_bigquery_job","google_bigquery_reservation","google_bigquery_reservation_assignment","google_bigquery_routine","google_bigquery_table","google_bigquery_table_iam_binding","google_bigquery_table_iam_member","google_bigquery_table_iam_policy","google_bigtable_app_profile","google_bigtable_gc_policy","google_bigtable_instance","google_bigtable_instance_iam_binding","google_bigtable_instance_iam_member","google_bigtable_instance_iam_policy","google_bigtable_table","google_bigtable_table_iam_binding","google_bigtable_table_iam_member","google_bigtable_table_iam_policy","google_binary_authorization_attestor","google_binary_authorization_policy","google_certificate_manager_certificate","google_certificate_manager_certificate_map","google_certificate_manager_certificate_map_entry","google_certificate_manager_dns_authorization","google_cloud_ids_endpoint","google_cloud_run_domain_mapping","google_cloud_run_service","google_cloud_run_service_iam_member","google_cloud_run_v2_job","google_cloud_run_v2_service","google_cloud_scheduler_job","google_cloud_tasks_queue","google_cloudbuild_trigger","google_cloudbuild_worker_pool","google_cloudfunctions2_function","google_cloudfunctions_function","google_cloudfunctions_function_iam_member","google_composer_environment","google_compute_address","google_compute_attached_disk","google_compute_autoscaler","google_compute_backend_bucket","google_compute_backend_bucket_signed_url_key","google_compute_backend_service","google_compute_backend_service_signed_url_key","google_compute_disk","google_compute_disk_iam_member","google_compute_disk_resource_policy_attachment","google_compute_external_vpn_gateway","google_compute_firewall","google_compute_firewall_policy","google_compute_firewall_policy_association","google_compute_firewall_policy_rule","google_compute_forwarding_rule","google_compute_global_address","google_compute_global_forwarding_rule","google_compute_global_network_endpoint","google_compute_global_network_endpoint_group","google_compute_ha_vpn_gateway","google_compute_health_check","google_compute_http_health_check","google_compute_https_health_check","google_compute_image","google_compute_image_iam_member","google_compute_instance","google_compute_instance_from_template","google_compute_instance_group","google_compute_instance_group_manager","google_compute_instance_group_named_port","google_compute_instance_iam_member","google_compute_instance_template","google_compute_interconnect_attachment","google_compute_managed_ssl_certificate","google_compute_network","google_compute_network_endpoint","google_compute_network_endpoint_group","google_compute_network_firewall_policy","google_compute_network_firewall_policy_association","google_compute_network_peering","google_compute_network_peering_routes_config","google_compute_node_group","google_compute_node_template","google_compute_packet_mirroring","google_compute_per_instance_config","google_compute_project_default_network_tier","google_compute_project_metadata","google_compute_project_metadata_item","google_compute_region_autoscaler","google_compute_region_backend_service","google_compute_region_disk","google_compute_region_disk_iam_member","google_compute_region_disk_resource_policy_attachment","google_compute_region_health_check","google_compute_region_instance_group_manager","google_compute_region_network_endpoint","google_compute_region_network_endpoint_group","google_compute_region_network_firewall_policy","google_compute_region_network_firewall_policy_association","google_compute_region_per_instance_config","google_compute_region_ssl_certificate","google_compute_region_target_http_proxy","google_compute_region_target_https_proxy","google_compute_region_target_tcp_proxy","google_compute_region_url_map","google_compute_reservation","google_compute_resource_policy","google_compute_route","google_compute_router","google_compute_router_interface","google_compute_router_nat","google_compute_router_peer","google_compute_security_policy","google_compute_service_attachment","google_compute_shared_vpc_host_project","google_compute_shared_vpc_service_project","google_compute_snapshot","google_compute_snapshot_iam_member","google_compute_ssl_certificate","google_compute_ssl_policy","google_compute_subnetwork","google_compute_subnetwork_iam_member","google_compute_target_grpc_proxy","google_compute_target_http_proxy","google_compute_target_https_proxy","google_compute_target_instance","google_compute_target_pool","google_compute_target_ssl_proxy","google_compute_target_tcp_proxy","google_compute_url_map","google_compute_vpn_gateway","google_compute_vpn_tunnel","google_container_analysis_note","google_container_attached_cluster","google_container_aws_cluster","google_container_aws_node_pool","google_container_azure_client","google_container_azure_cluster","google_container_azure_node_pool","google_container_cluster","google_container_node_pool","google_container_registry","google_data_catalog_entry","google_data_catalog_entry_group","google_data_catalog_tag","google_data_catalog_tag_template","google_data_fusion_instance","google_data_loss_prevention_deidentify_template","google_data_loss_prevention_inspect_template","google_data_loss_prevention_job_trigger","google_data_loss_prevention_stored_info_type","google_dataflow_job","google_dataplex_asset","google_dataplex_lake","google_dataplex_zone","google_dataproc_autoscaling_policy","google_dataproc_cluster","google_dataproc_job","google_dataproc_metastore_service","google_dataproc_workflow_template","google_datastore_index","google_datastream_connection_profile","google_datastream_private_connection","google_dialogflow_cx_agent","google_dialogflow_cx_entity_type","google_dialogflow_cx_environment","google_dialogflow_cx_flow","google_dialogflow_cx_intent","google_dialogflow_cx_page","google_dialogflow_cx_version","google_dialogflow_cx_webhook","google_dns_managed_zone","google_dns_managed_zone_iam_member","google_dns_policy","google_dns_record_set","google_document_ai_processor","google_essential_contacts_contact","google_eventarc_channel","google_eventarc_google_channel_config","google_eventarc_trigger","google_filestore_backup","google_filestore_instance","google_filestore_snapshot","google_firebaserules_release","google_firebaserules_ruleset","google_folder","google_folder_iam_member","google_gke_backup_backup_plan","google_gke_hub_membership","google_gke_hub_membership_iam_member","google_healthcare_consent_store","google_healthcare_dataset","google_healthcare_dataset_iam_member","google_iam_workload_identity_pool","google_iam_workload_identity_pool_provider","google_iap_app_engine_service_iam_member","google_iap_app_engine_version_iam_member","google_iap_tunnel_iam_member","google_iap_web_backend_service_iam_member","google_iap_web_iam_member","google_iap_web_type_app_engine_iam_member","google_iap_web_type_compute_iam_member","google_identity_platform_default_supported_idp_config","google_identity_platform_inbound_saml_config","google_identity_platform_oauth_idp_config","google_identity_platform_project_default_config","google_identity_platform_tenant","google_identity_platform_tenant_default_supported_idp_config","google_identity_platform_tenant_inbound_saml_config","google_identity_platform_tenant_oauth_idp_config","google_kms_crypto_key","google_kms_crypto_key_iam_member","google_kms_crypto_key_version","google_kms_key_ring","google_kms_key_ring_iam_member","google_kms_key_ring_import_job","google_kms_secret_ciphertext","google_logging_folder_bucket_config","google_logging_folder_exclusion","google_logging_folder_sink","google_logging_log_view","google_logging_metric","google_logging_project_bucket_config","google_logging_project_exclusion","google_logging_project_sink","google_memcache_instance","google_ml_engine_model","google_monitoring_alert_policy","google_monitoring_custom_service","google_monitoring_dashboard","google_monitoring_group","google_monitoring_metric_descriptor","google_monitoring_notification_channel","google_monitoring_service","google_monitoring_slo","google_monitoring_uptime_check_config","google_network_connectivity_hub","google_network_connectivity_service_connection_policy","google_network_connectivity_spoke","google_network_management_connectivity_test","google_notebooks_environment","google_notebooks_instance","google_notebooks_instance_iam_member","google_notebooks_runtime","google_notebooks_runtime_iam_member","google_org_policy_policy","google_organization_iam_audit_config","google_organization_iam_custom_role","google_organization_iam_member","google_os_config_os_policy_assignment","google_os_config_patch_deployment","google_os_login_ssh_public_key","google_privateca_ca_pool","google_privateca_ca_pool_iam_member","google_privateca_certificate","google_privateca_certificate_authority","google_privateca_certificate_template","google_privateca_certificate_template_iam_member","google_project","google_project_default_service_accounts","google_project_iam_audit_config","google_project_iam_custom_role","google_project_iam_member","google_project_service","google_project_usage_export_bucket","google_pubsub_lite_reservation","google_pubsub_lite_subscription","google_pubsub_lite_topic","google_pubsub_schema","google_pubsub_subscription","google_pubsub_subscription_iam_member","google_pubsub_topic","google_pubsub_topic_iam_member","google_redis_cluster","google_redis_instance","google_secret_manager_secret","google_secret_manager_secret_iam_member","google_secret_manager_secret_version","google_service_account","google_service_account_iam_member","google_service_account_key","google_service_networking_connection","google_service_networking_peered_dns_domain","google_sourcerepo_repository","google_sourcerepo_repository_iam_member","google_spanner_database","google_spanner_database_iam_member","google_spanner_instance","google_spanner_instance_iam_member","google_sql_database","google_sql_database_instance","google_sql_source_representation_instance","google_sql_ssl_cert","google_sql_user","google_storage_bucket","google_storage_bucket_access_control","google_storage_bucket_acl","google_storage_bucket_iam_member","google_storage_bucket_object","google_storage_default_object_access_control","google_storage_default_object_acl","google_storage_hmac_key","google_storage_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","google_tags_tag_binding","google_tags_tag_key","google_tags_tag_value","google_tpu_node","google_vertex_ai_dataset","google_vertex_ai_featurestore","google_vertex_ai_featurestore_entitytype","google_vertex_ai_tensorboard","google_vpc_access_connector","google_workflows_workflow"] \ No newline at end of file diff --git a/config/redis/config.go b/config/redis/config.go index 7a9048a01..d21c82bd1 100644 --- a/config/redis/config.go +++ b/config/redis/config.go @@ -4,7 +4,15 @@ package redis -import "github.com/crossplane/upjet/pkg/config" +import ( + "strconv" + + "github.com/crossplane/crossplane-runtime/pkg/fieldpath" + "github.com/crossplane/upjet/pkg/config" + "github.com/pkg/errors" + + "github.com/upbound/provider-gcp/config/common" +) // Configure configures individual resources by adding custom // ResourceConfigurators. @@ -19,4 +27,40 @@ func Configure(p *config.Provider) { return conn, nil } }) + + p.AddResourceConfigurator("google_redis_cluster", func(r *config.Resource) { + r.MarkAsRequired("region") + r.UseAsync = true + r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) { + conn := map[string][]byte{} + + address, err := common.GetField(attr, "discovery_endpoints[0].address") + if err != nil { + return nil, err + } + conn["address"] = []byte(address) + + port, err := GetFloat(attr, "discovery_endpoints[0].port") + if err != nil { + return nil, err + } + conn["port"] = []byte(strconv.FormatFloat(port, 'f', -1, 64)) + + return conn, nil + } + }) +} + +// GetFloat value of the supplied field path. +func GetFloat(from map[string]interface{}, path string) (float64, error) { + v, err := fieldpath.Pave(from).GetValue(path) + if err != nil { + return 0, err + } + + f, ok := v.(float64) + if !ok { + return 0, errors.Errorf("%s: not a (float64) number", path) + } + return f, nil } diff --git a/examples-generated/redis/v1beta1/cluster.yaml b/examples-generated/redis/v1beta1/cluster.yaml new file mode 100644 index 000000000..ede766320 --- /dev/null +++ b/examples-generated/redis/v1beta1/cluster.yaml @@ -0,0 +1,78 @@ +apiVersion: redis.gcp.upbound.io/v1beta1 +kind: Cluster +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: cluster-ha + name: cluster-ha +spec: + forProvider: + authorizationMode: AUTH_MODE_DISABLED + nodeType: REDIS_SHARED_CORE_NANO + pscConfigs: + - networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + redisConfigs: + maxmemory-policy: volatile-ttl + region: us-central1 + replicaCount: 1 + shardCount: 3 + transitEncryptionMode: TRANSIT_ENCRYPTION_MODE_DISABLED + zoneDistributionConfig: + - mode: MULTI_ZONE + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Network +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: producer_net + name: producer-net +spec: + forProvider: + autoCreateSubnetworks: false + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: Subnetwork +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: producer_subnet + name: producer-subnet +spec: + forProvider: + ipCidrRange: 10.0.0.248/29 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 + +--- + +apiVersion: networkconnectivity.gcp.upbound.io/v1beta1 +kind: ServiceConnectionPolicy +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + description: my basic service connection policy + location: us-central1 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + pscConfig: + - subnetworksRefs: + - name: producer_subnet + serviceClass: gcp-memorystore-redis diff --git a/examples/redis/v1beta1/cluster.yaml b/examples/redis/v1beta1/cluster.yaml new file mode 100644 index 000000000..417f10d01 --- /dev/null +++ b/examples/redis/v1beta1/cluster.yaml @@ -0,0 +1,78 @@ +apiVersion: redis.gcp.upbound.io/v1beta1 +kind: Cluster +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: cluster-ha + name: cluster-ha +spec: + forProvider: + authorizationMode: AUTH_MODE_DISABLED + nodeType: REDIS_SHARED_CORE_NANO + pscConfigs: + - networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + redisConfigs: + maxmemory-policy: volatile-ttl + region: us-central1 + replicaCount: 1 + shardCount: 3 + transitEncryptionMode: TRANSIT_ENCRYPTION_MODE_DISABLED + zoneDistributionConfig: + mode: MULTI_ZONE + +--- + +apiVersion: compute.gcp.upbound.io/v1beta1 +kind: Network +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: producer_net + name: producer-net +spec: + forProvider: + autoCreateSubnetworks: false + +--- + +apiVersion: compute.gcp.upbound.io/v1beta2 +kind: Subnetwork +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: producer_subnet + name: producer-subnet +spec: + forProvider: + ipCidrRange: 10.0.0.248/29 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + region: us-central1 + +--- + +apiVersion: networkconnectivity.gcp.upbound.io/v1beta1 +kind: ServiceConnectionPolicy +metadata: + annotations: + meta.upbound.io/example-id: redis/v1beta1/cluster + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + description: my basic service connection policy + location: us-central1 + networkSelector: + matchLabels: + testing.upbound.io/example-name: producer_net + pscConfig: + subnetworksRefs: + - name: producer-subnet + serviceClass: gcp-memorystore-redis diff --git a/internal/controller/redis/cluster/zz_controller.go b/internal/controller/redis/cluster/zz_controller.go new file mode 100755 index 000000000..6159d654f --- /dev/null +++ b/internal/controller/redis/cluster/zz_controller.go @@ -0,0 +1,92 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package cluster + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-gcp/apis/redis/v1beta1" + features "github.com/upbound/provider-gcp/internal/features" +) + +// Setup adds a controller that reconciles Cluster managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.Cluster_GroupVersionKind.String()) + var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Cluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["google_redis_cluster"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Cluster_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1beta1.Cluster + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1beta1.Cluster{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.Cluster") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.ClusterList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.ClusterList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.Cluster_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.Cluster{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_monolith_setup.go b/internal/controller/zz_monolith_setup.go index 9e705b9a5..918c44345 100755 --- a/internal/controller/zz_monolith_setup.go +++ b/internal/controller/zz_monolith_setup.go @@ -327,6 +327,7 @@ import ( subscriptioniammember "github.com/upbound/provider-gcp/internal/controller/pubsub/subscriptioniammember" topic "github.com/upbound/provider-gcp/internal/controller/pubsub/topic" topiciammember "github.com/upbound/provider-gcp/internal/controller/pubsub/topiciammember" + clusterredis "github.com/upbound/provider-gcp/internal/controller/redis/cluster" instanceredis "github.com/upbound/provider-gcp/internal/controller/redis/instance" secret "github.com/upbound/provider-gcp/internal/controller/secretmanager/secret" secretiammember "github.com/upbound/provider-gcp/internal/controller/secretmanager/secretiammember" @@ -689,6 +690,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { subscriptioniammember.Setup, topic.Setup, topiciammember.Setup, + clusterredis.Setup, instanceredis.Setup, secret.Setup, secretiammember.Setup, diff --git a/internal/controller/zz_redis_setup.go b/internal/controller/zz_redis_setup.go index 30161b6b2..bca5dbcdc 100755 --- a/internal/controller/zz_redis_setup.go +++ b/internal/controller/zz_redis_setup.go @@ -9,6 +9,7 @@ import ( "github.com/crossplane/upjet/pkg/controller" + cluster "github.com/upbound/provider-gcp/internal/controller/redis/cluster" instance "github.com/upbound/provider-gcp/internal/controller/redis/instance" ) @@ -16,6 +17,7 @@ import ( // the supplied manager. func Setup_redis(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ + cluster.Setup, instance.Setup, } { if err := setup(mgr, o); err != nil { diff --git a/package/crds/redis.gcp.upbound.io_clusters.yaml b/package/crds/redis.gcp.upbound.io_clusters.yaml new file mode 100644 index 000000000..fcb58b097 --- /dev/null +++ b/package/crds/redis.gcp.upbound.io_clusters.yaml @@ -0,0 +1,807 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: clusters.redis.gcp.upbound.io +spec: + group: redis.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: Cluster + listKind: ClusterList + plural: clusters + singular: cluster + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: Cluster is the Schema for the Clusters API. A Google Cloud Redis + Cluster instance. + 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 + 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 + type: string + metadata: + type: object + spec: + description: ClusterSpec defines the desired state of Cluster + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + authorizationMode: + description: |- + Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + Default value is AUTH_MODE_DISABLED. + Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + type: string + nodeType: + description: |- + The nodeType for the Redis cluster. + If not provided, REDIS_HIGHMEM_MEDIUM will be used as default + Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL. + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfigs: + description: |- + Required. Each PscConfig configures the consumer network where two + network addresses will be designated to the cluster for client access. + Currently, only one PscConfig is supported. + Structure is documented below. + items: + properties: + network: + description: |- + Required. The consumer network where the network address of + the discovery endpoint will be reserved, in the form of + projects/{network_project_id_or_number}/global/networks/{network_id}. + type: string + networkRef: + description: Reference to a Network in compute to populate + network. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + networkSelector: + description: Selector for a Network in compute to populate + network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + type: array + redisConfigs: + additionalProperties: + type: string + description: |- + Configure Redis Cluster behavior using a subset of native Redis configuration parameters. + Please check Memorystore documentation for the list of supported parameters: + https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations + type: object + x-kubernetes-map-type: granular + region: + description: The name of the region of the Redis cluster. + type: string + replicaCount: + description: Optional. The number of replica nodes per shard. + type: number + shardCount: + description: Required. Number of shards for the Redis cluster. + type: number + transitEncryptionMode: + description: |- + Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + type: string + zoneDistributionConfig: + description: |- + Immutable. Zone distribution config for Memorystore Redis cluster. + Structure is documented below. + properties: + mode: + description: |- + Immutable. The mode for zone distribution for Memorystore Redis cluster. + If not provided, MULTI_ZONE will be used as default + Possible values are: MULTI_ZONE, SINGLE_ZONE. + type: string + zone: + description: Immutable. The zone for single zone Memorystore + Redis cluster. + type: string + type: object + required: + - region + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + authorizationMode: + description: |- + Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + Default value is AUTH_MODE_DISABLED. + Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + type: string + nodeType: + description: |- + The nodeType for the Redis cluster. + If not provided, REDIS_HIGHMEM_MEDIUM will be used as default + Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL. + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfigs: + description: |- + Required. Each PscConfig configures the consumer network where two + network addresses will be designated to the cluster for client access. + Currently, only one PscConfig is supported. + Structure is documented below. + items: + properties: + network: + description: |- + Required. The consumer network where the network address of + the discovery endpoint will be reserved, in the form of + projects/{network_project_id_or_number}/global/networks/{network_id}. + type: string + networkRef: + description: Reference to a Network in compute to populate + network. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + networkSelector: + description: Selector for a Network in compute to populate + network. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + type: array + redisConfigs: + additionalProperties: + type: string + description: |- + Configure Redis Cluster behavior using a subset of native Redis configuration parameters. + Please check Memorystore documentation for the list of supported parameters: + https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations + type: object + x-kubernetes-map-type: granular + replicaCount: + description: Optional. The number of replica nodes per shard. + type: number + shardCount: + description: Required. Number of shards for the Redis cluster. + type: number + transitEncryptionMode: + description: |- + Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + type: string + zoneDistributionConfig: + description: |- + Immutable. Zone distribution config for Memorystore Redis cluster. + Structure is documented below. + properties: + mode: + description: |- + Immutable. The mode for zone distribution for Memorystore Redis cluster. + If not provided, MULTI_ZONE will be used as default + Possible values are: MULTI_ZONE, SINGLE_ZONE. + type: string + zone: + description: Immutable. The zone for single zone Memorystore + Redis cluster. + type: string + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.pscConfigs is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.pscConfigs) + || (has(self.initProvider) && has(self.initProvider.pscConfigs))' + - message: spec.forProvider.shardCount is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.shardCount) + || (has(self.initProvider) && has(self.initProvider.shardCount))' + status: + description: ClusterStatus defines the observed state of Cluster. + properties: + atProvider: + properties: + authorizationMode: + description: |- + Optional. The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. + Default value is AUTH_MODE_DISABLED. + Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED. + type: string + createTime: + description: |- + The timestamp associated with the cluster creation request. A timestamp in + RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional + digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z". + type: string + discoveryEndpoints: + description: |- + Output only. Endpoints created on each given network, + for Redis clients to connect to the cluster. + Currently only one endpoint is supported. + Structure is documented below. + items: + properties: + address: + description: Output only. Network address of the exposed + Redis endpoint used by clients to connect to the service. + type: string + port: + description: Output only. The port number of the exposed + Redis endpoint. + type: number + pscConfig: + description: |- + Output only. Customer configuration for where the endpoint + is created and accessed from. + Structure is documented below. + properties: + network: + description: The consumer network where the IP address + resides, in the form of projects/{projectId}/global/networks/{network_id}. + type: string + type: object + type: object + type: array + id: + description: an identifier for the resource with format projects/{{project}}/locations/{{region}}/clusters/{{name}} + type: string + nodeType: + description: |- + The nodeType for the Redis cluster. + If not provided, REDIS_HIGHMEM_MEDIUM will be used as default + Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL. + type: string + preciseSizeGb: + description: Output only. Redis memory precise size in GB for + the entire cluster. + type: number + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + pscConfigs: + description: |- + Required. Each PscConfig configures the consumer network where two + network addresses will be designated to the cluster for client access. + Currently, only one PscConfig is supported. + Structure is documented below. + items: + properties: + network: + description: |- + Required. The consumer network where the network address of + the discovery endpoint will be reserved, in the form of + projects/{network_project_id_or_number}/global/networks/{network_id}. + type: string + type: object + type: array + pscConnections: + description: |- + Output only. PSC connections for discovery of the cluster topology and accessing the cluster. + Structure is documented below. + items: + properties: + address: + description: Output only. The IP allocated on the consumer + network for the PSC forwarding rule. + type: string + forwardingRule: + description: 'Output only. The URI of the consumer side + forwarding rule. Example: projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.' + type: string + network: + description: The consumer network where the IP address resides, + in the form of projects/{projectId}/global/networks/{network_id}. + type: string + projectId: + description: Output only. The consumer projectId where the + forwarding rule is created from. + type: string + pscConnectionId: + description: Output only. The PSC connection id of the forwarding + rule connected to the service attachment. + type: string + type: object + type: array + redisConfigs: + additionalProperties: + type: string + description: |- + Configure Redis Cluster behavior using a subset of native Redis configuration parameters. + Please check Memorystore documentation for the list of supported parameters: + https://cloud.google.com/memorystore/docs/cluster/supported-instance-configurations + type: object + x-kubernetes-map-type: granular + region: + description: The name of the region of the Redis cluster. + type: string + replicaCount: + description: Optional. The number of replica nodes per shard. + type: number + shardCount: + description: Required. Number of shards for the Redis cluster. + type: number + sizeGb: + description: Output only. Redis memory size in GB for the entire + cluster. + type: number + state: + description: The current state of this cluster. Can be CREATING, + READY, UPDATING, DELETING and SUSPENDED + type: string + stateInfo: + description: |- + Output only. Additional information about the current state of the cluster. + Structure is documented below. + items: + properties: + updateInfo: + description: |- + A nested object resource + Structure is documented below. + properties: + targetReplicaCount: + description: Target number of replica nodes per shard. + type: number + targetShardCount: + description: Target number of shards for redis cluster. + type: number + type: object + type: object + type: array + transitEncryptionMode: + description: |- + Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. + Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION. + type: string + uid: + description: System assigned, unique identifier for the cluster. + type: string + zoneDistributionConfig: + description: |- + Immutable. Zone distribution config for Memorystore Redis cluster. + Structure is documented below. + properties: + mode: + description: |- + Immutable. The mode for zone distribution for Memorystore Redis cluster. + If not provided, MULTI_ZONE will be used as default + Possible values are: MULTI_ZONE, SINGLE_ZONE. + type: string + zone: + description: Immutable. The zone for single zone Memorystore + Redis cluster. + type: string + type: object + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From b5685978cb63c80bd4e2a0d79e5a585f92c68546 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:38:07 +0000 Subject: [PATCH 25/34] Update actions/checkout digest to 11bd719 --- .github/workflows/uptest-all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index f28953d5e..032db51f5 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -19,7 +19,7 @@ jobs: api_groups: ${{ steps.api-groups.outputs.list }} steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: submodules: true - name: Detect Api Groups @@ -59,7 +59,7 @@ jobs: install: true - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: submodules: true @@ -143,7 +143,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: submodules: true - name: Manual Intervention Report From 68d3bfbaefa9eb9586d676bc827242ff99ccd969 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:32:34 +0000 Subject: [PATCH 26/34] Update actions/setup-go digest to 41dfa10 --- .github/workflows/uptest-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uptest-all.yml b/.github/workflows/uptest-all.yml index f28953d5e..44e847c76 100644 --- a/.github/workflows/uptest-all.yml +++ b/.github/workflows/uptest-all.yml @@ -67,7 +67,7 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version: ${{ env.GO_VERSION }} From 9cc2c5136050db48598cf8b95c0ada15d4ae7b19 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Fri, 25 Oct 2024 12:18:18 +0200 Subject: [PATCH 27/34] Put all discovery endpoints in AdditionalConnectionDetails Signed-off-by: Rickard von Essen --- config/redis/config.go | 45 +++++++++++++----------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/config/redis/config.go b/config/redis/config.go index d21c82bd1..ba42b4669 100644 --- a/config/redis/config.go +++ b/config/redis/config.go @@ -5,13 +5,9 @@ package redis import ( - "strconv" + "fmt" - "github.com/crossplane/crossplane-runtime/pkg/fieldpath" "github.com/crossplane/upjet/pkg/config" - "github.com/pkg/errors" - - "github.com/upbound/provider-gcp/config/common" ) // Configure configures individual resources by adding custom @@ -33,34 +29,21 @@ func Configure(p *config.Provider) { r.UseAsync = true r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) { conn := map[string][]byte{} - - address, err := common.GetField(attr, "discovery_endpoints[0].address") - if err != nil { - return nil, err - } - conn["address"] = []byte(address) - - port, err := GetFloat(attr, "discovery_endpoints[0].port") - if err != nil { - return nil, err + if discoveryendpoints, ok := attr["discovery_endpoints"].([]any); ok { + for i, de := range discoveryendpoints { + if discoveryendpoints, ok := de.(map[string]any); ok && len(discoveryendpoints) > 0 { + if address, ok := discoveryendpoints["address"].(string); ok { + key := fmt.Sprintf("discovery_endpoints_%d_address", i) + conn[key] = []byte(address) + } + if port, ok := discoveryendpoints["port"].(float64); ok { + key := fmt.Sprintf("discovery_endpoints_%d_port", i) + conn[key] = []byte(fmt.Sprintf("%g", port)) + } + } + } } - conn["port"] = []byte(strconv.FormatFloat(port, 'f', -1, 64)) - return conn, nil } }) } - -// GetFloat value of the supplied field path. -func GetFloat(from map[string]interface{}, path string) (float64, error) { - v, err := fieldpath.Pave(from).GetValue(path) - if err != nil { - return 0, err - } - - f, ok := v.(float64) - if !ok { - return 0, errors.Errorf("%s: not a (float64) number", path) - } - return f, nil -} From 25f8e4bbbb673c9d1f52195dd1cffa591f56df13 Mon Sep 17 00:00:00 2001 From: Brad Wadsworth Date: Wed, 28 Aug 2024 08:44:03 -0500 Subject: [PATCH 28/34] added reference for private endpoint subnetworks for gke cluster Signed-off-by: Brad Wadsworth --- apis/container/v1beta1/zz_cluster_types.go | 20 ++ .../v1beta1/zz_generated.deepcopy.go | 20 ++ .../v1beta1/zz_generated.resolvers.go | 42 +++ apis/container/v1beta2/zz_cluster_types.go | 20 ++ .../v1beta2/zz_generated.deepcopy.go | 20 ++ .../v1beta2/zz_generated.resolvers.go | 42 +++ config/container/config.go | 4 + .../container.gcp.upbound.io_clusters.yaml | 304 ++++++++++++++++++ 8 files changed, 472 insertions(+) diff --git a/apis/container/v1beta1/zz_cluster_types.go b/apis/container/v1beta1/zz_cluster_types.go index 6c1ba2161..6a744af4a 100755 --- a/apis/container/v1beta1/zz_cluster_types.go +++ b/apis/container/v1beta1/zz_cluster_types.go @@ -4566,7 +4566,17 @@ type PrivateClusterConfigInitParameters struct { MasterIPv4CidrBlock *string `json:"masterIpv4CidrBlock,omitempty" tf:"master_ipv4_cidr_block,omitempty"` // Subnetwork in cluster's network where master's endpoint will be provisioned. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork + // +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.SelfLinkExtractor() PrivateEndpointSubnetwork *string `json:"privateEndpointSubnetwork,omitempty" tf:"private_endpoint_subnetwork,omitempty"` + + // Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkRef *v1.Reference `json:"privateEndpointSubnetworkRef,omitempty" tf:"-"` + + // Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkSelector *v1.Selector `json:"privateEndpointSubnetworkSelector,omitempty" tf:"-"` } type PrivateClusterConfigObservation struct { @@ -4641,8 +4651,18 @@ type PrivateClusterConfigParameters struct { MasterIPv4CidrBlock *string `json:"masterIpv4CidrBlock,omitempty" tf:"master_ipv4_cidr_block,omitempty"` // Subnetwork in cluster's network where master's endpoint will be provisioned. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork + // +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.SelfLinkExtractor() // +kubebuilder:validation:Optional PrivateEndpointSubnetwork *string `json:"privateEndpointSubnetwork,omitempty" tf:"private_endpoint_subnetwork,omitempty"` + + // Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkRef *v1.Reference `json:"privateEndpointSubnetworkRef,omitempty" tf:"-"` + + // Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkSelector *v1.Selector `json:"privateEndpointSubnetworkSelector,omitempty" tf:"-"` } type PrivateRegistryAccessConfigCertificateAuthorityDomainConfigGCPSecretManagerCertificateConfigInitParameters struct { diff --git a/apis/container/v1beta1/zz_generated.deepcopy.go b/apis/container/v1beta1/zz_generated.deepcopy.go index e3ec73b33..24c0fe069 100644 --- a/apis/container/v1beta1/zz_generated.deepcopy.go +++ b/apis/container/v1beta1/zz_generated.deepcopy.go @@ -14447,6 +14447,16 @@ func (in *PrivateClusterConfigInitParameters) DeepCopyInto(out *PrivateClusterCo *out = new(string) **out = **in } + if in.PrivateEndpointSubnetworkRef != nil { + in, out := &in.PrivateEndpointSubnetworkRef, &out.PrivateEndpointSubnetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.PrivateEndpointSubnetworkSelector != nil { + in, out := &in.PrivateEndpointSubnetworkSelector, &out.PrivateEndpointSubnetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateClusterConfigInitParameters. @@ -14546,6 +14556,16 @@ func (in *PrivateClusterConfigParameters) DeepCopyInto(out *PrivateClusterConfig *out = new(string) **out = **in } + if in.PrivateEndpointSubnetworkRef != nil { + in, out := &in.PrivateEndpointSubnetworkRef, &out.PrivateEndpointSubnetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.PrivateEndpointSubnetworkSelector != nil { + in, out := &in.PrivateEndpointSubnetworkSelector, &out.PrivateEndpointSubnetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateClusterConfigParameters. diff --git a/apis/container/v1beta1/zz_generated.resolvers.go b/apis/container/v1beta1/zz_generated.resolvers.go index a8ddfbf68..42a1cdb6b 100644 --- a/apis/container/v1beta1/zz_generated.resolvers.go +++ b/apis/container/v1beta1/zz_generated.resolvers.go @@ -67,6 +67,27 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.NodeConfig[i3].ServiceAccount = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.NodeConfig[i3].ServiceAccountRef = rsp.ResolvedReference + } + for i3 := 0; i3 < len(mg.Spec.ForProvider.PrivateClusterConfig); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetwork), + Extract: common.SelfLinkExtractor(), + Reference: mg.Spec.ForProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetworkRef, + Selector: mg.Spec.ForProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetwork") + } + mg.Spec.ForProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetwork = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetworkRef = rsp.ResolvedReference + } { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Subnetwork", "SubnetworkList") @@ -126,6 +147,27 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.InitProvider.NodeConfig[i3].ServiceAccount = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.InitProvider.NodeConfig[i3].ServiceAccountRef = rsp.ResolvedReference + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.PrivateClusterConfig); i3++ { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetwork), + Extract: common.SelfLinkExtractor(), + Reference: mg.Spec.InitProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetworkRef, + Selector: mg.Spec.InitProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetwork") + } + mg.Spec.InitProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetwork = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.PrivateClusterConfig[i3].PrivateEndpointSubnetworkRef = rsp.ResolvedReference + } { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta1", "Subnetwork", "SubnetworkList") diff --git a/apis/container/v1beta2/zz_cluster_types.go b/apis/container/v1beta2/zz_cluster_types.go index 4db957d95..98be18acd 100755 --- a/apis/container/v1beta2/zz_cluster_types.go +++ b/apis/container/v1beta2/zz_cluster_types.go @@ -4572,7 +4572,17 @@ type PrivateClusterConfigInitParameters struct { MasterIPv4CidrBlock *string `json:"masterIpv4CidrBlock,omitempty" tf:"master_ipv4_cidr_block,omitempty"` // Subnetwork in cluster's network where master's endpoint will be provisioned. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork + // +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.SelfLinkExtractor() PrivateEndpointSubnetwork *string `json:"privateEndpointSubnetwork,omitempty" tf:"private_endpoint_subnetwork,omitempty"` + + // Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkRef *v1.Reference `json:"privateEndpointSubnetworkRef,omitempty" tf:"-"` + + // Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkSelector *v1.Selector `json:"privateEndpointSubnetworkSelector,omitempty" tf:"-"` } type PrivateClusterConfigObservation struct { @@ -4647,8 +4657,18 @@ type PrivateClusterConfigParameters struct { MasterIPv4CidrBlock *string `json:"masterIpv4CidrBlock,omitempty" tf:"master_ipv4_cidr_block,omitempty"` // Subnetwork in cluster's network where master's endpoint will be provisioned. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/compute/v1beta2.Subnetwork + // +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.SelfLinkExtractor() // +kubebuilder:validation:Optional PrivateEndpointSubnetwork *string `json:"privateEndpointSubnetwork,omitempty" tf:"private_endpoint_subnetwork,omitempty"` + + // Reference to a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkRef *v1.Reference `json:"privateEndpointSubnetworkRef,omitempty" tf:"-"` + + // Selector for a Subnetwork in compute to populate privateEndpointSubnetwork. + // +kubebuilder:validation:Optional + PrivateEndpointSubnetworkSelector *v1.Selector `json:"privateEndpointSubnetworkSelector,omitempty" tf:"-"` } type PrivateRegistryAccessConfigCertificateAuthorityDomainConfigGCPSecretManagerCertificateConfigInitParameters struct { diff --git a/apis/container/v1beta2/zz_generated.deepcopy.go b/apis/container/v1beta2/zz_generated.deepcopy.go index 08c0c5699..41395bfaa 100644 --- a/apis/container/v1beta2/zz_generated.deepcopy.go +++ b/apis/container/v1beta2/zz_generated.deepcopy.go @@ -13813,6 +13813,16 @@ func (in *PrivateClusterConfigInitParameters) DeepCopyInto(out *PrivateClusterCo *out = new(string) **out = **in } + if in.PrivateEndpointSubnetworkRef != nil { + in, out := &in.PrivateEndpointSubnetworkRef, &out.PrivateEndpointSubnetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.PrivateEndpointSubnetworkSelector != nil { + in, out := &in.PrivateEndpointSubnetworkSelector, &out.PrivateEndpointSubnetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateClusterConfigInitParameters. @@ -13908,6 +13918,16 @@ func (in *PrivateClusterConfigParameters) DeepCopyInto(out *PrivateClusterConfig *out = new(string) **out = **in } + if in.PrivateEndpointSubnetworkRef != nil { + in, out := &in.PrivateEndpointSubnetworkRef, &out.PrivateEndpointSubnetworkRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.PrivateEndpointSubnetworkSelector != nil { + in, out := &in.PrivateEndpointSubnetworkSelector, &out.PrivateEndpointSubnetworkSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateClusterConfigParameters. diff --git a/apis/container/v1beta2/zz_generated.resolvers.go b/apis/container/v1beta2/zz_generated.resolvers.go index 131c5871b..e5dfb9f56 100644 --- a/apis/container/v1beta2/zz_generated.resolvers.go +++ b/apis/container/v1beta2/zz_generated.resolvers.go @@ -67,6 +67,27 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.NodeConfig.ServiceAccount = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.NodeConfig.ServiceAccountRef = rsp.ResolvedReference + } + if mg.Spec.ForProvider.PrivateClusterConfig != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.PrivateClusterConfig.PrivateEndpointSubnetwork), + Extract: common.SelfLinkExtractor(), + Reference: mg.Spec.ForProvider.PrivateClusterConfig.PrivateEndpointSubnetworkRef, + Selector: mg.Spec.ForProvider.PrivateClusterConfig.PrivateEndpointSubnetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.PrivateClusterConfig.PrivateEndpointSubnetwork") + } + mg.Spec.ForProvider.PrivateClusterConfig.PrivateEndpointSubnetwork = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.PrivateClusterConfig.PrivateEndpointSubnetworkRef = rsp.ResolvedReference + } { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") @@ -126,6 +147,27 @@ func (mg *Cluster) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.InitProvider.NodeConfig.ServiceAccount = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.InitProvider.NodeConfig.ServiceAccountRef = rsp.ResolvedReference + } + if mg.Spec.InitProvider.PrivateClusterConfig != nil { + { + m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.PrivateClusterConfig.PrivateEndpointSubnetwork), + Extract: common.SelfLinkExtractor(), + Reference: mg.Spec.InitProvider.PrivateClusterConfig.PrivateEndpointSubnetworkRef, + Selector: mg.Spec.InitProvider.PrivateClusterConfig.PrivateEndpointSubnetworkSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.PrivateClusterConfig.PrivateEndpointSubnetwork") + } + mg.Spec.InitProvider.PrivateClusterConfig.PrivateEndpointSubnetwork = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.PrivateClusterConfig.PrivateEndpointSubnetworkRef = rsp.ResolvedReference + } { m, l, err = apisresolver.GetManagedResource("compute.gcp.upbound.io", "v1beta2", "Subnetwork", "SubnetworkList") diff --git a/config/container/config.go b/config/container/config.go index 615b9473d..231c291df 100644 --- a/config/container/config.go +++ b/config/container/config.go @@ -125,6 +125,10 @@ func Configure(p *config.Provider) { //nolint:gocyclo TerraformName: "google_compute_subnetwork", Extractor: common.PathSelfLinkExtractor, } + r.References["private_cluster_config.private_endpoint_subnetwork"] = config.Reference{ + TerraformName: "google_compute_subnetwork", + Extractor: common.PathSelfLinkExtractor, + } config.MarkAsRequired(r.TerraformResource, "location") }) diff --git a/package/crds/container.gcp.upbound.io_clusters.yaml b/package/crds/container.gcp.upbound.io_clusters.yaml index 5a7debe8e..4a2f16c31 100644 --- a/package/crds/container.gcp.upbound.io_clusters.yaml +++ b/package/crds/container.gcp.upbound.io_clusters.yaml @@ -1864,6 +1864,82 @@ spec: description: Subnetwork in cluster's network where master's endpoint will be provisioned. type: string + privateEndpointSubnetworkRef: + description: Reference to a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + privateEndpointSubnetworkSelector: + description: Selector for a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array privateIpv6GoogleAccess: @@ -3871,6 +3947,82 @@ spec: description: Subnetwork in cluster's network where master's endpoint will be provisioned. type: string + privateEndpointSubnetworkRef: + description: Reference to a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + privateEndpointSubnetworkSelector: + description: Selector for a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object type: array privateIpv6GoogleAccess: @@ -8592,6 +8744,82 @@ spec: description: Subnetwork in cluster's network where master's endpoint will be provisioned. type: string + privateEndpointSubnetworkRef: + description: Reference to a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + privateEndpointSubnetworkSelector: + description: Selector for a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object privateIpv6GoogleAccess: description: The desired state of IPv6 connectivity to Google @@ -10403,6 +10631,82 @@ spec: description: Subnetwork in cluster's network where master's endpoint will be provisioned. type: string + privateEndpointSubnetworkRef: + description: Reference to a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + privateEndpointSubnetworkSelector: + description: Selector for a Subnetwork in compute to populate + privateEndpointSubnetwork. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching + labels is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object privateIpv6GoogleAccess: description: The desired state of IPv6 connectivity to Google From e8f9838a2696593460cb68faad048f50a5453680 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Fri, 25 Oct 2024 21:04:43 +0200 Subject: [PATCH 29/34] Increase timeout to 30 min Signed-off-by: Rickard von Essen --- examples/redis/v1beta1/cluster.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/redis/v1beta1/cluster.yaml b/examples/redis/v1beta1/cluster.yaml index 417f10d01..94d1a936e 100644 --- a/examples/redis/v1beta1/cluster.yaml +++ b/examples/redis/v1beta1/cluster.yaml @@ -3,6 +3,7 @@ kind: Cluster metadata: annotations: meta.upbound.io/example-id: redis/v1beta1/cluster + uptest.upbound.io/timeout: "1800" labels: testing.upbound.io/example-name: cluster-ha name: cluster-ha From 71cf525986dcb8d864834a6312e09cfcb715568f Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Mon, 28 Oct 2024 10:22:54 +0100 Subject: [PATCH 30/34] build: Update submodule to d315554 Signed-off-by: Rickard von Essen --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index b0dfb8fbe..d3155548b 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit b0dfb8fbe8c626e3e0f0b6efdfac926d750adf48 +Subproject commit d3155548bfab68fc8bea64c5526642b7b565ae33 From e02473db6d07c34e7f547634f6ee3e0e5be072f9 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Sun, 27 Oct 2024 12:32:06 +0100 Subject: [PATCH 31/34] golangci-lint: Migrated deprecated configs Signed-off-by: Rickard von Essen --- .golangci.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index cc2469c5d..ee069ac4c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,14 +3,12 @@ # SPDX-License-Identifier: CC0-1.0 run: - deadline: 10m - - skip-files: - - "zz_\\..+\\.go$" + timeout: 10m output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: colored-line-number + formats: + - format: colored-line-number linters-settings: errcheck: @@ -25,7 +23,8 @@ linters-settings: # [deprecated] comma-separated list of pairs of the form pkg:regex # the regex is used to ignore names within pkg. (default "fmt:.*"). # see https://github.com/kisielk/errcheck#the-deprecated-method for details - ignore: fmt:.*,io/ioutil:^Read.* + exclude-files: + - fmt:.*,io/ioutil:^Read.* govet: # report about shadowed variables @@ -129,6 +128,8 @@ linters: issues: + exclude-files: + - "zz_\\..+\\.go$" # Excluding configuration per-path and per-linter exclude-rules: # Exclude some linters from running on tests files. @@ -140,7 +141,7 @@ issues: - gosec - scopelint - unparam - + # Ease some gocritic warnings on test files. - path: _test\.go text: "(unnamedResult|exitAfterDefer)" From 50d126ea9c49ad8fe987c4d3a48a21b542bf4abb Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Sun, 27 Oct 2024 12:34:04 +0100 Subject: [PATCH 32/34] golangci-lint: Remove archived/deprecated interfacer linter Signed-off-by: Rickard von Essen --- .golangci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index ee069ac4c..cf1db8c17 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -111,7 +111,6 @@ linters: - govet - gocyclo - gocritic - - interfacer - goconst - goimports - gofmt # We enable this as well as goimports for its simplify mode. From 97c083158ad3437aaa097fc5f1a5d215e8a439fa Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Sun, 27 Oct 2024 12:35:25 +0100 Subject: [PATCH 33/34] golangci-lint: megacheck has been replaced with gosimple, staticcheck, and unused Signed-off-by: Rickard von Essen --- .golangci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index cf1db8c17..c16541f76 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -107,16 +107,18 @@ linters-settings: linters: enable: - - megacheck - govet - gocyclo - gocritic - goconst - goimports - gofmt # We enable this as well as goimports for its simplify mode. + - gosimple - prealloc - revive + - staticcheck - unconvert + - unused - misspell - nakedret From dbc74fcb08601c12a59b0bd14e6fb6242b540ac4 Mon Sep 17 00:00:00 2001 From: Rickard von Essen Date: Sun, 27 Oct 2024 12:37:45 +0100 Subject: [PATCH 34/34] Dockerfile: Updated deprecated syntax for ENV Signed-off-by: Rickard von Essen --- cluster/images/provider-gcp/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cluster/images/provider-gcp/Dockerfile b/cluster/images/provider-gcp/Dockerfile index a478cc86a..dcee5f83b 100644 --- a/cluster/images/provider-gcp/Dockerfile +++ b/cluster/images/provider-gcp/Dockerfile @@ -7,9 +7,10 @@ ARG CROSSPLANE_PROVIDER_VERSION ENV USER_ID=65532 # set user agent -ENV GOOGLE_TERRAFORM_USERAGENT_EXTENSION "upbound-provider-gcp/${CROSSPLANE_PROVIDER_VERSION}" +ENV GOOGLE_TERRAFORM_USERAGENT_EXTENSION="upbound-provider-gcp/${CROSSPLANE_PROVIDER_VERSION}" USER ${USER_ID} EXPOSE 8080 -ENTRYPOINT ["provider"] \ No newline at end of file +ENTRYPOINT ["provider"] +