diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af7681a..ff83c87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,15 +18,14 @@ on: env: # Common versions - GO_VERSION: '1.19' - GOLANGCI_VERSION: 'v1.50.0' + GO_VERSION: '1.21' + GOLANGCI_VERSION: 'v1.54.2' DOCKER_BUILDX_VERSION: 'v0.8.2' # Common users. We can't run a step 'if secrets.XXX != ""' but we can run a - # step 'if env.XXX != ""', so we copy these to succinctly test whether + # step 'if env.XXX' != ""', so we copy these to succinctly test whether # credentials have been provided before trying to run steps that need them. UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} - jobs: detect-noop: runs-on: ubuntu-22.04 @@ -35,13 +34,12 @@ jobs: steps: - name: Detect No-op Changes id: noop - uses: fkirc/skip-duplicate-actions@v5.3.0 + uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v5.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} paths_ignore: '["**.md", "**.png", "**.jpg"]' do_not_skip: '["workflow_dispatch", "schedule", "push"]' - lint: runs-on: ubuntu-22.04 needs: detect-noop @@ -49,13 +47,15 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: + # turn off caching as it currently conflicts with the golangci-lint action https://github.com/golangci/golangci-lint-action/issues/863 + cache: false go-version: ${{ env.GO_VERSION }} - name: Find the Go Build Cache @@ -63,26 +63,19 @@ jobs: run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-lint-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-lint- - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - name: Vendor Dependencies run: make vendor vendor.check # We could run 'make lint' but we prefer this action because it leaves # 'annotations' (i.e. it comments on PRs to point out linter violations). - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3 with: version: ${{ env.GOLANGCI_VERSION }} @@ -93,41 +86,42 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: go-version: ${{ env.GO_VERSION }} - name: Install goimports - run: go install golang.org/x/tools/cmd/goimports + run: | + cd /tmp + go install golang.org/x/tools/cmd/goimports@v0.1.12 - name: Find the Go Build Cache id: go run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-check-diff- - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - name: Vendor Dependencies run: make vendor vendor.check - name: Check Diff - run: make check-diff + id: check-diff + run: | + make check-diff + + - name: Show diff + if: failure() && steps.check-diff.outcome == 'failure' + run: git diff unit-tests: runs-on: ubuntu-22.04 @@ -136,7 +130,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true @@ -144,7 +138,7 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: go-version: ${{ env.GO_VERSION }} @@ -153,19 +147,12 @@ jobs: run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-unit-tests- - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - name: Vendor Dependencies run: make vendor vendor.check @@ -173,54 +160,11 @@ jobs: run: make -j2 test - name: Publish Unit Test Coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3 with: flags: unittests file: _output/tests/linux_amd64/coverage.txt - local-deploy: - runs-on: ubuntu-22.04 - needs: detect-noop - if: needs.detect-noop.outputs.noop != 'true' - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - - - name: Fetch History - run: git fetch --prune --unshallow - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Find the Go Build Cache - id: go - run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - - - name: Cache the Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go.outputs.cache }} - key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-build-unit-tests- - - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - - name: Vendor Dependencies - run: make vendor vendor.check - - - name: Deploying locally built provider package - run: make local-deploy - publish-artifacts: runs-on: ubuntu-22.04 needs: detect-noop @@ -228,26 +172,18 @@ jobs: steps: - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2 with: platforms: all - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2 with: version: ${{ env.DOCKER_BUILDX_VERSION }} install: true - - name: Login to Upbound - uses: docker/login-action@v2 - if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' - with: - registry: xpkg.upbound.io - username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} - password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} - - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true @@ -255,7 +191,7 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3 with: go-version: ${{ env.GO_VERSION }} @@ -264,19 +200,12 @@ jobs: run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v3 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-publish-artifacts- - - name: Cache Go Dependencies - uses: actions/cache@v3 - with: - path: .work/pkg - key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-pkg- - - name: Vendor Dependencies run: make vendor vendor.check @@ -287,11 +216,8 @@ jobs: # builds by default. Specifying --load does so. BUILD_ARGS: "--load" - - name: Upload Artifacts to GitHub - uses: actions/upload-artifact@v2 + - name: Publish Artifacts to GitHub + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: output path: _output/** - - - name: Publish Artifacts - run: make publish BRANCH_NAME=${GITHUB_REF##*/} diff --git a/.golangci.yml b/.golangci.yml index 494a907..2281e28 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,8 +1,8 @@ run: - deadline: 10m + deadline: 20m skip-files: - - "zz_\\..+\\.go$" + - "zz_\\..+\\.go$" output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" @@ -27,9 +27,9 @@ linters-settings: # report about shadowed variables check-shadowing: false - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 + revive: + # confidence for issues, default is 0.8 + confidence: 0.8 gofmt: # simplify code: gofmt with `-s` option, true by default @@ -38,7 +38,7 @@ linters-settings: goimports: # put imports beginning with prefix after 3rd-party packages; # it's a comma-separated list of prefixes - local-prefixes: github.com/upbound/upjet-provider-template + local-prefixes: github.com/linode/provider-linode gocyclo: # minimal code complexity to report, 30 by default (but we recommend 10-20) @@ -113,7 +113,7 @@ linters: - goimports - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - golint + - revive - unconvert - misspell - nakedret @@ -136,7 +136,7 @@ issues: - gosec - scopelint - unparam - + # Ease some gocritic warnings on test files. - path: _test\.go text: "(unnamedResult|exitAfterDefer)" @@ -148,31 +148,31 @@ issues: # rather than using a pointer. - text: "(hugeParam|rangeValCopy):" linters: - - gocritic + - gocritic # This "TestMain should call os.Exit to set exit code" warning is not clever # enough to notice that we call a helper method that calls os.Exit. - text: "SA3000:" linters: - - staticcheck + - staticcheck - text: "k8s.io/api/core/v1" linters: - - goimports + - goimports # This is a "potential hardcoded credentials" warning. It's triggered by # any variable with 'secret' in the same, and thus hits a lot of false # positives in Kubernetes land where a Secret is an object type. - text: "G101:" linters: - - gosec - - gas + - gosec + - gas # This is an 'errors unhandled' warning that duplicates errcheck. - text: "G104:" linters: - - gosec - - gas + - gosec + - gas # Independently from option `exclude` we use default exclude patterns, # it can be disabled by this option. To list all diff --git a/Makefile b/Makefile index dab9dbe..67103f7 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PROJECT_NAME := provider-linode PROJECT_REPO := github.com/linode/$(PROJECT_NAME) -export TERRAFORM_VERSION := 1.3.3 +export TERRAFORM_VERSION := 1.5.5 export TERRAFORM_PROVIDER_SOURCE := linode/linode export TERRAFORM_PROVIDER_VERSION := 2.9.3 export TERRAFORM_PROVIDER_DOWNLOAD_NAME := terraform-provider-linode @@ -12,8 +12,9 @@ export TERRAFORM_NATIVE_PROVIDER_BINARY := terraform-provider-linode_v$(TERRAFOR export TERRAFORM_PROVIDER_REPO := https://github.com/linode/terraform-provider-linode export TERRAFORM_DOCS_PATH := docs/resources -#PLATFORMS ?= linux_amd64 linux_arm64 -PLATFORMS ?= linux_amd64 +PLATFORMS ?= linux_amd64 linux_arm64 + +export PROJECT_NAME := $(PROJECT_NAME) # -include will silently skip missing files, which allows us # to load those files with a target in the Makefile. If only @@ -38,20 +39,32 @@ NPROCS ?= 1 # to half the number of CPU cores. GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 ))) -GO_REQUIRED_VERSION ?= 1.19 -GOLANGCILINT_VERSION ?= 1.50.0 +# We need to specify which repos might require login for go commands to authorize +# correctly. +export GOPRIVATE = github.com/upbound/* + +GO_REQUIRED_VERSION ?= 1.21 +# GOLANGCILINT_VERSION is inherited from build submodule by default. +# Uncomment below if you need to override the version. +# GOLANGCILINT_VERSION ?= 1.54.0 + GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider $(GO_PROJECT)/cmd/generator GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION) GO_SUBDIRS += cmd internal apis + -include build/makelib/golang.mk # ==================================================================================== # Setup Kubernetes tools -KIND_VERSION = v0.17.0 -UP_VERSION = v0.17.0 +KIND_VERSION = v0.20.0 +UP_VERSION = v0.20.0 UP_CHANNEL = stable -UPTEST_VERSION = v0.5.0 +UPTEST_VERSION = v0.6.1 + +export UP_VERSION := $(UP_VERSION) +export UP_CHANNEL := $(UP_CHANNEL) + -include build/makelib/k8s_tools.mk # ==================================================================================== @@ -59,6 +72,9 @@ UPTEST_VERSION = v0.5.0 REGISTRY_ORGS ?= xpkg.upbound.io/linode IMAGES = $(PROJECT_NAME) +BATCH_PLATFORMS ?= linux_amd64,linux_arm64 +export BATCH_PLATFORMS := $(BATCH_PLATFORMS) + -include build/makelib/imagelight.mk # ==================================================================================== @@ -69,18 +85,14 @@ XPKG_REG_ORGS ?= xpkg.upbound.io/linode # inferred. XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/linode XPKGS = $(PROJECT_NAME) +export XPKG_REG_ORGS := $(XPKG_REG_ORGS) +export XPKG_REG_ORGS_NO_PROMOTE := $(XPKG_REG_ORGS_NO_PROMOTE) + -include build/makelib/xpkg.mk -# NOTE(hasheddan): we force image building to happen prior to xpkg build so that -# we ensure image is present in daemon. xpkg.build.provider-linode: do.build.images - -# NOTE(hasheddan): we ensure up is installed prior to running platform-specific -# build steps in parallel to avoid encountering an installation race condition. -build.init: $(UP) - # ==================================================================================== -# Fallthrough +# Targets # run `make help` to see the targets and options @@ -93,6 +105,30 @@ fallthrough: submodules @echo Initial setup complete. Running make again . . . @make +# Generate a coverage report for cobertura applying exclusions on +# - generated file +cobertura: + @cat $(GO_TEST_OUTPUT)/coverage.txt | \ + grep -v zz_ | \ + $(GOCOVER_COBERTURA) > $(GO_TEST_OUTPUT)/cobertura-coverage.xml + +# Update the submodules, such as the common build scripts. +submodules: + @git submodule sync + @git submodule update --init --recursive + +# This is for running out-of-cluster locally, and is for convenience. Running +# this make target will print out the command which was used. For more control, +# try running the binary directly with different arguments. +run: go.build + @$(INFO) Running Crossplane locally out-of-cluster . . . + @# To see other arguments that can be provided, run the command with --help instead + UPBOUND_CONTEXT="local" $(GO_OUT_DIR)/provider --debug + +# NOTE(hasheddan): we ensure up is installed prior to running platform-specific +# build steps in parallel to avoid encountering an installation race condition. +build.init: $(UP) + # ==================================================================================== # Setup Terraform for fetching provider schema TERRAFORM := $(TOOLS_HOST_DIR)/terraform-$(TERRAFORM_VERSION) @@ -102,7 +138,7 @@ TERRAFORM_PROVIDER_SCHEMA := config/schema.json $(TERRAFORM): @$(INFO) installing terraform $(HOSTOS)-$(HOSTARCH) @mkdir -p $(TOOLS_HOST_DIR)/tmp-terraform - @curl -fsSL https://releases.hashicorp.com/terraform/$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_$(SAFEHOST_PLATFORM).zip -o $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip + @curl -fsSL https://github.com/upbound/terraform/releases/download/v$(TERRAFORM_VERSION)/terraform_$(TERRAFORM_VERSION)_$(SAFEHOST_PLATFORM).zip -o $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip @unzip $(TOOLS_HOST_DIR)/tmp-terraform/terraform.zip -d $(TOOLS_HOST_DIR)/tmp-terraform @mv $(TOOLS_HOST_DIR)/tmp-terraform/terraform $(TERRAFORM) @rm -fr $(TOOLS_HOST_DIR)/tmp-terraform @@ -112,51 +148,18 @@ $(TERRAFORM_PROVIDER_SCHEMA): $(TERRAFORM) @$(INFO) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION) @mkdir -p $(TERRAFORM_WORKDIR) @echo '{"terraform":[{"required_providers":[{"provider":{"source":"'"$(TERRAFORM_PROVIDER_SOURCE)"'","version":"'"$(TERRAFORM_PROVIDER_VERSION)"'"}}],"required_version":"'"$(TERRAFORM_VERSION)"'"}]}' > $(TERRAFORM_WORKDIR)/main.tf.json - @$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) init > $(TERRAFORM_WORKDIR)/terraform-logs.txt 2>&1 + @$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) init -upgrade > $(TERRAFORM_WORKDIR)/terraform-logs.txt 2>&1 @$(TERRAFORM) -chdir=$(TERRAFORM_WORKDIR) providers schema -json=true > $(TERRAFORM_PROVIDER_SCHEMA) 2>> $(TERRAFORM_WORKDIR)/terraform-logs.txt @$(OK) generating provider schema for $(TERRAFORM_PROVIDER_SOURCE) $(TERRAFORM_PROVIDER_VERSION) pull-docs: - @if [ ! -d "$(WORK_DIR)/$(TERRAFORM_PROVIDER_SOURCE)" ]; then \ - mkdir -p "$(WORK_DIR)/$(TERRAFORM_PROVIDER_SOURCE)" && \ - git clone -c advice.detachedHead=false --depth 1 --filter=blob:none --branch "v$(TERRAFORM_PROVIDER_VERSION)" --sparse "$(TERRAFORM_PROVIDER_REPO)" "$(WORK_DIR)/$(TERRAFORM_PROVIDER_SOURCE)"; \ - fi - @git -C "$(WORK_DIR)/$(TERRAFORM_PROVIDER_SOURCE)" sparse-checkout set "$(TERRAFORM_DOCS_PATH)" + rm -fR "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))" + git clone -c advice.detachedHead=false --depth 1 --filter=blob:none --branch "v$(TERRAFORM_PROVIDER_VERSION)" --sparse "$(TERRAFORM_PROVIDER_REPO)" "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))"; + @git -C "$(WORK_DIR)/$(notdir $(TERRAFORM_PROVIDER_REPO))" sparse-checkout set "$(TERRAFORM_DOCS_PATH)" generate.init: $(TERRAFORM_PROVIDER_SCHEMA) pull-docs -.PHONY: $(TERRAFORM_PROVIDER_SCHEMA) pull-docs -# ==================================================================================== -# Targets - -# NOTE: the build submodule currently overrides XDG_CACHE_HOME in order to -# force the Helm 3 to use the .work/helm directory. This causes Go on Linux -# machines to use that directory as the build cache as well. We should adjust -# this behavior in the build submodule because it is also causing Linux users -# to duplicate their build cache, but for now we just make it easier to identify -# its location in CI so that we cache between builds. -go.cachedir: - @go env GOCACHE - -# Generate a coverage report for cobertura applying exclusions on -# - generated file -cobertura: - @cat $(GO_TEST_OUTPUT)/coverage.txt | \ - grep -v zz_ | \ - $(GOCOVER_COBERTURA) > $(GO_TEST_OUTPUT)/cobertura-coverage.xml - -# Update the submodules, such as the common build scripts. -submodules: - @git submodule sync - @git submodule update --init --recursive - -# This is for running out-of-cluster locally, and is for convenience. Running -# this make target will print out the command which was used. For more control, -# try running the binary directly with different arguments. -run: go.build - @$(INFO) Running Crossplane locally out-of-cluster . . . - @# To see other arguments that can be provided, run the command with --help instead - UPBOUND_CONTEXT="local" $(GO_OUT_DIR)/provider --debug +.PHONY: pull-docs # ==================================================================================== # End to End Testing @@ -164,11 +167,19 @@ CROSSPLANE_NAMESPACE = upbound-system -include build/makelib/local.xpkg.mk -include build/makelib/controlplane.mk +# This target requires the following environment variables to be set: +# - UPTEST_EXAMPLE_LIST, a comma-separated list of examples to test +# - UPTEST_CLOUD_CREDENTIALS (optional) +# - UPTEST_DATASOURCE_PATH (optional), see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --setup-script=cluster/test/setup.sh || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e "${UPTEST_EXAMPLE_LIST}" --data-source="${UPTEST_DATASOURCE_PATH}" --setup-script=cluster/test/setup.sh --default-conditions="Ready" || $(FAIL) @$(OK) running automated tests +uptest-local: + @$(WARN) "this target is deprecated, please use 'make uptest' instead" + + local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME) @$(INFO) running locally built provider @$(KUBECTL) wait provider.pkg $(PROJECT_NAME) --for condition=Healthy --timeout 5m @@ -177,7 +188,36 @@ local-deploy: build controlplane.up local.xpkg.deploy.provider.$(PROJECT_NAME) e2e: local-deploy uptest -.PHONY: cobertura submodules fallthrough run crds.clean +# TODO: please move this to the common build submodule +# once the use cases mature +crddiff: $(UPTEST) + @$(INFO) Checking breaking CRD schema changes + @for crd in $${MODIFIED_CRD_LIST}; do \ + if ! git cat-file -e "$${GITHUB_BASE_REF}:$${crd}" 2>/dev/null; then \ + echo "CRD $${crd} does not exist in the $${GITHUB_BASE_REF} branch. Skipping..." ; \ + continue ; \ + fi ; \ + echo "Checking $${crd} for breaking API changes..." ; \ + changes_detected=$$($(UPTEST) crddiff revision <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \ + if [[ $$? != 0 ]] ; then \ + printf "\033[31m"; echo "Breaking change detected!"; printf "\033[0m" ; \ + echo "$${changes_detected}" ; \ + echo ; \ + fi ; \ + done + @$(OK) Checking breaking CRD schema changes + +schema-version-diff: + @$(INFO) Checking for native state schema version changes + @export PREV_PROVIDER_VERSION=$$(git cat-file -p "${GITHUB_BASE_REF}:Makefile" | sed -nr 's/^export[[:space:]]*TERRAFORM_PROVIDER_VERSION[[:space:]]*:=[[:space:]]*(.+)/\1/p'); \ + echo Detected previous Terraform provider version: $${PREV_PROVIDER_VERSION}; \ + echo Current Terraform provider version: $${TERRAFORM_PROVIDER_VERSION}; \ + mkdir -p $(WORK_DIR); \ + git cat-file -p "$${GITHUB_BASE_REF}:config/schema.json" > "$(WORK_DIR)/schema.json.$${PREV_PROVIDER_VERSION}"; \ + ./scripts/version_diff.py config/generated.lst "$(WORK_DIR)/schema.json.$${PREV_PROVIDER_VERSION}" config/schema.json + @$(OK) Checking for native state schema version changes + +.PHONY: uptest e2e crddiff schema-version-diff # ==================================================================================== # Special Targets @@ -198,4 +238,16 @@ crossplane.help: help-special: crossplane.help -.PHONY: crossplane.help help-special +# NOTE(hasheddan): the build submodule currently overrides XDG_CACHE_HOME in +# order to force the Helm 3 to use the .work/helm directory. This causes Go on +# Linux machines to use that directory as the build cache as well. We should +# adjust this behavior in the build submodule because it is also causing Linux +# users to duplicate their build cache, but for now we just make it easier to +# identify its location in CI so that we cache between builds. +go.cachedir: + @go env GOCACHE + +go.mod.cachedir: + @go env GOMODCACHE + +.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir run crds.clean $(TERRAFORM_PROVIDER_SCHEMA) diff --git a/README.md b/README.md index d99fda2..8fd40ed 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ This provider plugin is maintained by Linode. ## Using the provider `provider-linode` is a [Crossplane](https://crossplane.io/) provider that -is built using [Upjet](https://github.com/upbound/upjet) code +is built using [Upjet](https://github.com/crossplane/upjet) code generation tools and exposes XRM-conformant managed resources for the Linode API. diff --git a/apis/database/v1alpha1/zz_accesscontrols_terraformed.go b/apis/database/v1alpha1/zz_accesscontrols_terraformed.go new file mode 100755 index 0000000..e61c975 --- /dev/null +++ b/apis/database/v1alpha1/zz_accesscontrols_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 AccessControls +func (mg *AccessControls) GetTerraformResourceType() string { + return "linode_database_access_controls" +} + +// GetConnectionDetailsMapping for this AccessControls +func (tr *AccessControls) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this AccessControls +func (tr *AccessControls) 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 AccessControls +func (tr *AccessControls) 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 AccessControls +func (tr *AccessControls) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this AccessControls +func (tr *AccessControls) 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 AccessControls +func (tr *AccessControls) 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 AccessControls +func (tr *AccessControls) 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 AccessControls +func (tr *AccessControls) 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 AccessControls using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *AccessControls) LateInitialize(attrs []byte) (bool, error) { + params := &AccessControlsParameters{} + 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 *AccessControls) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/database/v1alpha1/zz_accesscontrols_types.go b/apis/database/v1alpha1/zz_accesscontrols_types.go index e8cab4a..86ace15 100755 --- a/apis/database/v1alpha1/zz_accesscontrols_types.go +++ b/apis/database/v1alpha1/zz_accesscontrols_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,10 +17,27 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type AccessControlsInitParameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The unique ID of the target database. + // The ID of the database to manage the allow list for. + DatabaseID *float64 `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The unique type of the target database. (mysql, mongodb, postgresql) + // The type of the database to manage the allow list for. + DatabaseType *string `json:"databaseType,omitempty" tf:"database_type,omitempty"` +} + type AccessControlsObservation struct { // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` // The unique ID of the target database. @@ -35,6 +56,7 @@ type AccessControlsParameters struct { // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. // +kubebuilder:validation:Optional + // +listType=set AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` // The unique ID of the target database. @@ -52,6 +74,17 @@ type AccessControlsParameters struct { type AccessControlsSpec struct { v1.ResourceSpec `json:",inline"` ForProvider AccessControlsParameters `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 AccessControlsInitParameters `json:"initProvider,omitempty"` } // AccessControlsStatus defines the observed state of AccessControls. @@ -61,20 +94,21 @@ type AccessControlsStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // AccessControls is the Schema for the AccessControlss API. Manages the access controls for a Linode Database. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type AccessControls struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.allowList)",message="allowList is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseType)",message="databaseType is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.allowList) || (has(self.initProvider) && has(self.initProvider.allowList))",message="spec.forProvider.allowList is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.databaseId) || (has(self.initProvider) && has(self.initProvider.databaseId))",message="spec.forProvider.databaseId is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.databaseType) || (has(self.initProvider) && has(self.initProvider.databaseType))",message="spec.forProvider.databaseType is a required parameter" Spec AccessControlsSpec `json:"spec"` Status AccessControlsStatus `json:"status,omitempty"` } diff --git a/apis/database/v1alpha1/zz_generated.conversion_hubs.go b/apis/database/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..bea5bbe --- /dev/null +++ b/apis/database/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *AccessControls) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *MySQL) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PostgreSQL) Hub() {} diff --git a/apis/database/v1alpha1/zz_generated.deepcopy.go b/apis/database/v1alpha1/zz_generated.deepcopy.go index 222e3b0..e050b7d 100644 --- a/apis/database/v1alpha1/zz_generated.deepcopy.go +++ b/apis/database/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -40,6 +39,42 @@ func (in *AccessControls) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AccessControlsInitParameters) DeepCopyInto(out *AccessControlsInitParameters) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(float64) + **out = **in + } + if in.DatabaseType != nil { + in, out := &in.DatabaseType, &out.DatabaseType + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AccessControlsInitParameters. +func (in *AccessControlsInitParameters) DeepCopy() *AccessControlsInitParameters { + if in == nil { + return nil + } + out := new(AccessControlsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AccessControlsList) DeepCopyInto(out *AccessControlsList) { *out = *in @@ -154,6 +189,7 @@ func (in *AccessControlsSpec) DeepCopyInto(out *AccessControlsSpec) { *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 AccessControlsSpec. @@ -210,6 +246,79 @@ func (in *MySQL) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MySQLInitParameters) DeepCopyInto(out *MySQLInitParameters) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicationType != nil { + in, out := &in.ReplicationType, &out.ReplicationType + *out = new(string) + **out = **in + } + if in.SSLConnection != nil { + in, out := &in.SSLConnection, &out.SSLConnection + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make([]UpdatesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLInitParameters. +func (in *MySQLInitParameters) DeepCopy() *MySQLInitParameters { + if in == nil { + return nil + } + out := new(MySQLInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MySQLList) DeepCopyInto(out *MySQLList) { *out = *in @@ -433,6 +542,7 @@ func (in *MySQLSpec) DeepCopyInto(out *MySQLSpec) { *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 MySQLSpec. @@ -489,6 +599,84 @@ func (in *PostgreSQL) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLInitParameters) DeepCopyInto(out *PostgreSQLInitParameters) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicationCommitType != nil { + in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + *out = new(string) + **out = **in + } + if in.ReplicationType != nil { + in, out := &in.ReplicationType, &out.ReplicationType + *out = new(string) + **out = **in + } + if in.SSLConnection != nil { + in, out := &in.SSLConnection, &out.SSLConnection + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make([]PostgreSQLUpdatesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLInitParameters. +func (in *PostgreSQLInitParameters) DeepCopy() *PostgreSQLInitParameters { + if in == nil { + return nil + } + out := new(PostgreSQLInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgreSQLList) DeepCopyInto(out *PostgreSQLList) { *out = *in @@ -727,6 +915,7 @@ func (in *PostgreSQLSpec) DeepCopyInto(out *PostgreSQLSpec) { *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 PostgreSQLSpec. @@ -756,6 +945,46 @@ func (in *PostgreSQLStatus) DeepCopy() *PostgreSQLStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLUpdatesInitParameters) DeepCopyInto(out *PostgreSQLUpdatesInitParameters) { + *out = *in + if in.DayOfWeek != nil { + in, out := &in.DayOfWeek, &out.DayOfWeek + *out = new(string) + **out = **in + } + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(float64) + **out = **in + } + if in.Frequency != nil { + in, out := &in.Frequency, &out.Frequency + *out = new(string) + **out = **in + } + if in.HourOfDay != nil { + in, out := &in.HourOfDay, &out.HourOfDay + *out = new(float64) + **out = **in + } + if in.WeekOfMonth != nil { + in, out := &in.WeekOfMonth, &out.WeekOfMonth + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesInitParameters. +func (in *PostgreSQLUpdatesInitParameters) DeepCopy() *PostgreSQLUpdatesInitParameters { + if in == nil { + return nil + } + out := new(PostgreSQLUpdatesInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgreSQLUpdatesObservation) DeepCopyInto(out *PostgreSQLUpdatesObservation) { *out = *in @@ -836,6 +1065,46 @@ func (in *PostgreSQLUpdatesParameters) DeepCopy() *PostgreSQLUpdatesParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdatesInitParameters) DeepCopyInto(out *UpdatesInitParameters) { + *out = *in + if in.DayOfWeek != nil { + in, out := &in.DayOfWeek, &out.DayOfWeek + *out = new(string) + **out = **in + } + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(float64) + **out = **in + } + if in.Frequency != nil { + in, out := &in.Frequency, &out.Frequency + *out = new(string) + **out = **in + } + if in.HourOfDay != nil { + in, out := &in.HourOfDay, &out.HourOfDay + *out = new(float64) + **out = **in + } + if in.WeekOfMonth != nil { + in, out := &in.WeekOfMonth, &out.WeekOfMonth + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatesInitParameters. +func (in *UpdatesInitParameters) DeepCopy() *UpdatesInitParameters { + if in == nil { + return nil + } + out := new(UpdatesInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UpdatesObservation) DeepCopyInto(out *UpdatesObservation) { *out = *in diff --git a/apis/database/v1alpha1/zz_generated.managed.go b/apis/database/v1alpha1/zz_generated.managed.go index 039b75c..d00e78b 100644 --- a/apis/database/v1alpha1/zz_generated.managed.go +++ b/apis/database/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *AccessControls) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this AccessControls. -func (mg *AccessControls) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this AccessControls. +func (mg *AccessControls) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this AccessControls. @@ -27,14 +27,6 @@ func (mg *AccessControls) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this AccessControls. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *AccessControls) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this AccessControls. func (mg *AccessControls) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *AccessControls) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this AccessControls. -func (mg *AccessControls) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this AccessControls. +func (mg *AccessControls) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this AccessControls. @@ -65,14 +57,6 @@ func (mg *AccessControls) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this AccessControls. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *AccessControls) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this AccessControls. func (mg *AccessControls) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -93,9 +77,9 @@ func (mg *MySQL) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this MySQL. -func (mg *MySQL) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this MySQL. +func (mg *MySQL) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this MySQL. @@ -103,14 +87,6 @@ func (mg *MySQL) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this MySQL. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *MySQL) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this MySQL. func (mg *MySQL) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -131,9 +107,9 @@ func (mg *MySQL) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this MySQL. -func (mg *MySQL) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this MySQL. +func (mg *MySQL) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this MySQL. @@ -141,14 +117,6 @@ func (mg *MySQL) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this MySQL. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *MySQL) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this MySQL. func (mg *MySQL) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -169,9 +137,9 @@ func (mg *PostgreSQL) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this PostgreSQL. -func (mg *PostgreSQL) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this PostgreSQL. +func (mg *PostgreSQL) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this PostgreSQL. @@ -179,14 +147,6 @@ func (mg *PostgreSQL) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this PostgreSQL. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *PostgreSQL) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this PostgreSQL. func (mg *PostgreSQL) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -207,9 +167,9 @@ func (mg *PostgreSQL) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this PostgreSQL. -func (mg *PostgreSQL) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this PostgreSQL. +func (mg *PostgreSQL) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this PostgreSQL. @@ -217,14 +177,6 @@ func (mg *PostgreSQL) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this PostgreSQL. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *PostgreSQL) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this PostgreSQL. func (mg *PostgreSQL) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/database/v1alpha1/zz_generated_terraformed.go b/apis/database/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 34e0a2c..0000000 --- a/apis/database/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/pkg/errors" - - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this AccessControls -func (mg *AccessControls) GetTerraformResourceType() string { - return "linode_database_access_controls" -} - -// GetConnectionDetailsMapping for this AccessControls -func (tr *AccessControls) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this AccessControls -func (tr *AccessControls) 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 AccessControls -func (tr *AccessControls) 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 AccessControls -func (tr *AccessControls) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this AccessControls -func (tr *AccessControls) 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 AccessControls -func (tr *AccessControls) 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) -} - -// LateInitialize this AccessControls using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *AccessControls) LateInitialize(attrs []byte) (bool, error) { - params := &AccessControlsParameters{} - 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 *AccessControls) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this MySQL -func (mg *MySQL) GetTerraformResourceType() string { - return "linode_database_mysql" -} - -// GetConnectionDetailsMapping for this MySQL -func (tr *MySQL) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"ca_cert": "status.atProvider.caCert", "root_password": "status.atProvider.rootPassword", "root_username": "status.atProvider.rootUsername"} -} - -// GetObservation of this MySQL -func (tr *MySQL) 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 MySQL -func (tr *MySQL) 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 MySQL -func (tr *MySQL) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this MySQL -func (tr *MySQL) 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 MySQL -func (tr *MySQL) 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) -} - -// LateInitialize this MySQL using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *MySQL) LateInitialize(attrs []byte) (bool, error) { - params := &MySQLParameters{} - 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 *MySQL) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this PostgreSQL -func (mg *PostgreSQL) GetTerraformResourceType() string { - return "linode_database_postgresql" -} - -// GetConnectionDetailsMapping for this PostgreSQL -func (tr *PostgreSQL) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"ca_cert": "status.atProvider.caCert", "root_password": "status.atProvider.rootPassword", "root_username": "status.atProvider.rootUsername"} -} - -// GetObservation of this PostgreSQL -func (tr *PostgreSQL) 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 PostgreSQL -func (tr *PostgreSQL) 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 PostgreSQL -func (tr *PostgreSQL) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this PostgreSQL -func (tr *PostgreSQL) 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 PostgreSQL -func (tr *PostgreSQL) 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) -} - -// LateInitialize this PostgreSQL using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *PostgreSQL) LateInitialize(attrs []byte) (bool, error) { - params := &PostgreSQLParameters{} - 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 *PostgreSQL) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/database/v1alpha1/zz_groupversion_info.go b/apis/database/v1alpha1/zz_groupversion_info.go index 6598302..768e3fa 100755 --- a/apis/database/v1alpha1/zz_groupversion_info.go +++ b/apis/database/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/database/v1alpha1/zz_mysql_terraformed.go b/apis/database/v1alpha1/zz_mysql_terraformed.go new file mode 100755 index 0000000..53f3639 --- /dev/null +++ b/apis/database/v1alpha1/zz_mysql_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 MySQL +func (mg *MySQL) GetTerraformResourceType() string { + return "linode_database_mysql" +} + +// GetConnectionDetailsMapping for this MySQL +func (tr *MySQL) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ca_cert": "status.atProvider.caCert", "root_password": "status.atProvider.rootPassword", "root_username": "status.atProvider.rootUsername"} +} + +// GetObservation of this MySQL +func (tr *MySQL) 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 MySQL +func (tr *MySQL) 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 MySQL +func (tr *MySQL) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this MySQL +func (tr *MySQL) 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 MySQL +func (tr *MySQL) 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 MySQL +func (tr *MySQL) 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 MySQL +func (tr *MySQL) 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 MySQL using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *MySQL) LateInitialize(attrs []byte) (bool, error) { + params := &MySQLParameters{} + 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 *MySQL) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/database/v1alpha1/zz_mysql_types.go b/apis/database/v1alpha1/zz_mysql_types.go index 27e1ce7..03a4d29 100755 --- a/apis/database/v1alpha1/zz_mysql_types.go +++ b/apis/database/v1alpha1/zz_mysql_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,10 +17,54 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type MySQLInitParameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode Instance nodes deployed to the Managed Database. Defaults to 1. + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // Whether the Managed Databases is encrypted. (default false) + // Whether the Managed Databases is encrypted. + Encrypted *bool `json:"encrypted,omitempty" tf:"encrypted,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. mysql/8.0.30) + // The Managed Database engine in engine/version format. (e.g. mysql/8.0.30) + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region to use for the Managed Database. + // The region to use for the Managed Database. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The replication method used for the Managed Database. (none, asynch, semi_synch; default none) + // The replication method used for the Managed Database. + ReplicationType *string `json:"replicationType,omitempty" tf:"replication_type,omitempty"` + + // Whether to require SSL credentials to establish a connection to the Managed Database. (default false) + // Whether to require SSL credentials to establish a connection to the Managed Database. + SSLConnection *bool `json:"sslConnection,omitempty" tf:"ssl_connection,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database instance. + // The Linode Instance type used by the Managed Database for its nodes. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + Updates []UpdatesInitParameters `json:"updates,omitempty" tf:"updates,omitempty"` +} + type MySQLObservation struct { // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` // The number of Linode Instance nodes deployed to the Managed Database. (default 1) @@ -91,6 +139,7 @@ type MySQLParameters struct { // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. // +kubebuilder:validation:Optional + // +listType=set AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` // The number of Linode Instance nodes deployed to the Managed Database. (default 1) @@ -138,6 +187,29 @@ type MySQLParameters struct { Updates []UpdatesParameters `json:"updates,omitempty" tf:"updates,omitempty"` } +type UpdatesInitParameters struct { + + // The day to perform maintenance. (monday, tuesday, ...) + // The day to perform maintenance. + DayOfWeek *string `json:"dayOfWeek,omitempty" tf:"day_of_week,omitempty"` + + // The maximum maintenance window time in hours. (1..3) + // The maximum maintenance window time in hours. + Duration *float64 `json:"duration,omitempty" tf:"duration,omitempty"` + + // Whether maintenance occurs on a weekly or monthly basis. (weekly, monthly) + // Whether maintenance occurs on a weekly or monthly basis. + Frequency *string `json:"frequency,omitempty" tf:"frequency,omitempty"` + + // The hour to begin maintenance based in UTC time. (0..23) + // The hour to begin maintenance based in UTC time. + HourOfDay *float64 `json:"hourOfDay,omitempty" tf:"hour_of_day,omitempty"` + + // The week of the month to perform monthly frequency updates. Required for monthly frequency updates. (1..4) + // The week of the month to perform monthly frequency updates. Required for monthly frequency updates. + WeekOfMonth *float64 `json:"weekOfMonth,omitempty" tf:"week_of_month,omitempty"` +} + type UpdatesObservation struct { // The day to perform maintenance. (monday, tuesday, ...) @@ -165,22 +237,22 @@ type UpdatesParameters struct { // The day to perform maintenance. (monday, tuesday, ...) // The day to perform maintenance. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional DayOfWeek *string `json:"dayOfWeek" tf:"day_of_week,omitempty"` // The maximum maintenance window time in hours. (1..3) // The maximum maintenance window time in hours. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Duration *float64 `json:"duration" tf:"duration,omitempty"` // Whether maintenance occurs on a weekly or monthly basis. (weekly, monthly) // Whether maintenance occurs on a weekly or monthly basis. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Frequency *string `json:"frequency" tf:"frequency,omitempty"` // The hour to begin maintenance based in UTC time. (0..23) // The hour to begin maintenance based in UTC time. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional HourOfDay *float64 `json:"hourOfDay" tf:"hour_of_day,omitempty"` // The week of the month to perform monthly frequency updates. Required for monthly frequency updates. (1..4) @@ -193,6 +265,17 @@ type UpdatesParameters struct { type MySQLSpec struct { v1.ResourceSpec `json:",inline"` ForProvider MySQLParameters `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 MySQLInitParameters `json:"initProvider,omitempty"` } // MySQLStatus defines the observed state of MySQL. @@ -202,21 +285,22 @@ type MySQLStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // MySQL is the Schema for the MySQLs API. Manages a Linode MySQL Database. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type MySQL struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.engineId)",message="engineId is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.type)",message="type is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.engineId) || (has(self.initProvider) && has(self.initProvider.engineId))",message="spec.forProvider.engineId is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" Spec MySQLSpec `json:"spec"` Status MySQLStatus `json:"status,omitempty"` } diff --git a/apis/database/v1alpha1/zz_postgresql_terraformed.go b/apis/database/v1alpha1/zz_postgresql_terraformed.go new file mode 100755 index 0000000..199eb53 --- /dev/null +++ b/apis/database/v1alpha1/zz_postgresql_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 PostgreSQL +func (mg *PostgreSQL) GetTerraformResourceType() string { + return "linode_database_postgresql" +} + +// GetConnectionDetailsMapping for this PostgreSQL +func (tr *PostgreSQL) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ca_cert": "status.atProvider.caCert", "root_password": "status.atProvider.rootPassword", "root_username": "status.atProvider.rootUsername"} +} + +// GetObservation of this PostgreSQL +func (tr *PostgreSQL) 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 PostgreSQL +func (tr *PostgreSQL) 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 PostgreSQL +func (tr *PostgreSQL) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this PostgreSQL +func (tr *PostgreSQL) 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 PostgreSQL +func (tr *PostgreSQL) 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 PostgreSQL +func (tr *PostgreSQL) 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 PostgreSQL +func (tr *PostgreSQL) 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 PostgreSQL using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *PostgreSQL) LateInitialize(attrs []byte) (bool, error) { + params := &PostgreSQLParameters{} + 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 *PostgreSQL) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/database/v1alpha1/zz_postgresql_types.go b/apis/database/v1alpha1/zz_postgresql_types.go index 1fe3df7..51ecb20 100755 --- a/apis/database/v1alpha1/zz_postgresql_types.go +++ b/apis/database/v1alpha1/zz_postgresql_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,10 +17,58 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type PostgreSQLInitParameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode Instance nodes deployed to the Managed Database. Defaults to 1. + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // Whether the Managed Databases is encrypted. (default false) + // Whether the Managed Databases is encrypted. + Encrypted *bool `json:"encrypted,omitempty" tf:"encrypted,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. postgresql/13.2) + // The Managed Database engine in engine/version format. (e.g. mysql/8.0.30) + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region to use for the Managed Database. + // The region to use for the Managed Database. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The synchronization level of the replicating server. (on, local, remote_write, remote_apply, off; default off) + // The synchronization level of the replicating server.Must be `local` or `off` for the `asynch` replication type. Must be `on`, `remote_write`, or `remote_apply` for the `semi_synch` replication type. + ReplicationCommitType *string `json:"replicationCommitType,omitempty" tf:"replication_commit_type,omitempty"` + + // The replication method used for the Managed Database. (none, asynch, semi_synch; default none) + // The replication method used for the Managed Database. Must be `none` for a single node cluster. Must be `asynch` or `semi_synch` for a high availability cluster. + ReplicationType *string `json:"replicationType,omitempty" tf:"replication_type,omitempty"` + + // Whether to require SSL credentials to establish a connection to the Managed Database. (default false) + // Whether to require SSL credentials to establish a connection to the Managed Database. + SSLConnection *bool `json:"sslConnection,omitempty" tf:"ssl_connection,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database instance. + // The Linode Instance type used by the Managed Database for its nodes. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + Updates []PostgreSQLUpdatesInitParameters `json:"updates,omitempty" tf:"updates,omitempty"` +} + type PostgreSQLObservation struct { // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` // The number of Linode Instance nodes deployed to the Managed Database. (default 1) @@ -98,6 +150,7 @@ type PostgreSQLParameters struct { // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. // +kubebuilder:validation:Optional + // +listType=set AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` // The number of Linode Instance nodes deployed to the Managed Database. (default 1) @@ -150,6 +203,29 @@ type PostgreSQLParameters struct { Updates []PostgreSQLUpdatesParameters `json:"updates,omitempty" tf:"updates,omitempty"` } +type PostgreSQLUpdatesInitParameters struct { + + // The day to perform maintenance. (monday, tuesday, ...) + // The day to perform maintenance. + DayOfWeek *string `json:"dayOfWeek,omitempty" tf:"day_of_week,omitempty"` + + // The maximum maintenance window time in hours. (1..3) + // The maximum maintenance window time in hours. + Duration *float64 `json:"duration,omitempty" tf:"duration,omitempty"` + + // Whether maintenance occurs on a weekly or monthly basis. (weekly, monthly) + // Whether maintenance occurs on a weekly or monthly basis. + Frequency *string `json:"frequency,omitempty" tf:"frequency,omitempty"` + + // The hour to begin maintenance based in UTC time. (0..23) + // The hour to begin maintenance based in UTC time. + HourOfDay *float64 `json:"hourOfDay,omitempty" tf:"hour_of_day,omitempty"` + + // The week of the month to perform monthly frequency updates. Required for monthly frequency updates. (1..4) + // The week of the month to perform monthly frequency updates. Required for monthly frequency updates. + WeekOfMonth *float64 `json:"weekOfMonth,omitempty" tf:"week_of_month,omitempty"` +} + type PostgreSQLUpdatesObservation struct { // The day to perform maintenance. (monday, tuesday, ...) @@ -177,22 +253,22 @@ type PostgreSQLUpdatesParameters struct { // The day to perform maintenance. (monday, tuesday, ...) // The day to perform maintenance. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional DayOfWeek *string `json:"dayOfWeek" tf:"day_of_week,omitempty"` // The maximum maintenance window time in hours. (1..3) // The maximum maintenance window time in hours. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Duration *float64 `json:"duration" tf:"duration,omitempty"` // Whether maintenance occurs on a weekly or monthly basis. (weekly, monthly) // Whether maintenance occurs on a weekly or monthly basis. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Frequency *string `json:"frequency" tf:"frequency,omitempty"` // The hour to begin maintenance based in UTC time. (0..23) // The hour to begin maintenance based in UTC time. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional HourOfDay *float64 `json:"hourOfDay" tf:"hour_of_day,omitempty"` // The week of the month to perform monthly frequency updates. Required for monthly frequency updates. (1..4) @@ -205,6 +281,17 @@ type PostgreSQLUpdatesParameters struct { type PostgreSQLSpec struct { v1.ResourceSpec `json:",inline"` ForProvider PostgreSQLParameters `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 PostgreSQLInitParameters `json:"initProvider,omitempty"` } // PostgreSQLStatus defines the observed state of PostgreSQL. @@ -214,21 +301,22 @@ type PostgreSQLStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // PostgreSQL is the Schema for the PostgreSQLs API. Manages a Linode PostgreSQL Database. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type PostgreSQL struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.engineId)",message="engineId is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.type)",message="type is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.engineId) || (has(self.initProvider) && has(self.initProvider.engineId))",message="spec.forProvider.engineId is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" Spec PostgreSQLSpec `json:"spec"` Status PostgreSQLStatus `json:"status,omitempty"` } diff --git a/apis/domain/v1alpha1/zz_domain_terraformed.go b/apis/domain/v1alpha1/zz_domain_terraformed.go new file mode 100755 index 0000000..46e00c4 --- /dev/null +++ b/apis/domain/v1alpha1/zz_domain_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Domain +func (mg *Domain) GetTerraformResourceType() string { + return "linode_domain" +} + +// GetConnectionDetailsMapping for this Domain +func (tr *Domain) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Domain +func (tr *Domain) 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 Domain +func (tr *Domain) 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 Domain +func (tr *Domain) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Domain +func (tr *Domain) 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 Domain +func (tr *Domain) 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 Domain +func (tr *Domain) 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 Domain +func (tr *Domain) 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 Domain using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Domain) LateInitialize(attrs []byte) (bool, error) { + params := &DomainParameters{} + 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 *Domain) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/domain/v1alpha1/zz_domain_types.go b/apis/domain/v1alpha1/zz_domain_types.go index 7abcebe..eec8c30 100755 --- a/apis/domain/v1alpha1/zz_domain_types.go +++ b/apis/domain/v1alpha1/zz_domain_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,9 +17,55 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type DomainInitParameters struct { + + // The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it. + // +listType=set + AxfrIps []*string `json:"axfrIps,omitempty" tf:"axfr_ips,omitempty"` + + // A description for this Domain. This is for display purposes only. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The domain this Domain represents. These must be unique in our system; you cannot have two Domains representing the same domain. + Domain *string `json:"domain,omitempty" tf:"domain,omitempty"` + + // The amount of time in seconds that may pass before this Domain is no longer Valid values are 0, 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. + ExpireSec *float64 `json:"expireSec,omitempty" tf:"expire_sec,omitempty"` + + // The group this Domain belongs to. This is for display purposes only. + Group *string `json:"group,omitempty" tf:"group,omitempty"` + + // The IP addresses representing the master DNS for this Domain. + // +listType=set + MasterIps []*string `json:"masterIps,omitempty" tf:"master_ips,omitempty"` + + // The amount of time in seconds before this Domain should be refreshed. Valid values are 0, 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. + RefreshSec *float64 `json:"refreshSec,omitempty" tf:"refresh_sec,omitempty"` + + // The interval, in seconds, at which a failed refresh should be retried. Valid values are 0, 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. + RetrySec *float64 `json:"retrySec,omitempty" tf:"retry_sec,omitempty"` + + // Start of Authority email address. This is required for master Domains. + SoaEmail *string `json:"soaEmail,omitempty" tf:"soa_email,omitempty"` + + // Used to control whether this Domain is currently being rendered. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // 'Time to Live' - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 0, 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. + TTLSec *float64 `json:"ttlSec,omitempty" tf:"ttl_sec,omitempty"` + + // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // If this Domain represents the authoritative source of information for the domain it describes, or if it is a read-only copy of a master (also called a slave). + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + type DomainObservation struct { // The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it. + // +listType=set AxfrIps []*string `json:"axfrIps,omitempty" tf:"axfr_ips,omitempty"` // A description for this Domain. This is for display purposes only. @@ -33,6 +83,7 @@ type DomainObservation struct { ID *string `json:"id,omitempty" tf:"id,omitempty"` // The IP addresses representing the master DNS for this Domain. + // +listType=set MasterIps []*string `json:"masterIps,omitempty" tf:"master_ips,omitempty"` // The amount of time in seconds before this Domain should be refreshed. Valid values are 0, 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. @@ -51,6 +102,7 @@ type DomainObservation struct { TTLSec *float64 `json:"ttlSec,omitempty" tf:"ttl_sec,omitempty"` // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` // If this Domain represents the authoritative source of information for the domain it describes, or if it is a read-only copy of a master (also called a slave). @@ -61,6 +113,7 @@ type DomainParameters struct { // The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it. // +kubebuilder:validation:Optional + // +listType=set AxfrIps []*string `json:"axfrIps,omitempty" tf:"axfr_ips,omitempty"` // A description for this Domain. This is for display purposes only. @@ -81,6 +134,7 @@ type DomainParameters struct { // The IP addresses representing the master DNS for this Domain. // +kubebuilder:validation:Optional + // +listType=set MasterIps []*string `json:"masterIps,omitempty" tf:"master_ips,omitempty"` // The amount of time in seconds before this Domain should be refreshed. Valid values are 0, 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. @@ -105,6 +159,7 @@ type DomainParameters struct { // An array of tags applied to this object. Tags are for organizational purposes only. // +kubebuilder:validation:Optional + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` // If this Domain represents the authoritative source of information for the domain it describes, or if it is a read-only copy of a master (also called a slave). @@ -116,6 +171,17 @@ type DomainParameters struct { type DomainSpec struct { v1.ResourceSpec `json:",inline"` ForProvider DomainParameters `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 DomainInitParameters `json:"initProvider,omitempty"` } // DomainStatus defines the observed state of Domain. @@ -125,19 +191,20 @@ type DomainStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Domain is the Schema for the Domains API. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Domain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.domain)",message="domain is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.type)",message="type is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.domain) || (has(self.initProvider) && has(self.initProvider.domain))",message="spec.forProvider.domain is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" Spec DomainSpec `json:"spec"` Status DomainStatus `json:"status,omitempty"` } diff --git a/apis/domain/v1alpha1/zz_generated.conversion_hubs.go b/apis/domain/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..18f60f8 --- /dev/null +++ b/apis/domain/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Domain) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Record) Hub() {} diff --git a/apis/domain/v1alpha1/zz_generated.deepcopy.go b/apis/domain/v1alpha1/zz_generated.deepcopy.go index 566c1f6..d5c241d 100644 --- a/apis/domain/v1alpha1/zz_generated.deepcopy.go +++ b/apis/domain/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,104 @@ func (in *Domain) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainInitParameters) DeepCopyInto(out *DomainInitParameters) { + *out = *in + if in.AxfrIps != nil { + in, out := &in.AxfrIps, &out.AxfrIps + *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.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Domain != nil { + in, out := &in.Domain, &out.Domain + *out = new(string) + **out = **in + } + if in.ExpireSec != nil { + in, out := &in.ExpireSec, &out.ExpireSec + *out = new(float64) + **out = **in + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } + if in.MasterIps != nil { + in, out := &in.MasterIps, &out.MasterIps + *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.RefreshSec != nil { + in, out := &in.RefreshSec, &out.RefreshSec + *out = new(float64) + **out = **in + } + if in.RetrySec != nil { + in, out := &in.RetrySec, &out.RetrySec + *out = new(float64) + **out = **in + } + if in.SoaEmail != nil { + in, out := &in.SoaEmail, &out.SoaEmail + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.TTLSec != nil { + in, out := &in.TTLSec, &out.TTLSec + *out = new(float64) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainInitParameters. +func (in *DomainInitParameters) DeepCopy() *DomainInitParameters { + if in == nil { + return nil + } + out := new(DomainInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DomainList) DeepCopyInto(out *DomainList) { *out = *in @@ -279,6 +376,7 @@ func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { *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 DomainSpec. @@ -335,6 +433,86 @@ func (in *Record) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RecordInitParameters) DeepCopyInto(out *RecordInitParameters) { + *out = *in + if in.DomainID != nil { + in, out := &in.DomainID, &out.DomainID + *out = new(float64) + **out = **in + } + if in.DomainIDRef != nil { + in, out := &in.DomainIDRef, &out.DomainIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DomainIDSelector != nil { + in, out := &in.DomainIDSelector, &out.DomainIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.RecordType != nil { + in, out := &in.RecordType, &out.RecordType + *out = new(string) + **out = **in + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(string) + **out = **in + } + if in.TTLSec != nil { + in, out := &in.TTLSec, &out.TTLSec + *out = new(float64) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.Target != nil { + in, out := &in.Target, &out.Target + *out = new(string) + **out = **in + } + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RecordInitParameters. +func (in *RecordInitParameters) DeepCopy() *RecordInitParameters { + if in == nil { + return nil + } + out := new(RecordInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RecordList) DeepCopyInto(out *RecordList) { *out = *in @@ -527,6 +705,7 @@ func (in *RecordSpec) DeepCopyInto(out *RecordSpec) { *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 RecordSpec. diff --git a/apis/domain/v1alpha1/zz_generated.managed.go b/apis/domain/v1alpha1/zz_generated.managed.go index 59481fd..0328641 100644 --- a/apis/domain/v1alpha1/zz_generated.managed.go +++ b/apis/domain/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Domain) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Domain. -func (mg *Domain) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Domain. +func (mg *Domain) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Domain. @@ -27,14 +27,6 @@ func (mg *Domain) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Domain. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Domain) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Domain. func (mg *Domain) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Domain) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Domain. -func (mg *Domain) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Domain. +func (mg *Domain) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Domain. @@ -65,14 +57,6 @@ func (mg *Domain) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Domain. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Domain) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Domain. func (mg *Domain) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -93,9 +77,9 @@ func (mg *Record) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Record. -func (mg *Record) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Record. +func (mg *Record) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Record. @@ -103,14 +87,6 @@ func (mg *Record) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Record. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Record) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Record. func (mg *Record) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -131,9 +107,9 @@ func (mg *Record) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Record. -func (mg *Record) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Record. +func (mg *Record) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Record. @@ -141,14 +117,6 @@ func (mg *Record) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Record. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Record) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Record. func (mg *Record) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/domain/v1alpha1/zz_generated.resolvers.go b/apis/domain/v1alpha1/zz_generated.resolvers.go index 082777f..7a4f0e1 100644 --- a/apis/domain/v1alpha1/zz_generated.resolvers.go +++ b/apis/domain/v1alpha1/zz_generated.resolvers.go @@ -35,5 +35,21 @@ func (mg *Record) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.DomainID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.DomainIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.DomainID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.DomainIDRef, + Selector: mg.Spec.InitProvider.DomainIDSelector, + To: reference.To{ + List: &DomainList{}, + Managed: &Domain{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DomainID") + } + mg.Spec.InitProvider.DomainID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.DomainIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/domain/v1alpha1/zz_groupversion_info.go b/apis/domain/v1alpha1/zz_groupversion_info.go index 8052d7a..f5d4fdc 100755 --- a/apis/domain/v1alpha1/zz_groupversion_info.go +++ b/apis/domain/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/domain/v1alpha1/zz_generated_terraformed.go b/apis/domain/v1alpha1/zz_record_terraformed.go similarity index 54% rename from apis/domain/v1alpha1/zz_generated_terraformed.go rename to apis/domain/v1alpha1/zz_record_terraformed.go index 657d725..4cd48d9 100755 --- a/apis/domain/v1alpha1/zz_generated_terraformed.go +++ b/apis/domain/v1alpha1/zz_record_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,24 +11,25 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) -// GetTerraformResourceType returns Terraform resource type for this Domain -func (mg *Domain) GetTerraformResourceType() string { - return "linode_domain" +// GetTerraformResourceType returns Terraform resource type for this Record +func (mg *Record) GetTerraformResourceType() string { + return "linode_domain_record" } -// GetConnectionDetailsMapping for this Domain -func (tr *Domain) GetConnectionDetailsMapping() map[string]string { +// GetConnectionDetailsMapping for this Record +func (tr *Record) GetConnectionDetailsMapping() map[string]string { return nil } -// GetObservation of this Domain -func (tr *Domain) GetObservation() (map[string]any, error) { +// GetObservation of this Record +func (tr *Record) GetObservation() (map[string]any, error) { o, err := json.TFParser.Marshal(tr.Status.AtProvider) if err != nil { return nil, err @@ -33,8 +38,8 @@ func (tr *Domain) GetObservation() (map[string]any, error) { return base, json.TFParser.Unmarshal(o, &base) } -// SetObservation for this Domain -func (tr *Domain) SetObservation(obs map[string]any) error { +// SetObservation for this Record +func (tr *Record) SetObservation(obs map[string]any) error { p, err := json.TFParser.Marshal(obs) if err != nil { return err @@ -42,16 +47,16 @@ func (tr *Domain) SetObservation(obs map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) } -// GetID returns ID of underlying Terraform resource of this Domain -func (tr *Domain) GetID() string { +// GetID returns ID of underlying Terraform resource of this Record +func (tr *Record) GetID() string { if tr.Status.AtProvider.ID == nil { return "" } return *tr.Status.AtProvider.ID } -// GetParameters of this Domain -func (tr *Domain) GetParameters() (map[string]any, error) { +// GetParameters of this Record +func (tr *Record) GetParameters() (map[string]any, error) { p, err := json.TFParser.Marshal(tr.Spec.ForProvider) if err != nil { return nil, err @@ -60,8 +65,8 @@ func (tr *Domain) GetParameters() (map[string]any, error) { return base, json.TFParser.Unmarshal(p, &base) } -// SetParameters for this Domain -func (tr *Domain) SetParameters(params map[string]any) error { +// SetParameters for this Record +func (tr *Record) SetParameters(params map[string]any) error { p, err := json.TFParser.Marshal(params) if err != nil { return err @@ -69,78 +74,44 @@ func (tr *Domain) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// LateInitialize this Domain using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Domain) LateInitialize(attrs []byte) (bool, error) { - params := &DomainParameters{} - 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 *Domain) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this Record -func (mg *Record) GetTerraformResourceType() string { - return "linode_domain_record" -} - -// GetConnectionDetailsMapping for this Record -func (tr *Record) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Record -func (tr *Record) GetObservation() (map[string]any, error) { - o, err := json.TFParser.Marshal(tr.Status.AtProvider) +// GetInitParameters of this Record +func (tr *Record) 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(o, &base) + return base, json.TFParser.Unmarshal(p, &base) } -// SetObservation for this Record -func (tr *Record) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) +// GetInitParameters of this Record +func (tr *Record) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() if err != nil { - return err + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this Record -func (tr *Record) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" + if !shouldMergeInitProvider { + return params, nil } - return *tr.Status.AtProvider.ID -} -// GetParameters of this Record -func (tr *Record) GetParameters() (map[string]any, error) { - p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + initParams, err := tr.GetInitParameters() if err != nil { - return nil, err + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) } - base := map[string]any{} - return base, json.TFParser.Unmarshal(p, &base) -} -// SetParameters for this Record -func (tr *Record) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) + // 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 err + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) + + return params, nil } // LateInitialize this Record using its observed tfState. diff --git a/apis/domain/v1alpha1/zz_record_types.go b/apis/domain/v1alpha1/zz_record_types.go index d721068..d28caa0 100755 --- a/apis/domain/v1alpha1/zz_record_types.go +++ b/apis/domain/v1alpha1/zz_record_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,62 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type RecordInitParameters struct { + + // The ID of the Domain to access. Changing . + // The ID of the Domain to access. + // +crossplane:generate:reference:type=Domain + DomainID *float64 `json:"domainId,omitempty" tf:"domain_id,omitempty"` + + // Reference to a Domain to populate domainId. + // +kubebuilder:validation:Optional + DomainIDRef *v1.Reference `json:"domainIdRef,omitempty" tf:"-"` + + // Selector for a Domain to populate domainId. + // +kubebuilder:validation:Optional + DomainIDSelector *v1.Selector `json:"domainIdSelector,omitempty" tf:"-"` + + // The name of this Record. Setting this is invalid for SRV records as it is generated by the API. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address. + // The name of this Record. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the subdomain being associated with an IP address. Generated for SRV records. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The port this Record points to. + // The port this Record points to. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // The priority of the target host. Lower values are preferred. + // The priority of the target host. Lower values are preferred. + Priority *float64 `json:"priority,omitempty" tf:"priority,omitempty"` + + // The protocol this Record's service communicates with. Only valid for SRV records. + // The protocol this Record's service communicates with. Only valid for SRV records. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. See all supported record types here. Changing . + // The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. + RecordType *string `json:"recordType,omitempty" tf:"record_type,omitempty"` + + // The service this Record identified. Only valid for SRV records. + // The service this Record identified. Only valid for SRV records. + Service *string `json:"service,omitempty" tf:"service,omitempty"` + + // 'Time to Live' - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. + // 'Time to Live' - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 30, 120, 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. + TTLSec *float64 `json:"ttlSec,omitempty" tf:"ttl_sec,omitempty"` + + // The tag portion of a CAA record. It is invalid to set this on other record types. + // The tag portion of a CAA record. It is invalid to set this on other record types. + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // The target for this Record. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to. + // The target for this Record. This field's actual usage depends on the type of record this represents. For A and AAAA records, this is the address the named Domain should resolve to. + Target *string `json:"target,omitempty" tf:"target,omitempty"` + + // The relative weight of this Record. Higher values are preferred. + // The relative weight of this Record. Higher values are preferred. + Weight *float64 `json:"weight,omitempty" tf:"weight,omitempty"` +} + type RecordObservation struct { // The ID of the Domain to access. Changing . @@ -133,6 +193,17 @@ type RecordParameters struct { type RecordSpec struct { v1.ResourceSpec `json:",inline"` ForProvider RecordParameters `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 RecordInitParameters `json:"initProvider,omitempty"` } // RecordStatus defines the observed state of Record. @@ -142,19 +213,20 @@ type RecordStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Record is the Schema for the Records API. Manages a Linode Domain Record. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Record struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.recordType)",message="recordType is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.target)",message="target is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.recordType) || (has(self.initProvider) && has(self.initProvider.recordType))",message="spec.forProvider.recordType is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.target) || (has(self.initProvider) && has(self.initProvider.target))",message="spec.forProvider.target is a required parameter" Spec RecordSpec `json:"spec"` Status RecordStatus `json:"status,omitempty"` } diff --git a/apis/firewall/v1alpha1/zz_device_terraformed.go b/apis/firewall/v1alpha1/zz_device_terraformed.go new file mode 100755 index 0000000..a5e49c8 --- /dev/null +++ b/apis/firewall/v1alpha1/zz_device_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Device +func (mg *Device) GetTerraformResourceType() string { + return "linode_firewall_device" +} + +// GetConnectionDetailsMapping for this Device +func (tr *Device) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Device +func (tr *Device) 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 Device +func (tr *Device) 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 Device +func (tr *Device) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Device +func (tr *Device) 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 Device +func (tr *Device) 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 Device +func (tr *Device) 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 Device +func (tr *Device) 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 Device using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Device) LateInitialize(attrs []byte) (bool, error) { + params := &DeviceParameters{} + 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 *Device) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/firewall/v1alpha1/zz_device_types.go b/apis/firewall/v1alpha1/zz_device_types.go index 703febb..9677cd4 100755 --- a/apis/firewall/v1alpha1/zz_device_types.go +++ b/apis/firewall/v1alpha1/zz_device_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,39 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type DeviceInitParameters struct { + + // The unique ID of the entity to attach. + // The ID of the entity to create a Firewall device for. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + EntityID *float64 `json:"entityId,omitempty" tf:"entity_id,omitempty"` + + // Reference to a Instance in instance to populate entityId. + // +kubebuilder:validation:Optional + EntityIDRef *v1.Reference `json:"entityIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate entityId. + // +kubebuilder:validation:Optional + EntityIDSelector *v1.Selector `json:"entityIdSelector,omitempty" tf:"-"` + + // The type of the entity to attach. (default: linode) + // The type of the entity to create a Firewall device for. + EntityType *string `json:"entityType,omitempty" tf:"entity_type,omitempty"` + + // The unique ID of the target Firewall. + // The ID of the Firewall to access. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/firewall/v1alpha1.Device + FirewallID *float64 `json:"firewallId,omitempty" tf:"firewall_id,omitempty"` + + // Reference to a Device in firewall to populate firewallId. + // +kubebuilder:validation:Optional + FirewallIDRef *v1.Reference `json:"firewallIdRef,omitempty" tf:"-"` + + // Selector for a Device in firewall to populate firewallId. + // +kubebuilder:validation:Optional + FirewallIDSelector *v1.Selector `json:"firewallIdSelector,omitempty" tf:"-"` +} + type DeviceObservation struct { // When the Firewall Device was last created. @@ -78,6 +115,17 @@ type DeviceParameters struct { type DeviceSpec struct { v1.ResourceSpec `json:",inline"` ForProvider DeviceParameters `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 DeviceInitParameters `json:"initProvider,omitempty"` } // DeviceStatus defines the observed state of Device. @@ -87,13 +135,14 @@ type DeviceStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Device is the Schema for the Devices API. Manages a Linode Firewall Device. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Device struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/firewall/v1alpha1/zz_generated_terraformed.go b/apis/firewall/v1alpha1/zz_firewall_terraformed.go similarity index 54% rename from apis/firewall/v1alpha1/zz_generated_terraformed.go rename to apis/firewall/v1alpha1/zz_firewall_terraformed.go index f0bb415..e7124b6 100755 --- a/apis/firewall/v1alpha1/zz_generated_terraformed.go +++ b/apis/firewall/v1alpha1/zz_firewall_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this Firewall @@ -69,84 +74,50 @@ func (tr *Firewall) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } -// LateInitialize this Firewall using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Firewall) LateInitialize(attrs []byte) (bool, error) { - params := &FirewallParameters{} - 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 *Firewall) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this Device -func (mg *Device) GetTerraformResourceType() string { - return "linode_firewall_device" -} - -// GetConnectionDetailsMapping for this Device -func (tr *Device) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Device -func (tr *Device) GetObservation() (map[string]any, error) { - o, err := json.TFParser.Marshal(tr.Status.AtProvider) +// GetInitParameters of this Firewall +func (tr *Firewall) 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(o, &base) + return base, json.TFParser.Unmarshal(p, &base) } -// SetObservation for this Device -func (tr *Device) SetObservation(obs map[string]any) error { - p, err := json.TFParser.Marshal(obs) +// GetInitParameters of this Firewall +func (tr *Firewall) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() if err != nil { - return err + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) } - return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) -} - -// GetID returns ID of underlying Terraform resource of this Device -func (tr *Device) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" + if !shouldMergeInitProvider { + return params, nil } - return *tr.Status.AtProvider.ID -} -// GetParameters of this Device -func (tr *Device) GetParameters() (map[string]any, error) { - p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + initParams, err := tr.GetInitParameters() if err != nil { - return nil, err + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) } - base := map[string]any{} - return base, json.TFParser.Unmarshal(p, &base) -} -// SetParameters for this Device -func (tr *Device) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) + // 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 err + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) + + return params, nil } -// LateInitialize this Device using its observed tfState. +// LateInitialize this Firewall using its observed tfState. // returns True if there are any spec changes for the resource. -func (tr *Device) LateInitialize(attrs []byte) (bool, error) { - params := &DeviceParameters{} +func (tr *Firewall) LateInitialize(attrs []byte) (bool, error) { + params := &FirewallParameters{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } @@ -157,6 +128,6 @@ func (tr *Device) LateInitialize(attrs []byte) (bool, error) { } // GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *Device) GetTerraformSchemaVersion() int { +func (tr *Firewall) GetTerraformSchemaVersion() int { return 0 } diff --git a/apis/firewall/v1alpha1/zz_firewall_types.go b/apis/firewall/v1alpha1/zz_firewall_types.go index ac7e1fd..7bff734 100755 --- a/apis/firewall/v1alpha1/zz_firewall_types.go +++ b/apis/firewall/v1alpha1/zz_firewall_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,9 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type DevicesInitParameters struct { +} + type DevicesObservation struct { // The ID of the underlying entity this device references (i.e. the Linode's ID). @@ -34,6 +41,55 @@ type DevicesObservation struct { type DevicesParameters struct { } +type FirewallInitParameters struct { + + // If true, the Firewall's rules are not enforced (defaults to false). + // If true, the Firewall is inactive. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // A firewall rule that specifies what inbound network traffic is allowed. + Inbound []InboundInitParameters `json:"inbound,omitempty" tf:"inbound,omitempty"` + + // The default behavior for inbound traffic. This setting can be overridden by updating the inbound.action property of the Firewall Rule. (ACCEPT, DROP) + // The default behavior for inbound traffic. This setting can be overridden by updating the inbound.action property for an individual Firewall Rule. + InboundPolicy *string `json:"inboundPolicy,omitempty" tf:"inbound_policy,omitempty"` + + // This Firewall's unique label. + // The label for the Firewall. For display purposes only. If no label is provided, a default will be assigned. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // A list of IDs of Linodes this Firewall should govern network traffic for. + // The IDs of Linodes to apply this firewall to. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + // +listType=set + Linodes []*float64 `json:"linodes,omitempty" tf:"linodes,omitempty"` + + // References to Instance in instance to populate linodes. + // +kubebuilder:validation:Optional + LinodesRefs []v1.Reference `json:"linodesRefs,omitempty" tf:"-"` + + // Selector for a list of Instance in instance to populate linodes. + // +kubebuilder:validation:Optional + LinodesSelector *v1.Selector `json:"linodesSelector,omitempty" tf:"-"` + + // A list of IDs of NodeBalancers this Firewall should govern network traffic for. + // The IDs of NodeBalancers to apply this firewall to. + // +listType=set + Nodebalancers []*float64 `json:"nodebalancers,omitempty" tf:"nodebalancers,omitempty"` + + // A firewall rule that specifies what outbound network traffic is allowed. + Outbound []OutboundInitParameters `json:"outbound,omitempty" tf:"outbound,omitempty"` + + // The default behavior for outbound traffic. This setting can be overridden by updating the outbound.action property for an individual Firewall Rule. (ACCEPT, DROP) + // The default behavior for outbound traffic. This setting can be overridden by updating the outbound.action property for an individual Firewall Rule. + OutboundPolicy *string `json:"outboundPolicy,omitempty" tf:"outbound_policy,omitempty"` + + // A list of tags applied to the Kubernetes cluster. Tags are for organizational purposes only. + // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + type FirewallObservation struct { // When this firewall was created @@ -62,10 +118,12 @@ type FirewallObservation struct { // A list of IDs of Linodes this Firewall should govern network traffic for. // The IDs of Linodes to apply this firewall to. + // +listType=set Linodes []*float64 `json:"linodes,omitempty" tf:"linodes,omitempty"` // A list of IDs of NodeBalancers this Firewall should govern network traffic for. // The IDs of NodeBalancers to apply this firewall to. + // +listType=set Nodebalancers []*float64 `json:"nodebalancers,omitempty" tf:"nodebalancers,omitempty"` // A firewall rule that specifies what outbound network traffic is allowed. @@ -81,6 +139,7 @@ type FirewallObservation struct { // A list of tags applied to the Kubernetes cluster. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` // When this firewall was last updated @@ -112,6 +171,7 @@ type FirewallParameters struct { // The IDs of Linodes to apply this firewall to. // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance // +kubebuilder:validation:Optional + // +listType=set Linodes []*float64 `json:"linodes,omitempty" tf:"linodes,omitempty"` // References to Instance in instance to populate linodes. @@ -125,6 +185,7 @@ type FirewallParameters struct { // A list of IDs of NodeBalancers this Firewall should govern network traffic for. // The IDs of NodeBalancers to apply this firewall to. // +kubebuilder:validation:Optional + // +listType=set Nodebalancers []*float64 `json:"nodebalancers,omitempty" tf:"nodebalancers,omitempty"` // A firewall rule that specifies what outbound network traffic is allowed. @@ -139,9 +200,37 @@ type FirewallParameters struct { // A list of tags applied to the Kubernetes cluster. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. // +kubebuilder:validation:Optional + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` } +type InboundInitParameters struct { + + // Controls whether traffic is accepted or dropped by this rule (ACCEPT, DROP). Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. + // Controls whether traffic is accepted or dropped by this rule. Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. + Action *string `json:"action,omitempty" tf:"action,omitempty"` + + // A list of IPv4 addresses or networks. Must be in IP/mask (CIDR) format. + // A list of CIDR blocks or 0.0.0.0/0 (to allow all) this rule applies to. + IPv4 []*string `json:"ipv4,omitempty" tf:"ipv4,omitempty"` + + // A list of IPv6 addresses or networks. Must be in IP/mask (CIDR) format. + // A list of IPv6 addresses or networks this rule applies to. + IPv6 []*string `json:"ipv6,omitempty" tf:"ipv6,omitempty"` + + // This Firewall's unique label. + // Used to identify this rule. For display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91"). + // A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91"). + Ports *string `json:"ports,omitempty" tf:"ports,omitempty"` + + // The network protocol this rule controls. (TCP, UDP, ICMP) + // The network protocol this rule controls. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` +} + type InboundObservation struct { // Controls whether traffic is accepted or dropped by this rule (ACCEPT, DROP). Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. @@ -173,7 +262,7 @@ type InboundParameters struct { // Controls whether traffic is accepted or dropped by this rule (ACCEPT, DROP). Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. // Controls whether traffic is accepted or dropped by this rule. Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Action *string `json:"action" tf:"action,omitempty"` // A list of IPv4 addresses or networks. Must be in IP/mask (CIDR) format. @@ -188,7 +277,7 @@ type InboundParameters struct { // This Firewall's unique label. // Used to identify this rule. For display purposes only. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Label *string `json:"label" tf:"label,omitempty"` // A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91"). @@ -198,10 +287,37 @@ type InboundParameters struct { // The network protocol this rule controls. (TCP, UDP, ICMP) // The network protocol this rule controls. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Protocol *string `json:"protocol" tf:"protocol,omitempty"` } +type OutboundInitParameters struct { + + // Controls whether traffic is accepted or dropped by this rule (ACCEPT, DROP). Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. + // Controls whether traffic is accepted or dropped by this rule. Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. + Action *string `json:"action,omitempty" tf:"action,omitempty"` + + // A list of IPv4 addresses or networks. Must be in IP/mask (CIDR) format. + // A list of CIDR blocks or 0.0.0.0/0 (to allow all) this rule applies to. + IPv4 []*string `json:"ipv4,omitempty" tf:"ipv4,omitempty"` + + // A list of IPv6 addresses or networks. Must be in IP/mask (CIDR) format. + // A list of IPv6 addresses or networks this rule applies to. + IPv6 []*string `json:"ipv6,omitempty" tf:"ipv6,omitempty"` + + // This Firewall's unique label. + // Used to identify this rule. For display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91"). + // A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91"). + Ports *string `json:"ports,omitempty" tf:"ports,omitempty"` + + // The network protocol this rule controls. (TCP, UDP, ICMP) + // The network protocol this rule controls. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` +} + type OutboundObservation struct { // Controls whether traffic is accepted or dropped by this rule (ACCEPT, DROP). Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. @@ -233,7 +349,7 @@ type OutboundParameters struct { // Controls whether traffic is accepted or dropped by this rule (ACCEPT, DROP). Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. // Controls whether traffic is accepted or dropped by this rule. Overrides the Firewall’s inbound_policy if this is an inbound rule, or the outbound_policy if this is an outbound rule. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Action *string `json:"action" tf:"action,omitempty"` // A list of IPv4 addresses or networks. Must be in IP/mask (CIDR) format. @@ -248,7 +364,7 @@ type OutboundParameters struct { // This Firewall's unique label. // Used to identify this rule. For display purposes only. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Label *string `json:"label" tf:"label,omitempty"` // A string representation of ports and/or port ranges (i.e. "443" or "80-90, 91"). @@ -258,7 +374,7 @@ type OutboundParameters struct { // The network protocol this rule controls. (TCP, UDP, ICMP) // The network protocol this rule controls. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Protocol *string `json:"protocol" tf:"protocol,omitempty"` } @@ -266,6 +382,17 @@ type OutboundParameters struct { type FirewallSpec struct { v1.ResourceSpec `json:",inline"` ForProvider FirewallParameters `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 FirewallInitParameters `json:"initProvider,omitempty"` } // FirewallStatus defines the observed state of Firewall. @@ -275,20 +402,21 @@ type FirewallStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Firewall is the Schema for the Firewalls API. Manages a Linode Firewall. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Firewall struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.inboundPolicy)",message="inboundPolicy is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.outboundPolicy)",message="outboundPolicy is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.inboundPolicy) || (has(self.initProvider) && has(self.initProvider.inboundPolicy))",message="spec.forProvider.inboundPolicy is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.outboundPolicy) || (has(self.initProvider) && has(self.initProvider.outboundPolicy))",message="spec.forProvider.outboundPolicy is a required parameter" Spec FirewallSpec `json:"spec"` Status FirewallStatus `json:"status,omitempty"` } diff --git a/apis/firewall/v1alpha1/zz_generated.conversion_hubs.go b/apis/firewall/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..0e5f7d8 --- /dev/null +++ b/apis/firewall/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Firewall) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Device) Hub() {} diff --git a/apis/firewall/v1alpha1/zz_generated.deepcopy.go b/apis/firewall/v1alpha1/zz_generated.deepcopy.go index 06ccabc..e21e6fe 100644 --- a/apis/firewall/v1alpha1/zz_generated.deepcopy.go +++ b/apis/firewall/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,56 @@ func (in *Device) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceInitParameters) DeepCopyInto(out *DeviceInitParameters) { + *out = *in + if in.EntityID != nil { + in, out := &in.EntityID, &out.EntityID + *out = new(float64) + **out = **in + } + if in.EntityIDRef != nil { + in, out := &in.EntityIDRef, &out.EntityIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.EntityIDSelector != nil { + in, out := &in.EntityIDSelector, &out.EntityIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.EntityType != nil { + in, out := &in.EntityType, &out.EntityType + *out = new(string) + **out = **in + } + if in.FirewallID != nil { + in, out := &in.FirewallID, &out.FirewallID + *out = new(float64) + **out = **in + } + if in.FirewallIDRef != nil { + in, out := &in.FirewallIDRef, &out.FirewallIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FirewallIDSelector != nil { + in, out := &in.FirewallIDSelector, &out.FirewallIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceInitParameters. +func (in *DeviceInitParameters) DeepCopy() *DeviceInitParameters { + if in == nil { + return nil + } + out := new(DeviceInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceList) DeepCopyInto(out *DeviceList) { *out = *in @@ -173,6 +222,7 @@ func (in *DeviceSpec) DeepCopyInto(out *DeviceSpec) { *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 DeviceSpec. @@ -202,6 +252,21 @@ func (in *DeviceStatus) DeepCopy() *DeviceStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesInitParameters) DeepCopyInto(out *DevicesInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesInitParameters. +func (in *DevicesInitParameters) DeepCopy() *DevicesInitParameters { + if in == nil { + return nil + } + out := new(DevicesInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesObservation) DeepCopyInto(out *DevicesObservation) { *out = *in @@ -284,6 +349,100 @@ func (in *Firewall) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallInitParameters) DeepCopyInto(out *FirewallInitParameters) { + *out = *in + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Inbound != nil { + in, out := &in.Inbound, &out.Inbound + *out = make([]InboundInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InboundPolicy != nil { + in, out := &in.InboundPolicy, &out.InboundPolicy + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Linodes != nil { + in, out := &in.Linodes, &out.Linodes + *out = make([]*float64, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(float64) + **out = **in + } + } + } + if in.LinodesRefs != nil { + in, out := &in.LinodesRefs, &out.LinodesRefs + *out = make([]v1.Reference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LinodesSelector != nil { + in, out := &in.LinodesSelector, &out.LinodesSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Nodebalancers != nil { + in, out := &in.Nodebalancers, &out.Nodebalancers + *out = make([]*float64, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(float64) + **out = **in + } + } + } + if in.Outbound != nil { + in, out := &in.Outbound, &out.Outbound + *out = make([]OutboundInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.OutboundPolicy != nil { + in, out := &in.OutboundPolicy, &out.OutboundPolicy + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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 FirewallInitParameters. +func (in *FirewallInitParameters) DeepCopy() *FirewallInitParameters { + if in == nil { + return nil + } + out := new(FirewallInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FirewallList) DeepCopyInto(out *FirewallList) { *out = *in @@ -524,6 +683,7 @@ func (in *FirewallSpec) DeepCopyInto(out *FirewallSpec) { *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 FirewallSpec. @@ -553,6 +713,63 @@ func (in *FirewallStatus) DeepCopy() *FirewallStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InboundInitParameters) DeepCopyInto(out *InboundInitParameters) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(string) + **out = **in + } + if in.IPv4 != nil { + in, out := &in.IPv4, &out.IPv4 + *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.IPv6 != nil { + in, out := &in.IPv6, &out.IPv6 + *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.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InboundInitParameters. +func (in *InboundInitParameters) DeepCopy() *InboundInitParameters { + if in == nil { + return nil + } + out := new(InboundInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InboundObservation) DeepCopyInto(out *InboundObservation) { *out = *in @@ -667,6 +884,63 @@ func (in *InboundParameters) DeepCopy() *InboundParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OutboundInitParameters) DeepCopyInto(out *OutboundInitParameters) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(string) + **out = **in + } + if in.IPv4 != nil { + in, out := &in.IPv4, &out.IPv4 + *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.IPv6 != nil { + in, out := &in.IPv6, &out.IPv6 + *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.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutboundInitParameters. +func (in *OutboundInitParameters) DeepCopy() *OutboundInitParameters { + if in == nil { + return nil + } + out := new(OutboundInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OutboundObservation) DeepCopyInto(out *OutboundObservation) { *out = *in diff --git a/apis/firewall/v1alpha1/zz_generated.managed.go b/apis/firewall/v1alpha1/zz_generated.managed.go index 1bf7b48..e603689 100644 --- a/apis/firewall/v1alpha1/zz_generated.managed.go +++ b/apis/firewall/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Device) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Device. -func (mg *Device) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Device. +func (mg *Device) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Device. @@ -27,14 +27,6 @@ func (mg *Device) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Device. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Device) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Device. func (mg *Device) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Device) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Device. -func (mg *Device) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Device. +func (mg *Device) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Device. @@ -65,14 +57,6 @@ func (mg *Device) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Device. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Device) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Device. func (mg *Device) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -93,9 +77,9 @@ func (mg *Firewall) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Firewall. -func (mg *Firewall) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Firewall. +func (mg *Firewall) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Firewall. @@ -103,14 +87,6 @@ func (mg *Firewall) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Firewall. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Firewall) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Firewall. func (mg *Firewall) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -131,9 +107,9 @@ func (mg *Firewall) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Firewall. -func (mg *Firewall) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Firewall. +func (mg *Firewall) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Firewall. @@ -141,14 +117,6 @@ func (mg *Firewall) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Firewall. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Firewall) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Firewall. func (mg *Firewall) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/firewall/v1alpha1/zz_generated.resolvers.go b/apis/firewall/v1alpha1/zz_generated.resolvers.go index bd16beb..458c795 100644 --- a/apis/firewall/v1alpha1/zz_generated.resolvers.go +++ b/apis/firewall/v1alpha1/zz_generated.resolvers.go @@ -52,6 +52,38 @@ func (mg *Device) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.FirewallID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.FirewallIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.EntityID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.EntityIDRef, + Selector: mg.Spec.InitProvider.EntityIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.EntityID") + } + mg.Spec.InitProvider.EntityID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.EntityIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.FirewallID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.FirewallIDRef, + Selector: mg.Spec.InitProvider.FirewallIDSelector, + To: reference.To{ + List: &DeviceList{}, + Managed: &Device{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.FirewallID") + } + mg.Spec.InitProvider.FirewallID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.FirewallIDRef = rsp.ResolvedReference + return nil } @@ -78,5 +110,21 @@ func (mg *Firewall) ResolveReferences(ctx context.Context, c client.Reader) erro mg.Spec.ForProvider.Linodes = reference.ToFloatPtrValues(mrsp.ResolvedValues) mg.Spec.ForProvider.LinodesRefs = mrsp.ResolvedReferences + mrsp, err = r.ResolveMultiple(ctx, reference.MultiResolutionRequest{ + CurrentValues: reference.FromFloatPtrValues(mg.Spec.InitProvider.Linodes), + Extract: reference.ExternalName(), + References: mg.Spec.InitProvider.LinodesRefs, + Selector: mg.Spec.InitProvider.LinodesSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Linodes") + } + mg.Spec.InitProvider.Linodes = reference.ToFloatPtrValues(mrsp.ResolvedValues) + mg.Spec.InitProvider.LinodesRefs = mrsp.ResolvedReferences + return nil } diff --git a/apis/firewall/v1alpha1/zz_groupversion_info.go b/apis/firewall/v1alpha1/zz_groupversion_info.go index 31ce3ef..dab9901 100755 --- a/apis/firewall/v1alpha1/zz_groupversion_info.go +++ b/apis/firewall/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/generate.go b/apis/generate.go index 7dcd77d..7708947 100644 --- a/apis/generate.go +++ b/apis/generate.go @@ -17,9 +17,11 @@ Copyright 2021 Upbound Inc. //go:generate bash -c "find ../internal/controller -iname 'zz_*' -delete" //go:generate bash -c "find ../internal/controller -type d -empty -delete" //go:generate rm -rf ../examples-generated +//go:generate bash -c "find ../cmd/provider -name 'zz_*' -type f -delete" +//go:generate bash -c "find ../cmd/provider -type d -maxdepth 1 -mindepth 1 -empty -delete" // Generate documentation from Terraform docs. -//go:generate go run github.com/upbound/upjet/cmd/scraper -n ${TERRAFORM_PROVIDER_SOURCE} -r ../.work/${TERRAFORM_PROVIDER_SOURCE}/${TERRAFORM_DOCS_PATH} -o ../config/provider-metadata.yaml +//go:generate go run github.com/crossplane/upjet/cmd/scraper -n ${TERRAFORM_PROVIDER_SOURCE} -r ../.work/${TERRAFORM_PROVIDER_DOWNLOAD_NAME}/${TERRAFORM_DOCS_PATH} -o ../config/provider-metadata.yaml // Run Upjet generator //go:generate go run ../cmd/generator/main.go .. @@ -36,4 +38,6 @@ import ( _ "sigs.k8s.io/controller-tools/cmd/controller-gen" //nolint:typecheck _ "github.com/crossplane/crossplane-tools/cmd/angryjet" //nolint:typecheck + + _ "github.com/crossplane/upjet/cmd/scraper" ) diff --git a/apis/image/v1alpha1/zz_generated.conversion_hubs.go b/apis/image/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..efa6ea8 --- /dev/null +++ b/apis/image/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Image) Hub() {} diff --git a/apis/image/v1alpha1/zz_generated.deepcopy.go b/apis/image/v1alpha1/zz_generated.deepcopy.go index b523b3b..4b43e3b 100644 --- a/apis/image/v1alpha1/zz_generated.deepcopy.go +++ b/apis/image/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,81 @@ func (in *Image) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageInitParameters) DeepCopyInto(out *ImageInitParameters) { + *out = *in + if in.CloudInit != nil { + in, out := &in.CloudInit, &out.CloudInit + *out = new(bool) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.FileHash != nil { + in, out := &in.FileHash, &out.FileHash + *out = new(string) + **out = **in + } + if in.FilePath != nil { + in, out := &in.FilePath, &out.FilePath + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageInitParameters. +func (in *ImageInitParameters) DeepCopy() *ImageInitParameters { + if in == nil { + return nil + } + out := new(ImageInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImageList) DeepCopyInto(out *ImageList) { *out = *in @@ -269,6 +343,7 @@ func (in *ImageSpec) DeepCopyInto(out *ImageSpec) { *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 ImageSpec. diff --git a/apis/image/v1alpha1/zz_generated.managed.go b/apis/image/v1alpha1/zz_generated.managed.go index 0acbed6..b7b1920 100644 --- a/apis/image/v1alpha1/zz_generated.managed.go +++ b/apis/image/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Image) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Image. -func (mg *Image) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Image. +func (mg *Image) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Image. @@ -27,14 +27,6 @@ func (mg *Image) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Image. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Image) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Image. func (mg *Image) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Image) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Image. -func (mg *Image) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Image. +func (mg *Image) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Image. @@ -65,14 +57,6 @@ func (mg *Image) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Image. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Image) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Image. func (mg *Image) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/image/v1alpha1/zz_generated.resolvers.go b/apis/image/v1alpha1/zz_generated.resolvers.go index 33d08cf..3703315 100644 --- a/apis/image/v1alpha1/zz_generated.resolvers.go +++ b/apis/image/v1alpha1/zz_generated.resolvers.go @@ -52,5 +52,37 @@ func (mg *Image) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.DiskIDRef, + Selector: mg.Spec.InitProvider.DiskIDSelector, + To: reference.To{ + List: &v1alpha1.DiskList{}, + Managed: &v1alpha1.Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.DiskID") + } + mg.Spec.InitProvider.DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.DiskIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/image/v1alpha1/zz_groupversion_info.go b/apis/image/v1alpha1/zz_groupversion_info.go index 51e04ae..5fe174a 100755 --- a/apis/image/v1alpha1/zz_groupversion_info.go +++ b/apis/image/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/image/v1alpha1/zz_generated_terraformed.go b/apis/image/v1alpha1/zz_image_terraformed.go similarity index 60% rename from apis/image/v1alpha1/zz_generated_terraformed.go rename to apis/image/v1alpha1/zz_image_terraformed.go index de2db25..8ee1402 100755 --- a/apis/image/v1alpha1/zz_generated_terraformed.go +++ b/apis/image/v1alpha1/zz_image_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this Image @@ -69,6 +74,46 @@ func (tr *Image) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this Image +func (tr *Image) 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 Image +func (tr *Image) 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 Image using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *Image) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/image/v1alpha1/zz_image_types.go b/apis/image/v1alpha1/zz_image_types.go index d26f5d2..e39fc90 100755 --- a/apis/image/v1alpha1/zz_image_types.go +++ b/apis/image/v1alpha1/zz_image_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,58 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type ImageInitParameters struct { + + // Whether this image supports cloud-init. + CloudInit *bool `json:"cloudInit,omitempty" tf:"cloud_init,omitempty"` + + // A detailed description of this Image. + // A detailed description of this Image. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The ID of the Linode Disk that this Image will be created from. + // The ID of the Linode Disk that this Image will be created from. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk in instance to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk in instance to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The MD5 hash of the file to be uploaded. This is used to trigger file updates. + // The MD5 hash of the image file. + FileHash *string `json:"fileHash,omitempty" tf:"file_hash,omitempty"` + + // The path of the image file to be uploaded. + // The name of the file to upload to this image. + FilePath *string `json:"filePath,omitempty" tf:"file_path,omitempty"` + + // A short description of the Image. Labels cannot contain special characters. + // A short description of the Image. Labels cannot contain special characters. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The ID of the Linode that this Image will be created from. + // The ID of the Linode that this Image will be created from. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // The region of the image. See all regions here. + // The region to upload to. + Region *string `json:"region,omitempty" tf:"region,omitempty"` +} + type ImageObservation struct { // The capabilities of this Image. @@ -152,6 +208,17 @@ type ImageParameters struct { type ImageSpec struct { v1.ResourceSpec `json:",inline"` ForProvider ImageParameters `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 ImageInitParameters `json:"initProvider,omitempty"` } // ImageStatus defines the observed state of Image. @@ -161,18 +228,19 @@ type ImageStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Image is the Schema for the Images API. Manages a Linode Image. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Image struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" Spec ImageSpec `json:"spec"` Status ImageStatus `json:"status,omitempty"` } diff --git a/apis/instance/v1alpha1/zz_config_terraformed.go b/apis/instance/v1alpha1/zz_config_terraformed.go new file mode 100755 index 0000000..8c0e2c4 --- /dev/null +++ b/apis/instance/v1alpha1/zz_config_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Config +func (mg *Config) GetTerraformResourceType() string { + return "linode_instance_config" +} + +// GetConnectionDetailsMapping for this Config +func (tr *Config) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config +func (tr *Config) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Config) LateInitialize(attrs []byte) (bool, error) { + params := &ConfigParameters_2{} + 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 *Config) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/instance/v1alpha1/zz_config_types.go b/apis/instance/v1alpha1/zz_config_types.go index b2a746c..d1f8fdf 100755 --- a/apis/instance/v1alpha1/zz_config_types.go +++ b/apis/instance/v1alpha1/zz_config_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,34 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type ConfigDevicesInitParameters struct { + + // The SDA-SDH slots, represent the Linux block device nodes for the first 8 disks attached to the Linode. Each device must be suplied sequentially. The device can be either a Disk or a Volume identified by disk_id or volume_id. Only one disk identifier is permitted per slot. Devices mapped from sde through sdh are unavailable in "fullvirt" virt_mode. + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sda []DevicesSdaInitParameters `json:"sda,omitempty" tf:"sda,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdb []DevicesSdbInitParameters `json:"sdb,omitempty" tf:"sdb,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdc []DevicesSdcInitParameters `json:"sdc,omitempty" tf:"sdc,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdd []DevicesSddInitParameters `json:"sdd,omitempty" tf:"sdd,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sde []DevicesSdeInitParameters `json:"sde,omitempty" tf:"sde,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdf []DevicesSdfInitParameters `json:"sdf,omitempty" tf:"sdf,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdg []DevicesSdgInitParameters `json:"sdg,omitempty" tf:"sdg,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdh []DevicesSdhInitParameters `json:"sdh,omitempty" tf:"sdh,omitempty"` +} + type ConfigDevicesObservation struct { // The SDA-SDH slots, represent the Linux block device nodes for the first 8 disks attached to the Linode. Each device must be suplied sequentially. The device can be either a Disk or a Volume identified by disk_id or volume_id. Only one disk identifier is permitted per slot. Devices mapped from sde through sdh are unavailable in "fullvirt" virt_mode. @@ -77,6 +109,29 @@ type ConfigDevicesParameters struct { Sdh []DevicesSdhParameters `json:"sdh,omitempty" tf:"sdh,omitempty"` } +type ConfigHelpersInitParameters struct { + + // Populates the /dev directory early during boot without udev. (default true) + // Populates the /dev directory early during boot without udev. + DevtmpfsAutomount *bool `json:"devtmpfsAutomount,omitempty" tf:"devtmpfs_automount,omitempty"` + + // Helps maintain correct inittab/upstart console device. (default true) + // Helps maintain correct inittab/upstart console device. + Distro *bool `json:"distro,omitempty" tf:"distro,omitempty"` + + // Creates a modules dependency file for the Kernel you run. (default true) + // Creates a modules dependency file for the Kernel you run. + ModulesDep *bool `json:"modulesDep,omitempty" tf:"modules_dep,omitempty"` + + // Automatically configures static networking. (default true) + // Automatically configures static networking. + Network *bool `json:"network,omitempty" tf:"network,omitempty"` + + // Disables updatedb cron job to avoid disk thrashing. (default true) + // Disables updatedb cron job to avoid disk thrashing. + UpdatedbDisabled *bool `json:"updatedbDisabled,omitempty" tf:"updatedb_disabled,omitempty"` +} + type ConfigHelpersObservation struct { // Populates the /dev directory early during boot without udev. (default true) @@ -128,6 +183,81 @@ type ConfigHelpersParameters struct { UpdatedbDisabled *bool `json:"updatedbDisabled,omitempty" tf:"updatedb_disabled,omitempty"` } +type ConfigInitParameters_2 struct { + + // If true, the Linode will be booted into this config. If another config is booted, the Linode will be rebooted into this config. If false, the Linode will be shutdown only if it is currently booted into this config. If undefined, the config will alter the boot status of the Linode. + // If true, the Linode will be booted to running state. If false, the Linode will be shutdown. If undefined, no action will be taken. + Booted *bool `json:"booted,omitempty" tf:"booted,omitempty"` + + // Optional field for arbitrary User comments on this Config. + // Optional field for arbitrary User comments on this Config. + Comments *string `json:"comments,omitempty" tf:"comments,omitempty"` + + // Blocks for device disks in a Linode's configuration profile. + Device []DeviceInitParameters `json:"device,omitempty" tf:"device,omitempty"` + + // A dictionary of device disks to use as a device map in a Linode's configuration profile. + Devices []ConfigDevicesInitParameters `json:"devices,omitempty" tf:"devices,omitempty"` + + // Helpers enabled when booting to this Linode Config. + Helpers []ConfigHelpersInitParameters `json:"helpers,omitempty" tf:"helpers,omitempty"` + + // An array of Network Interfaces to add to this Linode's Configuration Profile. + Interface []ConfigInterfaceInitParameters `json:"interface,omitempty" tf:"interface,omitempty"` + + // A Kernel ID to boot a Linode with. (default linode/latest-64bit) + // A Kernel ID to boot a Linode with. Defaults to “linode/latest-64bit”. + Kernel *string `json:"kernel,omitempty" tf:"kernel,omitempty"` + + // The Config’s label for display purposes only. + // The Config's label for display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The ID of the Linode to create this configuration profile under. + // The ID of the Linode to create this configuration profile under. + // +crossplane:generate:reference:type=Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // The memory limit of the Config. Defaults to the total ram of the Linode. + // The memory limit of the Linode. + MemoryLimit *float64 `json:"memoryLimit,omitempty" tf:"memory_limit,omitempty"` + + // The root device to boot. (default /dev/sda) + // The root device to boot. If no value or an invalid value is provided, root device will default to /dev/sda. If the device specified at the root device location is not mounted, the Linode will not boot until a device is mounted. + RootDevice *string `json:"rootDevice,omitempty" tf:"root_device,omitempty"` + + // Defines the state of your Linode after booting. (default, single, binbash) + // Defines the state of your Linode after booting. + RunLevel *string `json:"runLevel,omitempty" tf:"run_level,omitempty"` + + // Controls the virtualization mode. (paravirt, fullvirt) + // Controls the virtualization mode. + VirtMode *string `json:"virtMode,omitempty" tf:"virt_mode,omitempty"` +} + +type ConfigInterfaceInitParameters struct { + + // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. (e.g. 10.0.0.1/24) + // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. + IpamAddress *string `json:"ipamAddress,omitempty" tf:"ipam_address,omitempty"` + + // The Config’s label for display purposes only. + // The name of this interface. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The type of interface. (public, vlan) + // The type of interface. + Purpose *string `json:"purpose,omitempty" tf:"purpose,omitempty"` +} + type ConfigInterfaceObservation struct { // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. (e.g. 10.0.0.1/24) @@ -157,7 +287,7 @@ type ConfigInterfaceParameters struct { // The type of interface. (public, vlan) // The type of interface. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Purpose *string `json:"purpose" tf:"purpose,omitempty"` } @@ -287,6 +417,20 @@ type ConfigParameters_2 struct { VirtMode *string `json:"virtMode,omitempty" tf:"virt_mode,omitempty"` } +type DeviceInitParameters struct { + + // The Disk ID to map to this disk slot + DeviceName *string `json:"deviceName,omitempty" tf:"device_name,omitempty"` + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DeviceObservation struct { // The Disk ID to map to this disk slot @@ -304,7 +448,7 @@ type DeviceObservation struct { type DeviceParameters struct { // The Disk ID to map to this disk slot - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional DeviceName *string `json:"deviceName" tf:"device_name,omitempty"` // The Disk ID to map to this device slot @@ -318,6 +462,26 @@ type DeviceParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdaInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdaObservation struct { // The Disk ID to map to this device slot @@ -351,6 +515,26 @@ type DevicesSdaParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdbInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdbObservation struct { // The Disk ID to map to this device slot @@ -384,6 +568,26 @@ type DevicesSdbParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdcInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdcObservation struct { // The Disk ID to map to this device slot @@ -417,6 +621,26 @@ type DevicesSdcParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSddInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSddObservation struct { // The Disk ID to map to this device slot @@ -450,6 +674,26 @@ type DevicesSddParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdeInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdeObservation struct { // The Disk ID to map to this device slot @@ -483,6 +727,26 @@ type DevicesSdeParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdfInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdfObservation struct { // The Disk ID to map to this device slot @@ -516,6 +780,26 @@ type DevicesSdfParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdgInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdgObservation struct { // The Disk ID to map to this device slot @@ -549,6 +833,26 @@ type DevicesSdgParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type DevicesSdhInitParameters struct { + + // The Disk ID to map to this device slot + // The Disk ID to map to this disk slot + // +crossplane:generate:reference:type=Disk + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // Reference to a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDRef *v1.Reference `json:"diskIdRef,omitempty" tf:"-"` + + // Selector for a Disk to populate diskId. + // +kubebuilder:validation:Optional + DiskIDSelector *v1.Selector `json:"diskIdSelector,omitempty" tf:"-"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type DevicesSdhObservation struct { // The Disk ID to map to this device slot @@ -586,6 +890,17 @@ type DevicesSdhParameters struct { type ConfigSpec struct { v1.ResourceSpec `json:",inline"` ForProvider ConfigParameters_2 `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 ConfigInitParameters_2 `json:"initProvider,omitempty"` } // ConfigStatus defines the observed state of Config. @@ -595,18 +910,19 @@ type ConfigStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Config is the Schema for the Configs API. Manages a Linode Instance Config. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Config struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" Spec ConfigSpec `json:"spec"` Status ConfigStatus `json:"status,omitempty"` } diff --git a/apis/instance/v1alpha1/zz_disk_terraformed.go b/apis/instance/v1alpha1/zz_disk_terraformed.go new file mode 100755 index 0000000..f91ec04 --- /dev/null +++ b/apis/instance/v1alpha1/zz_disk_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Disk +func (mg *Disk) GetTerraformResourceType() string { + return "linode_instance_disk" +} + +// GetConnectionDetailsMapping for this Disk +func (tr *Disk) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"root_pass": "spec.forProvider.rootPassSecretRef", "stackscript_data": "spec.forProvider.stackscriptDataSecretRef"} +} + +// GetObservation of this Disk +func (tr *Disk) 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 Disk +func (tr *Disk) 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 Disk +func (tr *Disk) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Disk +func (tr *Disk) 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 Disk +func (tr *Disk) 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 Disk +func (tr *Disk) 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 Disk +func (tr *Disk) 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 Disk using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Disk) LateInitialize(attrs []byte) (bool, error) { + params := &DiskParameters_2{} + 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 *Disk) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/instance/v1alpha1/zz_disk_types.go b/apis/instance/v1alpha1/zz_disk_types.go index 14c2cbc..6d21e0f 100755 --- a/apis/instance/v1alpha1/zz_disk_types.go +++ b/apis/instance/v1alpha1/zz_disk_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,14 +17,71 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type DiskInitParameters_2 struct { + + // A list of public SSH keys that will be automatically appended to the root user’s ~/.ssh/authorized_keys file when deploying from an Image. + // A list of public SSH keys that will be automatically appended to the root user’s ~/.ssh/authorized_keys file when deploying from an Image. + // +listType=set + AuthorizedKeys []*string `json:"authorizedKeys,omitempty" tf:"authorized_keys,omitempty"` + + // A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the + // A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the root users ~/.ssh/authorized_keys file automatically when deploying from an Image. + // +listType=set + AuthorizedUsers []*string `json:"authorizedUsers,omitempty" tf:"authorized_users,omitempty"` + + // The filesystem of this disk. (raw, swap, ext3, ext4, initrd) + // The filesystem of this disk. + Filesystem *string `json:"filesystem,omitempty" tf:"filesystem,omitempty"` + + // An Image ID to deploy the Linode Disk from. + // An Image ID to deploy the Linode Disk from. + Image *string `json:"image,omitempty" tf:"image,omitempty"` + + // The Disk's label for display purposes only. + // The Disk’s label is for display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The ID of the Linode to create this Disk under. + // The ID of the Linode to assign this disk to. + // +crossplane:generate:reference:type=Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // The size of the Disk in MB. NOTE: Resizing a disk will trigger a Linode reboot. + // The size of the Disk in MB. + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` + + // A StackScript ID that will cause the referenced StackScript to be run during deployment of this Disk. + // A StackScript ID that will cause the referenced StackScript to be run during deployment of this Linode. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/stackscript/v1alpha1.Stackscript + StackscriptID *float64 `json:"stackscriptId,omitempty" tf:"stackscript_id,omitempty"` + + // Reference to a Stackscript in stackscript to populate stackscriptId. + // +kubebuilder:validation:Optional + StackscriptIDRef *v1.Reference `json:"stackscriptIdRef,omitempty" tf:"-"` + + // Selector for a Stackscript in stackscript to populate stackscriptId. + // +kubebuilder:validation:Optional + StackscriptIDSelector *v1.Selector `json:"stackscriptIdSelector,omitempty" tf:"-"` +} + type DiskObservation_2 struct { // A list of public SSH keys that will be automatically appended to the root user’s ~/.ssh/authorized_keys file when deploying from an Image. // A list of public SSH keys that will be automatically appended to the root user’s ~/.ssh/authorized_keys file when deploying from an Image. + // +listType=set AuthorizedKeys []*string `json:"authorizedKeys,omitempty" tf:"authorized_keys,omitempty"` // A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the // A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the root users ~/.ssh/authorized_keys file automatically when deploying from an Image. + // +listType=set AuthorizedUsers []*string `json:"authorizedUsers,omitempty" tf:"authorized_users,omitempty"` // When this disk was created. @@ -67,11 +128,13 @@ type DiskParameters_2 struct { // A list of public SSH keys that will be automatically appended to the root user’s ~/.ssh/authorized_keys file when deploying from an Image. // A list of public SSH keys that will be automatically appended to the root user’s ~/.ssh/authorized_keys file when deploying from an Image. // +kubebuilder:validation:Optional + // +listType=set AuthorizedKeys []*string `json:"authorizedKeys,omitempty" tf:"authorized_keys,omitempty"` // A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the // A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the root users ~/.ssh/authorized_keys file automatically when deploying from an Image. // +kubebuilder:validation:Optional + // +listType=set AuthorizedUsers []*string `json:"authorizedUsers,omitempty" tf:"authorized_users,omitempty"` // The filesystem of this disk. (raw, swap, ext3, ext4, initrd) @@ -137,6 +200,17 @@ type DiskParameters_2 struct { type DiskSpec struct { v1.ResourceSpec `json:",inline"` ForProvider DiskParameters_2 `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 DiskInitParameters_2 `json:"initProvider,omitempty"` } // DiskStatus defines the observed state of Disk. @@ -146,19 +220,20 @@ type DiskStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Disk is the Schema for the Disks API. Manages a Linode Instance Disk. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Disk struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size)",message="size is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.size) || (has(self.initProvider) && has(self.initProvider.size))",message="spec.forProvider.size is a required parameter" Spec DiskSpec `json:"spec"` Status DiskStatus `json:"status,omitempty"` } diff --git a/apis/instance/v1alpha1/zz_generated.conversion_hubs.go b/apis/instance/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..eae72c5 --- /dev/null +++ b/apis/instance/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Instance) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Config) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Disk) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *IP) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *SharedIPs) Hub() {} diff --git a/apis/instance/v1alpha1/zz_generated.deepcopy.go b/apis/instance/v1alpha1/zz_generated.deepcopy.go index c05501c..a00a9d4 100644 --- a/apis/instance/v1alpha1/zz_generated.deepcopy.go +++ b/apis/instance/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -14,6 +13,46 @@ 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 *AlertsInitParameters) DeepCopyInto(out *AlertsInitParameters) { + *out = *in + if in.CPU != nil { + in, out := &in.CPU, &out.CPU + *out = new(float64) + **out = **in + } + if in.Io != nil { + in, out := &in.Io, &out.Io + *out = new(float64) + **out = **in + } + if in.NetworkIn != nil { + in, out := &in.NetworkIn, &out.NetworkIn + *out = new(float64) + **out = **in + } + if in.NetworkOut != nil { + in, out := &in.NetworkOut, &out.NetworkOut + *out = new(float64) + **out = **in + } + if in.TransferQuota != nil { + in, out := &in.TransferQuota, &out.TransferQuota + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertsInitParameters. +func (in *AlertsInitParameters) DeepCopy() *AlertsInitParameters { + if in == nil { + return nil + } + out := new(AlertsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AlertsObservation) DeepCopyInto(out *AlertsObservation) { *out = *in @@ -94,6 +133,21 @@ func (in *AlertsParameters) DeepCopy() *AlertsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupsInitParameters) DeepCopyInto(out *BackupsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupsInitParameters. +func (in *BackupsInitParameters) DeepCopy() *BackupsInitParameters { + if in == nil { + return nil + } + out := new(BackupsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BackupsObservation) DeepCopyInto(out *BackupsObservation) { *out = *in @@ -168,6 +222,77 @@ func (in *Config) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigDevicesInitParameters) DeepCopyInto(out *ConfigDevicesInitParameters) { + *out = *in + if in.Sda != nil { + in, out := &in.Sda, &out.Sda + *out = make([]DevicesSdaInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdb != nil { + in, out := &in.Sdb, &out.Sdb + *out = make([]DevicesSdbInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdc != nil { + in, out := &in.Sdc, &out.Sdc + *out = make([]DevicesSdcInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdd != nil { + in, out := &in.Sdd, &out.Sdd + *out = make([]DevicesSddInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sde != nil { + in, out := &in.Sde, &out.Sde + *out = make([]DevicesSdeInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdf != nil { + in, out := &in.Sdf, &out.Sdf + *out = make([]DevicesSdfInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdg != nil { + in, out := &in.Sdg, &out.Sdg + *out = make([]DevicesSdgInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdh != nil { + in, out := &in.Sdh, &out.Sdh + *out = make([]DevicesSdhInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigDevicesInitParameters. +func (in *ConfigDevicesInitParameters) DeepCopy() *ConfigDevicesInitParameters { + if in == nil { + return nil + } + out := new(ConfigDevicesInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConfigDevicesObservation) DeepCopyInto(out *ConfigDevicesObservation) { *out = *in @@ -311,7 +436,7 @@ func (in *ConfigDevicesParameters) DeepCopy() *ConfigDevicesParameters { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigHelpersObservation) DeepCopyInto(out *ConfigHelpersObservation) { +func (in *ConfigHelpersInitParameters) DeepCopyInto(out *ConfigHelpersInitParameters) { *out = *in if in.DevtmpfsAutomount != nil { in, out := &in.DevtmpfsAutomount, &out.DevtmpfsAutomount @@ -340,18 +465,18 @@ func (in *ConfigHelpersObservation) DeepCopyInto(out *ConfigHelpersObservation) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigHelpersObservation. -func (in *ConfigHelpersObservation) DeepCopy() *ConfigHelpersObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigHelpersInitParameters. +func (in *ConfigHelpersInitParameters) DeepCopy() *ConfigHelpersInitParameters { if in == nil { return nil } - out := new(ConfigHelpersObservation) + out := new(ConfigHelpersInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigHelpersParameters) DeepCopyInto(out *ConfigHelpersParameters) { +func (in *ConfigHelpersObservation) DeepCopyInto(out *ConfigHelpersObservation) { *out = *in if in.DevtmpfsAutomount != nil { in, out := &in.DevtmpfsAutomount, &out.DevtmpfsAutomount @@ -380,110 +505,58 @@ func (in *ConfigHelpersParameters) DeepCopyInto(out *ConfigHelpersParameters) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigHelpersParameters. -func (in *ConfigHelpersParameters) DeepCopy() *ConfigHelpersParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigHelpersObservation. +func (in *ConfigHelpersObservation) DeepCopy() *ConfigHelpersObservation { if in == nil { return nil } - out := new(ConfigHelpersParameters) + out := new(ConfigHelpersObservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigInterfaceObservation) DeepCopyInto(out *ConfigInterfaceObservation) { +func (in *ConfigHelpersParameters) DeepCopyInto(out *ConfigHelpersParameters) { *out = *in - if in.IpamAddress != nil { - in, out := &in.IpamAddress, &out.IpamAddress - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) + if in.DevtmpfsAutomount != nil { + in, out := &in.DevtmpfsAutomount, &out.DevtmpfsAutomount + *out = new(bool) **out = **in } - if in.Purpose != nil { - in, out := &in.Purpose, &out.Purpose - *out = new(string) + if in.Distro != nil { + in, out := &in.Distro, &out.Distro + *out = new(bool) **out = **in } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInterfaceObservation. -func (in *ConfigInterfaceObservation) DeepCopy() *ConfigInterfaceObservation { - if in == nil { - return nil - } - out := new(ConfigInterfaceObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigInterfaceParameters) DeepCopyInto(out *ConfigInterfaceParameters) { - *out = *in - if in.IpamAddress != nil { - in, out := &in.IpamAddress, &out.IpamAddress - *out = new(string) + if in.ModulesDep != nil { + in, out := &in.ModulesDep, &out.ModulesDep + *out = new(bool) **out = **in } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(bool) **out = **in } - if in.Purpose != nil { - in, out := &in.Purpose, &out.Purpose - *out = new(string) + if in.UpdatedbDisabled != nil { + in, out := &in.UpdatedbDisabled, &out.UpdatedbDisabled + *out = new(bool) **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInterfaceParameters. -func (in *ConfigInterfaceParameters) DeepCopy() *ConfigInterfaceParameters { - if in == nil { - return nil - } - out := new(ConfigInterfaceParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigList) DeepCopyInto(out *ConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Config, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigList. -func (in *ConfigList) DeepCopy() *ConfigList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigHelpersParameters. +func (in *ConfigHelpersParameters) DeepCopy() *ConfigHelpersParameters { if in == nil { return nil } - out := new(ConfigList) + out := new(ConfigHelpersParameters) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ConfigList) 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 *ConfigObservation) DeepCopyInto(out *ConfigObservation) { +func (in *ConfigInitParameters) DeepCopyInto(out *ConfigInitParameters) { *out = *in if in.Comments != nil { in, out := &in.Comments, &out.Comments @@ -492,21 +565,21 @@ func (in *ConfigObservation) DeepCopyInto(out *ConfigObservation) { } if in.Devices != nil { in, out := &in.Devices, &out.Devices - *out = make([]DevicesObservation, len(*in)) + *out = make([]DevicesInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Helpers != nil { in, out := &in.Helpers, &out.Helpers - *out = make([]HelpersObservation, len(*in)) + *out = make([]HelpersInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Interface != nil { in, out := &in.Interface, &out.Interface - *out = make([]InterfaceObservation, len(*in)) + *out = make([]InterfaceInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -543,18 +616,18 @@ func (in *ConfigObservation) DeepCopyInto(out *ConfigObservation) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigObservation. -func (in *ConfigObservation) DeepCopy() *ConfigObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInitParameters. +func (in *ConfigInitParameters) DeepCopy() *ConfigInitParameters { if in == nil { return nil } - out := new(ConfigObservation) + out := new(ConfigInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigObservation_2) DeepCopyInto(out *ConfigObservation_2) { +func (in *ConfigInitParameters_2) DeepCopyInto(out *ConfigInitParameters_2) { *out = *in if in.Booted != nil { in, out := &in.Booted, &out.Booted @@ -568,33 +641,28 @@ func (in *ConfigObservation_2) DeepCopyInto(out *ConfigObservation_2) { } if in.Device != nil { in, out := &in.Device, &out.Device - *out = make([]DeviceObservation, len(*in)) + *out = make([]DeviceInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Devices != nil { in, out := &in.Devices, &out.Devices - *out = make([]ConfigDevicesObservation, len(*in)) + *out = make([]ConfigDevicesInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Helpers != nil { in, out := &in.Helpers, &out.Helpers - *out = make([]ConfigHelpersObservation, len(*in)) + *out = make([]ConfigHelpersInitParameters, 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.Interface != nil { in, out := &in.Interface, &out.Interface - *out = make([]ConfigInterfaceObservation, len(*in)) + *out = make([]ConfigInterfaceInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -614,6 +682,16 @@ func (in *ConfigObservation_2) DeepCopyInto(out *ConfigObservation_2) { *out = new(float64) **out = **in } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.MemoryLimit != nil { in, out := &in.MemoryLimit, &out.MemoryLimit *out = new(float64) @@ -636,34 +714,320 @@ func (in *ConfigObservation_2) DeepCopyInto(out *ConfigObservation_2) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigObservation_2. -func (in *ConfigObservation_2) DeepCopy() *ConfigObservation_2 { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInitParameters_2. +func (in *ConfigInitParameters_2) DeepCopy() *ConfigInitParameters_2 { if in == nil { return nil } - out := new(ConfigObservation_2) + out := new(ConfigInitParameters_2) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigParameters) DeepCopyInto(out *ConfigParameters) { +func (in *ConfigInterfaceInitParameters) DeepCopyInto(out *ConfigInterfaceInitParameters) { *out = *in - if in.Comments != nil { - in, out := &in.Comments, &out.Comments + if in.IpamAddress != nil { + in, out := &in.IpamAddress, &out.IpamAddress *out = new(string) **out = **in } - if in.Devices != nil { - in, out := &in.Devices, &out.Devices - *out = make([]DevicesParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in } - if in.Helpers != nil { - in, out := &in.Helpers, &out.Helpers - *out = make([]HelpersParameters, len(*in)) + if in.Purpose != nil { + in, out := &in.Purpose, &out.Purpose + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInterfaceInitParameters. +func (in *ConfigInterfaceInitParameters) DeepCopy() *ConfigInterfaceInitParameters { + if in == nil { + return nil + } + out := new(ConfigInterfaceInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigInterfaceObservation) DeepCopyInto(out *ConfigInterfaceObservation) { + *out = *in + if in.IpamAddress != nil { + in, out := &in.IpamAddress, &out.IpamAddress + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Purpose != nil { + in, out := &in.Purpose, &out.Purpose + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInterfaceObservation. +func (in *ConfigInterfaceObservation) DeepCopy() *ConfigInterfaceObservation { + if in == nil { + return nil + } + out := new(ConfigInterfaceObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigInterfaceParameters) DeepCopyInto(out *ConfigInterfaceParameters) { + *out = *in + if in.IpamAddress != nil { + in, out := &in.IpamAddress, &out.IpamAddress + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Purpose != nil { + in, out := &in.Purpose, &out.Purpose + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInterfaceParameters. +func (in *ConfigInterfaceParameters) DeepCopy() *ConfigInterfaceParameters { + if in == nil { + return nil + } + out := new(ConfigInterfaceParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigList) DeepCopyInto(out *ConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Config, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigList. +func (in *ConfigList) DeepCopy() *ConfigList { + if in == nil { + return nil + } + out := new(ConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConfigList) 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 *ConfigObservation) DeepCopyInto(out *ConfigObservation) { + *out = *in + if in.Comments != nil { + in, out := &in.Comments, &out.Comments + *out = new(string) + **out = **in + } + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]DevicesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Helpers != nil { + in, out := &in.Helpers, &out.Helpers + *out = make([]HelpersObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Interface != nil { + in, out := &in.Interface, &out.Interface + *out = make([]InterfaceObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Kernel != nil { + in, out := &in.Kernel, &out.Kernel + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MemoryLimit != nil { + in, out := &in.MemoryLimit, &out.MemoryLimit + *out = new(float64) + **out = **in + } + if in.RootDevice != nil { + in, out := &in.RootDevice, &out.RootDevice + *out = new(string) + **out = **in + } + if in.RunLevel != nil { + in, out := &in.RunLevel, &out.RunLevel + *out = new(string) + **out = **in + } + if in.VirtMode != nil { + in, out := &in.VirtMode, &out.VirtMode + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigObservation. +func (in *ConfigObservation) DeepCopy() *ConfigObservation { + if in == nil { + return nil + } + out := new(ConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigObservation_2) DeepCopyInto(out *ConfigObservation_2) { + *out = *in + if in.Booted != nil { + in, out := &in.Booted, &out.Booted + *out = new(bool) + **out = **in + } + if in.Comments != nil { + in, out := &in.Comments, &out.Comments + *out = new(string) + **out = **in + } + if in.Device != nil { + in, out := &in.Device, &out.Device + *out = make([]DeviceObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]ConfigDevicesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Helpers != nil { + in, out := &in.Helpers, &out.Helpers + *out = make([]ConfigHelpersObservation, 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.Interface != nil { + in, out := &in.Interface, &out.Interface + *out = make([]ConfigInterfaceObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Kernel != nil { + in, out := &in.Kernel, &out.Kernel + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.MemoryLimit != nil { + in, out := &in.MemoryLimit, &out.MemoryLimit + *out = new(float64) + **out = **in + } + if in.RootDevice != nil { + in, out := &in.RootDevice, &out.RootDevice + *out = new(string) + **out = **in + } + if in.RunLevel != nil { + in, out := &in.RunLevel, &out.RunLevel + *out = new(string) + **out = **in + } + if in.VirtMode != nil { + in, out := &in.VirtMode, &out.VirtMode + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigObservation_2. +func (in *ConfigObservation_2) DeepCopy() *ConfigObservation_2 { + if in == nil { + return nil + } + out := new(ConfigObservation_2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigParameters) DeepCopyInto(out *ConfigParameters) { + *out = *in + if in.Comments != nil { + in, out := &in.Comments, &out.Comments + *out = new(string) + **out = **in + } + if in.Devices != nil { + in, out := &in.Devices, &out.Devices + *out = make([]DevicesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Helpers != nil { + in, out := &in.Helpers, &out.Helpers + *out = make([]HelpersParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -820,6 +1184,7 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) { *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 ConfigSpec. @@ -849,6 +1214,36 @@ func (in *ConfigStatus) DeepCopy() *ConfigStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceInitParameters) DeepCopyInto(out *DeviceInitParameters) { + *out = *in + if in.DeviceName != nil { + in, out := &in.DeviceName, &out.DeviceName + *out = new(string) + **out = **in + } + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceInitParameters. +func (in *DeviceInitParameters) DeepCopy() *DeviceInitParameters { + if in == nil { + return nil + } + out := new(DeviceInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceObservation) DeepCopyInto(out *DeviceObservation) { *out = *in @@ -899,12 +1294,83 @@ func (in *DeviceParameters) DeepCopyInto(out *DeviceParameters) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceParameters. -func (in *DeviceParameters) DeepCopy() *DeviceParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceParameters. +func (in *DeviceParameters) DeepCopy() *DeviceParameters { + if in == nil { + return nil + } + out := new(DeviceParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesInitParameters) DeepCopyInto(out *DevicesInitParameters) { + *out = *in + if in.Sda != nil { + in, out := &in.Sda, &out.Sda + *out = make([]SdaInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdb != nil { + in, out := &in.Sdb, &out.Sdb + *out = make([]SdbInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdc != nil { + in, out := &in.Sdc, &out.Sdc + *out = make([]SdcInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdd != nil { + in, out := &in.Sdd, &out.Sdd + *out = make([]SddInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sde != nil { + in, out := &in.Sde, &out.Sde + *out = make([]SdeInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdf != nil { + in, out := &in.Sdf, &out.Sdf + *out = make([]SdfInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdg != nil { + in, out := &in.Sdg, &out.Sdg + *out = make([]SdgInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Sdh != nil { + in, out := &in.Sdh, &out.Sdh + *out = make([]SdhInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesInitParameters. +func (in *DevicesInitParameters) DeepCopy() *DevicesInitParameters { if in == nil { return nil } - out := new(DeviceParameters) + out := new(DevicesInitParameters) in.DeepCopyInto(out) return out } @@ -1051,6 +1517,41 @@ func (in *DevicesParameters) DeepCopy() *DevicesParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdaInitParameters) DeepCopyInto(out *DevicesSdaInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdaInitParameters. +func (in *DevicesSdaInitParameters) DeepCopy() *DevicesSdaInitParameters { + if in == nil { + return nil + } + out := new(DevicesSdaInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSdaObservation) DeepCopyInto(out *DevicesSdaObservation) { *out = *in @@ -1111,6 +1612,41 @@ func (in *DevicesSdaParameters) DeepCopy() *DevicesSdaParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdbInitParameters) DeepCopyInto(out *DevicesSdbInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdbInitParameters. +func (in *DevicesSdbInitParameters) DeepCopy() *DevicesSdbInitParameters { + if in == nil { + return nil + } + out := new(DevicesSdbInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSdbObservation) DeepCopyInto(out *DevicesSdbObservation) { *out = *in @@ -1171,6 +1707,41 @@ func (in *DevicesSdbParameters) DeepCopy() *DevicesSdbParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdcInitParameters) DeepCopyInto(out *DevicesSdcInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdcInitParameters. +func (in *DevicesSdcInitParameters) DeepCopy() *DevicesSdcInitParameters { + if in == nil { + return nil + } + out := new(DevicesSdcInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSdcObservation) DeepCopyInto(out *DevicesSdcObservation) { *out = *in @@ -1231,6 +1802,41 @@ func (in *DevicesSdcParameters) DeepCopy() *DevicesSdcParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSddInitParameters) DeepCopyInto(out *DevicesSddInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSddInitParameters. +func (in *DevicesSddInitParameters) DeepCopy() *DevicesSddInitParameters { + if in == nil { + return nil + } + out := new(DevicesSddInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSddObservation) DeepCopyInto(out *DevicesSddObservation) { *out = *in @@ -1291,6 +1897,41 @@ func (in *DevicesSddParameters) DeepCopy() *DevicesSddParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdeInitParameters) DeepCopyInto(out *DevicesSdeInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdeInitParameters. +func (in *DevicesSdeInitParameters) DeepCopy() *DevicesSdeInitParameters { + if in == nil { + return nil + } + out := new(DevicesSdeInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSdeObservation) DeepCopyInto(out *DevicesSdeObservation) { *out = *in @@ -1351,6 +1992,41 @@ func (in *DevicesSdeParameters) DeepCopy() *DevicesSdeParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdfInitParameters) DeepCopyInto(out *DevicesSdfInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdfInitParameters. +func (in *DevicesSdfInitParameters) DeepCopy() *DevicesSdfInitParameters { + if in == nil { + return nil + } + out := new(DevicesSdfInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSdfObservation) DeepCopyInto(out *DevicesSdfObservation) { *out = *in @@ -1411,6 +2087,41 @@ func (in *DevicesSdfParameters) DeepCopy() *DevicesSdfParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdgInitParameters) DeepCopyInto(out *DevicesSdgInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdgInitParameters. +func (in *DevicesSdgInitParameters) DeepCopy() *DevicesSdgInitParameters { + if in == nil { + return nil + } + out := new(DevicesSdgInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DevicesSdgObservation) DeepCopyInto(out *DevicesSdgObservation) { *out = *in @@ -1426,18 +2137,53 @@ func (in *DevicesSdgObservation) DeepCopyInto(out *DevicesSdgObservation) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdgObservation. -func (in *DevicesSdgObservation) DeepCopy() *DevicesSdgObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdgObservation. +func (in *DevicesSdgObservation) DeepCopy() *DevicesSdgObservation { + if in == nil { + return nil + } + out := new(DevicesSdgObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DevicesSdgParameters) DeepCopyInto(out *DevicesSdgParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskIDRef != nil { + in, out := &in.DiskIDRef, &out.DiskIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.DiskIDSelector != nil { + in, out := &in.DiskIDSelector, &out.DiskIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdgParameters. +func (in *DevicesSdgParameters) DeepCopy() *DevicesSdgParameters { if in == nil { return nil } - out := new(DevicesSdgObservation) + out := new(DevicesSdgParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DevicesSdgParameters) DeepCopyInto(out *DevicesSdgParameters) { +func (in *DevicesSdhInitParameters) DeepCopyInto(out *DevicesSdhInitParameters) { *out = *in if in.DiskID != nil { in, out := &in.DiskID, &out.DiskID @@ -1461,12 +2207,12 @@ func (in *DevicesSdgParameters) DeepCopyInto(out *DevicesSdgParameters) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdgParameters. -func (in *DevicesSdgParameters) DeepCopy() *DevicesSdgParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DevicesSdhInitParameters. +func (in *DevicesSdhInitParameters) DeepCopy() *DevicesSdhInitParameters { if in == nil { return nil } - out := new(DevicesSdgParameters) + out := new(DevicesSdhInitParameters) in.DeepCopyInto(out) return out } @@ -1558,6 +2304,160 @@ func (in *Disk) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiskInitParameters) DeepCopyInto(out *DiskInitParameters) { + *out = *in + if in.AuthorizedKeys != nil { + in, out := &in.AuthorizedKeys, &out.AuthorizedKeys + *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.AuthorizedUsers != nil { + in, out := &in.AuthorizedUsers, &out.AuthorizedUsers + *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.Filesystem != nil { + in, out := &in.Filesystem, &out.Filesystem + *out = new(string) + **out = **in + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.ReadOnly != nil { + in, out := &in.ReadOnly, &out.ReadOnly + *out = new(bool) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.StackscriptID != nil { + in, out := &in.StackscriptID, &out.StackscriptID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskInitParameters. +func (in *DiskInitParameters) DeepCopy() *DiskInitParameters { + if in == nil { + return nil + } + out := new(DiskInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DiskInitParameters_2) DeepCopyInto(out *DiskInitParameters_2) { + *out = *in + if in.AuthorizedKeys != nil { + in, out := &in.AuthorizedKeys, &out.AuthorizedKeys + *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.AuthorizedUsers != nil { + in, out := &in.AuthorizedUsers, &out.AuthorizedUsers + *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.Filesystem != nil { + in, out := &in.Filesystem, &out.Filesystem + *out = new(string) + **out = **in + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.StackscriptID != nil { + in, out := &in.StackscriptID, &out.StackscriptID + *out = new(float64) + **out = **in + } + if in.StackscriptIDRef != nil { + in, out := &in.StackscriptIDRef, &out.StackscriptIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.StackscriptIDSelector != nil { + in, out := &in.StackscriptIDSelector, &out.StackscriptIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskInitParameters_2. +func (in *DiskInitParameters_2) DeepCopy() *DiskInitParameters_2 { + if in == nil { + return nil + } + out := new(DiskInitParameters_2) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DiskList) DeepCopyInto(out *DiskList) { *out = *in @@ -1928,6 +2828,7 @@ func (in *DiskSpec) DeepCopyInto(out *DiskSpec) { *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 DiskSpec. @@ -1957,6 +2858,46 @@ func (in *DiskStatus) DeepCopy() *DiskStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HelpersInitParameters) DeepCopyInto(out *HelpersInitParameters) { + *out = *in + if in.DevtmpfsAutomount != nil { + in, out := &in.DevtmpfsAutomount, &out.DevtmpfsAutomount + *out = new(bool) + **out = **in + } + if in.Distro != nil { + in, out := &in.Distro, &out.Distro + *out = new(bool) + **out = **in + } + if in.ModulesDep != nil { + in, out := &in.ModulesDep, &out.ModulesDep + *out = new(bool) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(bool) + **out = **in + } + if in.UpdatedbDisabled != nil { + in, out := &in.UpdatedbDisabled, &out.UpdatedbDisabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelpersInitParameters. +func (in *HelpersInitParameters) DeepCopy() *HelpersInitParameters { + if in == nil { + return nil + } + out := new(HelpersInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HelpersObservation) DeepCopyInto(out *HelpersObservation) { *out = *in @@ -2046,24 +2987,79 @@ func (in *IP) DeepCopyInto(out *IP) { in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IP. -func (in *IP) DeepCopy() *IP { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IP. +func (in *IP) DeepCopy() *IP { + if in == nil { + return nil + } + out := new(IP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IP) 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 *IPInitParameters) DeepCopyInto(out *IPInitParameters) { + *out = *in + if in.ApplyImmediately != nil { + in, out := &in.ApplyImmediately, &out.ApplyImmediately + *out = new(bool) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Rdns != nil { + in, out := &in.Rdns, &out.Rdns + *out = new(string) + **out = **in + } + if in.RdnsRef != nil { + in, out := &in.RdnsRef, &out.RdnsRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RdnsSelector != nil { + in, out := &in.RdnsSelector, &out.RdnsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPInitParameters. +func (in *IPInitParameters) DeepCopy() *IPInitParameters { if in == nil { return nil } - out := new(IP) + out := new(IPInitParameters) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *IP) 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 *IPList) DeepCopyInto(out *IPList) { *out = *in @@ -2226,6 +3222,7 @@ func (in *IPSpec) DeepCopyInto(out *IPSpec) { *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 IPSpec. @@ -2282,6 +3279,210 @@ func (in *Instance) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceInitParameters) DeepCopyInto(out *InstanceInitParameters) { + *out = *in + if in.Alerts != nil { + in, out := &in.Alerts, &out.Alerts + *out = make([]AlertsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AuthorizedKeys != nil { + in, out := &in.AuthorizedKeys, &out.AuthorizedKeys + *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.AuthorizedUsers != nil { + in, out := &in.AuthorizedUsers, &out.AuthorizedUsers + *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.BackupID != nil { + in, out := &in.BackupID, &out.BackupID + *out = new(float64) + **out = **in + } + if in.BackupsEnabled != nil { + in, out := &in.BackupsEnabled, &out.BackupsEnabled + *out = new(bool) + **out = **in + } + if in.BootConfigLabel != nil { + in, out := &in.BootConfigLabel, &out.BootConfigLabel + *out = new(string) + **out = **in + } + if in.Booted != nil { + in, out := &in.Booted, &out.Booted + *out = new(bool) + **out = **in + } + if in.Config != nil { + in, out := &in.Config, &out.Config + *out = make([]ConfigInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Disk != nil { + in, out := &in.Disk, &out.Disk + *out = make([]DiskInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } + if in.Image != nil { + in, out := &in.Image, &out.Image + *out = new(string) + **out = **in + } + if in.Interface != nil { + in, out := &in.Interface, &out.Interface + *out = make([]InstanceInterfaceInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make([]MetadataInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PrivateIP != nil { + in, out := &in.PrivateIP, &out.PrivateIP + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ResizeDisk != nil { + in, out := &in.ResizeDisk, &out.ResizeDisk + *out = new(bool) + **out = **in + } + if in.SharedIPv4 != nil { + in, out := &in.SharedIPv4, &out.SharedIPv4 + *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.StackscriptID != nil { + in, out := &in.StackscriptID, &out.StackscriptID + *out = new(float64) + **out = **in + } + if in.StackscriptIDRef != nil { + in, out := &in.StackscriptIDRef, &out.StackscriptIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.StackscriptIDSelector != nil { + in, out := &in.StackscriptIDSelector, &out.StackscriptIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.SwapSize != nil { + in, out := &in.SwapSize, &out.SwapSize + *out = new(float64) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.WatchdogEnabled != nil { + in, out := &in.WatchdogEnabled, &out.WatchdogEnabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceInitParameters. +func (in *InstanceInitParameters) DeepCopy() *InstanceInitParameters { + if in == nil { + return nil + } + out := new(InstanceInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceInterfaceInitParameters) DeepCopyInto(out *InstanceInterfaceInitParameters) { + *out = *in + if in.IpamAddress != nil { + in, out := &in.IpamAddress, &out.IpamAddress + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Purpose != nil { + in, out := &in.Purpose, &out.Purpose + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceInterfaceInitParameters. +func (in *InstanceInterfaceInitParameters) DeepCopy() *InstanceInterfaceInitParameters { + if in == nil { + return nil + } + out := new(InstanceInterfaceInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstanceInterfaceObservation) DeepCopyInto(out *InstanceInterfaceObservation) { *out = *in @@ -2787,6 +3988,7 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { *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 InstanceSpec. @@ -2816,6 +4018,36 @@ func (in *InstanceStatus) DeepCopy() *InstanceStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InterfaceInitParameters) DeepCopyInto(out *InterfaceInitParameters) { + *out = *in + if in.IpamAddress != nil { + in, out := &in.IpamAddress, &out.IpamAddress + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Purpose != nil { + in, out := &in.Purpose, &out.Purpose + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterfaceInitParameters. +func (in *InterfaceInitParameters) DeepCopy() *InterfaceInitParameters { + if in == nil { + return nil + } + out := new(InterfaceInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InterfaceObservation) DeepCopyInto(out *InterfaceObservation) { *out = *in @@ -2876,6 +4108,26 @@ func (in *InterfaceParameters) DeepCopy() *InterfaceParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetadataInitParameters) DeepCopyInto(out *MetadataInitParameters) { + *out = *in + if in.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataInitParameters. +func (in *MetadataInitParameters) DeepCopy() *MetadataInitParameters { + if in == nil { + return nil + } + out := new(MetadataInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetadataObservation) DeepCopyInto(out *MetadataObservation) { *out = *in @@ -2916,6 +4168,21 @@ func (in *MetadataParameters) DeepCopy() *MetadataParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduleInitParameters) DeepCopyInto(out *ScheduleInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleInitParameters. +func (in *ScheduleInitParameters) DeepCopy() *ScheduleInitParameters { + if in == nil { + return nil + } + out := new(ScheduleInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ScheduleObservation) DeepCopyInto(out *ScheduleObservation) { *out = *in @@ -2956,6 +4223,36 @@ func (in *ScheduleParameters) DeepCopy() *ScheduleParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdaInitParameters) DeepCopyInto(out *SdaInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdaInitParameters. +func (in *SdaInitParameters) DeepCopy() *SdaInitParameters { + if in == nil { + return nil + } + out := new(SdaInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdaObservation) DeepCopyInto(out *SdaObservation) { *out = *in @@ -3016,6 +4313,36 @@ func (in *SdaParameters) DeepCopy() *SdaParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdbInitParameters) DeepCopyInto(out *SdbInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdbInitParameters. +func (in *SdbInitParameters) DeepCopy() *SdbInitParameters { + if in == nil { + return nil + } + out := new(SdbInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdbObservation) DeepCopyInto(out *SdbObservation) { *out = *in @@ -3076,6 +4403,36 @@ func (in *SdbParameters) DeepCopy() *SdbParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdcInitParameters) DeepCopyInto(out *SdcInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdcInitParameters. +func (in *SdcInitParameters) DeepCopy() *SdcInitParameters { + if in == nil { + return nil + } + out := new(SdcInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdcObservation) DeepCopyInto(out *SdcObservation) { *out = *in @@ -3136,6 +4493,36 @@ func (in *SdcParameters) DeepCopy() *SdcParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SddInitParameters) DeepCopyInto(out *SddInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SddInitParameters. +func (in *SddInitParameters) DeepCopy() *SddInitParameters { + if in == nil { + return nil + } + out := new(SddInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SddObservation) DeepCopyInto(out *SddObservation) { *out = *in @@ -3196,6 +4583,36 @@ func (in *SddParameters) DeepCopy() *SddParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdeInitParameters) DeepCopyInto(out *SdeInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdeInitParameters. +func (in *SdeInitParameters) DeepCopy() *SdeInitParameters { + if in == nil { + return nil + } + out := new(SdeInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdeObservation) DeepCopyInto(out *SdeObservation) { *out = *in @@ -3256,6 +4673,36 @@ func (in *SdeParameters) DeepCopy() *SdeParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdfInitParameters) DeepCopyInto(out *SdfInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdfInitParameters. +func (in *SdfInitParameters) DeepCopy() *SdfInitParameters { + if in == nil { + return nil + } + out := new(SdfInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdfObservation) DeepCopyInto(out *SdfObservation) { *out = *in @@ -3316,6 +4763,36 @@ func (in *SdfParameters) DeepCopy() *SdfParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdgInitParameters) DeepCopyInto(out *SdgInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdgInitParameters. +func (in *SdgInitParameters) DeepCopy() *SdgInitParameters { + if in == nil { + return nil + } + out := new(SdgInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdgObservation) DeepCopyInto(out *SdgObservation) { *out = *in @@ -3376,6 +4853,36 @@ func (in *SdgParameters) DeepCopy() *SdgParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SdhInitParameters) DeepCopyInto(out *SdhInitParameters) { + *out = *in + if in.DiskID != nil { + in, out := &in.DiskID, &out.DiskID + *out = new(float64) + **out = **in + } + if in.DiskLabel != nil { + in, out := &in.DiskLabel, &out.DiskLabel + *out = new(string) + **out = **in + } + if in.VolumeID != nil { + in, out := &in.VolumeID, &out.VolumeID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdhInitParameters. +func (in *SdhInitParameters) DeepCopy() *SdhInitParameters { + if in == nil { + return nil + } + out := new(SdhInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SdhObservation) DeepCopyInto(out *SdhObservation) { *out = *in @@ -3463,6 +4970,47 @@ func (in *SharedIPs) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SharedIPsInitParameters) DeepCopyInto(out *SharedIPsInitParameters) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *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.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SharedIPsInitParameters. +func (in *SharedIPsInitParameters) DeepCopy() *SharedIPsInitParameters { + if in == nil { + return nil + } + out := new(SharedIPsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SharedIPsList) DeepCopyInto(out *SharedIPsList) { *out = *in @@ -3577,6 +5125,7 @@ func (in *SharedIPsSpec) DeepCopyInto(out *SharedIPsSpec) { *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 SharedIPsSpec. @@ -3606,6 +5155,21 @@ func (in *SharedIPsStatus) DeepCopy() *SharedIPsStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpecsInitParameters) DeepCopyInto(out *SpecsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpecsInitParameters. +func (in *SpecsInitParameters) DeepCopy() *SpecsInitParameters { + if in == nil { + return nil + } + out := new(SpecsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SpecsObservation) DeepCopyInto(out *SpecsObservation) { *out = *in diff --git a/apis/instance/v1alpha1/zz_generated.managed.go b/apis/instance/v1alpha1/zz_generated.managed.go index 0b83cb7..d76f7b9 100644 --- a/apis/instance/v1alpha1/zz_generated.managed.go +++ b/apis/instance/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Config) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Config. -func (mg *Config) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Config. +func (mg *Config) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Config. @@ -27,14 +27,6 @@ func (mg *Config) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Config. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Config) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Config. func (mg *Config) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Config) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Config. -func (mg *Config) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Config. +func (mg *Config) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Config. @@ -65,14 +57,6 @@ func (mg *Config) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Config. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Config) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Config. func (mg *Config) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -93,9 +77,9 @@ func (mg *Disk) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Disk. -func (mg *Disk) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Disk. +func (mg *Disk) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Disk. @@ -103,14 +87,6 @@ func (mg *Disk) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Disk. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Disk) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Disk. func (mg *Disk) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -131,9 +107,9 @@ func (mg *Disk) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Disk. -func (mg *Disk) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Disk. +func (mg *Disk) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Disk. @@ -141,14 +117,6 @@ func (mg *Disk) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Disk. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Disk) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Disk. func (mg *Disk) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -169,9 +137,9 @@ func (mg *IP) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this IP. -func (mg *IP) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this IP. +func (mg *IP) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this IP. @@ -179,14 +147,6 @@ func (mg *IP) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this IP. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *IP) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this IP. func (mg *IP) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -207,9 +167,9 @@ func (mg *IP) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this IP. -func (mg *IP) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this IP. +func (mg *IP) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this IP. @@ -217,14 +177,6 @@ func (mg *IP) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this IP. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *IP) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this IP. func (mg *IP) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -245,9 +197,9 @@ func (mg *Instance) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Instance. -func (mg *Instance) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Instance. +func (mg *Instance) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Instance. @@ -255,14 +207,6 @@ func (mg *Instance) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Instance. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Instance) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Instance. func (mg *Instance) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -283,9 +227,9 @@ func (mg *Instance) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Instance. -func (mg *Instance) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Instance. +func (mg *Instance) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Instance. @@ -293,14 +237,6 @@ func (mg *Instance) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Instance. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Instance) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Instance. func (mg *Instance) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -321,9 +257,9 @@ func (mg *SharedIPs) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this SharedIPs. -func (mg *SharedIPs) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this SharedIPs. +func (mg *SharedIPs) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this SharedIPs. @@ -331,14 +267,6 @@ func (mg *SharedIPs) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this SharedIPs. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *SharedIPs) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this SharedIPs. func (mg *SharedIPs) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -359,9 +287,9 @@ func (mg *SharedIPs) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this SharedIPs. -func (mg *SharedIPs) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this SharedIPs. +func (mg *SharedIPs) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this SharedIPs. @@ -369,14 +297,6 @@ func (mg *SharedIPs) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this SharedIPs. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *SharedIPs) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this SharedIPs. func (mg *SharedIPs) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/instance/v1alpha1/zz_generated.resolvers.go b/apis/instance/v1alpha1/zz_generated.resolvers.go index 0f36b6c..ea333dc 100644 --- a/apis/instance/v1alpha1/zz_generated.resolvers.go +++ b/apis/instance/v1alpha1/zz_generated.resolvers.go @@ -197,6 +197,182 @@ func (mg *Config) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sda); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sda[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sda[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sda[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sda[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sda[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sda[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sdb); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sdb[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sdb[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sdb[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sdb[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sdb[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sdb[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sdc); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sdc[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sdc[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sdc[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sdc[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sdc[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sdc[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sdd); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sdd[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sdd[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sdd[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sdd[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sdd[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sdd[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sde); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sde[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sde[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sde[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sde[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sde[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sde[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sdf); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sdf[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sdf[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sdf[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sdf[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sdf[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sdf[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sdg); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sdg[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sdg[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sdg[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sdg[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sdg[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sdg[i4].DiskIDRef = rsp.ResolvedReference + + } + } + for i3 := 0; i3 < len(mg.Spec.InitProvider.Devices); i3++ { + for i4 := 0; i4 < len(mg.Spec.InitProvider.Devices[i3].Sdh); i4++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.Devices[i3].Sdh[i4].DiskID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.Devices[i3].Sdh[i4].DiskIDRef, + Selector: mg.Spec.InitProvider.Devices[i3].Sdh[i4].DiskIDSelector, + To: reference.To{ + List: &DiskList{}, + Managed: &Disk{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Devices[i3].Sdh[i4].DiskID") + } + mg.Spec.InitProvider.Devices[i3].Sdh[i4].DiskID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.Devices[i3].Sdh[i4].DiskIDRef = rsp.ResolvedReference + + } + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &InstanceList{}, + Managed: &Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + return nil } @@ -239,6 +415,38 @@ func (mg *Disk) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.StackscriptID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.StackscriptIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &InstanceList{}, + Managed: &Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.StackscriptID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.StackscriptIDRef, + Selector: mg.Spec.InitProvider.StackscriptIDSelector, + To: reference.To{ + List: &v1alpha1.StackscriptList{}, + Managed: &v1alpha1.Stackscript{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.StackscriptID") + } + mg.Spec.InitProvider.StackscriptID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.StackscriptIDRef = rsp.ResolvedReference + return nil } @@ -281,6 +489,38 @@ func (mg *IP) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.Rdns = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.RdnsRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &InstanceList{}, + Managed: &Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.Rdns), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.RdnsRef, + Selector: mg.Spec.InitProvider.RdnsSelector, + To: reference.To{ + List: &v1alpha11.RDNSList{}, + Managed: &v1alpha11.RDNS{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Rdns") + } + mg.Spec.InitProvider.Rdns = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.RdnsRef = rsp.ResolvedReference + return nil } @@ -307,6 +547,22 @@ func (mg *Instance) ResolveReferences(ctx context.Context, c client.Reader) erro mg.Spec.ForProvider.StackscriptID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.StackscriptIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.StackscriptID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.StackscriptIDRef, + Selector: mg.Spec.InitProvider.StackscriptIDSelector, + To: reference.To{ + List: &v1alpha1.StackscriptList{}, + Managed: &v1alpha1.Stackscript{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.StackscriptID") + } + mg.Spec.InitProvider.StackscriptID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.StackscriptIDRef = rsp.ResolvedReference + return nil } @@ -333,5 +589,21 @@ func (mg *SharedIPs) ResolveReferences(ctx context.Context, c client.Reader) err mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &InstanceList{}, + Managed: &Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/instance/v1alpha1/zz_generated_terraformed.go b/apis/instance/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 9bee91d..0000000 --- a/apis/instance/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,386 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/pkg/errors" - - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Instance -func (mg *Instance) GetTerraformResourceType() string { - return "linode_instance" -} - -// GetConnectionDetailsMapping for this Instance -func (tr *Instance) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"disk[*].root_pass": "spec.forProvider.disk[*].rootPassSecretRef", "disk[*].stackscript_data": "spec.forProvider.disk[*].stackscriptDataSecretRef", "root_pass": "spec.forProvider.rootPassSecretRef", "stackscript_data": "spec.forProvider.stackscriptDataSecretRef"} -} - -// GetObservation of this Instance -func (tr *Instance) 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 Instance -func (tr *Instance) 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 Instance -func (tr *Instance) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Instance -func (tr *Instance) 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 Instance -func (tr *Instance) 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) -} - -// LateInitialize this Instance using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Instance) LateInitialize(attrs []byte) (bool, error) { - params := &InstanceParameters{} - 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)} - opts = append(opts, resource.WithNameFilter("Config")) - opts = append(opts, resource.WithNameFilter("Disk")) - - li := resource.NewGenericLateInitializer(opts...) - return li.LateInitialize(&tr.Spec.ForProvider, params) -} - -// GetTerraformSchemaVersion returns the associated Terraform schema version -func (tr *Instance) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this Config -func (mg *Config) GetTerraformResourceType() string { - return "linode_instance_config" -} - -// GetConnectionDetailsMapping for this Config -func (tr *Config) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Config -func (tr *Config) 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 Config -func (tr *Config) 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 Config -func (tr *Config) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Config -func (tr *Config) 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 Config -func (tr *Config) 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) -} - -// LateInitialize this Config using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Config) LateInitialize(attrs []byte) (bool, error) { - params := &ConfigParameters_2{} - 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 *Config) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this Disk -func (mg *Disk) GetTerraformResourceType() string { - return "linode_instance_disk" -} - -// GetConnectionDetailsMapping for this Disk -func (tr *Disk) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"root_pass": "spec.forProvider.rootPassSecretRef", "stackscript_data": "spec.forProvider.stackscriptDataSecretRef"} -} - -// GetObservation of this Disk -func (tr *Disk) 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 Disk -func (tr *Disk) 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 Disk -func (tr *Disk) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Disk -func (tr *Disk) 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 Disk -func (tr *Disk) 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) -} - -// LateInitialize this Disk using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Disk) LateInitialize(attrs []byte) (bool, error) { - params := &DiskParameters_2{} - 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 *Disk) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this IP -func (mg *IP) GetTerraformResourceType() string { - return "linode_instance_ip" -} - -// GetConnectionDetailsMapping for this IP -func (tr *IP) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this IP -func (tr *IP) 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 IP -func (tr *IP) 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 IP -func (tr *IP) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this IP -func (tr *IP) 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 IP -func (tr *IP) 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) -} - -// LateInitialize this IP using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *IP) LateInitialize(attrs []byte) (bool, error) { - params := &IPParameters{} - 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 *IP) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this SharedIPs -func (mg *SharedIPs) GetTerraformResourceType() string { - return "linode_instance_shared_ips" -} - -// GetConnectionDetailsMapping for this SharedIPs -func (tr *SharedIPs) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this SharedIPs -func (tr *SharedIPs) 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 SharedIPs -func (tr *SharedIPs) 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 SharedIPs -func (tr *SharedIPs) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this SharedIPs -func (tr *SharedIPs) 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 SharedIPs -func (tr *SharedIPs) 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) -} - -// LateInitialize this SharedIPs using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *SharedIPs) LateInitialize(attrs []byte) (bool, error) { - params := &SharedIPsParameters{} - 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 *SharedIPs) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/instance/v1alpha1/zz_groupversion_info.go b/apis/instance/v1alpha1/zz_groupversion_info.go index f4d9b36..b152baa 100755 --- a/apis/instance/v1alpha1/zz_groupversion_info.go +++ b/apis/instance/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/instance/v1alpha1/zz_instance_terraformed.go b/apis/instance/v1alpha1/zz_instance_terraformed.go new file mode 100755 index 0000000..e9463d9 --- /dev/null +++ b/apis/instance/v1alpha1/zz_instance_terraformed.go @@ -0,0 +1,135 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Instance +func (mg *Instance) GetTerraformResourceType() string { + return "linode_instance" +} + +// GetConnectionDetailsMapping for this Instance +func (tr *Instance) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"disk[*].root_pass": "spec.forProvider.disk[*].rootPassSecretRef", "disk[*].stackscript_data": "spec.forProvider.disk[*].stackscriptDataSecretRef", "root_pass": "spec.forProvider.rootPassSecretRef", "stackscript_data": "spec.forProvider.stackscriptDataSecretRef"} +} + +// GetObservation of this Instance +func (tr *Instance) 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 Instance +func (tr *Instance) 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 Instance +func (tr *Instance) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Instance +func (tr *Instance) 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 Instance +func (tr *Instance) 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 Instance +func (tr *Instance) 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 Instance +func (tr *Instance) 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 Instance using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Instance) LateInitialize(attrs []byte) (bool, error) { + params := &InstanceParameters{} + 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)} + opts = append(opts, resource.WithNameFilter("Config")) + opts = append(opts, resource.WithNameFilter("Disk")) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *Instance) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/instance/v1alpha1/zz_instance_types.go b/apis/instance/v1alpha1/zz_instance_types.go index 0a084ff..e9e0d66 100755 --- a/apis/instance/v1alpha1/zz_instance_types.go +++ b/apis/instance/v1alpha1/zz_instance_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,29 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type AlertsInitParameters struct { + + // The percentage of CPU usage required to trigger an alert. If the average CPU usage over two hours exceeds this value, we'll send you an alert. If this is set to 0, the alert is disabled. + // The percentage of CPU usage required to trigger an alert. If the average CPU usage over two hours exceeds this value, we'll send you an alert. If this is set to 0, the alert is disabled. + CPU *float64 `json:"cpu,omitempty" tf:"cpu,omitempty"` + + // The amount of disk IO operation per second required to trigger an alert. If the average disk IO over two hours exceeds this value, we'll send you an alert. If set to 0, this alert is disabled. + // The amount of disk IO operation per second required to trigger an alert. If the average disk IO over two hours exceeds this value, we'll send you an alert. If set to 0, this alert is disabled. + Io *float64 `json:"io,omitempty" tf:"io,omitempty"` + + // The amount of incoming traffic, in Mbit/s, required to trigger an alert. If the average incoming traffic over two hours exceeds this value, we'll send you an alert. If this is set to 0 (zero), the alert is disabled. + // The amount of incoming traffic, in Mbit/s, required to trigger an alert. If the average incoming traffic over two hours exceeds this value, we'll send you an alert. If this is set to 0 (zero), the alert is disabled. + NetworkIn *float64 `json:"networkIn,omitempty" tf:"network_in,omitempty"` + + // The amount of outbound traffic, in Mbit/s, required to trigger an alert. If the average outbound traffic over two hours exceeds this value, we'll send you an alert. If this is set to 0 (zero), the alert is disabled. + // The amount of outbound traffic, in Mbit/s, required to trigger an alert. If the average outbound traffic over two hours exceeds this value, we'll send you an alert. If this is set to 0 (zero), the alert is disabled. + NetworkOut *float64 `json:"networkOut,omitempty" tf:"network_out,omitempty"` + + // The percentage of network transfer that may be used before an alert is triggered. When this value is exceeded, we'll alert you. If this is set to 0 (zero), the alert is disabled. + // The percentage of network transfer that may be used before an alert is triggered. When this value is exceeded, we'll alert you. If this is set to 0 (zero), the alert is disabled. + TransferQuota *float64 `json:"transferQuota,omitempty" tf:"transfer_quota,omitempty"` +} + type AlertsObservation struct { // The percentage of CPU usage required to trigger an alert. If the average CPU usage over two hours exceeds this value, we'll send you an alert. If this is set to 0, the alert is disabled. @@ -64,6 +91,9 @@ type AlertsParameters struct { TransferQuota *float64 `json:"transferQuota,omitempty" tf:"transfer_quota,omitempty"` } +type BackupsInitParameters struct { +} + type BackupsObservation struct { Available *bool `json:"available,omitempty" tf:"available,omitempty"` @@ -76,6 +106,48 @@ type BackupsObservation struct { type BackupsParameters struct { } +type ConfigInitParameters struct { + + // - Arbitrary user comments about this config. + // Optional field for arbitrary User comments on this Config. + Comments *string `json:"comments,omitempty" tf:"comments,omitempty"` + + // A list of disk or volume attachments for this config. If the boot_config_label omits a devices block, the Linode will not be booted. + // Device sda-sdh can be either a Disk or Volume identified by disk_label or volume_id. Only one type per slot allowed. + Devices []DevicesInitParameters `json:"devices,omitempty" tf:"devices,omitempty"` + + // (Options) Helpers enabled when booting to this Linode Config. + // Helpers enabled when booting to this Linode Config. + Helpers []HelpersInitParameters `json:"helpers,omitempty" tf:"helpers,omitempty"` + + // An array of Network Interfaces for this Linode’s Configuration Profile. + Interface []InterfaceInitParameters `json:"interface,omitempty" tf:"interface,omitempty"` + + // - A Kernel ID to boot a Linode with. Default is based on image choice. Examples are linode/latest-64bit, linode/grub2, linode/direct-disk, etc. See all kernels here. Note that this is a paginated API endpoint (docs). + // A Kernel ID to boot a Linode with. Default is based on image choice. (examples: linode/latest-64bit, linode/grub2, linode/direct-disk) + Kernel *string `json:"kernel,omitempty" tf:"kernel,omitempty"` + + // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. + // The Config's label for display purposes. Also used by `boot_config_label`. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // - Defaults to the total RAM of the Linode + // Defaults to the total RAM of the Linode + MemoryLimit *float64 `json:"memoryLimit,omitempty" tf:"memory_limit,omitempty"` + + // - The root device to boot. The corresponding disk must be attached to a device slot. Example: "/dev/sda" + // The root device to boot. The corresponding disk must be attached. + RootDevice *string `json:"rootDevice,omitempty" tf:"root_device,omitempty"` + + // - Defines the state of your Linode after booting. Defaults to "default". + // Defines the state of your Linode after booting. Defaults to default. + RunLevel *string `json:"runLevel,omitempty" tf:"run_level,omitempty"` + + // - Controls the virtualization mode. Defaults to "paravirt". + // Controls the virtualization mode. Defaults to paravirt. + VirtMode *string `json:"virtMode,omitempty" tf:"virt_mode,omitempty"` +} + type ConfigObservation struct { // - Arbitrary user comments about this config. @@ -146,7 +218,7 @@ type ConfigParameters struct { // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. // The Config's label for display purposes. Also used by `boot_config_label`. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Label *string `json:"label" tf:"label,omitempty"` // - Defaults to the total RAM of the Linode @@ -170,6 +242,34 @@ type ConfigParameters struct { VirtMode *string `json:"virtMode,omitempty" tf:"virt_mode,omitempty"` } +type DevicesInitParameters struct { + + // The SDA-SDH slots, represent the Linux block device nodes for the first 8 disks attached to the Linode. Each device must be suplied sequentially. The device can be either a Disk or a Volume identified by disk_label or volume_id. Only one disk identifier is permitted per slot. Devices mapped from sde through sdh are unavailable in "fullvirt" virt_mode. + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sda []SdaInitParameters `json:"sda,omitempty" tf:"sda,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdb []SdbInitParameters `json:"sdb,omitempty" tf:"sdb,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdc []SdcInitParameters `json:"sdc,omitempty" tf:"sdc,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdd []SddInitParameters `json:"sdd,omitempty" tf:"sdd,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sde []SdeInitParameters `json:"sde,omitempty" tf:"sde,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdf []SdfInitParameters `json:"sdf,omitempty" tf:"sdf,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdg []SdgInitParameters `json:"sdg,omitempty" tf:"sdg,omitempty"` + + // Device can be either a Disk or Volume identified by disk_id or volume_id. Only one type per slot allowed. + Sdh []SdhInitParameters `json:"sdh,omitempty" tf:"sdh,omitempty"` +} + type DevicesObservation struct { // The SDA-SDH slots, represent the Linux block device nodes for the first 8 disks attached to the Linode. Each device must be suplied sequentially. The device can be either a Disk or a Volume identified by disk_label or volume_id. Only one disk identifier is permitted per slot. Devices mapped from sde through sdh are unavailable in "fullvirt" virt_mode. @@ -234,6 +334,39 @@ type DevicesParameters struct { Sdh []SdhParameters `json:"sdh,omitempty" tf:"sdh,omitempty"` } +type DiskInitParameters struct { + + // A list of SSH public keys to deploy for the root user on the newly created Linode. This value can not be imported. Changing + // A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if 'image' is provided. + AuthorizedKeys []*string `json:"authorizedKeys,omitempty" tf:"authorized_keys,omitempty"` + + // A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the root user's ~/.ssh/authorized_keys file automatically. This value can not be imported. Changing + // A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. Only accepted if 'image' is provided. + AuthorizedUsers []*string `json:"authorizedUsers,omitempty" tf:"authorized_users,omitempty"` + + // The Disk filesystem can be one of: raw, swap, ext3, ext4, initrd (max 32mb) + Filesystem *string `json:"filesystem,omitempty" tf:"filesystem,omitempty"` + + // An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See images for more information on the Images available for you to use. Examples are linode/debian9, linode/fedora28, linode/ubuntu16.04lts, linode/arch, and private/12345. See all images here (Requires a personal access token; docs here). This value can not be imported. Changing + // An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. + Image *string `json:"image,omitempty" tf:"image,omitempty"` + + // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // If true, this Disk is read-only. + // If true, this Disk is read-only. + ReadOnly *bool `json:"readOnly,omitempty" tf:"read_only,omitempty"` + + // The size of the Disk in MB. + // The size of the Disk in MB. + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` + + // The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. This value can not be imported. Changing + // The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. + StackscriptID *float64 `json:"stackscriptId,omitempty" tf:"stackscript_id,omitempty"` +} + type DiskObservation struct { // A list of SSH public keys to deploy for the root user on the newly created Linode. This value can not be imported. Changing @@ -293,7 +426,7 @@ type DiskParameters struct { Image *string `json:"image,omitempty" tf:"image,omitempty"` // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Label *string `json:"label" tf:"label,omitempty"` // If true, this Disk is read-only. @@ -308,7 +441,7 @@ type DiskParameters struct { // The size of the Disk in MB. // The size of the Disk in MB. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Size *float64 `json:"size" tf:"size,omitempty"` // An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. This value can not be imported. Changing @@ -322,6 +455,28 @@ type DiskParameters struct { StackscriptID *float64 `json:"stackscriptId,omitempty" tf:"stackscript_id,omitempty"` } +type HelpersInitParameters struct { + + // Populates the /dev directory early during boot without udev. Defaults to false. + DevtmpfsAutomount *bool `json:"devtmpfsAutomount,omitempty" tf:"devtmpfs_automount,omitempty"` + + // Controls the behavior of the Linode Config's Distribution Helper setting. + // Controls the behavior of the Linode Config's Distribution Helper setting. + Distro *bool `json:"distro,omitempty" tf:"distro,omitempty"` + + // Creates a modules dependency file for the Kernel you run. + // Creates a modules dependency file for the Kernel you run. + ModulesDep *bool `json:"modulesDep,omitempty" tf:"modules_dep,omitempty"` + + // Controls the behavior of the Linode Config's Network Helper setting, used to automatically configure additional IP addresses assigned to this instance. + // Controls the behavior of the Linode Config's Network Helper setting, used to automatically configure additional IP addresses assigned to this instance. + Network *bool `json:"network,omitempty" tf:"network,omitempty"` + + // Disables updatedb cron job to avoid disk thrashing. + // Disables updatedb cron job to avoid disk thrashing. + UpdatedbDisabled *bool `json:"updatedbDisabled,omitempty" tf:"updatedb_disabled,omitempty"` +} + type HelpersObservation struct { // Populates the /dev directory early during boot without udev. Defaults to false. @@ -371,6 +526,122 @@ type HelpersParameters struct { UpdatedbDisabled *bool `json:"updatedbDisabled,omitempty" tf:"updatedb_disabled,omitempty"` } +type InstanceInitParameters struct { + + // Configuration options for alert triggers on this Linode. + Alerts []AlertsInitParameters `json:"alerts,omitempty" tf:"alerts,omitempty"` + + // A list of SSH public keys to deploy for the root user on the newly created Linode. This value can not be imported. Changing + // A list of SSH public keys to deploy for the root user on the newly created Linode. Only accepted if 'image' is provided. + AuthorizedKeys []*string `json:"authorizedKeys,omitempty" tf:"authorized_keys,omitempty"` + + // A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the root user's ~/.ssh/authorized_keys file automatically. This value can not be imported. Changing + // A list of Linode usernames. If the usernames have associated SSH keys, the keys will be appended to the `root` user's `~/.ssh/authorized_keys` file automatically. Only accepted if 'image' is provided. + AuthorizedUsers []*string `json:"authorizedUsers,omitempty" tf:"authorized_users,omitempty"` + + // A Backup ID from another Linode's available backups. Your User must have read_write access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. This value can not be imported. Changing + // A Backup ID from another Linode's available backups. Your User must have read_write access to that Linode, the Backup must have a status of successful, and the Linode must be deployed to the same region as the Backup. See /linode/instances/{linodeId}/backups for a Linode's available backups. This field and the image field are mutually exclusive. + BackupID *float64 `json:"backupId,omitempty" tf:"backup_id,omitempty"` + + // If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed. + // If this field is set to true, the created Linode will automatically be enrolled in the Linode Backup service. This will incur an additional charge. The cost for the Backup service is dependent on the Type of Linode deployed. + BackupsEnabled *bool `json:"backupsEnabled,omitempty" tf:"backups_enabled,omitempty"` + + // The Label of the Instance Config that should be used to boot the Linode instance. If there is only one config, the label of that config will be used as the boot_config_label. This value can not be imported. + // The Label of the Instance Config that should be used to boot the Linode instance. + BootConfigLabel *string `json:"bootConfigLabel,omitempty" tf:"boot_config_label,omitempty"` + + // If true, then the instance is kept or converted into in a running state. If false, the instance will be shutdown. If unspecified, the Linode's power status will not be managed by the Provider. + Booted *bool `json:"booted,omitempty" tf:"booted,omitempty"` + + // block + // Configuration profiles define the VM settings and boot behavior of the Linode Instance. + Config []ConfigInitParameters `json:"config,omitempty" tf:"config,omitempty"` + + // The amount of storage space, in GB. this Linode has access to. A typical Linode will divide this space between a primary disk with an image deployed to it, and a swap disk, usually 512 MB. This is the default configuration created when deploying a Linode with an image through POST /linode/instances. + Disk []DiskInitParameters `json:"disk,omitempty" tf:"disk,omitempty"` + + // The display group of the Linode instance. + // The display group of the Linode instance. + Group *string `json:"group,omitempty" tf:"group,omitempty"` + + // An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See images for more information on the Images available for you to use. Examples are linode/debian9, linode/fedora28, linode/ubuntu16.04lts, linode/arch, and private/12345. See all images here (Requires a personal access token; docs here). This value can not be imported. Changing + // An Image ID to deploy the Disk from. Official Linode Images start with linode/, while your Images start with private/. See /images for more information on the Images available for you to use. + Image *string `json:"image,omitempty" tf:"image,omitempty"` + + // An array of Network Interfaces for this Linode to be created with. If an explicit config or disk is defined, interfaces must be declared in the config block. + Interface []InstanceInterfaceInitParameters `json:"interface,omitempty" tf:"interface,omitempty"` + + // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. + // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // Various fields related to the Linode Metadata service. + Metadata []MetadataInitParameters `json:"metadata,omitempty" tf:"metadata,omitempty"` + + // If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. It can be enabled on an existing Linode but it can't be disabled. + // If true, the created Linode will have private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region. + PrivateIP *bool `json:"privateIp,omitempty" tf:"private_ip,omitempty"` + + // This is the location where the Linode is deployed. Examples are "us-east", "us-west", "ap-south", etc. See all regions here. Changing . + // This is the location where the Linode was deployed. This cannot be changed without opening a support ticket. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // If true, changes in Linode type will attempt to upsize or downsize implicitly created disks. This must be false if explicit disks are defined. This is an irreversible action as Linode disks cannot be automatically downsized. + // If true, changes in Linode type will attempt to upsize or downsize implicitly created disks. This must be false if explicit disks are defined. This is an irreversible action as Linode disks cannot be automatically downsized. + ResizeDisk *bool `json:"resizeDisk,omitempty" tf:"resize_disk,omitempty"` + + // A set of IPv4 addresses to be shared with the Instance. These IP addresses can be both private and public, but must be in the same region as the instance. + // A set of IPv4 addresses to share with this Linode. + // +listType=set + SharedIPv4 []*string `json:"sharedIpv4,omitempty" tf:"shared_ipv4,omitempty"` + + // The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. This value can not be imported. Changing + // The StackScript to deploy to the newly created Linode. If provided, 'image' must also be provided, and must be an Image that is compatible with this StackScript. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/stackscript/v1alpha1.Stackscript + StackscriptID *float64 `json:"stackscriptId,omitempty" tf:"stackscript_id,omitempty"` + + // Reference to a Stackscript in stackscript to populate stackscriptId. + // +kubebuilder:validation:Optional + StackscriptIDRef *v1.Reference `json:"stackscriptIdRef,omitempty" tf:"-"` + + // Selector for a Stackscript in stackscript to populate stackscriptId. + // +kubebuilder:validation:Optional + StackscriptIDSelector *v1.Selector `json:"stackscriptIdSelector,omitempty" tf:"-"` + + // When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode. + // When deploying from an Image, this field is optional with a Linode API default of 512mb, otherwise it is ignored. This is used to set the swap disk size for the newly-created Linode. + SwapSize *float64 `json:"swapSize,omitempty" tf:"swap_size,omitempty"` + + // A list of tags applied to this object. Tags are for organizational purposes only. + // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", "g6-highmem-16", "g6-dedicated-16", etc. See all types here. + // The type of instance to be deployed, determining the price and size. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes. + // The watchdog, named Lassie, is a Shutdown Watchdog that monitors your Linode and will reboot it if it powers off unexpectedly. It works by issuing a boot job when your Linode powers off without a shutdown job being responsible. To prevent a loop, Lassie will give up if there have been more than 5 boot jobs issued within 15 minutes. + WatchdogEnabled *bool `json:"watchdogEnabled,omitempty" tf:"watchdog_enabled,omitempty"` +} + +type InstanceInterfaceInitParameters struct { + + // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. + // The IPAM Address of this interface. + IpamAddress *string `json:"ipamAddress,omitempty" tf:"ipam_address,omitempty"` + + // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. + // The unique label of this interface. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The type of interface. (public, vlan) + // The purpose of this interface. + Purpose *string `json:"purpose,omitempty" tf:"purpose,omitempty"` +} + type InstanceInterfaceObservation struct { // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. @@ -463,6 +734,7 @@ type InstanceObservation struct { // This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses. // This Linode's IPv4 Addresses. Each Linode is assigned a single public IPv4 address upon creation, and may get a single private IPv4 address if needed. You may need to open a support ticket to get additional IPv4 addresses. + // +listType=set IPv4 []*string `json:"ipv4,omitempty" tf:"ipv4,omitempty"` // This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared. The prefix (/64) is included in this attribute. @@ -501,6 +773,7 @@ type InstanceObservation struct { // A set of IPv4 addresses to be shared with the Instance. These IP addresses can be both private and public, but must be in the same region as the instance. // A set of IPv4 addresses to share with this Linode. + // +listType=set SharedIPv4 []*string `json:"sharedIpv4,omitempty" tf:"shared_ipv4,omitempty"` // Information about the resources available to this Linode. @@ -520,6 +793,7 @@ type InstanceObservation struct { // A list of tags applied to this object. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` // The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", "g6-highmem-16", "g6-dedicated-16", etc. See all types here. @@ -621,6 +895,7 @@ type InstanceParameters struct { // A set of IPv4 addresses to be shared with the Instance. These IP addresses can be both private and public, but must be in the same region as the instance. // A set of IPv4 addresses to share with this Linode. // +kubebuilder:validation:Optional + // +listType=set SharedIPv4 []*string `json:"sharedIpv4,omitempty" tf:"shared_ipv4,omitempty"` // An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. Only accepted if 'stackscript_id' is given. The required values depend on the StackScript being deployed. This value can not be imported. Changing @@ -650,6 +925,7 @@ type InstanceParameters struct { // A list of tags applied to this object. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. // +kubebuilder:validation:Optional + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` // The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", "g6-highmem-16", "g6-dedicated-16", etc. See all types here. @@ -663,6 +939,21 @@ type InstanceParameters struct { WatchdogEnabled *bool `json:"watchdogEnabled,omitempty" tf:"watchdog_enabled,omitempty"` } +type InterfaceInitParameters struct { + + // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. + // The IPAM Address of this interface. + IpamAddress *string `json:"ipamAddress,omitempty" tf:"ipam_address,omitempty"` + + // The Linode's label is for display purposes only. If no label is provided for a Linode, a default will be assigned. + // The unique label of this interface. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The type of interface. (public, vlan) + // The purpose of this interface. + Purpose *string `json:"purpose,omitempty" tf:"purpose,omitempty"` +} + type InterfaceObservation struct { // This Network Interface’s private IP address in Classless Inter-Domain Routing (CIDR) notation. @@ -696,6 +987,12 @@ type InterfaceParameters struct { Purpose *string `json:"purpose,omitempty" tf:"purpose,omitempty"` } +type MetadataInitParameters struct { + + // The base64-encoded user-defined data exposed to this instance through the Linode Metadata service. Refer to the base64encode(...) function for information on encoding content for this field. + UserData *string `json:"userData,omitempty" tf:"user_data,omitempty"` +} + type MetadataObservation struct { // The base64-encoded user-defined data exposed to this instance through the Linode Metadata service. Refer to the base64encode(...) function for information on encoding content for this field. @@ -709,6 +1006,9 @@ type MetadataParameters struct { UserData *string `json:"userData,omitempty" tf:"user_data,omitempty"` } +type ScheduleInitParameters struct { +} + type ScheduleObservation struct { // The day of the week that your Linode's weekly Backup is taken. If not set manually, a day will be chosen for you. Backups are taken every day, but backups taken on this day are preferred when selecting backups to retain for a longer period. If not set manually, then when backups are initially enabled, this may come back as "Scheduling" until the day is automatically selected. @@ -721,6 +1021,21 @@ type ScheduleObservation struct { type ScheduleParameters struct { } +type SdaInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdaObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -754,6 +1069,21 @@ type SdaParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SdbInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdbObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -787,6 +1117,21 @@ type SdbParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SdcInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdcObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -820,6 +1165,21 @@ type SdcParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SddInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SddObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -853,6 +1213,21 @@ type SddParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SdeInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdeObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -886,6 +1261,21 @@ type SdeParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SdfInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdfObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -919,6 +1309,21 @@ type SdfParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SdgInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdgObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -952,6 +1357,21 @@ type SdgParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SdhInitParameters struct { + + // (Computed) The Disk ID of the associated disk_label, if used. + // The Disk ID to map to this disk slot + DiskID *float64 `json:"diskId,omitempty" tf:"disk_id,omitempty"` + + // The label of the disk to map to this device slot. + // The `label` of the `disk` to map to this `device` slot. + DiskLabel *string `json:"diskLabel,omitempty" tf:"disk_label,omitempty"` + + // The Volume ID to map to this device slot. + // The Block Storage volume ID to map to this disk slot + VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` +} + type SdhObservation struct { // (Computed) The Disk ID of the associated disk_label, if used. @@ -985,6 +1405,9 @@ type SdhParameters struct { VolumeID *float64 `json:"volumeId,omitempty" tf:"volume_id,omitempty"` } +type SpecsInitParameters struct { +} + type SpecsObservation struct { // The amount of storage space, in GB. this Linode has access to. A typical Linode will divide this space between a primary disk with an image deployed to it, and a swap disk, usually 512 MB. This is the default configuration created when deploying a Linode with an image through POST /linode/instances. @@ -1007,6 +1430,17 @@ type SpecsParameters struct { type InstanceSpec struct { v1.ResourceSpec `json:",inline"` ForProvider InstanceParameters `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 InstanceInitParameters `json:"initProvider,omitempty"` } // InstanceStatus defines the observed state of Instance. @@ -1016,18 +1450,19 @@ type InstanceStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Instance is the Schema for the Instances API. Manages a Linode instance. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Instance struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" Spec InstanceSpec `json:"spec"` Status InstanceStatus `json:"status,omitempty"` } diff --git a/apis/instance/v1alpha1/zz_ip_terraformed.go b/apis/instance/v1alpha1/zz_ip_terraformed.go new file mode 100755 index 0000000..321b7b0 --- /dev/null +++ b/apis/instance/v1alpha1/zz_ip_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 IP +func (mg *IP) GetTerraformResourceType() string { + return "linode_instance_ip" +} + +// GetConnectionDetailsMapping for this IP +func (tr *IP) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this IP +func (tr *IP) 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 IP +func (tr *IP) 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 IP +func (tr *IP) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this IP +func (tr *IP) 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 IP +func (tr *IP) 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 IP +func (tr *IP) 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 IP +func (tr *IP) 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 IP using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *IP) LateInitialize(attrs []byte) (bool, error) { + params := &IPParameters{} + 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 *IP) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/instance/v1alpha1/zz_ip_types.go b/apis/instance/v1alpha1/zz_ip_types.go index 9bfe624..71a517f 100755 --- a/apis/instance/v1alpha1/zz_ip_types.go +++ b/apis/instance/v1alpha1/zz_ip_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,43 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type IPInitParameters struct { + + // If true, the instance will be rebooted to update network interfaces. + // If true, the instance will be rebooted to update network interfaces. This functionality is not affected by the `skip_implicit_reboots` provider argument. + ApplyImmediately *bool `json:"applyImmediately,omitempty" tf:"apply_immediately,omitempty"` + + // The ID of the Linode to allocate an IPv4 address for. + // The ID of the Linode to allocate an IPv4 address for. + // +crossplane:generate:reference:type=Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // Whether the IPv4 address is public or private. Defaults to true. + // Whether the IPv4 address is public or private. + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The reverse DNS assigned to this address. + // The reverse DNS assigned to this address. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/rdns/v1alpha1.RDNS + Rdns *string `json:"rdns,omitempty" tf:"rdns,omitempty"` + + // Reference to a RDNS in rdns to populate rdns. + // +kubebuilder:validation:Optional + RdnsRef *v1.Reference `json:"rdnsRef,omitempty" tf:"-"` + + // Selector for a RDNS in rdns to populate rdns. + // +kubebuilder:validation:Optional + RdnsSelector *v1.Selector `json:"rdnsSelector,omitempty" tf:"-"` +} + type IPObservation struct { // The resulting IPv4 address. @@ -103,6 +144,17 @@ type IPParameters struct { type IPSpec struct { v1.ResourceSpec `json:",inline"` ForProvider IPParameters `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 IPInitParameters `json:"initProvider,omitempty"` } // IPStatus defines the observed state of IP. @@ -112,13 +164,14 @@ type IPStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // IP is the Schema for the IPs API. Manages a Linode instance IP. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type IP struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/instance/v1alpha1/zz_sharedips_terraformed.go b/apis/instance/v1alpha1/zz_sharedips_terraformed.go new file mode 100755 index 0000000..7c0a358 --- /dev/null +++ b/apis/instance/v1alpha1/zz_sharedips_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 SharedIPs +func (mg *SharedIPs) GetTerraformResourceType() string { + return "linode_instance_shared_ips" +} + +// GetConnectionDetailsMapping for this SharedIPs +func (tr *SharedIPs) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this SharedIPs +func (tr *SharedIPs) 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 SharedIPs +func (tr *SharedIPs) 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 SharedIPs +func (tr *SharedIPs) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this SharedIPs +func (tr *SharedIPs) 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 SharedIPs +func (tr *SharedIPs) 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 SharedIPs +func (tr *SharedIPs) 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 SharedIPs +func (tr *SharedIPs) 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 SharedIPs using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *SharedIPs) LateInitialize(attrs []byte) (bool, error) { + params := &SharedIPsParameters{} + 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 *SharedIPs) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/instance/v1alpha1/zz_sharedips_types.go b/apis/instance/v1alpha1/zz_sharedips_types.go index f6a22eb..5cf8cc4 100755 --- a/apis/instance/v1alpha1/zz_sharedips_types.go +++ b/apis/instance/v1alpha1/zz_sharedips_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,10 +17,32 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type SharedIPsInitParameters struct { + + // The set of IPs to share with the Linode. + // A set of IP addresses to share to the Linode + // +listType=set + Addresses []*string `json:"addresses,omitempty" tf:"addresses,omitempty"` + + // The ID of the Linode to share the IPs to. + // The ID of the Linode to share these IP addresses with. + // +crossplane:generate:reference:type=Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` +} + type SharedIPsObservation struct { // The set of IPs to share with the Linode. // A set of IP addresses to share to the Linode + // +listType=set Addresses []*string `json:"addresses,omitempty" tf:"addresses,omitempty"` ID *string `json:"id,omitempty" tf:"id,omitempty"` @@ -31,6 +57,7 @@ type SharedIPsParameters struct { // The set of IPs to share with the Linode. // A set of IP addresses to share to the Linode // +kubebuilder:validation:Optional + // +listType=set Addresses []*string `json:"addresses,omitempty" tf:"addresses,omitempty"` // The ID of the Linode to share the IPs to. @@ -52,6 +79,17 @@ type SharedIPsParameters struct { type SharedIPsSpec struct { v1.ResourceSpec `json:",inline"` ForProvider SharedIPsParameters `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 SharedIPsInitParameters `json:"initProvider,omitempty"` } // SharedIPsStatus defines the observed state of SharedIPs. @@ -61,18 +99,19 @@ type SharedIPsStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // SharedIPs is the Schema for the SharedIPss API. Manages IP addresses shared to a Linode. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode},path=sharedips type SharedIPs struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.addresses)",message="addresses is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.addresses) || (has(self.initProvider) && has(self.initProvider.addresses))",message="spec.forProvider.addresses is a required parameter" Spec SharedIPsSpec `json:"spec"` Status SharedIPsStatus `json:"status,omitempty"` } diff --git a/apis/ipv6/v1alpha1/zz_generated.conversion_hubs.go b/apis/ipv6/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..1404ea2 --- /dev/null +++ b/apis/ipv6/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *IPv6Range) Hub() {} diff --git a/apis/ipv6/v1alpha1/zz_generated.deepcopy.go b/apis/ipv6/v1alpha1/zz_generated.deepcopy.go index 9a54df1..5a24264 100644 --- a/apis/ipv6/v1alpha1/zz_generated.deepcopy.go +++ b/apis/ipv6/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,46 @@ func (in *IPv6Range) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPv6RangeInitParameters) DeepCopyInto(out *IPv6RangeInitParameters) { + *out = *in + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.PrefixLength != nil { + in, out := &in.PrefixLength, &out.PrefixLength + *out = new(float64) + **out = **in + } + if in.RouteTarget != nil { + in, out := &in.RouteTarget, &out.RouteTarget + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPv6RangeInitParameters. +func (in *IPv6RangeInitParameters) DeepCopy() *IPv6RangeInitParameters { + if in == nil { + return nil + } + out := new(IPv6RangeInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IPv6RangeList) DeepCopyInto(out *IPv6RangeList) { *out = *in @@ -179,6 +218,7 @@ func (in *IPv6RangeSpec) DeepCopyInto(out *IPv6RangeSpec) { *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 IPv6RangeSpec. diff --git a/apis/ipv6/v1alpha1/zz_generated.managed.go b/apis/ipv6/v1alpha1/zz_generated.managed.go index 49fe1fe..6c82356 100644 --- a/apis/ipv6/v1alpha1/zz_generated.managed.go +++ b/apis/ipv6/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *IPv6Range) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this IPv6Range. -func (mg *IPv6Range) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this IPv6Range. +func (mg *IPv6Range) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this IPv6Range. @@ -27,14 +27,6 @@ func (mg *IPv6Range) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this IPv6Range. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *IPv6Range) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this IPv6Range. func (mg *IPv6Range) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *IPv6Range) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this IPv6Range. -func (mg *IPv6Range) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this IPv6Range. +func (mg *IPv6Range) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this IPv6Range. @@ -65,14 +57,6 @@ func (mg *IPv6Range) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this IPv6Range. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *IPv6Range) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this IPv6Range. func (mg *IPv6Range) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/ipv6/v1alpha1/zz_generated.resolvers.go b/apis/ipv6/v1alpha1/zz_generated.resolvers.go index f06a67e..e7e6c58 100644 --- a/apis/ipv6/v1alpha1/zz_generated.resolvers.go +++ b/apis/ipv6/v1alpha1/zz_generated.resolvers.go @@ -36,5 +36,21 @@ func (mg *IPv6Range) ResolveReferences(ctx context.Context, c client.Reader) err mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/ipv6/v1alpha1/zz_groupversion_info.go b/apis/ipv6/v1alpha1/zz_groupversion_info.go index e49c1d5..a4db103 100755 --- a/apis/ipv6/v1alpha1/zz_groupversion_info.go +++ b/apis/ipv6/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/ipv6/v1alpha1/zz_generated_terraformed.go b/apis/ipv6/v1alpha1/zz_ipv6range_terraformed.go similarity index 60% rename from apis/ipv6/v1alpha1/zz_generated_terraformed.go rename to apis/ipv6/v1alpha1/zz_ipv6range_terraformed.go index 9363cfd..6af45c1 100755 --- a/apis/ipv6/v1alpha1/zz_generated_terraformed.go +++ b/apis/ipv6/v1alpha1/zz_ipv6range_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this IPv6Range @@ -69,6 +74,46 @@ func (tr *IPv6Range) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this IPv6Range +func (tr *IPv6Range) 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 IPv6Range +func (tr *IPv6Range) 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 IPv6Range using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *IPv6Range) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/ipv6/v1alpha1/zz_ipv6range_types.go b/apis/ipv6/v1alpha1/zz_ipv6range_types.go index e7ae008..3d99995 100755 --- a/apis/ipv6/v1alpha1/zz_ipv6range_types.go +++ b/apis/ipv6/v1alpha1/zz_ipv6range_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,30 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type IPv6RangeInitParameters struct { + + // The ID of the Linode to assign this range to. This field may be updated to reassign the IPv6 range. + // The ID of the Linode to assign this range to. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // The prefix length of the IPv6 range. + // The prefix length of the IPv6 range. + PrefixLength *float64 `json:"prefixLength,omitempty" tf:"prefix_length,omitempty"` + + // The IPv6 SLAAC address to assign this range to. + // The IPv6 SLAAC address to assign this range to. + RouteTarget *string `json:"routeTarget,omitempty" tf:"route_target,omitempty"` +} + type IPv6RangeObservation struct { ID *string `json:"id,omitempty" tf:"id,omitempty"` @@ -26,6 +54,7 @@ type IPv6RangeObservation struct { // A list of Linodes targeted by this IPv6 range. Includes Linodes with IP sharing. // A list of Linodes targeted by this IPv6 range.Includes Linodes with IP sharing. + // +listType=set Linodes []*float64 `json:"linodes,omitempty" tf:"linodes,omitempty"` // The prefix length of the IPv6 range. @@ -76,6 +105,17 @@ type IPv6RangeParameters struct { type IPv6RangeSpec struct { v1.ResourceSpec `json:",inline"` ForProvider IPv6RangeParameters `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 IPv6RangeInitParameters `json:"initProvider,omitempty"` } // IPv6RangeStatus defines the observed state of IPv6Range. @@ -85,18 +125,19 @@ type IPv6RangeStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // IPv6Range is the Schema for the IPv6Ranges API. Manages a Linode IPv6 range. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type IPv6Range struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.prefixLength)",message="prefixLength is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.prefixLength) || (has(self.initProvider) && has(self.initProvider.prefixLength))",message="spec.forProvider.prefixLength is a required parameter" Spec IPv6RangeSpec `json:"spec"` Status IPv6RangeStatus `json:"status,omitempty"` } diff --git a/apis/lke/v1alpha1/zz_generated_terraformed.go b/apis/lke/v1alpha1/zz_cluster_terraformed.go similarity index 60% rename from apis/lke/v1alpha1/zz_generated_terraformed.go rename to apis/lke/v1alpha1/zz_cluster_terraformed.go index 1ef17a6..1fd57c4 100755 --- a/apis/lke/v1alpha1/zz_generated_terraformed.go +++ b/apis/lke/v1alpha1/zz_cluster_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this Cluster @@ -69,6 +74,46 @@ func (tr *Cluster) SetParameters(params map[string]any) error { 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) { diff --git a/apis/lke/v1alpha1/zz_cluster_types.go b/apis/lke/v1alpha1/zz_cluster_types.go index dbca42c..e0b99d7 100755 --- a/apis/lke/v1alpha1/zz_cluster_types.go +++ b/apis/lke/v1alpha1/zz_cluster_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,17 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type AutoscalerInitParameters struct { + + // The maximum number of nodes to autoscale to. + // The maximum number of nodes to autoscale to. + Max *float64 `json:"max,omitempty" tf:"max,omitempty"` + + // The minimum number of nodes to autoscale to. + // The minimum number of nodes to autoscale to. + Min *float64 `json:"min,omitempty" tf:"min,omitempty"` +} + type AutoscalerObservation struct { // The maximum number of nodes to autoscale to. @@ -28,15 +43,42 @@ type AutoscalerParameters struct { // The maximum number of nodes to autoscale to. // The maximum number of nodes to autoscale to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Max *float64 `json:"max" tf:"max,omitempty"` // The minimum number of nodes to autoscale to. // The minimum number of nodes to autoscale to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Min *float64 `json:"min" tf:"min,omitempty"` } +type ClusterInitParameters struct { + + // Defines settings for the Kubernetes Control Plane. + ControlPlane []ControlPlaneInitParameters `json:"controlPlane,omitempty" tf:"control_plane,omitempty"` + + // The desired Kubernetes version for this Kubernetes cluster in the format of major.minor (e.g. 1.21), and the latest supported patch version will be deployed. + // The desired Kubernetes version for this Kubernetes cluster in the format of .. The latest supported patch version will be deployed. + K8SVersion *string `json:"k8sVersion,omitempty" tf:"k8s_version,omitempty"` + + // This Kubernetes cluster's unique label. + // The unique label for the cluster. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // Additional nested attributes: + // A node pool in the cluster. + Pool []PoolInitParameters `json:"pool,omitempty" tf:"pool,omitempty"` + + // This Kubernetes cluster's location. + // This cluster's location. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // An array of tags applied to the Kubernetes cluster. Tags are for organizational purposes only. + // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + type ClusterObservation struct { // The endpoints for the Kubernetes API server. @@ -75,6 +117,7 @@ type ClusterObservation struct { // An array of tags applied to the Kubernetes cluster. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` } @@ -107,9 +150,17 @@ type ClusterParameters struct { // An array of tags applied to the Kubernetes cluster. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. // +kubebuilder:validation:Optional + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` } +type ControlPlaneInitParameters struct { + + // Defines whether High Availability is enabled for the cluster Control Plane. This is an irreversible change. + // Defines whether High Availability is enabled for the Control Plane Components of the cluster. + HighAvailability *bool `json:"highAvailability,omitempty" tf:"high_availability,omitempty"` +} + type ControlPlaneObservation struct { // Defines whether High Availability is enabled for the cluster Control Plane. This is an irreversible change. @@ -125,6 +176,9 @@ type ControlPlaneParameters struct { HighAvailability *bool `json:"highAvailability,omitempty" tf:"high_availability,omitempty"` } +type NodesInitParameters struct { +} + type NodesObservation struct { // The ID of the cluster. @@ -140,6 +194,20 @@ type NodesObservation struct { type NodesParameters struct { } +type PoolInitParameters struct { + + // When specified, the number of nodes autoscales within the defined minimum and maximum values. + Autoscaler []AutoscalerInitParameters `json:"autoscaler,omitempty" tf:"autoscaler,omitempty"` + + // The number of nodes in the Node Pool. + // The number of nodes in the Node Pool. + Count *float64 `json:"count,omitempty" tf:"count,omitempty"` + + // A Linode Type for all of the nodes in the Node Pool. See all node types here. + // A Linode Type for all of the nodes in the Node Pool. + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + type PoolObservation struct { // When specified, the number of nodes autoscales within the defined minimum and maximum values. @@ -169,12 +237,12 @@ type PoolParameters struct { // The number of nodes in the Node Pool. // The number of nodes in the Node Pool. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Count *float64 `json:"count" tf:"count,omitempty"` // A Linode Type for all of the nodes in the Node Pool. See all node types here. // A Linode Type for all of the nodes in the Node Pool. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Type *string `json:"type" tf:"type,omitempty"` } @@ -182,6 +250,17 @@ type PoolParameters struct { 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. @@ -191,21 +270,22 @@ type ClusterStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Cluster is the Schema for the Clusters API. Manages a Linode instance. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Cluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.k8sVersion)",message="k8sVersion is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.pool)",message="pool is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.k8sVersion) || (has(self.initProvider) && has(self.initProvider.k8sVersion))",message="spec.forProvider.k8sVersion is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.pool) || (has(self.initProvider) && has(self.initProvider.pool))",message="spec.forProvider.pool is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" Spec ClusterSpec `json:"spec"` Status ClusterStatus `json:"status,omitempty"` } diff --git a/apis/lke/v1alpha1/zz_generated.conversion_hubs.go b/apis/lke/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..7f1aa17 --- /dev/null +++ b/apis/lke/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Cluster) Hub() {} diff --git a/apis/lke/v1alpha1/zz_generated.deepcopy.go b/apis/lke/v1alpha1/zz_generated.deepcopy.go index d2bcfb7..b513fa2 100644 --- a/apis/lke/v1alpha1/zz_generated.deepcopy.go +++ b/apis/lke/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -13,6 +12,31 @@ 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 *AutoscalerInitParameters) DeepCopyInto(out *AutoscalerInitParameters) { + *out = *in + if in.Max != nil { + in, out := &in.Max, &out.Max + *out = new(float64) + **out = **in + } + if in.Min != nil { + in, out := &in.Min, &out.Min + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalerInitParameters. +func (in *AutoscalerInitParameters) DeepCopy() *AutoscalerInitParameters { + if in == nil { + return nil + } + out := new(AutoscalerInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AutoscalerObservation) DeepCopyInto(out *AutoscalerObservation) { *out = *in @@ -90,6 +114,61 @@ func (in *Cluster) DeepCopyObject() runtime.Object { 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.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = make([]ControlPlaneInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.K8SVersion != nil { + in, out := &in.K8SVersion, &out.K8SVersion + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Pool != nil { + in, out := &in.Pool, &out.Pool + *out = make([]PoolInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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 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 @@ -263,6 +342,7 @@ 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. @@ -292,6 +372,26 @@ func (in *ClusterStatus) DeepCopy() *ClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneInitParameters) DeepCopyInto(out *ControlPlaneInitParameters) { + *out = *in + if in.HighAvailability != nil { + in, out := &in.HighAvailability, &out.HighAvailability + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneInitParameters. +func (in *ControlPlaneInitParameters) DeepCopy() *ControlPlaneInitParameters { + if in == nil { + return nil + } + out := new(ControlPlaneInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ControlPlaneObservation) DeepCopyInto(out *ControlPlaneObservation) { *out = *in @@ -332,6 +432,21 @@ func (in *ControlPlaneParameters) DeepCopy() *ControlPlaneParameters { 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 @@ -377,6 +492,38 @@ func (in *NodesParameters) DeepCopy() *NodesParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PoolInitParameters) DeepCopyInto(out *PoolInitParameters) { + *out = *in + if in.Autoscaler != nil { + in, out := &in.Autoscaler, &out.Autoscaler + *out = make([]AutoscalerInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(float64) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PoolInitParameters. +func (in *PoolInitParameters) DeepCopy() *PoolInitParameters { + if in == nil { + return nil + } + out := new(PoolInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PoolObservation) DeepCopyInto(out *PoolObservation) { *out = *in diff --git a/apis/lke/v1alpha1/zz_generated.managed.go b/apis/lke/v1alpha1/zz_generated.managed.go index 71aacbf..3eca84a 100644 --- a/apis/lke/v1alpha1/zz_generated.managed.go +++ b/apis/lke/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Cluster) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Cluster. -func (mg *Cluster) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Cluster. +func (mg *Cluster) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Cluster. @@ -27,14 +27,6 @@ func (mg *Cluster) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Cluster. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Cluster) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Cluster. func (mg *Cluster) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Cluster) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Cluster. -func (mg *Cluster) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Cluster. +func (mg *Cluster) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Cluster. @@ -65,14 +57,6 @@ func (mg *Cluster) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Cluster. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Cluster) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Cluster. func (mg *Cluster) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/lke/v1alpha1/zz_groupversion_info.go b/apis/lke/v1alpha1/zz_groupversion_info.go index 2dbd4eb..4d4aafb 100755 --- a/apis/lke/v1alpha1/zz_groupversion_info.go +++ b/apis/lke/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/nodebalancer/v1alpha1/zz_config_terraformed.go b/apis/nodebalancer/v1alpha1/zz_config_terraformed.go new file mode 100755 index 0000000..a1cc33d --- /dev/null +++ b/apis/nodebalancer/v1alpha1/zz_config_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Config +func (mg *Config) GetTerraformResourceType() string { + return "linode_nodebalancer_config" +} + +// GetConnectionDetailsMapping for this Config +func (tr *Config) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ssl_cert": "spec.forProvider.sslCertSecretRef", "ssl_key": "spec.forProvider.sslKeySecretRef"} +} + +// GetObservation of this Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config +func (tr *Config) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config +func (tr *Config) 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 Config using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Config) LateInitialize(attrs []byte) (bool, error) { + params := &ConfigParameters{} + 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 *Config) GetTerraformSchemaVersion() int { + return 1 +} diff --git a/apis/nodebalancer/v1alpha1/zz_config_types.go b/apis/nodebalancer/v1alpha1/zz_config_types.go index 665fa7a..2812aba 100755 --- a/apis/nodebalancer/v1alpha1/zz_config_types.go +++ b/apis/nodebalancer/v1alpha1/zz_config_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,73 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type ConfigInitParameters struct { + + // What algorithm this NodeBalancer should use for routing traffic to backends. (roundrobin, leastconn, source) + // What algorithm this NodeBalancer should use for routing traffic to backends: roundrobin, leastconn, source + Algorithm *string `json:"algorithm,omitempty" tf:"algorithm,omitempty"` + + // The type of check to perform against backends to ensure they are serving requests. This is used to determine if backends are up or down. If none no check is performed. connection requires only a connection to the backend to succeed. http and http_body rely on the backend serving HTTP, and that the response returned matches what is expected. (none, connection, http, http_body) + // The type of check to perform against backends to ensure they are serving requests. This is used to determine if backends are up or down. If none no check is performed. connection requires only a connection to the backend to succeed. http and http_body rely on the backend serving HTTP, and that the response returned matches what is expected. + Check *string `json:"check,omitempty" tf:"check,omitempty"` + + // How many times to attempt a check before considering a backend to be down. (1-30) + // How many times to attempt a check before considering a backend to be down. (1-30) + CheckAttempts *float64 `json:"checkAttempts,omitempty" tf:"check_attempts,omitempty"` + + // This value must be present in the response body of the check in order for it to pass. If this value is not present in the response body of a check request, the backend is considered to be down + CheckBody *string `json:"checkBody,omitempty" tf:"check_body,omitempty"` + + // How often, in seconds, to check that backends are up and serving requests. + // How often, in seconds, to check that backends are up and serving requests. + CheckInterval *float64 `json:"checkInterval,omitempty" tf:"check_interval,omitempty"` + + // If true, any response from this backend with a 5xx status code will be enough for it to be considered unhealthy and taken out of rotation. + // If true, any response from this backend with a 5xx status code will be enough for it to be considered unhealthy and taken out of rotation. + CheckPassive *bool `json:"checkPassive,omitempty" tf:"check_passive,omitempty"` + + // The URL path to check on each backend. If the backend does not respond to this request it is considered to be down. + // The URL path to check on each backend. If the backend does not respond to this request it is considered to be down. + CheckPath *string `json:"checkPath,omitempty" tf:"check_path,omitempty"` + + // How long, in seconds, to wait for a check attempt before considering it failed. (1-30) + // How long, in seconds, to wait for a check attempt before considering it failed. (1-30) + CheckTimeout *float64 `json:"checkTimeout,omitempty" tf:"check_timeout,omitempty"` + + // What ciphers to use for SSL connections served by this NodeBalancer. legacy is considered insecure and should only be used if necessary. + // What ciphers to use for SSL connections served by this NodeBalancer. `legacy` is considered insecure and should only be used if necessary. + CipherSuite *string `json:"cipherSuite,omitempty" tf:"cipher_suite,omitempty"` + + // The ID of the NodeBalancer to access. + // The ID of the NodeBalancer to access. + // +crossplane:generate:reference:type=Nodebalancer + NodebalancerID *float64 `json:"nodebalancerId,omitempty" tf:"nodebalancer_id,omitempty"` + + // Reference to a Nodebalancer to populate nodebalancerId. + // +kubebuilder:validation:Optional + NodebalancerIDRef *v1.Reference `json:"nodebalancerIdRef,omitempty" tf:"-"` + + // Selector for a Nodebalancer to populate nodebalancerId. + // +kubebuilder:validation:Optional + NodebalancerIDSelector *v1.Selector `json:"nodebalancerIdSelector,omitempty" tf:"-"` + + // The TCP port this Config is for. These values must be unique across configs on a single NodeBalancer (you can't have two configs for port 80, for example). While some ports imply some protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a NodeBalancer listening on port 443. (Defaults to 80) + // The TCP port this Config is for. These values must be unique across configs on a single NodeBalancer (you can't have two configs for port 80, for example). While some ports imply some protocols, no enforcement is done and you may configure your NodeBalancer however is useful to you. For example, while port 443 is generally used for HTTPS, you do not need SSL configured to have a NodeBalancer listening on port 443. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // The protocol this port is configured to serve. If this is set to https you must include an ssl_cert and an ssl_key. (http, https, tcp) (Defaults to http) + // The protocol this port is configured to serve. If this is set to https you must include an ssl_cert and an ssl_key. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // The version of ProxyProtocol to use for the underlying NodeBalancer. This requires protocol to be tcp. (none, v1, v2) (Defaults to none) + // The version of ProxyProtocol to use for the underlying NodeBalancer. This requires protocol to be `tcp`. Valid values are `none`, `v1`, and `v2`. + ProxyProtocol *string `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` + + // Controls how session stickiness is handled on this port. (none, table, http_cookie) + // Controls how session stickiness is handled on this port: 'none', 'table', 'http_cookie' + Stickiness *string `json:"stickiness,omitempty" tf:"stickiness,omitempty"` +} + type ConfigObservation struct { // What algorithm this NodeBalancer should use for routing traffic to backends. (roundrobin, leastconn, source) @@ -175,6 +246,9 @@ type ConfigParameters struct { Stickiness *string `json:"stickiness,omitempty" tf:"stickiness,omitempty"` } +type NodeStatusInitParameters struct { +} + type NodeStatusObservation struct { // The number of backends considered to be 'DOWN' and unhealthy. These are not in rotation, and not serving requests. @@ -191,6 +265,17 @@ type NodeStatusParameters struct { type ConfigSpec struct { v1.ResourceSpec `json:",inline"` ForProvider ConfigParameters `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 ConfigInitParameters `json:"initProvider,omitempty"` } // ConfigStatus defines the observed state of Config. @@ -200,13 +285,14 @@ type ConfigStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Config is the Schema for the Configs API. Manages a Linode NodeBalancer Config. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Config struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/nodebalancer/v1alpha1/zz_generated.conversion_hubs.go b/apis/nodebalancer/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..82b23f2 --- /dev/null +++ b/apis/nodebalancer/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Nodebalancer) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Config) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Node) Hub() {} diff --git a/apis/nodebalancer/v1alpha1/zz_generated.deepcopy.go b/apis/nodebalancer/v1alpha1/zz_generated.deepcopy.go index 4fce23f..9b923ce 100644 --- a/apis/nodebalancer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/nodebalancer/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,101 @@ func (in *Config) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigInitParameters) DeepCopyInto(out *ConfigInitParameters) { + *out = *in + if in.Algorithm != nil { + in, out := &in.Algorithm, &out.Algorithm + *out = new(string) + **out = **in + } + if in.Check != nil { + in, out := &in.Check, &out.Check + *out = new(string) + **out = **in + } + if in.CheckAttempts != nil { + in, out := &in.CheckAttempts, &out.CheckAttempts + *out = new(float64) + **out = **in + } + if in.CheckBody != nil { + in, out := &in.CheckBody, &out.CheckBody + *out = new(string) + **out = **in + } + if in.CheckInterval != nil { + in, out := &in.CheckInterval, &out.CheckInterval + *out = new(float64) + **out = **in + } + if in.CheckPassive != nil { + in, out := &in.CheckPassive, &out.CheckPassive + *out = new(bool) + **out = **in + } + if in.CheckPath != nil { + in, out := &in.CheckPath, &out.CheckPath + *out = new(string) + **out = **in + } + if in.CheckTimeout != nil { + in, out := &in.CheckTimeout, &out.CheckTimeout + *out = new(float64) + **out = **in + } + if in.CipherSuite != nil { + in, out := &in.CipherSuite, &out.CipherSuite + *out = new(string) + **out = **in + } + if in.NodebalancerID != nil { + in, out := &in.NodebalancerID, &out.NodebalancerID + *out = new(float64) + **out = **in + } + if in.NodebalancerIDRef != nil { + in, out := &in.NodebalancerIDRef, &out.NodebalancerIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NodebalancerIDSelector != nil { + in, out := &in.NodebalancerIDSelector, &out.NodebalancerIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ProxyProtocol != nil { + in, out := &in.ProxyProtocol, &out.ProxyProtocol + *out = new(string) + **out = **in + } + if in.Stickiness != nil { + in, out := &in.Stickiness, &out.Stickiness + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigInitParameters. +func (in *ConfigInitParameters) DeepCopy() *ConfigInitParameters { + if in == nil { + return nil + } + out := new(ConfigInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConfigList) DeepCopyInto(out *ConfigList) { *out = *in @@ -290,6 +384,7 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) { *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 ConfigSpec. @@ -346,6 +441,71 @@ func (in *Node) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeInitParameters) DeepCopyInto(out *NodeInitParameters) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.ConfigID != nil { + in, out := &in.ConfigID, &out.ConfigID + *out = new(float64) + **out = **in + } + if in.ConfigIDRef != nil { + in, out := &in.ConfigIDRef, &out.ConfigIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ConfigIDSelector != nil { + in, out := &in.ConfigIDSelector, &out.ConfigIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.NodebalancerID != nil { + in, out := &in.NodebalancerID, &out.NodebalancerID + *out = new(float64) + **out = **in + } + if in.NodebalancerIDRef != nil { + in, out := &in.NodebalancerIDRef, &out.NodebalancerIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NodebalancerIDSelector != nil { + in, out := &in.NodebalancerIDSelector, &out.NodebalancerIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeInitParameters. +func (in *NodeInitParameters) DeepCopy() *NodeInitParameters { + if in == nil { + return nil + } + out := new(NodeInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeList) DeepCopyInto(out *NodeList) { *out = *in @@ -503,6 +663,7 @@ func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { *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 NodeSpec. @@ -532,6 +693,21 @@ func (in *NodeStatus) DeepCopy() *NodeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeStatusInitParameters) DeepCopyInto(out *NodeStatusInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeStatusInitParameters. +func (in *NodeStatusInitParameters) DeepCopy() *NodeStatusInitParameters { + if in == nil { + return nil + } + out := new(NodeStatusInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeStatusObservation) DeepCopyInto(out *NodeStatusObservation) { *out = *in @@ -599,6 +775,52 @@ func (in *Nodebalancer) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodebalancerInitParameters) DeepCopyInto(out *NodebalancerInitParameters) { + *out = *in + if in.ClientConnThrottle != nil { + in, out := &in.ClientConnThrottle, &out.ClientConnThrottle + *out = new(float64) + **out = **in + } + if in.FirewallID != nil { + in, out := &in.FirewallID, &out.FirewallID + *out = new(float64) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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 NodebalancerInitParameters. +func (in *NodebalancerInitParameters) DeepCopy() *NodebalancerInitParameters { + if in == nil { + return nil + } + out := new(NodebalancerInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodebalancerList) DeepCopyInto(out *NodebalancerList) { *out = *in @@ -765,6 +987,7 @@ func (in *NodebalancerSpec) DeepCopyInto(out *NodebalancerSpec) { *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 NodebalancerSpec. @@ -794,6 +1017,21 @@ func (in *NodebalancerStatus) DeepCopy() *NodebalancerStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TransferInitParameters) DeepCopyInto(out *TransferInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TransferInitParameters. +func (in *TransferInitParameters) DeepCopy() *TransferInitParameters { + if in == nil { + return nil + } + out := new(TransferInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TransferObservation) DeepCopyInto(out *TransferObservation) { *out = *in diff --git a/apis/nodebalancer/v1alpha1/zz_generated.managed.go b/apis/nodebalancer/v1alpha1/zz_generated.managed.go index fc5de20..6d2d63c 100644 --- a/apis/nodebalancer/v1alpha1/zz_generated.managed.go +++ b/apis/nodebalancer/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Config) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Config. -func (mg *Config) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Config. +func (mg *Config) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Config. @@ -27,14 +27,6 @@ func (mg *Config) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Config. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Config) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Config. func (mg *Config) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Config) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Config. -func (mg *Config) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Config. +func (mg *Config) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Config. @@ -65,14 +57,6 @@ func (mg *Config) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Config. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Config) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Config. func (mg *Config) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -93,9 +77,9 @@ func (mg *Node) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Node. -func (mg *Node) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Node. +func (mg *Node) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Node. @@ -103,14 +87,6 @@ func (mg *Node) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Node. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Node) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Node. func (mg *Node) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -131,9 +107,9 @@ func (mg *Node) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Node. -func (mg *Node) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Node. +func (mg *Node) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Node. @@ -141,14 +117,6 @@ func (mg *Node) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Node. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Node) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Node. func (mg *Node) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -169,9 +137,9 @@ func (mg *Nodebalancer) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Nodebalancer. -func (mg *Nodebalancer) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Nodebalancer. +func (mg *Nodebalancer) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Nodebalancer. @@ -179,14 +147,6 @@ func (mg *Nodebalancer) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Nodebalancer. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Nodebalancer) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Nodebalancer. func (mg *Nodebalancer) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -207,9 +167,9 @@ func (mg *Nodebalancer) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Nodebalancer. -func (mg *Nodebalancer) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Nodebalancer. +func (mg *Nodebalancer) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Nodebalancer. @@ -217,14 +177,6 @@ func (mg *Nodebalancer) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Nodebalancer. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Nodebalancer) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Nodebalancer. func (mg *Nodebalancer) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/nodebalancer/v1alpha1/zz_generated.resolvers.go b/apis/nodebalancer/v1alpha1/zz_generated.resolvers.go index f718ea8..af05ab9 100644 --- a/apis/nodebalancer/v1alpha1/zz_generated.resolvers.go +++ b/apis/nodebalancer/v1alpha1/zz_generated.resolvers.go @@ -35,6 +35,22 @@ func (mg *Config) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.NodebalancerID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.NodebalancerIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.NodebalancerID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.NodebalancerIDRef, + Selector: mg.Spec.InitProvider.NodebalancerIDSelector, + To: reference.To{ + List: &NodebalancerList{}, + Managed: &Nodebalancer{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.NodebalancerID") + } + mg.Spec.InitProvider.NodebalancerID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.NodebalancerIDRef = rsp.ResolvedReference + return nil } @@ -77,5 +93,37 @@ func (mg *Node) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.NodebalancerID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.NodebalancerIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.ConfigID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.ConfigIDRef, + Selector: mg.Spec.InitProvider.ConfigIDSelector, + To: reference.To{ + List: &ConfigList{}, + Managed: &Config{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ConfigID") + } + mg.Spec.InitProvider.ConfigID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.ConfigIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.NodebalancerID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.NodebalancerIDRef, + Selector: mg.Spec.InitProvider.NodebalancerIDSelector, + To: reference.To{ + List: &NodebalancerList{}, + Managed: &Nodebalancer{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.NodebalancerID") + } + mg.Spec.InitProvider.NodebalancerID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.NodebalancerIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/nodebalancer/v1alpha1/zz_generated_terraformed.go b/apis/nodebalancer/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index faf6c82..0000000 --- a/apis/nodebalancer/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/pkg/errors" - - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Nodebalancer -func (mg *Nodebalancer) GetTerraformResourceType() string { - return "linode_nodebalancer" -} - -// GetConnectionDetailsMapping for this Nodebalancer -func (tr *Nodebalancer) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Nodebalancer -func (tr *Nodebalancer) 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 Nodebalancer -func (tr *Nodebalancer) 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 Nodebalancer -func (tr *Nodebalancer) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Nodebalancer -func (tr *Nodebalancer) 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 Nodebalancer -func (tr *Nodebalancer) 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) -} - -// LateInitialize this Nodebalancer using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Nodebalancer) LateInitialize(attrs []byte) (bool, error) { - params := &NodebalancerParameters{} - 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 *Nodebalancer) GetTerraformSchemaVersion() int { - return 1 -} - -// GetTerraformResourceType returns Terraform resource type for this Config -func (mg *Config) GetTerraformResourceType() string { - return "linode_nodebalancer_config" -} - -// GetConnectionDetailsMapping for this Config -func (tr *Config) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"ssl_cert": "spec.forProvider.sslCertSecretRef", "ssl_key": "spec.forProvider.sslKeySecretRef"} -} - -// GetObservation of this Config -func (tr *Config) 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 Config -func (tr *Config) 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 Config -func (tr *Config) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Config -func (tr *Config) 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 Config -func (tr *Config) 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) -} - -// LateInitialize this Config using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Config) LateInitialize(attrs []byte) (bool, error) { - params := &ConfigParameters{} - 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 *Config) GetTerraformSchemaVersion() int { - return 1 -} - -// GetTerraformResourceType returns Terraform resource type for this Node -func (mg *Node) GetTerraformResourceType() string { - return "linode_nodebalancer_node" -} - -// GetConnectionDetailsMapping for this Node -func (tr *Node) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Node -func (tr *Node) 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 Node -func (tr *Node) 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 Node -func (tr *Node) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Node -func (tr *Node) 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 Node -func (tr *Node) 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) -} - -// LateInitialize this Node using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Node) LateInitialize(attrs []byte) (bool, error) { - params := &NodeParameters{} - 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 *Node) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/nodebalancer/v1alpha1/zz_groupversion_info.go b/apis/nodebalancer/v1alpha1/zz_groupversion_info.go index d5b7c23..5d1ba56 100755 --- a/apis/nodebalancer/v1alpha1/zz_groupversion_info.go +++ b/apis/nodebalancer/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/nodebalancer/v1alpha1/zz_node_terraformed.go b/apis/nodebalancer/v1alpha1/zz_node_terraformed.go new file mode 100755 index 0000000..a2e8209 --- /dev/null +++ b/apis/nodebalancer/v1alpha1/zz_node_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Node +func (mg *Node) GetTerraformResourceType() string { + return "linode_nodebalancer_node" +} + +// GetConnectionDetailsMapping for this Node +func (tr *Node) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Node +func (tr *Node) 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 Node +func (tr *Node) 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 Node +func (tr *Node) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Node +func (tr *Node) 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 Node +func (tr *Node) 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 Node +func (tr *Node) 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 Node +func (tr *Node) 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 Node using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Node) LateInitialize(attrs []byte) (bool, error) { + params := &NodeParameters{} + 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 *Node) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nodebalancer/v1alpha1/zz_node_types.go b/apis/nodebalancer/v1alpha1/zz_node_types.go index e6180dc..33bb0f3 100755 --- a/apis/nodebalancer/v1alpha1/zz_node_types.go +++ b/apis/nodebalancer/v1alpha1/zz_node_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,51 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type NodeInitParameters struct { + + // The private IP Address where this backend can be reached. This must be a private IP address. + // The private IP Address and port (IP:PORT) where this backend can be reached. This must be a private IP address. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // The ID of the NodeBalancerConfig to access. + // The ID of the NodeBalancerConfig to access. + // +crossplane:generate:reference:type=Config + ConfigID *float64 `json:"configId,omitempty" tf:"config_id,omitempty"` + + // Reference to a Config to populate configId. + // +kubebuilder:validation:Optional + ConfigIDRef *v1.Reference `json:"configIdRef,omitempty" tf:"-"` + + // Selector for a Config to populate configId. + // +kubebuilder:validation:Optional + ConfigIDSelector *v1.Selector `json:"configIdSelector,omitempty" tf:"-"` + + // The label of the Linode NodeBalancer Node. This is for display purposes only. + // The label for this node. This is for display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The mode this NodeBalancer should use when sending traffic to this backend. If set to accept this backend is accepting traffic. If set to reject this backend will not receive traffic. If set to drain this backend will not receive new traffic, but connections already pinned to it will continue to be routed to it. (accept, reject, drain, backup) + // The mode this NodeBalancer should use when sending traffic to this backend. If set to `accept` this backend is accepting traffic. If set to `reject` this backend will not receive traffic. If set to `drain` this backend will not receive new traffic, but connections already pinned to it will continue to be routed to it. If set to `backup` this backend will only accept traffic if all other nodes are down. + Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + + // The ID of the NodeBalancer to access. + // The ID of the NodeBalancer to access. + // +crossplane:generate:reference:type=Nodebalancer + NodebalancerID *float64 `json:"nodebalancerId,omitempty" tf:"nodebalancer_id,omitempty"` + + // Reference to a Nodebalancer to populate nodebalancerId. + // +kubebuilder:validation:Optional + NodebalancerIDRef *v1.Reference `json:"nodebalancerIdRef,omitempty" tf:"-"` + + // Selector for a Nodebalancer to populate nodebalancerId. + // +kubebuilder:validation:Optional + NodebalancerIDSelector *v1.Selector `json:"nodebalancerIdSelector,omitempty" tf:"-"` + + // Used when picking a backend to serve a request and is not pinned to a single backend yet. Nodes with a higher weight will receive more traffic. (1-255). + // Used when picking a backend to serve a request and is not pinned to a single backend yet. Nodes with a higher weight will receive more traffic. (1-255) + Weight *float64 `json:"weight,omitempty" tf:"weight,omitempty"` +} + type NodeObservation struct { // The private IP Address where this backend can be reached. This must be a private IP address. @@ -101,6 +150,17 @@ type NodeParameters struct { type NodeSpec struct { v1.ResourceSpec `json:",inline"` ForProvider NodeParameters `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 NodeInitParameters `json:"initProvider,omitempty"` } // NodeStatus defines the observed state of Node. @@ -110,19 +170,20 @@ type NodeStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Node is the Schema for the Nodes API. Manages a Linode NodeBalancer Node. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Node struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.address)",message="address is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.address) || (has(self.initProvider) && has(self.initProvider.address))",message="spec.forProvider.address is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" Spec NodeSpec `json:"spec"` Status NodeStatus `json:"status,omitempty"` } diff --git a/apis/nodebalancer/v1alpha1/zz_nodebalancer_terraformed.go b/apis/nodebalancer/v1alpha1/zz_nodebalancer_terraformed.go new file mode 100755 index 0000000..be34551 --- /dev/null +++ b/apis/nodebalancer/v1alpha1/zz_nodebalancer_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Nodebalancer +func (mg *Nodebalancer) GetTerraformResourceType() string { + return "linode_nodebalancer" +} + +// GetConnectionDetailsMapping for this Nodebalancer +func (tr *Nodebalancer) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Nodebalancer +func (tr *Nodebalancer) 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 Nodebalancer +func (tr *Nodebalancer) 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 Nodebalancer +func (tr *Nodebalancer) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Nodebalancer +func (tr *Nodebalancer) 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 Nodebalancer +func (tr *Nodebalancer) 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 Nodebalancer +func (tr *Nodebalancer) 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 Nodebalancer +func (tr *Nodebalancer) 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 Nodebalancer using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Nodebalancer) LateInitialize(attrs []byte) (bool, error) { + params := &NodebalancerParameters{} + 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 *Nodebalancer) GetTerraformSchemaVersion() int { + return 1 +} diff --git a/apis/nodebalancer/v1alpha1/zz_nodebalancer_types.go b/apis/nodebalancer/v1alpha1/zz_nodebalancer_types.go index 2694b94..62bf1d3 100755 --- a/apis/nodebalancer/v1alpha1/zz_nodebalancer_types.go +++ b/apis/nodebalancer/v1alpha1/zz_nodebalancer_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,29 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type NodebalancerInitParameters struct { + + // Throttle connections per second (0-20). Set to 0 (default) to disable throttling. + // Throttle connections per second (0-20). Set to 0 (zero) to disable throttling. + ClientConnThrottle *float64 `json:"clientConnThrottle,omitempty" tf:"client_conn_throttle,omitempty"` + + // ID for the firewall you'd like to use with this NodeBalancer. + FirewallID *float64 `json:"firewallId,omitempty" tf:"firewall_id,omitempty"` + + // The label of the Linode NodeBalancer + // The label of the Linode NodeBalancer. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region where this NodeBalancer will be deployed. Examples are "us-east", "us-west", "ap-south", etc. See all regions here. Changing . + // The region where this NodeBalancer will be deployed. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // A list of tags applied to this object. Tags are for organizational purposes only. + // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + type NodebalancerObservation struct { // Throttle connections per second (0-20). Set to 0 (default) to disable throttling. @@ -50,6 +77,7 @@ type NodebalancerObservation struct { // A list of tags applied to this object. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` // Information about the amount of transfer this NodeBalancer has had so far this month. @@ -84,9 +112,13 @@ type NodebalancerParameters struct { // A list of tags applied to this object. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. // +kubebuilder:validation:Optional + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` } +type TransferInitParameters struct { +} + type TransferObservation struct { // The total transfer, in MB, used by this NodeBalancer for the current month @@ -106,6 +138,17 @@ type TransferParameters struct { type NodebalancerSpec struct { v1.ResourceSpec `json:",inline"` ForProvider NodebalancerParameters `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 NodebalancerInitParameters `json:"initProvider,omitempty"` } // NodebalancerStatus defines the observed state of Nodebalancer. @@ -115,13 +158,14 @@ type NodebalancerStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Nodebalancer is the Schema for the Nodebalancers API. Manages a Linode NodeBalancer. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Nodebalancer struct { metav1.TypeMeta `json:",inline"` diff --git a/apis/objectstorage/v1alpha1/zz_bucket_terraformed.go b/apis/objectstorage/v1alpha1/zz_bucket_terraformed.go new file mode 100755 index 0000000..a2030d3 --- /dev/null +++ b/apis/objectstorage/v1alpha1/zz_bucket_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Bucket +func (mg *Bucket) GetTerraformResourceType() string { + return "linode_object_storage_bucket" +} + +// GetConnectionDetailsMapping for this Bucket +func (tr *Bucket) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Bucket +func (tr *Bucket) 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 Bucket +func (tr *Bucket) 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 Bucket +func (tr *Bucket) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Bucket +func (tr *Bucket) 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 Bucket +func (tr *Bucket) 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 Bucket +func (tr *Bucket) 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 Bucket +func (tr *Bucket) 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 Bucket using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Bucket) LateInitialize(attrs []byte) (bool, error) { + params := &BucketParameters{} + 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 *Bucket) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/objectstorage/v1alpha1/zz_bucket_types.go b/apis/objectstorage/v1alpha1/zz_bucket_types.go index 61bf931..7d618ce 100755 --- a/apis/objectstorage/v1alpha1/zz_bucket_types.go +++ b/apis/objectstorage/v1alpha1/zz_bucket_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,65 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type BucketInitParameters struct { + + // The Access Control Level of the bucket using a canned ACL string. See all ACL strings in the Linode API v4 documentation. + // The Access Control Level of the bucket using a canned ACL string. + ACL *string `json:"acl,omitempty" tf:"acl,omitempty"` + + // The access key to authenticate with. + // The S3 access key to use for this resource. (Required for lifecycle_rule and versioning) + // +crossplane:generate:reference:type=Key + // +crossplane:generate:reference:refFieldName=AccessKeyRef + // +crossplane:generate:reference:selectorFieldName=AccessKeySelector + AccessKey *string `json:"accessKey,omitempty" tf:"access_key,omitempty"` + + // Reference to a Key to populate accessKey. + // +kubebuilder:validation:Optional + AccessKeyRef *v1.Reference `json:"accessKeyRef,omitempty" tf:"-"` + + // Selector for a Key to populate accessKey. + // +kubebuilder:validation:Optional + AccessKeySelector *v1.Selector `json:"accessKeySelector,omitempty" tf:"-"` + + // The cert used by this Object Storage Bucket. + Cert []CertInitParameters `json:"cert,omitempty" tf:"cert,omitempty"` + + // The cluster of the Linode Object Storage Bucket. + // The cluster of the Linode Object Storage Bucket. + Cluster *string `json:"cluster,omitempty" tf:"cluster,omitempty"` + + // If true, the bucket will have CORS enabled for all origins. + // If true, the bucket will be created with CORS enabled for all origins. + CorsEnabled *bool `json:"corsEnabled,omitempty" tf:"cors_enabled,omitempty"` + + // The label of the Linode Object Storage Bucket. + // The label of the Linode Object Storage Bucket. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // Lifecycle rules to be applied to the bucket. + LifecycleRule []LifecycleRuleInitParameters `json:"lifecycleRule,omitempty" tf:"lifecycle_rule,omitempty"` + + // The secret key to authenticate with. + // The S3 secret key to use for this resource. (Required for lifecycle_rule and versioning) + // +crossplane:generate:reference:type=Key + // +crossplane:generate:reference:refFieldName=SecretKeyRef + // +crossplane:generate:reference:selectorFieldName=SecretKeySelector + SecretKey *string `json:"secretKey,omitempty" tf:"secret_key,omitempty"` + + // Reference to a Key to populate secretKey. + // +kubebuilder:validation:Optional + SecretKeyRef *v1.Reference `json:"secretKeyRef,omitempty" tf:"-"` + + // Selector for a Key to populate secretKey. + // +kubebuilder:validation:Optional + SecretKeySelector *v1.Selector `json:"secretKeySelector,omitempty" tf:"-"` + + // Whether to enable versioning. Once you version-enable a bucket, it can never return to an unversioned state. You can, however, suspend versioning on that bucket. (Requires access_key and secret_key) + // Whether to enable versioning. + Versioning *bool `json:"versioning,omitempty" tf:"versioning,omitempty"` +} + type BucketObservation struct { // The Access Control Level of the bucket using a canned ACL string. See all ACL strings in the Linode API v4 documentation. @@ -24,7 +87,7 @@ type BucketObservation struct { AccessKey *string `json:"accessKey,omitempty" tf:"access_key,omitempty"` // The cert used by this Object Storage Bucket. - Cert []CertParameters `json:"cert,omitempty" tf:"cert,omitempty"` + Cert []CertObservation `json:"cert,omitempty" tf:"cert,omitempty"` // The cluster of the Linode Object Storage Bucket. // The cluster of the Linode Object Storage Bucket. @@ -124,20 +187,54 @@ type BucketParameters struct { Versioning *bool `json:"versioning,omitempty" tf:"versioning,omitempty"` } +type CertInitParameters struct { + + // The Base64 encoded and PEM formatted SSL certificate. + // The Base64 encoded and PEM formatted SSL certificate. + Certificate *string `json:"certificate,omitempty" tf:"certificate,omitempty"` + + // The private key associated with the TLS/SSL certificate. + // The private key associated with the TLS/SSL certificate. + PrivateKey *string `json:"privateKey,omitempty" tf:"private_key,omitempty"` +} + type CertObservation struct { + + // The Base64 encoded and PEM formatted SSL certificate. + // The Base64 encoded and PEM formatted SSL certificate. + Certificate *string `json:"certificate,omitempty" tf:"certificate,omitempty"` + + // The private key associated with the TLS/SSL certificate. + // The private key associated with the TLS/SSL certificate. + PrivateKey *string `json:"privateKey,omitempty" tf:"private_key,omitempty"` } type CertParameters struct { // The Base64 encoded and PEM formatted SSL certificate. // The Base64 encoded and PEM formatted SSL certificate. - // +kubebuilder:validation:Required - CertificateSecretRef v1.SecretKeySelector `json:"certificateSecretRef" tf:"-"` + // +kubebuilder:validation:Optional + Certificate *string `json:"certificate" tf:"certificate,omitempty"` // The private key associated with the TLS/SSL certificate. // The private key associated with the TLS/SSL certificate. - // +kubebuilder:validation:Required - PrivateKeySecretRef v1.SecretKeySelector `json:"privateKeySecretRef" tf:"-"` + // +kubebuilder:validation:Optional + PrivateKey *string `json:"privateKey" tf:"private_key,omitempty"` +} + +type ExpirationInitParameters struct { + + // Specifies the date after which you want the corresponding action to take effect. + // Specifies the date after which you want the corresponding action to take effect. + Date *string `json:"date,omitempty" tf:"date,omitempty"` + + // Specifies the number of days after object creation when the specific rule action takes effect. + // Specifies the number of days after object creation when the specific rule action takes effect. + Days *float64 `json:"days,omitempty" tf:"days,omitempty"` + + // On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Linode Object Storage to delete expired object delete markers. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. + // Directs Linode Object Storage to remove expired deleted markers. + ExpiredObjectDeleteMarker *bool `json:"expiredObjectDeleteMarker,omitempty" tf:"expired_object_delete_marker,omitempty"` } type ExpirationObservation struct { @@ -173,6 +270,31 @@ type ExpirationParameters struct { ExpiredObjectDeleteMarker *bool `json:"expiredObjectDeleteMarker,omitempty" tf:"expired_object_delete_marker,omitempty"` } +type LifecycleRuleInitParameters struct { + + // Specifies the number of days after initiating a multipart upload when the multipart upload must be completed. + // Specifies the number of days after initiating a multipart upload when the multipart upload must be completed. + AbortIncompleteMultipartUploadDays *float64 `json:"abortIncompleteMultipartUploadDays,omitempty" tf:"abort_incomplete_multipart_upload_days,omitempty"` + + // Specifies whether the lifecycle rule is active. + // Specifies whether the lifecycle rule is active. + Enabled *bool `json:"enabled,omitempty" tf:"enabled,omitempty"` + + // Specifies a period in the object's expire. + Expiration []ExpirationInitParameters `json:"expiration,omitempty" tf:"expiration,omitempty"` + + // The unique identifier for the rule. + // The unique identifier for the rule. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies when non-current object versions expire. + NoncurrentVersionExpiration []NoncurrentVersionExpirationInitParameters `json:"noncurrentVersionExpiration,omitempty" tf:"noncurrent_version_expiration,omitempty"` + + // The object key prefix identifying one or more objects to which the rule applies. + // The object key prefix identifying one or more objects to which the rule applies. + Prefix *string `json:"prefix,omitempty" tf:"prefix,omitempty"` +} + type LifecycleRuleObservation struct { // Specifies the number of days after initiating a multipart upload when the multipart upload must be completed. @@ -207,7 +329,7 @@ type LifecycleRuleParameters struct { // Specifies whether the lifecycle rule is active. // Specifies whether the lifecycle rule is active. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Enabled *bool `json:"enabled" tf:"enabled,omitempty"` // Specifies a period in the object's expire. @@ -229,6 +351,13 @@ type LifecycleRuleParameters struct { Prefix *string `json:"prefix,omitempty" tf:"prefix,omitempty"` } +type NoncurrentVersionExpirationInitParameters struct { + + // Specifies the number of days after object creation when the specific rule action takes effect. + // Specifies the number of days non-current object versions expire. + Days *float64 `json:"days,omitempty" tf:"days,omitempty"` +} + type NoncurrentVersionExpirationObservation struct { // Specifies the number of days after object creation when the specific rule action takes effect. @@ -240,7 +369,7 @@ type NoncurrentVersionExpirationParameters struct { // Specifies the number of days after object creation when the specific rule action takes effect. // Specifies the number of days non-current object versions expire. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Days *float64 `json:"days" tf:"days,omitempty"` } @@ -248,6 +377,17 @@ type NoncurrentVersionExpirationParameters struct { type BucketSpec struct { v1.ResourceSpec `json:",inline"` ForProvider BucketParameters `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 BucketInitParameters `json:"initProvider,omitempty"` } // BucketStatus defines the observed state of Bucket. @@ -257,19 +397,20 @@ type BucketStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Bucket is the Schema for the Buckets API. Manages a Linode Object Storage Bucket. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Bucket struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.cluster)",message="cluster is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.cluster) || (has(self.initProvider) && has(self.initProvider.cluster))",message="spec.forProvider.cluster is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" Spec BucketSpec `json:"spec"` Status BucketStatus `json:"status,omitempty"` } diff --git a/apis/objectstorage/v1alpha1/zz_generated.conversion_hubs.go b/apis/objectstorage/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..aaa3523 --- /dev/null +++ b/apis/objectstorage/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Bucket) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Key) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Object) Hub() {} diff --git a/apis/objectstorage/v1alpha1/zz_generated.deepcopy.go b/apis/objectstorage/v1alpha1/zz_generated.deepcopy.go index 4c42f65..9c39c24 100644 --- a/apis/objectstorage/v1alpha1/zz_generated.deepcopy.go +++ b/apis/objectstorage/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,36 @@ func (in *Bucket) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketAccessInitParameters) DeepCopyInto(out *BucketAccessInitParameters) { + *out = *in + if in.BucketName != nil { + in, out := &in.BucketName, &out.BucketName + *out = new(string) + **out = **in + } + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster + *out = new(string) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketAccessInitParameters. +func (in *BucketAccessInitParameters) DeepCopy() *BucketAccessInitParameters { + if in == nil { + return nil + } + out := new(BucketAccessInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BucketAccessObservation) DeepCopyInto(out *BucketAccessObservation) { *out = *in @@ -101,6 +130,90 @@ func (in *BucketAccessParameters) DeepCopy() *BucketAccessParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BucketInitParameters) DeepCopyInto(out *BucketInitParameters) { + *out = *in + if in.ACL != nil { + in, out := &in.ACL, &out.ACL + *out = new(string) + **out = **in + } + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(string) + **out = **in + } + if in.AccessKeyRef != nil { + in, out := &in.AccessKeyRef, &out.AccessKeyRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AccessKeySelector != nil { + in, out := &in.AccessKeySelector, &out.AccessKeySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Cert != nil { + in, out := &in.Cert, &out.Cert + *out = make([]CertInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster + *out = new(string) + **out = **in + } + if in.CorsEnabled != nil { + in, out := &in.CorsEnabled, &out.CorsEnabled + *out = new(bool) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LifecycleRule != nil { + in, out := &in.LifecycleRule, &out.LifecycleRule + *out = make([]LifecycleRuleInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(string) + **out = **in + } + if in.SecretKeyRef != nil { + in, out := &in.SecretKeyRef, &out.SecretKeyRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SecretKeySelector != nil { + in, out := &in.SecretKeySelector, &out.SecretKeySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Versioning != nil { + in, out := &in.Versioning, &out.Versioning + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BucketInitParameters. +func (in *BucketInitParameters) DeepCopy() *BucketInitParameters { + if in == nil { + return nil + } + out := new(BucketInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BucketList) DeepCopyInto(out *BucketList) { *out = *in @@ -148,8 +261,10 @@ func (in *BucketObservation) DeepCopyInto(out *BucketObservation) { } if in.Cert != nil { in, out := &in.Cert, &out.Cert - *out = make([]CertParameters, len(*in)) - copy(*out, *in) + *out = make([]CertObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster @@ -231,7 +346,9 @@ func (in *BucketParameters) DeepCopyInto(out *BucketParameters) { if in.Cert != nil { in, out := &in.Cert, &out.Cert *out = make([]CertParameters, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.Cluster != nil { in, out := &in.Cluster, &out.Cluster @@ -292,6 +409,7 @@ func (in *BucketSpec) DeepCopyInto(out *BucketSpec) { *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 BucketSpec. @@ -321,9 +439,44 @@ func (in *BucketStatus) DeepCopy() *BucketStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertInitParameters) DeepCopyInto(out *CertInitParameters) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertInitParameters. +func (in *CertInitParameters) DeepCopy() *CertInitParameters { + if in == nil { + return nil + } + out := new(CertInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertObservation) DeepCopyInto(out *CertObservation) { *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertObservation. @@ -339,8 +492,16 @@ func (in *CertObservation) DeepCopy() *CertObservation { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CertParameters) DeepCopyInto(out *CertParameters) { *out = *in - out.CertificateSecretRef = in.CertificateSecretRef - out.PrivateKeySecretRef = in.PrivateKeySecretRef + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.PrivateKey != nil { + in, out := &in.PrivateKey, &out.PrivateKey + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertParameters. @@ -353,6 +514,36 @@ func (in *CertParameters) DeepCopy() *CertParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExpirationInitParameters) DeepCopyInto(out *ExpirationInitParameters) { + *out = *in + if in.Date != nil { + in, out := &in.Date, &out.Date + *out = new(string) + **out = **in + } + if in.Days != nil { + in, out := &in.Days, &out.Days + *out = new(float64) + **out = **in + } + if in.ExpiredObjectDeleteMarker != nil { + in, out := &in.ExpiredObjectDeleteMarker, &out.ExpiredObjectDeleteMarker + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExpirationInitParameters. +func (in *ExpirationInitParameters) DeepCopy() *ExpirationInitParameters { + if in == nil { + return nil + } + out := new(ExpirationInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExpirationObservation) DeepCopyInto(out *ExpirationObservation) { *out = *in @@ -440,6 +631,33 @@ func (in *Key) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KeyInitParameters) DeepCopyInto(out *KeyInitParameters) { + *out = *in + if in.BucketAccess != nil { + in, out := &in.BucketAccess, &out.BucketAccess + *out = make([]BucketAccessInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyInitParameters. +func (in *KeyInitParameters) DeepCopy() *KeyInitParameters { + if in == nil { + return nil + } + out := new(KeyInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KeyList) DeepCopyInto(out *KeyList) { *out = *in @@ -541,6 +759,7 @@ func (in *KeySpec) DeepCopyInto(out *KeySpec) { *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 KeySpec. @@ -570,6 +789,55 @@ func (in *KeyStatus) DeepCopy() *KeyStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LifecycleRuleInitParameters) DeepCopyInto(out *LifecycleRuleInitParameters) { + *out = *in + if in.AbortIncompleteMultipartUploadDays != nil { + in, out := &in.AbortIncompleteMultipartUploadDays, &out.AbortIncompleteMultipartUploadDays + *out = new(float64) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Expiration != nil { + in, out := &in.Expiration, &out.Expiration + *out = make([]ExpirationInitParameters, 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.NoncurrentVersionExpiration != nil { + in, out := &in.NoncurrentVersionExpiration, &out.NoncurrentVersionExpiration + *out = make([]NoncurrentVersionExpirationInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LifecycleRuleInitParameters. +func (in *LifecycleRuleInitParameters) DeepCopy() *LifecycleRuleInitParameters { + if in == nil { + return nil + } + out := new(LifecycleRuleInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LifecycleRuleObservation) DeepCopyInto(out *LifecycleRuleObservation) { *out = *in @@ -668,6 +936,26 @@ func (in *LifecycleRuleParameters) DeepCopy() *LifecycleRuleParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NoncurrentVersionExpirationInitParameters) DeepCopyInto(out *NoncurrentVersionExpirationInitParameters) { + *out = *in + if in.Days != nil { + in, out := &in.Days, &out.Days + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NoncurrentVersionExpirationInitParameters. +func (in *NoncurrentVersionExpirationInitParameters) DeepCopy() *NoncurrentVersionExpirationInitParameters { + if in == nil { + return nil + } + out := new(NoncurrentVersionExpirationInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NoncurrentVersionExpirationObservation) DeepCopyInto(out *NoncurrentVersionExpirationObservation) { *out = *in @@ -735,6 +1023,142 @@ func (in *Object) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectInitParameters) DeepCopyInto(out *ObjectInitParameters) { + *out = *in + if in.ACL != nil { + in, out := &in.ACL, &out.ACL + *out = new(string) + **out = **in + } + if in.AccessKey != nil { + in, out := &in.AccessKey, &out.AccessKey + *out = new(string) + **out = **in + } + if in.AccessKeyRef != nil { + in, out := &in.AccessKeyRef, &out.AccessKeyRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AccessKeySelector != nil { + in, out := &in.AccessKeySelector, &out.AccessKeySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Bucket != nil { + in, out := &in.Bucket, &out.Bucket + *out = new(string) + **out = **in + } + if in.CacheControl != nil { + in, out := &in.CacheControl, &out.CacheControl + *out = new(string) + **out = **in + } + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster + *out = new(string) + **out = **in + } + if in.Content != nil { + in, out := &in.Content, &out.Content + *out = new(string) + **out = **in + } + if in.ContentBase64 != nil { + in, out := &in.ContentBase64, &out.ContentBase64 + *out = new(string) + **out = **in + } + if in.ContentDisposition != nil { + in, out := &in.ContentDisposition, &out.ContentDisposition + *out = new(string) + **out = **in + } + if in.ContentEncoding != nil { + in, out := &in.ContentEncoding, &out.ContentEncoding + *out = new(string) + **out = **in + } + if in.ContentLanguage != nil { + in, out := &in.ContentLanguage, &out.ContentLanguage + *out = new(string) + **out = **in + } + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.ForceDestroy != nil { + in, out := &in.ForceDestroy, &out.ForceDestroy + *out = new(bool) + **out = **in + } + if in.Key != nil { + in, out := &in.Key, &out.Key + *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.SecretKey != nil { + in, out := &in.SecretKey, &out.SecretKey + *out = new(string) + **out = **in + } + if in.SecretKeyRef != nil { + in, out := &in.SecretKeyRef, &out.SecretKeyRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SecretKeySelector != nil { + in, out := &in.SecretKeySelector, &out.SecretKeySelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } + if in.WebsiteRedirect != nil { + in, out := &in.WebsiteRedirect, &out.WebsiteRedirect + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectInitParameters. +func (in *ObjectInitParameters) DeepCopy() *ObjectInitParameters { + if in == nil { + return nil + } + out := new(ObjectInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ObjectList) DeepCopyInto(out *ObjectList) { *out = *in @@ -853,7 +1277,8 @@ func (in *ObjectObservation) DeepCopyInto(out *ObjectObservation) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = new(string) **out = **in } @@ -983,7 +1408,8 @@ func (in *ObjectParameters) DeepCopyInto(out *ObjectParameters) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = new(string) **out = **in } @@ -1032,6 +1458,7 @@ func (in *ObjectSpec) DeepCopyInto(out *ObjectSpec) { *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 ObjectSpec. diff --git a/apis/objectstorage/v1alpha1/zz_generated.managed.go b/apis/objectstorage/v1alpha1/zz_generated.managed.go index 7e62e42..65794c8 100644 --- a/apis/objectstorage/v1alpha1/zz_generated.managed.go +++ b/apis/objectstorage/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Bucket) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Bucket. -func (mg *Bucket) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Bucket. +func (mg *Bucket) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Bucket. @@ -27,14 +27,6 @@ func (mg *Bucket) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Bucket. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Bucket) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Bucket. func (mg *Bucket) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Bucket) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Bucket. -func (mg *Bucket) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Bucket. +func (mg *Bucket) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Bucket. @@ -65,14 +57,6 @@ func (mg *Bucket) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Bucket. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Bucket) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Bucket. func (mg *Bucket) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -93,9 +77,9 @@ func (mg *Key) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Key. -func (mg *Key) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Key. +func (mg *Key) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Key. @@ -103,14 +87,6 @@ func (mg *Key) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Key. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Key) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Key. func (mg *Key) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -131,9 +107,9 @@ func (mg *Key) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Key. -func (mg *Key) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Key. +func (mg *Key) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Key. @@ -141,14 +117,6 @@ func (mg *Key) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Key. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Key) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Key. func (mg *Key) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r @@ -169,9 +137,9 @@ func (mg *Object) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Object. -func (mg *Object) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Object. +func (mg *Object) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Object. @@ -179,14 +147,6 @@ func (mg *Object) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Object. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Object) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Object. func (mg *Object) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -207,9 +167,9 @@ func (mg *Object) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Object. -func (mg *Object) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Object. +func (mg *Object) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Object. @@ -217,14 +177,6 @@ func (mg *Object) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Object. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Object) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Object. func (mg *Object) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/objectstorage/v1alpha1/zz_generated.resolvers.go b/apis/objectstorage/v1alpha1/zz_generated.resolvers.go index 0e9c079..f66d45d 100644 --- a/apis/objectstorage/v1alpha1/zz_generated.resolvers.go +++ b/apis/objectstorage/v1alpha1/zz_generated.resolvers.go @@ -51,6 +51,38 @@ func (mg *Bucket) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.SecretKey = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.SecretKeyRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.AccessKey), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.AccessKeyRef, + Selector: mg.Spec.InitProvider.AccessKeySelector, + To: reference.To{ + List: &KeyList{}, + Managed: &Key{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.AccessKey") + } + mg.Spec.InitProvider.AccessKey = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.AccessKeyRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SecretKey), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.SecretKeyRef, + Selector: mg.Spec.InitProvider.SecretKeySelector, + To: reference.To{ + List: &KeyList{}, + Managed: &Key{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SecretKey") + } + mg.Spec.InitProvider.SecretKey = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SecretKeyRef = rsp.ResolvedReference + return nil } @@ -93,5 +125,37 @@ func (mg *Object) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.SecretKey = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.SecretKeyRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.AccessKey), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.AccessKeyRef, + Selector: mg.Spec.InitProvider.AccessKeySelector, + To: reference.To{ + List: &KeyList{}, + Managed: &Key{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.AccessKey") + } + mg.Spec.InitProvider.AccessKey = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.AccessKeyRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SecretKey), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.SecretKeyRef, + Selector: mg.Spec.InitProvider.SecretKeySelector, + To: reference.To{ + List: &KeyList{}, + Managed: &Key{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SecretKey") + } + mg.Spec.InitProvider.SecretKey = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SecretKeyRef = rsp.ResolvedReference + return nil } diff --git a/apis/objectstorage/v1alpha1/zz_generated_terraformed.go b/apis/objectstorage/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 63fefe6..0000000 --- a/apis/objectstorage/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/pkg/errors" - - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Bucket -func (mg *Bucket) GetTerraformResourceType() string { - return "linode_object_storage_bucket" -} - -// GetConnectionDetailsMapping for this Bucket -func (tr *Bucket) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"cert[*].certificate": "spec.forProvider.cert[*].certificateSecretRef", "cert[*].private_key": "spec.forProvider.cert[*].privateKeySecretRef"} -} - -// GetObservation of this Bucket -func (tr *Bucket) 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 Bucket -func (tr *Bucket) 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 Bucket -func (tr *Bucket) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Bucket -func (tr *Bucket) 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 Bucket -func (tr *Bucket) 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) -} - -// LateInitialize this Bucket using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Bucket) LateInitialize(attrs []byte) (bool, error) { - params := &BucketParameters{} - 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 *Bucket) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this Key -func (mg *Key) GetTerraformResourceType() string { - return "linode_object_storage_key" -} - -// GetConnectionDetailsMapping for this Key -func (tr *Key) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"access_key": "status.atProvider.accessKey", "secret_key": "status.atProvider.secretKey"} -} - -// GetObservation of this Key -func (tr *Key) 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 Key -func (tr *Key) 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 Key -func (tr *Key) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Key -func (tr *Key) 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 Key -func (tr *Key) 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) -} - -// LateInitialize this Key using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Key) LateInitialize(attrs []byte) (bool, error) { - params := &KeyParameters{} - 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 *Key) GetTerraformSchemaVersion() int { - return 0 -} - -// GetTerraformResourceType returns Terraform resource type for this Object -func (mg *Object) GetTerraformResourceType() string { - return "linode_object_storage_object" -} - -// GetConnectionDetailsMapping for this Object -func (tr *Object) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Object -func (tr *Object) 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 Object -func (tr *Object) 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 Object -func (tr *Object) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Object -func (tr *Object) 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 Object -func (tr *Object) 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) -} - -// LateInitialize this Object using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Object) LateInitialize(attrs []byte) (bool, error) { - params := &ObjectParameters{} - 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 *Object) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/objectstorage/v1alpha1/zz_groupversion_info.go b/apis/objectstorage/v1alpha1/zz_groupversion_info.go index ff137e9..1e7a1c4 100755 --- a/apis/objectstorage/v1alpha1/zz_groupversion_info.go +++ b/apis/objectstorage/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/objectstorage/v1alpha1/zz_key_terraformed.go b/apis/objectstorage/v1alpha1/zz_key_terraformed.go new file mode 100755 index 0000000..9c83103 --- /dev/null +++ b/apis/objectstorage/v1alpha1/zz_key_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Key +func (mg *Key) GetTerraformResourceType() string { + return "linode_object_storage_key" +} + +// GetConnectionDetailsMapping for this Key +func (tr *Key) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"access_key": "status.atProvider.accessKey", "secret_key": "status.atProvider.secretKey"} +} + +// GetObservation of this Key +func (tr *Key) 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 Key +func (tr *Key) 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 Key +func (tr *Key) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Key +func (tr *Key) 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 Key +func (tr *Key) 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 Key +func (tr *Key) 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 Key +func (tr *Key) 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 Key using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Key) LateInitialize(attrs []byte) (bool, error) { + params := &KeyParameters{} + 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 *Key) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/objectstorage/v1alpha1/zz_key_types.go b/apis/objectstorage/v1alpha1/zz_key_types.go index 39cbbec..4bc9c59 100755 --- a/apis/objectstorage/v1alpha1/zz_key_types.go +++ b/apis/objectstorage/v1alpha1/zz_key_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,21 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type BucketAccessInitParameters struct { + + // The unique label of the bucket to which the key will grant limited access. + // The unique label of the bucket to which the key will grant limited access. + BucketName *string `json:"bucketName,omitempty" tf:"bucket_name,omitempty"` + + // The Object Storage cluster where a bucket to which the key is granting access is hosted. + // The Object Storage cluster where a bucket to which the key is granting access is hosted. + Cluster *string `json:"cluster,omitempty" tf:"cluster,omitempty"` + + // This Limited Access Key’s permissions for the selected bucket. Changing (read_write, read_only) + // This Limited Access Key's permissions for the selected bucket. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type BucketAccessObservation struct { // The unique label of the bucket to which the key will grant limited access. @@ -32,20 +51,31 @@ type BucketAccessParameters struct { // The unique label of the bucket to which the key will grant limited access. // The unique label of the bucket to which the key will grant limited access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional BucketName *string `json:"bucketName" tf:"bucket_name,omitempty"` // The Object Storage cluster where a bucket to which the key is granting access is hosted. // The Object Storage cluster where a bucket to which the key is granting access is hosted. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Cluster *string `json:"cluster" tf:"cluster,omitempty"` // This Limited Access Key’s permissions for the selected bucket. Changing (read_write, read_only) // This Limited Access Key's permissions for the selected bucket. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type KeyInitParameters struct { + + // Defines this key as a Limited Access Key. Limited Access Keys restrict this Object Storage key’s access to only the bucket(s) declared in this array and define their bucket-level permissions. Not providing this block will not limit this Object Storage Key. + // A list of permissions to grant this limited access key. + BucketAccess []BucketAccessInitParameters `json:"bucketAccess,omitempty" tf:"bucket_access,omitempty"` + + // The label given to this key. For display purposes only. + // The label given to this key. For display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` +} + type KeyObservation struct { // Defines this key as a Limited Access Key. Limited Access Keys restrict this Object Storage key’s access to only the bucket(s) declared in this array and define their bucket-level permissions. Not providing this block will not limit this Object Storage Key. @@ -80,6 +110,17 @@ type KeyParameters struct { type KeySpec struct { v1.ResourceSpec `json:",inline"` ForProvider KeyParameters `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 KeyInitParameters `json:"initProvider,omitempty"` } // KeyStatus defines the observed state of Key. @@ -89,18 +130,19 @@ type KeyStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Key is the Schema for the Keys API. Manages a Linode Object Storage Key. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Key struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" Spec KeySpec `json:"spec"` Status KeyStatus `json:"status,omitempty"` } diff --git a/apis/objectstorage/v1alpha1/zz_object_terraformed.go b/apis/objectstorage/v1alpha1/zz_object_terraformed.go new file mode 100755 index 0000000..abf19cd --- /dev/null +++ b/apis/objectstorage/v1alpha1/zz_object_terraformed.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 Object +func (mg *Object) GetTerraformResourceType() string { + return "linode_object_storage_object" +} + +// GetConnectionDetailsMapping for this Object +func (tr *Object) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Object +func (tr *Object) 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 Object +func (tr *Object) 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 Object +func (tr *Object) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Object +func (tr *Object) 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 Object +func (tr *Object) 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 Object +func (tr *Object) 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 Object +func (tr *Object) 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 Object using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Object) LateInitialize(attrs []byte) (bool, error) { + params := &ObjectParameters{} + 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 *Object) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/objectstorage/v1alpha1/zz_object_types.go b/apis/objectstorage/v1alpha1/zz_object_types.go index 92208fc..805a7a6 100755 --- a/apis/objectstorage/v1alpha1/zz_object_types.go +++ b/apis/objectstorage/v1alpha1/zz_object_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,104 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type ObjectInitParameters struct { + + // The canned ACL to apply. (private, public-read, authenticated-read, public-read-write, custom) (defaults to private). + // The ACL config given to this object. + ACL *string `json:"acl,omitempty" tf:"acl,omitempty"` + + // The access key to authenticate with. + // The S3 access key with access to the target bucket. + // +crossplane:generate:reference:type=Key + // +crossplane:generate:reference:refFieldName=AccessKeyRef + // +crossplane:generate:reference:selectorFieldName=AccessKeySelector + AccessKey *string `json:"accessKey,omitempty" tf:"access_key,omitempty"` + + // Reference to a Key to populate accessKey. + // +kubebuilder:validation:Optional + AccessKeyRef *v1.Reference `json:"accessKeyRef,omitempty" tf:"-"` + + // Selector for a Key to populate accessKey. + // +kubebuilder:validation:Optional + AccessKeySelector *v1.Selector `json:"accessKeySelector,omitempty" tf:"-"` + + // The name of the bucket to put the object in. + // The target bucket to put this object in. + Bucket *string `json:"bucket,omitempty" tf:"bucket,omitempty"` + + // Specifies caching behavior along the request/reply chain Read w3c cache_control for further details. + // This cache_control configuration of this object. + CacheControl *string `json:"cacheControl,omitempty" tf:"cache_control,omitempty"` + + // The cluster the bucket is in. + // The target cluster that the bucket is in. + Cluster *string `json:"cluster,omitempty" tf:"cluster,omitempty"` + + // Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. + // The contents of the Object to upload. + Content *string `json:"content,omitempty" tf:"content,omitempty"` + + // Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the gzipbase64 function with small text strings. For larger objects, use source to stream the content from a disk file. + // The base64 contents of the Object to upload. + ContentBase64 *string `json:"contentBase64,omitempty" tf:"content_base64,omitempty"` + + // Specifies presentational information for the object. Read w3c content_disposition for further information. + // The content disposition configuration of this object. + ContentDisposition *string `json:"contentDisposition,omitempty" tf:"content_disposition,omitempty"` + + // Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read w3c content encoding for further information. + // The encoding of the content of this object. + ContentEncoding *string `json:"contentEncoding,omitempty" tf:"content_encoding,omitempty"` + + // The language the content is in e.g. en-US or en-GB. + // The language metadata of this object. + ContentLanguage *string `json:"contentLanguage,omitempty" tf:"content_language,omitempty"` + + // A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input. + // The MIME type of the content. + ContentType *string `json:"contentType,omitempty" tf:"content_type,omitempty"` + + // Used to trigger updates.11.11.11 or earlier). + // The specific version of this object. + Etag *string `json:"etag,omitempty" tf:"etag,omitempty"` + + // Allow the object to be deleted regardless of any legal hold or object lock (defaults to false). + // Whether the object should bypass deletion restrictions. + ForceDestroy *bool `json:"forceDestroy,omitempty" tf:"force_destroy,omitempty"` + + // They name of the object once it is in the bucket. + // The name of the uploaded object. + Key *string `json:"key,omitempty" tf:"key,omitempty"` + + // A map of keys/values to provision metadata. + // The metadata of this object + // +mapType=granular + Metadata map[string]*string `json:"metadata,omitempty" tf:"metadata,omitempty"` + + // The secret key to authenitcate with. + // The S3 secret key with access to the target bucket. + // +crossplane:generate:reference:type=Key + // +crossplane:generate:reference:refFieldName=SecretKeyRef + // +crossplane:generate:reference:selectorFieldName=SecretKeySelector + SecretKey *string `json:"secretKey,omitempty" tf:"secret_key,omitempty"` + + // Reference to a Key to populate secretKey. + // +kubebuilder:validation:Optional + SecretKeyRef *v1.Reference `json:"secretKeyRef,omitempty" tf:"-"` + + // Selector for a Key to populate secretKey. + // +kubebuilder:validation:Optional + SecretKeySelector *v1.Selector `json:"secretKeySelector,omitempty" tf:"-"` + + // The path to a file that will be read and uploaded as raw bytes for the object content. The path must either be relative to the root module or absolute. + // The source file to upload. + Source *string `json:"source,omitempty" tf:"source,omitempty"` + + // Specifies a target URL for website redirect. + // The website redirect location of this object. + WebsiteRedirect *string `json:"websiteRedirect,omitempty" tf:"website_redirect,omitempty"` +} + type ObjectObservation struct { // The canned ACL to apply. (private, public-read, authenticated-read, public-read-write, custom) (defaults to private). @@ -75,6 +177,7 @@ type ObjectObservation struct { // A map of keys/values to provision metadata. // The metadata of this object + // +mapType=granular Metadata map[string]*string `json:"metadata,omitempty" tf:"metadata,omitempty"` // The secret key to authenitcate with. @@ -180,6 +283,7 @@ type ObjectParameters struct { // A map of keys/values to provision metadata. // The metadata of this object // +kubebuilder:validation:Optional + // +mapType=granular Metadata map[string]*string `json:"metadata,omitempty" tf:"metadata,omitempty"` // The secret key to authenitcate with. @@ -213,6 +317,17 @@ type ObjectParameters struct { type ObjectSpec struct { v1.ResourceSpec `json:",inline"` ForProvider ObjectParameters `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 ObjectInitParameters `json:"initProvider,omitempty"` } // ObjectStatus defines the observed state of Object. @@ -222,20 +337,21 @@ type ObjectStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Object is the Schema for the Objects API. Manages a Linode Object Storage Object. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Object struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.bucket)",message="bucket is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.cluster)",message="cluster is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.key)",message="key is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.bucket) || (has(self.initProvider) && has(self.initProvider.bucket))",message="spec.forProvider.bucket is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.cluster) || (has(self.initProvider) && has(self.initProvider.cluster))",message="spec.forProvider.cluster is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.key) || (has(self.initProvider) && has(self.initProvider.key))",message="spec.forProvider.key is a required parameter" Spec ObjectSpec `json:"spec"` Status ObjectStatus `json:"status,omitempty"` } diff --git a/apis/rdns/v1alpha1/zz_generated.conversion_hubs.go b/apis/rdns/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..b9a9598 --- /dev/null +++ b/apis/rdns/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *RDNS) Hub() {} diff --git a/apis/rdns/v1alpha1/zz_generated.deepcopy.go b/apis/rdns/v1alpha1/zz_generated.deepcopy.go index 723131d..440d9c2 100644 --- a/apis/rdns/v1alpha1/zz_generated.deepcopy.go +++ b/apis/rdns/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -40,6 +39,36 @@ func (in *RDNS) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RDNSInitParameters) DeepCopyInto(out *RDNSInitParameters) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.Rdns != nil { + in, out := &in.Rdns, &out.Rdns + *out = new(string) + **out = **in + } + if in.WaitForAvailable != nil { + in, out := &in.WaitForAvailable, &out.WaitForAvailable + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RDNSInitParameters. +func (in *RDNSInitParameters) DeepCopy() *RDNSInitParameters { + if in == nil { + return nil + } + out := new(RDNSInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RDNSList) DeepCopyInto(out *RDNSList) { *out = *in @@ -142,6 +171,7 @@ func (in *RDNSSpec) DeepCopyInto(out *RDNSSpec) { *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 RDNSSpec. diff --git a/apis/rdns/v1alpha1/zz_generated.managed.go b/apis/rdns/v1alpha1/zz_generated.managed.go index 68cf495..be3b74c 100644 --- a/apis/rdns/v1alpha1/zz_generated.managed.go +++ b/apis/rdns/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *RDNS) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this RDNS. -func (mg *RDNS) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this RDNS. +func (mg *RDNS) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this RDNS. @@ -27,14 +27,6 @@ func (mg *RDNS) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this RDNS. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *RDNS) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this RDNS. func (mg *RDNS) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *RDNS) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this RDNS. -func (mg *RDNS) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this RDNS. +func (mg *RDNS) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this RDNS. @@ -65,14 +57,6 @@ func (mg *RDNS) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this RDNS. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *RDNS) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this RDNS. func (mg *RDNS) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/rdns/v1alpha1/zz_groupversion_info.go b/apis/rdns/v1alpha1/zz_groupversion_info.go index 1dccfdf..9d2210b 100755 --- a/apis/rdns/v1alpha1/zz_groupversion_info.go +++ b/apis/rdns/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/rdns/v1alpha1/zz_generated_terraformed.go b/apis/rdns/v1alpha1/zz_rdns_terraformed.go similarity index 59% rename from apis/rdns/v1alpha1/zz_generated_terraformed.go rename to apis/rdns/v1alpha1/zz_rdns_terraformed.go index 5c8bc10..47d7b38 100755 --- a/apis/rdns/v1alpha1/zz_generated_terraformed.go +++ b/apis/rdns/v1alpha1/zz_rdns_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this RDNS @@ -69,6 +74,46 @@ func (tr *RDNS) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this RDNS +func (tr *RDNS) 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 RDNS +func (tr *RDNS) 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 RDNS using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *RDNS) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/rdns/v1alpha1/zz_rdns_types.go b/apis/rdns/v1alpha1/zz_rdns_types.go index 27ef312..4adad74 100755 --- a/apis/rdns/v1alpha1/zz_rdns_types.go +++ b/apis/rdns/v1alpha1/zz_rdns_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,21 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type RDNSInitParameters struct { + + // The Public IPv4 or IPv6 address that will receive the PTR record. A matching A or AAAA record must exist. + // The public Linode IPv4 or IPv6 address to operate on. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // The name of the RDNS address. + // The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if not explicitly set. + Rdns *string `json:"rdns,omitempty" tf:"rdns,omitempty"` + + // If true, the RDNS assignment will be retried within the operation timeout period. + // If true, the RDNS assignment will be retried within the operation timeout period. + WaitForAvailable *bool `json:"waitForAvailable,omitempty" tf:"wait_for_available,omitempty"` +} + type RDNSObservation struct { // The Public IPv4 or IPv6 address that will receive the PTR record. A matching A or AAAA record must exist. @@ -52,6 +71,17 @@ type RDNSParameters struct { type RDNSSpec struct { v1.ResourceSpec `json:",inline"` ForProvider RDNSParameters `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 RDNSInitParameters `json:"initProvider,omitempty"` } // RDNSStatus defines the observed state of RDNS. @@ -61,19 +91,20 @@ type RDNSStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // RDNS is the Schema for the RDNSs API. Manages the RDNS / PTR record for the IP Address associated with a Linode Instance. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode},path=rdns type RDNS struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.address)",message="address is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.rdns)",message="rdns is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.address) || (has(self.initProvider) && has(self.initProvider.address))",message="spec.forProvider.address is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.rdns) || (has(self.initProvider) && has(self.initProvider.rdns))",message="spec.forProvider.rdns is a required parameter" Spec RDNSSpec `json:"spec"` Status RDNSStatus `json:"status,omitempty"` } diff --git a/apis/sshkey/v1alpha1/zz_generated.conversion_hubs.go b/apis/sshkey/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..a579875 --- /dev/null +++ b/apis/sshkey/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *SSHKey) Hub() {} diff --git a/apis/sshkey/v1alpha1/zz_generated.deepcopy.go b/apis/sshkey/v1alpha1/zz_generated.deepcopy.go index 15cd78d..e787153 100644 --- a/apis/sshkey/v1alpha1/zz_generated.deepcopy.go +++ b/apis/sshkey/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -40,6 +39,31 @@ func (in *SSHKey) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSHKeyInitParameters) DeepCopyInto(out *SSHKeyInitParameters) { + *out = *in + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.SSHKey != nil { + in, out := &in.SSHKey, &out.SSHKey + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSHKeyInitParameters. +func (in *SSHKeyInitParameters) DeepCopy() *SSHKeyInitParameters { + if in == nil { + return nil + } + out := new(SSHKeyInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SSHKeyList) DeepCopyInto(out *SSHKeyList) { *out = *in @@ -137,6 +161,7 @@ func (in *SSHKeySpec) DeepCopyInto(out *SSHKeySpec) { *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 SSHKeySpec. diff --git a/apis/sshkey/v1alpha1/zz_generated.managed.go b/apis/sshkey/v1alpha1/zz_generated.managed.go index 701a084..2c7b3ec 100644 --- a/apis/sshkey/v1alpha1/zz_generated.managed.go +++ b/apis/sshkey/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *SSHKey) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this SSHKey. -func (mg *SSHKey) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this SSHKey. +func (mg *SSHKey) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this SSHKey. @@ -27,14 +27,6 @@ func (mg *SSHKey) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this SSHKey. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *SSHKey) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this SSHKey. func (mg *SSHKey) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *SSHKey) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this SSHKey. -func (mg *SSHKey) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this SSHKey. +func (mg *SSHKey) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this SSHKey. @@ -65,14 +57,6 @@ func (mg *SSHKey) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this SSHKey. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *SSHKey) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this SSHKey. func (mg *SSHKey) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/sshkey/v1alpha1/zz_groupversion_info.go b/apis/sshkey/v1alpha1/zz_groupversion_info.go index 5bf94af..83a129d 100755 --- a/apis/sshkey/v1alpha1/zz_groupversion_info.go +++ b/apis/sshkey/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/sshkey/v1alpha1/zz_generated_terraformed.go b/apis/sshkey/v1alpha1/zz_sshkey_terraformed.go similarity index 60% rename from apis/sshkey/v1alpha1/zz_generated_terraformed.go rename to apis/sshkey/v1alpha1/zz_sshkey_terraformed.go index 03fc604..4be7c92 100755 --- a/apis/sshkey/v1alpha1/zz_generated_terraformed.go +++ b/apis/sshkey/v1alpha1/zz_sshkey_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this SSHKey @@ -69,6 +74,46 @@ func (tr *SSHKey) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this SSHKey +func (tr *SSHKey) 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 SSHKey +func (tr *SSHKey) 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 SSHKey using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *SSHKey) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/sshkey/v1alpha1/zz_sshkey_types.go b/apis/sshkey/v1alpha1/zz_sshkey_types.go index 0ff058c..cbeff80 100755 --- a/apis/sshkey/v1alpha1/zz_sshkey_types.go +++ b/apis/sshkey/v1alpha1/zz_sshkey_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,17 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type SSHKeyInitParameters struct { + + // A label for the SSH Key. + // The label of the Linode SSH Key. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy. + // The public SSH Key, which is used to authenticate to the root user of the Linodes you deploy. + SSHKey *string `json:"sshKey,omitempty" tf:"ssh_key,omitempty"` +} + type SSHKeyObservation struct { // The date this SSH Key was created. @@ -47,6 +62,17 @@ type SSHKeyParameters struct { type SSHKeySpec struct { v1.ResourceSpec `json:",inline"` ForProvider SSHKeyParameters `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 SSHKeyInitParameters `json:"initProvider,omitempty"` } // SSHKeyStatus defines the observed state of SSHKey. @@ -56,19 +82,20 @@ type SSHKeyStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // SSHKey is the Schema for the SSHKeys API. Manages a Linode SSH Key. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type SSHKey struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.sshKey)",message="sshKey is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.sshKey) || (has(self.initProvider) && has(self.initProvider.sshKey))",message="spec.forProvider.sshKey is a required parameter" Spec SSHKeySpec `json:"spec"` Status SSHKeyStatus `json:"status,omitempty"` } diff --git a/apis/stackscript/v1alpha1/zz_generated.conversion_hubs.go b/apis/stackscript/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..87ed277 --- /dev/null +++ b/apis/stackscript/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Stackscript) Hub() {} diff --git a/apis/stackscript/v1alpha1/zz_generated.deepcopy.go b/apis/stackscript/v1alpha1/zz_generated.deepcopy.go index 357490e..f9234ff 100644 --- a/apis/stackscript/v1alpha1/zz_generated.deepcopy.go +++ b/apis/stackscript/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -40,6 +39,57 @@ func (in *Stackscript) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackscriptInitParameters) DeepCopyInto(out *StackscriptInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Images != nil { + in, out := &in.Images, &out.Images + *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.IsPublic != nil { + in, out := &in.IsPublic, &out.IsPublic + *out = new(bool) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.RevNote != nil { + in, out := &in.RevNote, &out.RevNote + *out = new(string) + **out = **in + } + if in.Script != nil { + in, out := &in.Script, &out.Script + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackscriptInitParameters. +func (in *StackscriptInitParameters) DeepCopy() *StackscriptInitParameters { + if in == nil { + return nil + } + out := new(StackscriptInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StackscriptList) DeepCopyInto(out *StackscriptList) { *out = *in @@ -221,6 +271,7 @@ func (in *StackscriptSpec) DeepCopyInto(out *StackscriptSpec) { *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 StackscriptSpec. @@ -250,6 +301,21 @@ func (in *StackscriptStatus) DeepCopy() *StackscriptStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserDefinedFieldsInitParameters) DeepCopyInto(out *UserDefinedFieldsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserDefinedFieldsInitParameters. +func (in *UserDefinedFieldsInitParameters) DeepCopy() *UserDefinedFieldsInitParameters { + if in == nil { + return nil + } + out := new(UserDefinedFieldsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserDefinedFieldsObservation) DeepCopyInto(out *UserDefinedFieldsObservation) { *out = *in diff --git a/apis/stackscript/v1alpha1/zz_generated.managed.go b/apis/stackscript/v1alpha1/zz_generated.managed.go index ca9df05..d7a956d 100644 --- a/apis/stackscript/v1alpha1/zz_generated.managed.go +++ b/apis/stackscript/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Stackscript) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Stackscript. -func (mg *Stackscript) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Stackscript. +func (mg *Stackscript) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Stackscript. @@ -27,14 +27,6 @@ func (mg *Stackscript) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Stackscript. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Stackscript) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Stackscript. func (mg *Stackscript) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Stackscript) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Stackscript. -func (mg *Stackscript) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Stackscript. +func (mg *Stackscript) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Stackscript. @@ -65,14 +57,6 @@ func (mg *Stackscript) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Stackscript. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Stackscript) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Stackscript. func (mg *Stackscript) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/stackscript/v1alpha1/zz_groupversion_info.go b/apis/stackscript/v1alpha1/zz_groupversion_info.go index 906e406..0147f1b 100755 --- a/apis/stackscript/v1alpha1/zz_groupversion_info.go +++ b/apis/stackscript/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/stackscript/v1alpha1/zz_generated_terraformed.go b/apis/stackscript/v1alpha1/zz_stackscript_terraformed.go similarity index 60% rename from apis/stackscript/v1alpha1/zz_generated_terraformed.go rename to apis/stackscript/v1alpha1/zz_stackscript_terraformed.go index 547617d..16d88a7 100755 --- a/apis/stackscript/v1alpha1/zz_generated_terraformed.go +++ b/apis/stackscript/v1alpha1/zz_stackscript_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this Stackscript @@ -69,6 +74,46 @@ func (tr *Stackscript) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this Stackscript +func (tr *Stackscript) 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 Stackscript +func (tr *Stackscript) 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 Stackscript using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *Stackscript) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/stackscript/v1alpha1/zz_stackscript_types.go b/apis/stackscript/v1alpha1/zz_stackscript_types.go index 0356612..5511d2c 100755 --- a/apis/stackscript/v1alpha1/zz_stackscript_types.go +++ b/apis/stackscript/v1alpha1/zz_stackscript_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,34 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type StackscriptInitParameters struct { + + // A description for the StackScript. + // A description for the StackScript. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // A set of Image IDs representing the Images that this StackScript is compatible for deploying with. any/all indicates that all available image distributions, including private images, are accepted. Currently private image IDs are not supported. + // An array of Image IDs representing the Images that this StackScript is compatible for deploying with. + // +listType=set + Images []*string `json:"images,omitempty" tf:"images,omitempty"` + + // This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing + // This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. + IsPublic *bool `json:"isPublic,omitempty" tf:"is_public,omitempty"` + + // The StackScript's label is for display purposes only. + // The StackScript's label is for display purposes only. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // This field allows you to add notes for the set of revisions made to this StackScript. + // This field allows you to add notes for the set of revisions made to this StackScript. + RevNote *string `json:"revNote,omitempty" tf:"rev_note,omitempty"` + + // The script to execute when provisioning a new Linode with this StackScript. + // The script to execute when provisioning a new Linode with this StackScript. + Script *string `json:"script,omitempty" tf:"script,omitempty"` +} + type StackscriptObservation struct { // The date this StackScript was created. @@ -35,6 +67,7 @@ type StackscriptObservation struct { // A set of Image IDs representing the Images that this StackScript is compatible for deploying with. any/all indicates that all available image distributions, including private images, are accepted. Currently private image IDs are not supported. // An array of Image IDs representing the Images that this StackScript is compatible for deploying with. + // +listType=set Images []*string `json:"images,omitempty" tf:"images,omitempty"` // This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing @@ -80,6 +113,7 @@ type StackscriptParameters struct { // A set of Image IDs representing the Images that this StackScript is compatible for deploying with. any/all indicates that all available image distributions, including private images, are accepted. Currently private image IDs are not supported. // An array of Image IDs representing the Images that this StackScript is compatible for deploying with. // +kubebuilder:validation:Optional + // +listType=set Images []*string `json:"images,omitempty" tf:"images,omitempty"` // This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. Changing @@ -103,6 +137,9 @@ type StackscriptParameters struct { Script *string `json:"script,omitempty" tf:"script,omitempty"` } +type UserDefinedFieldsInitParameters struct { +} + type UserDefinedFieldsObservation struct { // The default value. If not specified, this value will be used. @@ -131,6 +168,17 @@ type UserDefinedFieldsParameters struct { type StackscriptSpec struct { v1.ResourceSpec `json:",inline"` ForProvider StackscriptParameters `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 StackscriptInitParameters `json:"initProvider,omitempty"` } // StackscriptStatus defines the observed state of Stackscript. @@ -140,21 +188,22 @@ type StackscriptStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Stackscript is the Schema for the Stackscripts API. Manages a Linode StackScript. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Stackscript struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.description)",message="description is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.images)",message="images is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.script)",message="script is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.description) || (has(self.initProvider) && has(self.initProvider.description))",message="spec.forProvider.description is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.images) || (has(self.initProvider) && has(self.initProvider.images))",message="spec.forProvider.images is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.script) || (has(self.initProvider) && has(self.initProvider.script))",message="spec.forProvider.script is a required parameter" Spec StackscriptSpec `json:"spec"` Status StackscriptStatus `json:"status,omitempty"` } diff --git a/apis/token/v1alpha1/zz_generated.conversion_hubs.go b/apis/token/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..f771356 --- /dev/null +++ b/apis/token/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Token) Hub() {} diff --git a/apis/token/v1alpha1/zz_generated.deepcopy.go b/apis/token/v1alpha1/zz_generated.deepcopy.go index b925ab3..1be7356 100644 --- a/apis/token/v1alpha1/zz_generated.deepcopy.go +++ b/apis/token/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -40,6 +39,36 @@ func (in *Token) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TokenInitParameters) DeepCopyInto(out *TokenInitParameters) { + *out = *in + if in.Expiry != nil { + in, out := &in.Expiry, &out.Expiry + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Scopes != nil { + in, out := &in.Scopes, &out.Scopes + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TokenInitParameters. +func (in *TokenInitParameters) DeepCopy() *TokenInitParameters { + if in == nil { + return nil + } + out := new(TokenInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TokenList) DeepCopyInto(out *TokenList) { *out = *in @@ -147,6 +176,7 @@ func (in *TokenSpec) DeepCopyInto(out *TokenSpec) { *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 TokenSpec. diff --git a/apis/token/v1alpha1/zz_generated.managed.go b/apis/token/v1alpha1/zz_generated.managed.go index de97a8f..89d7fed 100644 --- a/apis/token/v1alpha1/zz_generated.managed.go +++ b/apis/token/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Token) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Token. -func (mg *Token) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Token. +func (mg *Token) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Token. @@ -27,14 +27,6 @@ func (mg *Token) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Token. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Token) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Token. func (mg *Token) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Token) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Token. -func (mg *Token) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Token. +func (mg *Token) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Token. @@ -65,14 +57,6 @@ func (mg *Token) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Token. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Token) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Token. func (mg *Token) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/token/v1alpha1/zz_groupversion_info.go b/apis/token/v1alpha1/zz_groupversion_info.go index 3ec575e..d7d6161 100755 --- a/apis/token/v1alpha1/zz_groupversion_info.go +++ b/apis/token/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/token/v1alpha1/zz_generated_terraformed.go b/apis/token/v1alpha1/zz_token_terraformed.go similarity index 60% rename from apis/token/v1alpha1/zz_generated_terraformed.go rename to apis/token/v1alpha1/zz_token_terraformed.go index 78f2b9a..a130ff5 100755 --- a/apis/token/v1alpha1/zz_generated_terraformed.go +++ b/apis/token/v1alpha1/zz_token_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this Token @@ -69,6 +74,46 @@ func (tr *Token) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this Token +func (tr *Token) 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 Token +func (tr *Token) 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 Token using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *Token) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/token/v1alpha1/zz_token_types.go b/apis/token/v1alpha1/zz_token_types.go index 0b3ef40..aa2bf7c 100755 --- a/apis/token/v1alpha1/zz_token_types.go +++ b/apis/token/v1alpha1/zz_token_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,21 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type TokenInitParameters struct { + + // When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with 'null' as their expiry and will never expire unless revoked. + // When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with 'null' as their expiry and will never expire unless revoked. Format: 2006-01-02T15:04:05Z + Expiry *string `json:"expiry,omitempty" tf:"expiry,omitempty"` + + // A label for the Token. + // The label of the Linode Token. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure. All scopes can be viewed in the Linode API documentation. + // The scopes this token was created with. These define what parts of the Account the token can be used to access. Many command-line tools, such as the Linode CLI, require tokens with access to *. Tokens with more restrictive scopes are generally more secure. Multiple scopes are separated by a space character (e.g., "databases:read_only events:read_only"). You can find the list of available scopes on Linode API docs site, https://www.linode.com/docs/api#oauth-reference + Scopes *string `json:"scopes,omitempty" tf:"scopes,omitempty"` +} + type TokenObservation struct { // The date this Token was created. @@ -56,6 +75,17 @@ type TokenParameters struct { type TokenSpec struct { v1.ResourceSpec `json:",inline"` ForProvider TokenParameters `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 TokenInitParameters `json:"initProvider,omitempty"` } // TokenStatus defines the observed state of Token. @@ -65,18 +95,19 @@ type TokenStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Token is the Schema for the Tokens API. Manages a Linode Token. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Token struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.scopes)",message="scopes is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.scopes) || (has(self.initProvider) && has(self.initProvider.scopes))",message="spec.forProvider.scopes is a required parameter" Spec TokenSpec `json:"spec"` Status TokenStatus `json:"status,omitempty"` } diff --git a/apis/user/v1alpha1/zz_generated.conversion_hubs.go b/apis/user/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..19d84c0 --- /dev/null +++ b/apis/user/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *User) Hub() {} diff --git a/apis/user/v1alpha1/zz_generated.deepcopy.go b/apis/user/v1alpha1/zz_generated.deepcopy.go index 91e120e..8fe2941 100644 --- a/apis/user/v1alpha1/zz_generated.deepcopy.go +++ b/apis/user/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -13,6 +12,31 @@ 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 *DomainGrantInitParameters) DeepCopyInto(out *DomainGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainGrantInitParameters. +func (in *DomainGrantInitParameters) DeepCopy() *DomainGrantInitParameters { + if in == nil { + return nil + } + out := new(DomainGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DomainGrantObservation) DeepCopyInto(out *DomainGrantObservation) { *out = *in @@ -63,6 +87,31 @@ func (in *DomainGrantParameters) DeepCopy() *DomainGrantParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallGrantInitParameters) DeepCopyInto(out *FirewallGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallGrantInitParameters. +func (in *FirewallGrantInitParameters) DeepCopy() *FirewallGrantInitParameters { + if in == nil { + return nil + } + out := new(FirewallGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FirewallGrantObservation) DeepCopyInto(out *FirewallGrantObservation) { *out = *in @@ -113,6 +162,81 @@ func (in *FirewallGrantParameters) DeepCopy() *FirewallGrantParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalGrantsInitParameters) DeepCopyInto(out *GlobalGrantsInitParameters) { + *out = *in + if in.AccountAccess != nil { + in, out := &in.AccountAccess, &out.AccountAccess + *out = new(string) + **out = **in + } + if in.AddDatabases != nil { + in, out := &in.AddDatabases, &out.AddDatabases + *out = new(bool) + **out = **in + } + if in.AddDomains != nil { + in, out := &in.AddDomains, &out.AddDomains + *out = new(bool) + **out = **in + } + if in.AddFirewalls != nil { + in, out := &in.AddFirewalls, &out.AddFirewalls + *out = new(bool) + **out = **in + } + if in.AddImages != nil { + in, out := &in.AddImages, &out.AddImages + *out = new(bool) + **out = **in + } + if in.AddLinodes != nil { + in, out := &in.AddLinodes, &out.AddLinodes + *out = new(bool) + **out = **in + } + if in.AddLongview != nil { + in, out := &in.AddLongview, &out.AddLongview + *out = new(bool) + **out = **in + } + if in.AddNodebalancers != nil { + in, out := &in.AddNodebalancers, &out.AddNodebalancers + *out = new(bool) + **out = **in + } + if in.AddStackscripts != nil { + in, out := &in.AddStackscripts, &out.AddStackscripts + *out = new(bool) + **out = **in + } + if in.AddVolumes != nil { + in, out := &in.AddVolumes, &out.AddVolumes + *out = new(bool) + **out = **in + } + if in.CancelAccount != nil { + in, out := &in.CancelAccount, &out.CancelAccount + *out = new(bool) + **out = **in + } + if in.LongviewSubscription != nil { + in, out := &in.LongviewSubscription, &out.LongviewSubscription + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalGrantsInitParameters. +func (in *GlobalGrantsInitParameters) DeepCopy() *GlobalGrantsInitParameters { + if in == nil { + return nil + } + out := new(GlobalGrantsInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GlobalGrantsObservation) DeepCopyInto(out *GlobalGrantsObservation) { *out = *in @@ -263,6 +387,31 @@ func (in *GlobalGrantsParameters) DeepCopy() *GlobalGrantsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageGrantInitParameters) DeepCopyInto(out *ImageGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageGrantInitParameters. +func (in *ImageGrantInitParameters) DeepCopy() *ImageGrantInitParameters { + if in == nil { + return nil + } + out := new(ImageGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ImageGrantObservation) DeepCopyInto(out *ImageGrantObservation) { *out = *in @@ -313,6 +462,31 @@ func (in *ImageGrantParameters) DeepCopy() *ImageGrantParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LinodeGrantInitParameters) DeepCopyInto(out *LinodeGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinodeGrantInitParameters. +func (in *LinodeGrantInitParameters) DeepCopy() *LinodeGrantInitParameters { + if in == nil { + return nil + } + out := new(LinodeGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LinodeGrantObservation) DeepCopyInto(out *LinodeGrantObservation) { *out = *in @@ -363,6 +537,31 @@ func (in *LinodeGrantParameters) DeepCopy() *LinodeGrantParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LongviewGrantInitParameters) DeepCopyInto(out *LongviewGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LongviewGrantInitParameters. +func (in *LongviewGrantInitParameters) DeepCopy() *LongviewGrantInitParameters { + if in == nil { + return nil + } + out := new(LongviewGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LongviewGrantObservation) DeepCopyInto(out *LongviewGrantObservation) { *out = *in @@ -413,6 +612,31 @@ func (in *LongviewGrantParameters) DeepCopy() *LongviewGrantParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodebalancerGrantInitParameters) DeepCopyInto(out *NodebalancerGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodebalancerGrantInitParameters. +func (in *NodebalancerGrantInitParameters) DeepCopy() *NodebalancerGrantInitParameters { + if in == nil { + return nil + } + out := new(NodebalancerGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodebalancerGrantObservation) DeepCopyInto(out *NodebalancerGrantObservation) { *out = *in @@ -463,6 +687,31 @@ func (in *NodebalancerGrantParameters) DeepCopy() *NodebalancerGrantParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StackscriptGrantInitParameters) DeepCopyInto(out *StackscriptGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackscriptGrantInitParameters. +func (in *StackscriptGrantInitParameters) DeepCopy() *StackscriptGrantInitParameters { + if in == nil { + return nil + } + out := new(StackscriptGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StackscriptGrantObservation) DeepCopyInto(out *StackscriptGrantObservation) { *out = *in @@ -540,6 +789,99 @@ func (in *User) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserInitParameters) DeepCopyInto(out *UserInitParameters) { + *out = *in + if in.DomainGrant != nil { + in, out := &in.DomainGrant, &out.DomainGrant + *out = make([]DomainGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Email != nil { + in, out := &in.Email, &out.Email + *out = new(string) + **out = **in + } + if in.FirewallGrant != nil { + in, out := &in.FirewallGrant, &out.FirewallGrant + *out = make([]FirewallGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.GlobalGrants != nil { + in, out := &in.GlobalGrants, &out.GlobalGrants + *out = make([]GlobalGrantsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ImageGrant != nil { + in, out := &in.ImageGrant, &out.ImageGrant + *out = make([]ImageGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LinodeGrant != nil { + in, out := &in.LinodeGrant, &out.LinodeGrant + *out = make([]LinodeGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LongviewGrant != nil { + in, out := &in.LongviewGrant, &out.LongviewGrant + *out = make([]LongviewGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NodebalancerGrant != nil { + in, out := &in.NodebalancerGrant, &out.NodebalancerGrant + *out = make([]NodebalancerGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Restricted != nil { + in, out := &in.Restricted, &out.Restricted + *out = new(bool) + **out = **in + } + if in.StackscriptGrant != nil { + in, out := &in.StackscriptGrant, &out.StackscriptGrant + *out = make([]StackscriptGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } + if in.VolumeGrant != nil { + in, out := &in.VolumeGrant, &out.VolumeGrant + *out = make([]VolumeGrantInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserInitParameters. +func (in *UserInitParameters) DeepCopy() *UserInitParameters { + if in == nil { + return nil + } + out := new(UserInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserList) DeepCopyInto(out *UserList) { *out = *in @@ -784,6 +1126,7 @@ func (in *UserSpec) DeepCopyInto(out *UserSpec) { *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 UserSpec. @@ -813,6 +1156,31 @@ func (in *UserStatus) DeepCopy() *UserStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeGrantInitParameters) DeepCopyInto(out *VolumeGrantInitParameters) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(float64) + **out = **in + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeGrantInitParameters. +func (in *VolumeGrantInitParameters) DeepCopy() *VolumeGrantInitParameters { + if in == nil { + return nil + } + out := new(VolumeGrantInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeGrantObservation) DeepCopyInto(out *VolumeGrantObservation) { *out = *in diff --git a/apis/user/v1alpha1/zz_generated.managed.go b/apis/user/v1alpha1/zz_generated.managed.go index d8ea094..b1f452b 100644 --- a/apis/user/v1alpha1/zz_generated.managed.go +++ b/apis/user/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *User) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this User. -func (mg *User) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this User. +func (mg *User) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this User. @@ -27,14 +27,6 @@ func (mg *User) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this User. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *User) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this User. func (mg *User) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *User) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this User. -func (mg *User) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this User. +func (mg *User) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this User. @@ -65,14 +57,6 @@ func (mg *User) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this User. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *User) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this User. func (mg *User) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/user/v1alpha1/zz_groupversion_info.go b/apis/user/v1alpha1/zz_groupversion_info.go index 749bb5b..e13cb8e 100755 --- a/apis/user/v1alpha1/zz_groupversion_info.go +++ b/apis/user/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/user/v1alpha1/zz_generated_terraformed.go b/apis/user/v1alpha1/zz_user_terraformed.go similarity index 59% rename from apis/user/v1alpha1/zz_generated_terraformed.go rename to apis/user/v1alpha1/zz_user_terraformed.go index f138a6f..58f4d96 100755 --- a/apis/user/v1alpha1/zz_generated_terraformed.go +++ b/apis/user/v1alpha1/zz_user_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this User @@ -69,6 +74,46 @@ func (tr *User) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this User +func (tr *User) 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 User +func (tr *User) 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 User using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *User) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/user/v1alpha1/zz_user_types.go b/apis/user/v1alpha1/zz_user_types.go index 4b13d25..27d53de 100755 --- a/apis/user/v1alpha1/zz_user_types.go +++ b/apis/user/v1alpha1/zz_user_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,17 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type DomainGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type DomainGrantObservation struct { // The ID of the entity this grant applies to. @@ -28,15 +43,26 @@ type DomainGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type FirewallGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type FirewallGrantObservation struct { // The ID of the entity this grant applies to. @@ -52,15 +78,64 @@ type FirewallGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type GlobalGrantsInitParameters struct { + + // The level of access this User has to Account-level actions, like billing information. A restricted User will never be able to manage users. + AccountAccess *string `json:"accountAccess,omitempty" tf:"account_access,omitempty"` + + // If true, this User may add Databases. + // If true, this User may add Databases. + AddDatabases *bool `json:"addDatabases,omitempty" tf:"add_databases,omitempty"` + + // If true, this User may add Domains. + // If true, this User may add Domains. + AddDomains *bool `json:"addDomains,omitempty" tf:"add_domains,omitempty"` + + // If true, this User may add Firewalls. + // If true, this User may add Firewalls. + AddFirewalls *bool `json:"addFirewalls,omitempty" tf:"add_firewalls,omitempty"` + + // If true, this User may add Images. + // If true, this User may add Images. + AddImages *bool `json:"addImages,omitempty" tf:"add_images,omitempty"` + + // If true, this User may create Linodes. + // If true, this User may create Linodes. + AddLinodes *bool `json:"addLinodes,omitempty" tf:"add_linodes,omitempty"` + + // If true, this User may create Longview clients and view the current plan. + // If true, this User may create Longview clients and view the current plan. + AddLongview *bool `json:"addLongview,omitempty" tf:"add_longview,omitempty"` + + // If true, this User may add NodeBalancers. + // If true, this User may add NodeBalancers. + AddNodebalancers *bool `json:"addNodebalancers,omitempty" tf:"add_nodebalancers,omitempty"` + + // If true, this User may add StackScripts. + // If true, this User may add StackScripts. + AddStackscripts *bool `json:"addStackscripts,omitempty" tf:"add_stackscripts,omitempty"` + + // If true, this User may add Volumes. + AddVolumes *bool `json:"addVolumes,omitempty" tf:"add_volumes,omitempty"` + + // If true, this User may cancel the entire Account. + // If true, this User may cancel the entire Account. + CancelAccount *bool `json:"cancelAccount,omitempty" tf:"cancel_account,omitempty"` + + // If true, this User may manage the Account’s Longview subscription. + // If true, this User may manage the Account’s Longview subscription. + LongviewSubscription *bool `json:"longviewSubscription,omitempty" tf:"longview_subscription,omitempty"` +} + type GlobalGrantsObservation struct { // The level of access this User has to Account-level actions, like billing information. A restricted User will never be able to manage users. @@ -171,6 +246,17 @@ type GlobalGrantsParameters struct { LongviewSubscription *bool `json:"longviewSubscription,omitempty" tf:"longview_subscription,omitempty"` } +type ImageGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type ImageGrantObservation struct { // The ID of the entity this grant applies to. @@ -186,15 +272,26 @@ type ImageGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type LinodeGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type LinodeGrantObservation struct { // The ID of the entity this grant applies to. @@ -210,15 +307,26 @@ type LinodeGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type LongviewGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type LongviewGrantObservation struct { // The ID of the entity this grant applies to. @@ -234,15 +342,26 @@ type LongviewGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type NodebalancerGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type NodebalancerGrantObservation struct { // The ID of the entity this grant applies to. @@ -258,15 +377,26 @@ type NodebalancerGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type StackscriptGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type StackscriptGrantObservation struct { // The ID of the entity this grant applies to. @@ -282,15 +412,65 @@ type StackscriptGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } +type UserInitParameters struct { + + // The domains the user has permissions access to. + // A set containing all of the user's active grants. + DomainGrant []DomainGrantInitParameters `json:"domainGrant,omitempty" tf:"domain_grant,omitempty"` + + // The email address of the user. + // The email of the user. + Email *string `json:"email,omitempty" tf:"email,omitempty"` + + // The firewalls the user has permissions access to. + // A set containing all of the user's active grants. + FirewallGrant []FirewallGrantInitParameters `json:"firewallGrant,omitempty" tf:"firewall_grant,omitempty"` + + // A structure containing the Account-level grants a User has. + GlobalGrants []GlobalGrantsInitParameters `json:"globalGrants,omitempty" tf:"global_grants,omitempty"` + + // The images the user has permissions access to. + // A set containing all of the user's active grants. + ImageGrant []ImageGrantInitParameters `json:"imageGrant,omitempty" tf:"image_grant,omitempty"` + + // The Linodes the user has permissions access to. + // A set containing all of the user's active grants. + LinodeGrant []LinodeGrantInitParameters `json:"linodeGrant,omitempty" tf:"linode_grant,omitempty"` + + // The longview the user has permissions access to. + // A set containing all of the user's active grants. + LongviewGrant []LongviewGrantInitParameters `json:"longviewGrant,omitempty" tf:"longview_grant,omitempty"` + + // The NodeBalancers the user has permissions access to. + // A set containing all of the user's active grants. + NodebalancerGrant []NodebalancerGrantInitParameters `json:"nodebalancerGrant,omitempty" tf:"nodebalancer_grant,omitempty"` + + // If true, this user will only have explicit permissions granted. + // If true, the user must be explicitly granted access to platform actions and entities. + Restricted *bool `json:"restricted,omitempty" tf:"restricted,omitempty"` + + // The StackScripts the user has permissions access to. + // A set containing all of the user's active grants. + StackscriptGrant []StackscriptGrantInitParameters `json:"stackscriptGrant,omitempty" tf:"stackscript_grant,omitempty"` + + // The username of the user. + // The username of the user. + Username *string `json:"username,omitempty" tf:"username,omitempty"` + + // The volumes the user has permissions access to. + // A set containing all of the user's active grants. + VolumeGrant []VolumeGrantInitParameters `json:"volumeGrant,omitempty" tf:"volume_grant,omitempty"` +} + type UserObservation struct { // The domains the user has permissions access to. @@ -414,6 +594,17 @@ type UserParameters struct { VolumeGrant []VolumeGrantParameters `json:"volumeGrant,omitempty" tf:"volume_grant,omitempty"` } +type VolumeGrantInitParameters struct { + + // The ID of the entity this grant applies to. + // The ID of the entity this grant applies to. + ID *float64 `json:"id,omitempty" tf:"id,omitempty"` + + // The level of access this User has to this entity. (read_only, read_write) + // The level of access this User has to this entity. If null, this User has no access. + Permissions *string `json:"permissions,omitempty" tf:"permissions,omitempty"` +} + type VolumeGrantObservation struct { // The ID of the entity this grant applies to. @@ -429,12 +620,12 @@ type VolumeGrantParameters struct { // The ID of the entity this grant applies to. // The ID of the entity this grant applies to. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional ID *float64 `json:"id" tf:"id,omitempty"` // The level of access this User has to this entity. (read_only, read_write) // The level of access this User has to this entity. If null, this User has no access. - // +kubebuilder:validation:Required + // +kubebuilder:validation:Optional Permissions *string `json:"permissions" tf:"permissions,omitempty"` } @@ -442,6 +633,17 @@ type VolumeGrantParameters struct { type UserSpec struct { v1.ResourceSpec `json:",inline"` ForProvider UserParameters `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 UserInitParameters `json:"initProvider,omitempty"` } // UserStatus defines the observed state of User. @@ -451,19 +653,20 @@ type UserStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // User is the Schema for the Users API. Manages a Linode User. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type User struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.email)",message="email is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username)",message="username is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.email) || (has(self.initProvider) && has(self.initProvider.email))",message="spec.forProvider.email is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.username) || (has(self.initProvider) && has(self.initProvider.username))",message="spec.forProvider.username is a required parameter" Spec UserSpec `json:"spec"` Status UserStatus `json:"status,omitempty"` } diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index 9d284ba..86f2d29 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. diff --git a/apis/v1beta1/types.go b/apis/v1beta1/types.go index 110474a..dec7aec 100644 --- a/apis/v1beta1/types.go +++ b/apis/v1beta1/types.go @@ -5,9 +5,8 @@ Copyright 2022 Upbound Inc. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. @@ -32,12 +31,13 @@ type ProviderConfigStatus struct { // +kubebuilder:object:root=true -// A ProviderConfig configures a Template provider. +// A ProviderConfig configures a Linode provider. // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:printcolumn:name="SECRET-NAME",type="string",JSONPath=".spec.credentials.secretRef.name",priority=1 // +kubebuilder:resource:scope=Cluster -// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,template} +// +kubebuilder:resource:scope=Cluster,categories={crossplane,providerconfig,linode} +// +kubebuilder:storageversion type ProviderConfig struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -62,7 +62,8 @@ type ProviderConfigList struct { // +kubebuilder:printcolumn:name="CONFIG-NAME",type="string",JSONPath=".providerConfigRef.name" // +kubebuilder:printcolumn:name="RESOURCE-KIND",type="string",JSONPath=".resourceRef.kind" // +kubebuilder:printcolumn:name="RESOURCE-NAME",type="string",JSONPath=".resourceRef.name" -// +kubebuilder:resource:scope=Cluster,categories={crossplane,provider,template} +// +kubebuilder:resource:scope=Cluster,categories={crossplane,providerconfig,linode} +// +kubebuilder:storageversion type ProviderConfigUsage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/apis/v1beta1/zz_generated.deepcopy.go b/apis/v1beta1/zz_generated.deepcopy.go index ae71405..09df2c1 100644 --- a/apis/v1beta1/zz_generated.deepcopy.go +++ b/apis/v1beta1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. diff --git a/apis/volume/v1alpha1/zz_generated.conversion_hubs.go b/apis/volume/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..c0ce72c --- /dev/null +++ b/apis/volume/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Volume) Hub() {} diff --git a/apis/volume/v1alpha1/zz_generated.deepcopy.go b/apis/volume/v1alpha1/zz_generated.deepcopy.go index d8a8ae8..c16e9bb 100644 --- a/apis/volume/v1alpha1/zz_generated.deepcopy.go +++ b/apis/volume/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright 2022 Upbound Inc. @@ -41,6 +40,67 @@ func (in *Volume) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeInitParameters) DeepCopyInto(out *VolumeInitParameters) { + *out = *in + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.SourceVolumeID != nil { + in, out := &in.SourceVolumeID, &out.SourceVolumeID + *out = new(float64) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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 VolumeInitParameters. +func (in *VolumeInitParameters) DeepCopy() *VolumeInitParameters { + if in == nil { + return nil + } + out := new(VolumeInitParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeList) DeepCopyInto(out *VolumeList) { *out = *in @@ -205,6 +265,7 @@ func (in *VolumeSpec) DeepCopyInto(out *VolumeSpec) { *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 VolumeSpec. diff --git a/apis/volume/v1alpha1/zz_generated.managed.go b/apis/volume/v1alpha1/zz_generated.managed.go index 1e4e831..d5bd7ef 100644 --- a/apis/volume/v1alpha1/zz_generated.managed.go +++ b/apis/volume/v1alpha1/zz_generated.managed.go @@ -17,9 +17,9 @@ func (mg *Volume) GetDeletionPolicy() xpv1.DeletionPolicy { return mg.Spec.DeletionPolicy } -// GetManagementPolicy of this Volume. -func (mg *Volume) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy +// GetManagementPolicies of this Volume. +func (mg *Volume) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies } // GetProviderConfigReference of this Volume. @@ -27,14 +27,6 @@ func (mg *Volume) GetProviderConfigReference() *xpv1.Reference { return mg.Spec.ProviderConfigReference } -/* -GetProviderReference of this Volume. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Volume) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - // GetPublishConnectionDetailsTo of this Volume. func (mg *Volume) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { return mg.Spec.PublishConnectionDetailsTo @@ -55,9 +47,9 @@ func (mg *Volume) SetDeletionPolicy(r xpv1.DeletionPolicy) { mg.Spec.DeletionPolicy = r } -// SetManagementPolicy of this Volume. -func (mg *Volume) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r +// SetManagementPolicies of this Volume. +func (mg *Volume) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r } // SetProviderConfigReference of this Volume. @@ -65,14 +57,6 @@ func (mg *Volume) SetProviderConfigReference(r *xpv1.Reference) { mg.Spec.ProviderConfigReference = r } -/* -SetProviderReference of this Volume. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Volume) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - // SetPublishConnectionDetailsTo of this Volume. func (mg *Volume) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { mg.Spec.PublishConnectionDetailsTo = r diff --git a/apis/volume/v1alpha1/zz_generated.resolvers.go b/apis/volume/v1alpha1/zz_generated.resolvers.go index 57e6f00..b02d06c 100644 --- a/apis/volume/v1alpha1/zz_generated.resolvers.go +++ b/apis/volume/v1alpha1/zz_generated.resolvers.go @@ -36,5 +36,21 @@ func (mg *Volume) ResolveReferences(ctx context.Context, c client.Reader) error mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + return nil } diff --git a/apis/volume/v1alpha1/zz_groupversion_info.go b/apis/volume/v1alpha1/zz_groupversion_info.go index d2832fb..e6464fe 100755 --- a/apis/volume/v1alpha1/zz_groupversion_info.go +++ b/apis/volume/v1alpha1/zz_groupversion_info.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/apis/volume/v1alpha1/zz_generated_terraformed.go b/apis/volume/v1alpha1/zz_volume_terraformed.go similarity index 60% rename from apis/volume/v1alpha1/zz_generated_terraformed.go rename to apis/volume/v1alpha1/zz_volume_terraformed.go index ce3e334..6d855c3 100755 --- a/apis/volume/v1alpha1/zz_generated_terraformed.go +++ b/apis/volume/v1alpha1/zz_volume_terraformed.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -7,10 +11,11 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "dario.cat/mergo" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" ) // GetTerraformResourceType returns Terraform resource type for this Volume @@ -69,6 +74,46 @@ func (tr *Volume) SetParameters(params map[string]any) error { return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) } +// GetInitParameters of this Volume +func (tr *Volume) 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 Volume +func (tr *Volume) 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 Volume using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *Volume) LateInitialize(attrs []byte) (bool, error) { diff --git a/apis/volume/v1alpha1/zz_volume_types.go b/apis/volume/v1alpha1/zz_volume_types.go index e3bc822..179380d 100755 --- a/apis/volume/v1alpha1/zz_volume_types.go +++ b/apis/volume/v1alpha1/zz_volume_types.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -13,6 +17,43 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) +type VolumeInitParameters struct { + + // The label of the Linode Volume + // The label of the Linode Volume. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The ID of a Linode Instance where the Volume should be attached. + // The Linode ID where the Volume should be attached. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // The region where this volume will be deployed. Examples are "us-east", "us-west", "ap-south", etc. See all regions here. This field is optional for cloned volumes. Changing . + // The region where this volume will be deployed. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Size of the Volume in GB. + // Size of the Volume in GB + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` + + // The ID of a Linode Volume to clone. NOTE: Cloned volumes must be in the same region as the source volume. + // The ID of a volume to clone. + SourceVolumeID *float64 `json:"sourceVolumeId,omitempty" tf:"source_volume_id,omitempty"` + + // A list of tags applied to this object. Tags are for organizational purposes only. + // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + type VolumeObservation struct { // The full filesystem path for the Volume based on the Volume's label. The path is "/dev/disk/by-id/scsi-0Linode_Volume_" + the Volume label @@ -47,6 +88,7 @@ type VolumeObservation struct { // A list of tags applied to this object. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` } @@ -89,6 +131,7 @@ type VolumeParameters struct { // A list of tags applied to this object. Tags are for organizational purposes only. // An array of tags applied to this object. Tags are for organizational purposes only. // +kubebuilder:validation:Optional + // +listType=set Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` } @@ -96,6 +139,17 @@ type VolumeParameters struct { type VolumeSpec struct { v1.ResourceSpec `json:",inline"` ForProvider VolumeParameters `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 VolumeInitParameters `json:"initProvider,omitempty"` } // VolumeStatus defines the observed state of Volume. @@ -105,18 +159,19 @@ type VolumeStatus struct { } // +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion // Volume is the Schema for the Volumes API. Manages a Linode Volume. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} type Volume struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" Spec VolumeSpec `json:"spec"` Status VolumeStatus `json:"status,omitempty"` } diff --git a/apis/zz_register.go b/apis/zz_register.go index 391408c..22ffd12 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ diff --git a/build b/build index bd5297b..7233e36 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit bd5297bd16c113cbc5ed1905b1d96aa1cb3078ec +Subproject commit 7233e36491dc8298d33f1feb1bf8c5056a960cac diff --git a/cluster/test/setup.sh b/cluster/test/setup.sh index 6f381fd..e140b4b 100755 --- a/cluster/test/setup.sh +++ b/cluster/test/setup.sh @@ -24,3 +24,4 @@ spec: name: provider-secret namespace: upbound-system key: credentials +EOF diff --git a/cmd/generator/main.go b/cmd/generator/main.go index 2519aaa..0c9a07f 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -5,11 +5,14 @@ Copyright 2021 Upbound Inc. package main import ( + "context" "fmt" "os" "path/filepath" - "github.com/upbound/upjet/pkg/pipeline" + "gopkg.in/alecthomas/kingpin.v2" + + "github.com/crossplane/upjet/pkg/pipeline" "github.com/linode/provider-linode/config" ) @@ -23,5 +26,7 @@ func main() { if err != nil { panic(fmt.Sprintf("cannot calculate the absolute path with %s", rootDir)) } - pipeline.Run(config.GetProvider(), absRootDir) + p, err := config.GetProvider(context.Background(), true) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") + pipeline.Run(p, absRootDir) } diff --git a/cmd/provider/main.go b/cmd/provider/main.go index b524de2..9566223 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -11,17 +11,20 @@ import ( "time" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/certificates" xpcontroller "github.com/crossplane/crossplane-runtime/pkg/controller" + "github.com/crossplane/crossplane-runtime/pkg/feature" "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/terraform" "gopkg.in/alecthomas/kingpin.v2" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/leaderelection/resourcelock" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/log/zap" "github.com/linode/provider-linode/apis" @@ -34,21 +37,24 @@ import ( func main() { var ( - app = kingpin.New(filepath.Base(os.Args[0]), "Terraform based Crossplane provider for Linode").DefaultEnvars() - debug = app.Flag("debug", "Run with debug logging.").Short('d').Bool() - syncInterval = app.Flag("sync", "Sync interval controls how often all resources will be double checked for drift.").Short('s').Default("1h").Duration() - pollInterval = app.Flag("poll", "Poll interval controls how often an individual resource should be checked for drift.").Default("10m").Duration() - leaderElection = app.Flag("leader-election", "Use leader election for the controller manager.").Short('l').Default("false").OverrideDefaultFromEnvar("LEADER_ELECTION").Bool() - terraformVersion = app.Flag("terraform-version", "Terraform version.").Required().Envar("TERRAFORM_VERSION").String() - providerSource = app.Flag("terraform-provider-source", "Terraform provider source.").Required().Envar("TERRAFORM_PROVIDER_SOURCE").String() - providerVersion = app.Flag("terraform-provider-version", "Terraform provider version.").Required().Envar("TERRAFORM_PROVIDER_VERSION").String() - nativeProviderPath = app.Flag("terraform-native-provider-path", "Terraform native provider path for shared execution.").Default("").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").String() - nativeProviderTTL = app.Flag("provider-ttl", "TTL for the native plugin processes before they are replaced. Changing the default may increase memory consumption.").Default("100").Int() - maxReconcileRate = app.Flag("max-reconcile-rate", "The global maximum rate per second at which resources may checked for drift from the desired state.").Default("10").Int() + app = kingpin.New(filepath.Base(os.Args[0]), "Linode support for Crossplane.").DefaultEnvars() + debug = app.Flag("debug", "Run with debug logging.").Short('d').Bool() + syncInterval = app.Flag("sync", "Sync interval controls how often all resources will be double checked for drift.").Short('s').Default("1h").Duration() + pollInterval = app.Flag("poll", "Poll interval controls how often an individual resource should be checked for drift.").Default("10m").Duration() + leaderElection = app.Flag("leader-election", "Use leader election for the controller manager.").Short('l').Default("false").OverrideDefaultFromEnvar("LEADER_ELECTION").Bool() + maxReconcileRate = app.Flag("max-reconcile-rate", "The global maximum rate per second at which resources may be checked for drift from the desired state.").Default("100").Int() + pluginProcessTTL = app.Flag("provider-ttl", "TTL for the native plugin processes before they are replaced. Changing the default may increase memory consumption.").Default("100").Int() namespace = app.Flag("namespace", "Namespace used to set as default scope in default secret store config.").Default("crossplane-system").Envar("POD_NAMESPACE").String() enableExternalSecretStores = app.Flag("enable-external-secret-stores", "Enable support for ExternalSecretStores.").Default("false").Envar("ENABLE_EXTERNAL_SECRET_STORES").Bool() + essTLSCertsPath = app.Flag("ess-tls-cert-dir", "Path of ESS TLS certificates.").Envar("ESS_TLS_CERTS_DIR").String() + enableManagementPolicies = app.Flag("enable-management-policies", "Enable support for Management Policies.").Default("true").Envar("ENABLE_MANAGEMENT_POLICIES").Bool() ) + setupConfig := &clients.SetupConfig{} + setupConfig.TerraformVersion = app.Flag("terraform-version", "Terraform version.").Required().Envar("TERRAFORM_VERSION").String() + setupConfig.NativeProviderSource = app.Flag("terraform-provider-source", "Terraform provider source.").Required().Envar("TERRAFORM_PROVIDER_SOURCE").String() + setupConfig.NativeProviderVersion = app.Flag("terraform-provider-version", "Terraform provider version.").Required().Envar("TERRAFORM_PROVIDER_VERSION").String() + setupConfig.NativeProviderPath = app.Flag("terraform-native-provider-path", "Terraform native provider path for shared execution.").Default("").Envar("TERRAFORM_NATIVE_PROVIDER_PATH").String() kingpin.MustParse(app.Parse(os.Args[1:])) @@ -61,15 +67,20 @@ func main() { ctrl.SetLogger(zl) } - log.Debug("Starting", "sync-interval", syncInterval.String(), "poll-interval", pollInterval.String()) + // currently, we configure the jitter to be the 5% of the poll interval + pollJitter := time.Duration(float64(*pollInterval) * 0.05) + log.Debug("Starting", "sync-interval", syncInterval.String(), + "poll-interval", pollInterval.String(), "poll-jitter", pollJitter, "max-reconcile-rate", *maxReconcileRate) cfg, err := ctrl.GetConfig() kingpin.FatalIfError(err, "Cannot get API server rest config") - mgr, err := ctrl.NewManager(cfg, ctrl.Options{ - LeaderElection: *leaderElection, - LeaderElectionID: "crossplane-leader-election-provider-linode", - SyncPeriod: syncInterval, + mgr, err := ctrl.NewManager(ratelimiter.LimitRESTConfig(cfg, *maxReconcileRate), ctrl.Options{ + LeaderElection: *leaderElection, + LeaderElectionID: "crossplane-leader-election-provider-linode-config", + Cache: cache.Options{ + SyncPeriod: syncInterval, + }, LeaderElectionResourceLock: resourcelock.LeasesResourceLock, LeaseDuration: func() *time.Duration { d := 60 * time.Second; return &d }(), RenewDeadline: func() *time.Duration { d := 50 * time.Second; return &d }(), @@ -77,31 +88,59 @@ func main() { kingpin.FatalIfError(err, "Cannot create controller manager") kingpin.FatalIfError(apis.AddToScheme(mgr.GetScheme()), "Cannot add Linode APIs to scheme") - // no-op scheduler will preserve the (old) behavior of forking a Terraform plugin process per invocation - var scheduler terraform.ProviderScheduler = terraform.NewNoOpProviderScheduler() - // but if the Terraform provider plugin path is configured, shared gRPC server(s) will be used - if len(*nativeProviderPath) != 0 { - scheduler = terraform.NewSharedProviderScheduler(log, *nativeProviderTTL, terraform.WithNativeProviderPath(*nativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*providerSource)) + // if the native Terraform provider plugin's path is not configured via + // the env. variable TERRAFORM_NATIVE_PROVIDER_PATH or + // the `--terraform-native-provider-path` command-line option, + // we do not use the shared gRPC server and default to the regular + // Terraform CLI behaviour (of forking a plugin process per invocation). + // This removes some complexity for setting up development environments. + setupConfig.DefaultScheduler = terraform.NewNoOpProviderScheduler() + if len(*setupConfig.NativeProviderPath) != 0 { + setupConfig.DefaultScheduler = terraform.NewSharedProviderScheduler(log, *pluginProcessTTL, + terraform.WithSharedProviderOptions(terraform.WithNativeProviderPath(*setupConfig.NativeProviderPath), terraform.WithNativeProviderName("registry.terraform.io/"+*setupConfig.NativeProviderSource))) } + ctx := context.Background() + provider, err := config.GetProvider(ctx, false) + kingpin.FatalIfError(err, "Cannot initialize the provider configuration") + setupConfig.TerraformProvider = provider.TerraformProvider o := tjcontroller.Options{ Options: xpcontroller.Options{ Logger: log, GlobalRateLimiter: ratelimiter.NewGlobal(*maxReconcileRate), PollInterval: *pollInterval, MaxConcurrentReconciles: *maxReconcileRate, + Features: &feature.Flags{}, }, - Provider: config.GetProvider(), - WorkspaceStore: terraform.NewWorkspaceStore(log, terraform.WithDisableInit(len(*nativeProviderPath) != 0), terraform.WithProcessReportInterval(*pollInterval)), - SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion, scheduler), + Provider: provider, + SetupFn: clients.TerraformSetupBuilder(*setupConfig.TerraformVersion, *setupConfig.NativeProviderSource, *setupConfig.NativeProviderVersion, provider.TerraformProvider, setupConfig.DefaultScheduler), + PollJitter: pollJitter, + OperationTrackerStore: tjcontroller.NewOperationStore(log), + } + + if *enableManagementPolicies { + o.Features.Enable(features.EnableBetaManagementPolicies) + log.Info("Beta feature enabled", "flag", features.EnableBetaManagementPolicies) } + o.WorkspaceStore = terraform.NewWorkspaceStore(log, terraform.WithDisableInit(len(*setupConfig.NativeProviderPath) != 0), terraform.WithProcessReportInterval(*pollInterval), terraform.WithFeatures(o.Features)) + if *enableExternalSecretStores { o.SecretStoreConfigGVK = &v1alpha1.StoreConfigGroupVersionKind log.Info("Alpha feature enabled", "flag", features.EnableAlphaExternalSecretStores) + o.ESSOptions = &tjcontroller.ESSOptions{} + if *essTLSCertsPath != "" { + log.Info("ESS TLS certificates path is set. Loading mTLS configuration.") + tCfg, err := certificates.LoadMTLSConfig(filepath.Join(*essTLSCertsPath, "ca.crt"), filepath.Join(*essTLSCertsPath, "tls.crt"), filepath.Join(*essTLSCertsPath, "tls.key"), false) + kingpin.FatalIfError(err, "Cannot load ESS TLS config.") + + o.ESSOptions.TLSConfig = tCfg + } + // Ensure default store config exists. - kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{ + kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(ctx, &v1alpha1.StoreConfig{ + TypeMeta: metav1.TypeMeta{}, ObjectMeta: metav1.ObjectMeta{ Name: "default", }, @@ -112,6 +151,7 @@ func main() { DefaultScope: *namespace, }, }, + Status: v1alpha1.StoreConfigStatus{}, })), "cannot create default store config") } diff --git a/config/databaseaccesscontrols/config.go b/config/databaseaccesscontrols/config.go index 27ac8e8..af3503c 100644 --- a/config/databaseaccesscontrols/config.go +++ b/config/databaseaccesscontrols/config.go @@ -1,13 +1,13 @@ package databaseaccesscontrols -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("linode_database_access_controls", func(r *config.Resource) { // this field references the Mysql, Mongodb and Postgresql objects, // so we can't set this reference to a single model right now - // https://github.com/upbound/upjet/issues/95 + // https://github.com/crossplane/upjet/issues/95 // r.References["database_id"] = config.Reference{ // Type: "Mysql", // } diff --git a/config/databasemysql/config.go b/config/databasemysql/config.go index 772dc23..5b6fdb7 100644 --- a/config/databasemysql/config.go +++ b/config/databasemysql/config.go @@ -1,6 +1,6 @@ package databasemysql -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/databasepostgresql/config.go b/config/databasepostgresql/config.go index 9049860..699ad84 100644 --- a/config/databasepostgresql/config.go +++ b/config/databasepostgresql/config.go @@ -1,6 +1,6 @@ package databasepostgresql -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/domain/config.go b/config/domain/config.go index 7b86f51..24dfbd9 100644 --- a/config/domain/config.go +++ b/config/domain/config.go @@ -1,6 +1,6 @@ package domain -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/domainrecord/config.go b/config/domainrecord/config.go index ac7a43b..2925fa8 100644 --- a/config/domainrecord/config.go +++ b/config/domainrecord/config.go @@ -1,6 +1,6 @@ package domainrecord -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/externalname.go b/config/externalname.go index 4ea5d3f..8f41bcb 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -4,62 +4,90 @@ Copyright 2022 Upbound Inc. package config -import "github.com/upbound/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" +) -// ExternalNameConfigs contains all external name configurations for this +// terraformPluginFrameworkExternalNameConfigs contains all external +// name configurations belonging to Terraform Plugin Framework +// resources to be reconciled under the no-fork architecture for this // provider. -var ExternalNameConfigs = map[string]config.ExternalName{ +var terraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName{ + "linode_token": config.IdentifierFromProvider, + "linode_stackscript": config.IdentifierFromProvider, + "linode_rdns": config.IdentifierFromProvider, + "linode_object_storage_key": config.IdentifierFromProvider, + "linode_sshkey": config.IdentifierFromProvider, + "linode_ipv6_range": config.IdentifierFromProvider, + "linode_nodebalancer": config.IdentifierFromProvider, + "linode_vpc_subnet": config.IdentifierFromProvider, + "linode_vpc": config.IdentifierFromProvider, + "linode_instance_ip": config.IdentifierFromProvider, + "linode_firewall_device": config.IdentifierFromProvider, + "linode_volume": config.IdentifierFromProvider, +} + +// terraformPluginSDKIncludeList contains all external name configurations +// belonging to Terraform Plugin SDKv2 resources to be reconciled +// under the no-fork architecture for this provider. +var terraformPluginSDKIncludeList = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: 1234567 "linode_database_access_controls": config.IdentifierFromProvider, - "linode_database_mongodb": config.IdentifierFromProvider, "linode_database_mysql": config.IdentifierFromProvider, "linode_database_postgresql": config.IdentifierFromProvider, "linode_domain": config.IdentifierFromProvider, "linode_domain_record": config.IdentifierFromProvider, "linode_firewall": config.IdentifierFromProvider, - "linode_firewall_device": config.IdentifierFromProvider, "linode_image": config.IdentifierFromProvider, "linode_instance": config.IdentifierFromProvider, "linode_instance_config": config.IdentifierFromProvider, "linode_instance_disk": config.IdentifierFromProvider, - "linode_instance_ip": config.IdentifierFromProvider, "linode_instance_shared_ips": config.IdentifierFromProvider, - "linode_ipv6_range": config.IdentifierFromProvider, "linode_lke_cluster": config.IdentifierFromProvider, - "linode_nodebalancer": config.IdentifierFromProvider, - "linode_nodebalancer_config": config.IdentifierFromProvider, "linode_nodebalancer_node": config.IdentifierFromProvider, + "linode_nodebalancer_config": config.IdentifierFromProvider, "linode_object_storage_bucket": config.IdentifierFromProvider, - "linode_object_storage_key": config.IdentifierFromProvider, "linode_object_storage_object": config.IdentifierFromProvider, - "linode_rdns": config.IdentifierFromProvider, - "linode_sshkey": config.IdentifierFromProvider, - "linode_stackscript": config.IdentifierFromProvider, - "linode_token": config.IdentifierFromProvider, "linode_user": config.IdentifierFromProvider, - "linode_volume": config.IdentifierFromProvider, } -// ExternalNameConfigurations applies all external name configs listed in the -// table ExternalNameConfigs and sets the version of those resources to v1beta1 -// assuming they will be tested. -func ExternalNameConfigurations() config.ResourceOption { - return func(r *config.Resource) { - if e, ok := ExternalNameConfigs[r.Name]; ok { - r.ExternalName = e - } - } +// cliReconciledExternalNameConfigs contains all external name configurations +// belonging to Terraform resources to be reconciled under the CLI-based +// architecture for this provider. +var cliReconciledExternalNameConfigs = map[string]config.ExternalName{} + +// TemplatedStringAsIdentifierWithNoName uses TemplatedStringAsIdentifier but +// without the name initializer. This allows it to be used in cases where the ID +// is constructed with parameters and a provider-defined value, meaning no +// user-defined input. Since the external name is not user-defined, the name +// initializer has to be disabled. +func TemplatedStringAsIdentifierWithNoName(tmpl string) config.ExternalName { + e := config.TemplatedStringAsIdentifier("", tmpl) + e.DisableNameInitializer = true + return e } -// ExternalNameConfigured returns the list of all resources whose external name -// is configured manually. -func ExternalNameConfigured() []string { - l := make([]string, len(ExternalNameConfigs)) - i := 0 - for name := range ExternalNameConfigs { - // $ is added to match the exact string since the format is regex. - l[i] = name + "$" - i++ +// ResourceConfigurator applies all external name configs listed in +// the table NoForkExternalNameConfigs, +// CLIReconciledExternalNameConfigs, and +// TerraformPluginFrameworkExternalNameConfigs and sets the version of +// those resources to v1alpha1. +func resourceConfigurator() config.ResourceOption { + return func(r *config.Resource) { + // If an external name is configured for multiple architectures, + // Terraform Plugin Framework takes precedence over Terraform + // Plugin SDKv2, which takes precedence over CLI architecture. + e, configured := terraformPluginFrameworkExternalNameConfigs[r.Name] + if !configured { + e, configured = terraformPluginSDKIncludeList[r.Name] + if !configured { + e, configured = cliReconciledExternalNameConfigs[r.Name] + } + } + if !configured { + return + } + r.Version = "v1alpha1" + r.ExternalName = e } - return l } diff --git a/config/firewall/config.go b/config/firewall/config.go index f1978a9..ccc8884 100644 --- a/config/firewall/config.go +++ b/config/firewall/config.go @@ -1,6 +1,6 @@ package firewall -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/firewalldevice/config.go b/config/firewalldevice/config.go index 187d236..aa05c8d 100644 --- a/config/firewalldevice/config.go +++ b/config/firewalldevice/config.go @@ -1,6 +1,6 @@ package firewalldevice -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/image/config.go b/config/image/config.go index 0d1c6a6..a4548f7 100644 --- a/config/image/config.go +++ b/config/image/config.go @@ -1,6 +1,6 @@ package image -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/instance/config.go b/config/instance/config.go index eba5ea4..da67354 100644 --- a/config/instance/config.go +++ b/config/instance/config.go @@ -1,6 +1,6 @@ package instance -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/instanceconfig/config.go b/config/instanceconfig/config.go index 94c41cd..e552fb3 100644 --- a/config/instanceconfig/config.go +++ b/config/instanceconfig/config.go @@ -3,7 +3,7 @@ package instanceconfig import ( "fmt" - "github.com/upbound/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/config" ) // Configure configures individual resources by adding custom ResourceConfigurators. diff --git a/config/instancedisk/config.go b/config/instancedisk/config.go index 0db771f..d52a4f9 100644 --- a/config/instancedisk/config.go +++ b/config/instancedisk/config.go @@ -1,6 +1,6 @@ package instancedisk -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/instanceip/config.go b/config/instanceip/config.go index 827ae92..fb284f1 100644 --- a/config/instanceip/config.go +++ b/config/instanceip/config.go @@ -1,7 +1,7 @@ package instanceip import ( - "github.com/upbound/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/config" ) // Configure configures individual resources by adding custom ResourceConfigurators. diff --git a/config/instancesharedips/config.go b/config/instancesharedips/config.go index 294b229..079bebf 100644 --- a/config/instancesharedips/config.go +++ b/config/instancesharedips/config.go @@ -1,11 +1,12 @@ package instancesharedips -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("linode_instance_shared_ips", func(r *config.Resource) { r.Kind = "SharedIPs" + r.Path = "sharedips" r.References["linode_id"] = config.Reference{ Type: "Instance", } diff --git a/config/ipv6range/config.go b/config/ipv6range/config.go index 186e1d7..ed319b7 100644 --- a/config/ipv6range/config.go +++ b/config/ipv6range/config.go @@ -1,6 +1,6 @@ package ipv6range -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/lkecluster/config.go b/config/lkecluster/config.go index 860fb62..0d6f43b 100644 --- a/config/lkecluster/config.go +++ b/config/lkecluster/config.go @@ -3,8 +3,8 @@ package lkecluster import ( "encoding/base64" + "github.com/crossplane/upjet/pkg/config" "github.com/pkg/errors" - "github.com/upbound/upjet/pkg/config" ) const ( diff --git a/config/nodebalancer/config.go b/config/nodebalancer/config.go index 0a2d9e6..1d8853a 100644 --- a/config/nodebalancer/config.go +++ b/config/nodebalancer/config.go @@ -1,6 +1,6 @@ package nodebalancer -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/nodebalancerconfig/config.go b/config/nodebalancerconfig/config.go index 04e9747..0d1610e 100644 --- a/config/nodebalancerconfig/config.go +++ b/config/nodebalancerconfig/config.go @@ -1,6 +1,6 @@ package nodebalancerconfig -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/nodebalancernode/config.go b/config/nodebalancernode/config.go index 1a6bbb0..d42b756 100644 --- a/config/nodebalancernode/config.go +++ b/config/nodebalancernode/config.go @@ -1,6 +1,6 @@ package nodebalancernode -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/null/config.go b/config/null/config.go index 897c6f8..a0af24f 100644 --- a/config/null/config.go +++ b/config/null/config.go @@ -5,7 +5,7 @@ Copyright 2021 Upbound Inc. package null import ( - ujconfig "github.com/upbound/upjet/pkg/config" + ujconfig "github.com/crossplane/upjet/pkg/config" ) // Configure configures the null group diff --git a/config/objectstoragebucket/config.go b/config/objectstoragebucket/config.go index 74cb0b5..fb80e08 100644 --- a/config/objectstoragebucket/config.go +++ b/config/objectstoragebucket/config.go @@ -1,13 +1,21 @@ package objectstoragebucket -import "github.com/upbound/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("linode_object_storage_bucket", func(r *config.Resource) { - r.ShortGroup = "objectstorage" r.Kind = "Bucket" + element, ok := r.TerraformResource.Schema["cert"].Elem.(*schema.Resource) + if ok { + element.Schema["certificate"].Sensitive = false + element.Schema["private_key"].Sensitive = false + } + r.References["access_key"] = config.Reference{ Type: "Key", RefFieldName: "AccessKeyRef", diff --git a/config/objectstoragekey/config.go b/config/objectstoragekey/config.go index 027c7b8..3a9d78a 100644 --- a/config/objectstoragekey/config.go +++ b/config/objectstoragekey/config.go @@ -1,6 +1,6 @@ package objectstoragekey -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/objectstorageobject/config.go b/config/objectstorageobject/config.go index 629412e..d667561 100644 --- a/config/objectstorageobject/config.go +++ b/config/objectstorageobject/config.go @@ -1,6 +1,6 @@ package objectstorageobject -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/provider.go b/config/provider.go index 5f4f511..64988f0 100644 --- a/config/provider.go +++ b/config/provider.go @@ -6,11 +6,16 @@ package config import ( // Note(turkenh): we are importing this to embed provider schema document + "context" _ "embed" - "github.com/linode/provider-linode/config/ipv6range" - - ujconfig "github.com/upbound/upjet/pkg/config" + "github.com/crossplane/upjet/pkg/config" + conversiontfjson "github.com/crossplane/upjet/pkg/types/conversion/tfjson" + tfjson "github.com/hashicorp/terraform-json" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/linode/terraform-provider-linode/v2/linode" + "github.com/linode/terraform-provider-linode/v2/version" + "github.com/pkg/errors" "github.com/linode/provider-linode/config/databaseaccesscontrols" "github.com/linode/provider-linode/config/databasemysql" @@ -25,6 +30,7 @@ import ( "github.com/linode/provider-linode/config/instancedisk" "github.com/linode/provider-linode/config/instanceip" "github.com/linode/provider-linode/config/instancesharedips" + "github.com/linode/provider-linode/config/ipv6range" "github.com/linode/provider-linode/config/lkecluster" "github.com/linode/provider-linode/config/nodebalancer" "github.com/linode/provider-linode/config/nodebalancerconfig" @@ -51,15 +57,59 @@ var providerSchema string //go:embed provider-metadata.yaml var providerMetadata string +func externalNameConfig() config.ResourceOption { + return func(r *config.Resource) { + r.ExternalName = config.IdentifierFromProvider + } +} + +func getProviderSchema(s string) (*schema.Provider, error) { + ps := tfjson.ProviderSchemas{} + if err := ps.UnmarshalJSON([]byte(s)); err != nil { + panic(err) + } + if len(ps.Schemas) != 1 { + return nil, errors.Errorf("there should exactly be 1 provider schema but there are %d", len(ps.Schemas)) + } + var rs map[string]*tfjson.Schema + for _, v := range ps.Schemas { + rs = v.ResourceSchemas + break + } + return &schema.Provider{ + ResourcesMap: conversiontfjson.GetV2ResourceMap(rs), + }, nil +} + // GetProvider returns provider configuration -func GetProvider() *ujconfig.Provider { - pc := ujconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), - ujconfig.WithIncludeList(ExternalNameConfigured()), - ujconfig.WithDefaultResourceOptions( - ExternalNameConfigurations(), - )) - - for _, configure := range []func(provider *ujconfig.Provider){ +func GetProvider(_ context.Context, generationProvider bool) (*config.Provider, error) { + var p *schema.Provider + var err error + + if generationProvider { + p, err = getProviderSchema(providerSchema) + } else { + p = linode.Provider() + } + if err != nil { + return nil, errors.Wrapf(err, "cannot get the Terraform provider schema with generation mode set to %t", generationProvider) + } + + fwProvider := linode.CreateFrameworkProvider(version.ProviderVersion) + + pc := config.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), + config.WithDefaultResourceOptions( + externalNameConfig(), + resourceConfigurator(), + ), + config.WithIncludeList(resourceList(cliReconciledExternalNameConfigs)), + config.WithTerraformPluginSDKIncludeList(resourceList(terraformPluginSDKIncludeList)), + config.WithTerraformPluginFrameworkIncludeList(resourceList(terraformPluginFrameworkExternalNameConfigs)), + config.WithTerraformProvider(p), + config.WithTerraformPluginFrameworkProvider(fwProvider), + ) + + for _, configure := range []func(provider *config.Provider){ // add custom config functions databaseaccesscontrols.Configure, databasemysql.Configure, @@ -93,5 +143,18 @@ func GetProvider() *ujconfig.Provider { } pc.ConfigureResources() - return pc + return pc, nil +} + +// resourceList returns the list of resources that have external +// name configured in the specified table. +func resourceList(t map[string]config.ExternalName) []string { + l := make([]string, len(t)) + i := 0 + for n := range t { + // Expected format is regex and we'd like to have exact matches. + l[i] = n + "$" + i++ + } + return l } diff --git a/config/rdns/config.go b/config/rdns/config.go index bf67299..4902fcc 100644 --- a/config/rdns/config.go +++ b/config/rdns/config.go @@ -1,6 +1,6 @@ package rdns -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { @@ -9,5 +9,6 @@ func Configure(p *config.Provider) { // this resource, which would be "linode" r.ShortGroup = "rdns" r.Kind = "RDNS" + r.Path = "rdns" }) } diff --git a/config/sshkey/config.go b/config/sshkey/config.go index 53d784b..51eaf92 100644 --- a/config/sshkey/config.go +++ b/config/sshkey/config.go @@ -1,6 +1,6 @@ package sshkey -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/stackscript/config.go b/config/stackscript/config.go index ef3c309..f3edbff 100644 --- a/config/stackscript/config.go +++ b/config/stackscript/config.go @@ -1,6 +1,6 @@ package stackscript -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/token/config.go b/config/token/config.go index b4391ca..db53c9b 100644 --- a/config/token/config.go +++ b/config/token/config.go @@ -1,6 +1,6 @@ package token -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/user/config.go b/config/user/config.go index 887d99f..b052e5a 100644 --- a/config/user/config.go +++ b/config/user/config.go @@ -1,6 +1,6 @@ package user -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/config/volume/config.go b/config/volume/config.go index 554fe7e..cf4a0f6 100644 --- a/config/volume/config.go +++ b/config/volume/config.go @@ -1,6 +1,6 @@ package volume -import "github.com/upbound/upjet/pkg/config" +import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { diff --git a/examples-generated/database/accesscontrols.yaml b/examples-generated/database/v1alpha1/accesscontrols.yaml similarity index 99% rename from examples-generated/database/accesscontrols.yaml rename to examples-generated/database/v1alpha1/accesscontrols.yaml index 04468cd..d60842c 100644 --- a/examples-generated/database/accesscontrols.yaml +++ b/examples-generated/database/v1alpha1/accesscontrols.yaml @@ -46,6 +46,3 @@ spec: label: myinstance region: us-southeast type: g6-nanode-1 - ---- - diff --git a/examples-generated/database/mysql.yaml b/examples-generated/database/v1alpha1/mysql.yaml similarity index 98% rename from examples-generated/database/mysql.yaml rename to examples-generated/database/v1alpha1/mysql.yaml index 20cab64..e49c411 100644 --- a/examples-generated/database/mysql.yaml +++ b/examples-generated/database/v1alpha1/mysql.yaml @@ -12,6 +12,3 @@ spec: label: mydatabase region: us-southeast type: g6-nanode-1 - ---- - diff --git a/examples-generated/database/postgresql.yaml b/examples-generated/database/v1alpha1/postgresql.yaml similarity index 98% rename from examples-generated/database/postgresql.yaml rename to examples-generated/database/v1alpha1/postgresql.yaml index a41066b..29f8e38 100644 --- a/examples-generated/database/postgresql.yaml +++ b/examples-generated/database/v1alpha1/postgresql.yaml @@ -12,6 +12,3 @@ spec: label: mydatabase region: us-southeast type: g6-nanode-1 - ---- - diff --git a/examples-generated/domain/record.yaml b/examples-generated/domain/v1alpha1/record.yaml similarity index 98% rename from examples-generated/domain/record.yaml rename to examples-generated/domain/v1alpha1/record.yaml index e403994..685a448 100644 --- a/examples-generated/domain/record.yaml +++ b/examples-generated/domain/v1alpha1/record.yaml @@ -14,6 +14,3 @@ spec: name: www recordType: CNAME target: foobar.example - ---- - diff --git a/examples-generated/firewall/device.yaml b/examples-generated/firewall/v1alpha1/device.yaml similarity index 99% rename from examples-generated/firewall/device.yaml rename to examples-generated/firewall/v1alpha1/device.yaml index 9d72c21..45b1693 100644 --- a/examples-generated/firewall/device.yaml +++ b/examples-generated/firewall/v1alpha1/device.yaml @@ -55,6 +55,3 @@ spec: label: my_instance region: us-southeast type: g6-standard-1 - ---- - diff --git a/examples-generated/firewall/firewall.yaml b/examples-generated/firewall/v1alpha1/firewall.yaml similarity index 99% rename from examples-generated/firewall/firewall.yaml rename to examples-generated/firewall/v1alpha1/firewall.yaml index 882256f..bff81af 100644 --- a/examples-generated/firewall/firewall.yaml +++ b/examples-generated/firewall/v1alpha1/firewall.yaml @@ -69,6 +69,3 @@ spec: namespace: upbound-system swapSize: 256 type: g6-standard-1 - ---- - diff --git a/examples-generated/image/image.yaml b/examples-generated/image/v1alpha1/image.yaml similarity index 99% rename from examples-generated/image/image.yaml rename to examples-generated/image/v1alpha1/image.yaml index 6457cae..1983b2c 100644 --- a/examples-generated/image/image.yaml +++ b/examples-generated/image/v1alpha1/image.yaml @@ -52,6 +52,3 @@ spec: name: example-secret namespace: upbound-system type: g6-nanode-1 - ---- - diff --git a/examples-generated/instance/config.yaml b/examples-generated/instance/v1alpha1/config.yaml similarity index 99% rename from examples-generated/instance/config.yaml rename to examples-generated/instance/v1alpha1/config.yaml index 9690127..6c8468c 100644 --- a/examples-generated/instance/config.yaml +++ b/examples-generated/instance/v1alpha1/config.yaml @@ -57,6 +57,3 @@ spec: name: example-secret namespace: upbound-system size: ${linode_instance.my-instance.specs.0.disk} - ---- - diff --git a/examples-generated/instance/disk.yaml b/examples-generated/instance/v1alpha1/disk.yaml similarity index 99% rename from examples-generated/instance/disk.yaml rename to examples-generated/instance/v1alpha1/disk.yaml index 1e3467c..49f4190 100644 --- a/examples-generated/instance/disk.yaml +++ b/examples-generated/instance/v1alpha1/disk.yaml @@ -30,6 +30,3 @@ spec: label: my-instance region: us-southeast type: g6-standard-1 - ---- - diff --git a/examples-generated/instance/instance.yaml b/examples-generated/instance/v1alpha1/instance.yaml similarity index 98% rename from examples-generated/instance/instance.yaml rename to examples-generated/instance/v1alpha1/instance.yaml index 40f4a68..5be3e80 100644 --- a/examples-generated/instance/instance.yaml +++ b/examples-generated/instance/v1alpha1/instance.yaml @@ -23,6 +23,3 @@ spec: tags: - foo type: g6-standard-1 - ---- - diff --git a/examples-generated/instance/ip.yaml b/examples-generated/instance/v1alpha1/ip.yaml similarity index 99% rename from examples-generated/instance/ip.yaml rename to examples-generated/instance/v1alpha1/ip.yaml index fa92870..a1ee9aa 100644 --- a/examples-generated/instance/ip.yaml +++ b/examples-generated/instance/v1alpha1/ip.yaml @@ -29,6 +29,3 @@ spec: label: foobar-test region: us-east type: g6-nanode-1 - ---- - diff --git a/examples-generated/instance/sharedips.yaml b/examples-generated/instance/v1alpha1/sharedips.yaml similarity index 99% rename from examples-generated/instance/sharedips.yaml rename to examples-generated/instance/v1alpha1/sharedips.yaml index 713e924..97cb3a9 100644 --- a/examples-generated/instance/sharedips.yaml +++ b/examples-generated/instance/v1alpha1/sharedips.yaml @@ -61,6 +61,3 @@ spec: linodeIdSelector: matchLabels: testing.upbound.io/example-name: primary - ---- - diff --git a/examples-generated/ipv6/ipv6range.yaml b/examples-generated/ipv6/v1alpha1/ipv6range.yaml similarity index 99% rename from examples-generated/ipv6/ipv6range.yaml rename to examples-generated/ipv6/v1alpha1/ipv6range.yaml index 441ff9e..29302dd 100644 --- a/examples-generated/ipv6/ipv6range.yaml +++ b/examples-generated/ipv6/v1alpha1/ipv6range.yaml @@ -29,6 +29,3 @@ spec: label: my-linode region: us-southeast type: g6-nanode-1 - ---- - diff --git a/examples-generated/lke/cluster.yaml b/examples-generated/lke/v1alpha1/cluster.yaml similarity index 98% rename from examples-generated/lke/cluster.yaml rename to examples-generated/lke/v1alpha1/cluster.yaml index e87c35d..e0bbc02 100644 --- a/examples-generated/lke/cluster.yaml +++ b/examples-generated/lke/v1alpha1/cluster.yaml @@ -16,6 +16,3 @@ spec: region: us-central tags: - prod - ---- - diff --git a/examples-generated/nodebalancer/config.yaml b/examples-generated/nodebalancer/v1alpha1/config.yaml similarity index 99% rename from examples-generated/nodebalancer/config.yaml rename to examples-generated/nodebalancer/v1alpha1/config.yaml index 66d5f9d..e3bb996 100644 --- a/examples-generated/nodebalancer/config.yaml +++ b/examples-generated/nodebalancer/v1alpha1/config.yaml @@ -35,6 +35,3 @@ spec: clientConnThrottle: 20 label: mynodebalancer region: us-east - ---- - diff --git a/examples-generated/nodebalancer/node.yaml b/examples-generated/nodebalancer/v1alpha1/node.yaml similarity index 99% rename from examples-generated/nodebalancer/node.yaml rename to examples-generated/nodebalancer/v1alpha1/node.yaml index 68899c8..3941b02 100644 --- a/examples-generated/nodebalancer/node.yaml +++ b/examples-generated/nodebalancer/v1alpha1/node.yaml @@ -83,6 +83,3 @@ spec: port: 80 protocol: http stickiness: http_cookie - ---- - diff --git a/examples-generated/nodebalancer/nodebalancer.yaml b/examples-generated/nodebalancer/v1alpha1/nodebalancer.yaml similarity index 98% rename from examples-generated/nodebalancer/nodebalancer.yaml rename to examples-generated/nodebalancer/v1alpha1/nodebalancer.yaml index e33e7d1..90e7d05 100644 --- a/examples-generated/nodebalancer/nodebalancer.yaml +++ b/examples-generated/nodebalancer/v1alpha1/nodebalancer.yaml @@ -13,6 +13,3 @@ spec: region: us-east tags: - foobar - ---- - diff --git a/examples-generated/objectstorage/bucket.yaml b/examples-generated/objectstorage/v1alpha1/bucket.yaml similarity index 98% rename from examples-generated/objectstorage/bucket.yaml rename to examples-generated/objectstorage/v1alpha1/bucket.yaml index 47a317a..2db621e 100644 --- a/examples-generated/objectstorage/bucket.yaml +++ b/examples-generated/objectstorage/v1alpha1/bucket.yaml @@ -10,6 +10,3 @@ spec: forProvider: cluster: ${data.linode_object_storage_cluster.primary.id} label: mybucket - ---- - diff --git a/examples-generated/objectstorage/key.yaml b/examples-generated/objectstorage/v1alpha1/key.yaml similarity index 97% rename from examples-generated/objectstorage/key.yaml rename to examples-generated/objectstorage/v1alpha1/key.yaml index a52c08e..21bac4c 100644 --- a/examples-generated/objectstorage/key.yaml +++ b/examples-generated/objectstorage/v1alpha1/key.yaml @@ -9,6 +9,3 @@ metadata: spec: forProvider: label: image-access - ---- - diff --git a/examples-generated/objectstorage/object.yaml b/examples-generated/objectstorage/v1alpha1/object.yaml similarity index 98% rename from examples-generated/objectstorage/object.yaml rename to examples-generated/objectstorage/v1alpha1/object.yaml index 6de3f0c..57f253f 100644 --- a/examples-generated/objectstorage/object.yaml +++ b/examples-generated/objectstorage/v1alpha1/object.yaml @@ -18,6 +18,3 @@ spec: matchLabels: testing.upbound.io/example-name: my_key source: ${pathexpand("~/files/log.txt")} - ---- - diff --git a/examples-generated/rdns/rdns.yaml b/examples-generated/rdns/v1alpha1/rdns.yaml similarity index 99% rename from examples-generated/rdns/rdns.yaml rename to examples-generated/rdns/v1alpha1/rdns.yaml index 6461f3b..8451a8b 100644 --- a/examples-generated/rdns/rdns.yaml +++ b/examples-generated/rdns/v1alpha1/rdns.yaml @@ -26,6 +26,3 @@ spec: image: linode/alpine3.9 region: ca-east type: g6-dedicated-2 - ---- - diff --git a/examples-generated/sshkey/sshkey.yaml b/examples-generated/sshkey/v1alpha1/sshkey.yaml similarity index 99% rename from examples-generated/sshkey/sshkey.yaml rename to examples-generated/sshkey/v1alpha1/sshkey.yaml index 5d271fe..a302301 100644 --- a/examples-generated/sshkey/sshkey.yaml +++ b/examples-generated/sshkey/v1alpha1/sshkey.yaml @@ -33,6 +33,3 @@ spec: name: example-secret namespace: upbound-system type: g6-nanode-1 - ---- - diff --git a/examples-generated/stackscript/stackscript.yaml b/examples-generated/stackscript/v1alpha1/stackscript.yaml similarity index 99% rename from examples-generated/stackscript/stackscript.yaml rename to examples-generated/stackscript/v1alpha1/stackscript.yaml index 1f5ac60..7343cd2 100644 --- a/examples-generated/stackscript/stackscript.yaml +++ b/examples-generated/stackscript/v1alpha1/stackscript.yaml @@ -48,6 +48,3 @@ spec: matchLabels: testing.upbound.io/example-name: foo type: g6-nanode-1 - ---- - diff --git a/examples-generated/token/token.yaml b/examples-generated/token/v1alpha1/token.yaml similarity index 99% rename from examples-generated/token/token.yaml rename to examples-generated/token/v1alpha1/token.yaml index b85d27e..5e14909 100644 --- a/examples-generated/token/token.yaml +++ b/examples-generated/token/v1alpha1/token.yaml @@ -30,6 +30,3 @@ spec: echo -e "[DEFAULT]\n token = ${linode_token.foo.token}\n region=${self.region}\n type=${self.type}" > ~/.linode-cli pip install linode-cli linode-cli linodes list --format "ipv6,label" --text --no-headers >> /etc/hosts - ---- - diff --git a/examples-generated/user/user.yaml b/examples-generated/user/v1alpha1/user.yaml similarity index 97% rename from examples-generated/user/user.yaml rename to examples-generated/user/v1alpha1/user.yaml index e834321..a423df1 100644 --- a/examples-generated/user/user.yaml +++ b/examples-generated/user/v1alpha1/user.yaml @@ -10,6 +10,3 @@ spec: forProvider: email: john@acme.io username: john123 - ---- - diff --git a/examples-generated/volume/volume.yaml b/examples-generated/volume/v1alpha1/volume.yaml similarity index 99% rename from examples-generated/volume/volume.yaml rename to examples-generated/volume/v1alpha1/volume.yaml index 77734a4..83a57e3 100644 --- a/examples-generated/volume/volume.yaml +++ b/examples-generated/volume/v1alpha1/volume.yaml @@ -34,6 +34,3 @@ spec: tags: - foobaz type: g6-nanode-1 - ---- - diff --git a/examples/install.yaml b/examples/install.yaml index 13c91ec..6e143e1 100644 --- a/examples/install.yaml +++ b/examples/install.yaml @@ -3,4 +3,4 @@ kind: Provider metadata: name: provider-linode spec: - package: linode/provider-linode:v0.0.11 + package: linode/provider-linode:v0.0.15 diff --git a/examples/resources/instance/instance.yaml b/examples/resources/instance/instance.yaml index 5be3e80..9c5c8a0 100644 --- a/examples/resources/instance/instance.yaml +++ b/examples/resources/instance/instance.yaml @@ -14,11 +14,7 @@ spec: image: linode/ubuntu18.04 label: simple_instance privateIp: true - region: us-central - rootPassSecretRef: - key: example-key - name: example-secret - namespace: upbound-system + region: us-sea swapSize: 256 tags: - foo diff --git a/examples/resources/instance/simple-instance.yaml b/examples/resources/instance/simple-instance.yaml new file mode 100644 index 0000000..10eb5ce --- /dev/null +++ b/examples/resources/instance/simple-instance.yaml @@ -0,0 +1,17 @@ +apiVersion: instance.linode.upbound.io/v1alpha1 +kind: Instance +metadata: + name: uptest-instance +spec: + forProvider: + image: linode/ubuntu22.04 + label: provider-linode-test + authorizedKeys: + - ssh-rsa foobar.....AAAAA + privateIp: true + region: us-sea + tags: + - rke2 + type: g6-standard-2 + providerConfigRef: + name: default diff --git a/examples/resources/nodebalancer/nodebalancer.yaml b/examples/resources/nodebalancer/nodebalancer.yaml index 90e7d05..de6c85d 100644 --- a/examples/resources/nodebalancer/nodebalancer.yaml +++ b/examples/resources/nodebalancer/nodebalancer.yaml @@ -10,6 +10,6 @@ spec: forProvider: clientConnThrottle: 20 label: mynodebalancer - region: us-east + region: us-sea tags: - foobar diff --git a/examples/resources/objectstorage/bucket.yaml b/examples/resources/objectstorage/bucket.yaml new file mode 100644 index 0000000..84ae3c3 --- /dev/null +++ b/examples/resources/objectstorage/bucket.yaml @@ -0,0 +1,11 @@ +apiVersion: objectstorage.linode.upbound.io/v1alpha1 +kind: Bucket +metadata: + name: test-bucket +spec: + deletionPolicy: Orphan + forProvider: + label: test-bucket + cluster: us-sea-1 + providerConfigRef: + name: default diff --git a/examples/resources/objectstorage/key.yaml b/examples/resources/objectstorage/key.yaml new file mode 100644 index 0000000..defcf03 --- /dev/null +++ b/examples/resources/objectstorage/key.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: objectstorage.linode.upbound.io/v1alpha1 +kind: Key +metadata: + name: test-registry-key +spec: + forProvider: + label: test-registry-key + providerConfigRef: + name: default + writeConnectionSecretToRef: + name: access-key + namespace: default diff --git a/go.mod b/go.mod index 86f1fdd..b7976c4 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,21 @@ module github.com/linode/provider-linode -go 1.19 +go 1.21 require ( - github.com/crossplane/crossplane-runtime v0.20.0-rc.0.0.20230406155702-4e1673b7141f - github.com/crossplane/crossplane-tools v0.0.0-20230327091744-4236bf732aa5 + dario.cat/mergo v1.0.0 + github.com/crossplane/crossplane-runtime v1.14.2 + github.com/crossplane/crossplane-tools v0.0.0-20230925130601-628280f8bf79 + github.com/crossplane/upjet v1.1.0 + github.com/hashicorp/terraform-json v0.21.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 + github.com/linode/terraform-provider-linode/v2 v2.14.0 github.com/pkg/errors v0.9.1 - github.com/upbound/upjet v0.9.0-rc.0.0.20230502154751-645d7260d814 gopkg.in/alecthomas/kingpin.v2 v2.2.6 - k8s.io/apimachinery v0.26.3 - k8s.io/client-go v0.26.3 - sigs.k8s.io/controller-runtime v0.14.6 - sigs.k8s.io/controller-tools v0.11.3 + k8s.io/apimachinery v0.28.4 + k8s.io/client-go v0.28.4 + sigs.k8s.io/controller-runtime v0.16.3 + sigs.k8s.io/controller-tools v0.13.0 ) require ( @@ -20,71 +24,79 @@ require ( github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/antchfx/htmlquery v1.2.4 // indirect github.com/antchfx/xpath v1.2.0 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/armon/go-metrics v0.3.9 // indirect - github.com/armon/go-radix v1.0.0 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.24.1 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect + github.com/aws/aws-sdk-go-v2/config v1.26.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.12 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.7 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 // indirect + github.com/aws/smithy-go v1.19.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v3 v3.0.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dave/jennifer v1.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.9.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fatih/camelcase v1.0.0 // indirect - github.com/fatih/color v1.13.0 // indirect + github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-logr/zapr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.21.1 // indirect - github.com/gobuffalo/flect v0.3.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/zapr v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-resty/resty/v2 v2.11.0 // indirect + github.com/gobuffalo/flect v1.0.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect - github.com/hashicorp/go-hclog v1.2.1 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.4 // indirect - github.com/hashicorp/go-retryablehttp v0.7.1 // indirect - github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-secure-stdlib/mlock v0.1.1 // indirect - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1 // indirect - github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect + github.com/google/uuid v1.4.0 // indirect + github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/hcl/v2 v2.14.1 // indirect + github.com/hashicorp/hcl/v2 v2.19.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-json v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect - github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 // indirect - github.com/hashicorp/vault/api v1.5.0 // indirect - github.com/hashicorp/vault/sdk v0.4.1 // indirect - github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect + github.com/hashicorp/terraform-plugin-framework v1.5.0 // indirect + github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 // indirect + github.com/hashicorp/terraform-plugin-framework-timetypes v0.3.0 // indirect + github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.21.0 // indirect + github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect + github.com/hashicorp/terraform-registry-address v0.2.3 // indirect + github.com/hashicorp/terraform-svchost v0.1.1 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect github.com/iancoleman/strcase v0.2.0 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/imdario/mergo v0.3.16 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/linode/linodego v1.28.0 // indirect + github.com/linode/linodego/k8s v1.25.2 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect @@ -95,49 +107,51 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/muvaf/typewriter v0.0.0-20220131201631-921e94e8e8d7 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/pierrec/lz4 v2.5.2+incompatible // indirect - github.com/prometheus/client_golang v1.14.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect - github.com/ryanuber/go-glob v1.0.0 // indirect - github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/cobra v1.6.1 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect + github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect + github.com/sergi/go-diff v1.2.0 // indirect + github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tmccombs/hcl2json v0.3.3 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect - github.com/vmihailenco/tagparser v0.1.1 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/yuin/goldmark v1.4.13 // indirect - github.com/zclconf/go-cty v1.11.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.2.0 // indirect - golang.org/x/mod v0.7.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.1.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/zclconf/go-cty v1.14.2 // indirect + github.com/zclconf/go-cty-yaml v1.0.3 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.4.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect - google.golang.org/grpc v1.50.1 // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + golang.org/x/tools v0.14.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/grpc v1.61.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/square/go-jose.v2 v2.5.1 // indirect + gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.26.3 // indirect - k8s.io/apiextensions-apiserver v0.26.3 // indirect - k8s.io/component-base v0.26.3 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect - k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + k8s.io/api v0.28.4 // indirect + k8s.io/apiextensions-apiserver v0.28.4 // indirect + k8s.io/component-base v0.28.4 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) + +replace github.com/linode/terraform-provider-linode/v2 v2.14.0 => github.com/tchinmai7/terraform-provider-linode/v2 v2.0.0-20240212213046-468f25b69508 diff --git a/go.sum b/go.sum index 5b5070b..d2b9160 100644 --- a/go.sum +++ b/go.sum @@ -35,141 +35,142 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/alecthomas/kong v0.2.16/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/antchfx/htmlquery v1.2.4 h1:qLteofCMe/KGovBI6SQgmou2QNyedFUW+pE+BpeZ494= github.com/antchfx/htmlquery v1.2.4/go.mod h1:2xO6iu3EVWs7R2JYqBbp8YzG50gj/ofqs5/0VZoDZLc= github.com/antchfx/xpath v1.2.0 h1:mbwv7co+x0RwgeGAOHdrKy89GvHaGvxxBtPK0uF9Zr8= github.com/antchfx/xpath v1.2.0/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= -github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/aws/aws-sdk-go-v2 v1.24.1 h1:xAojnj+ktS95YZlDf0zxWBkbFtymPeDP+rvUQIH3uAU= +github.com/aws/aws-sdk-go-v2 v1.24.1/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4/go.mod h1:usURWEKSNNAcAZuzRn/9ZYPT8aZQkR7xcCtunK/LkJo= +github.com/aws/aws-sdk-go-v2/config v1.26.1 h1:z6DqMxclFGL3Zfo+4Q0rLnAZ6yVkzCRxhRMsiRQnD1o= +github.com/aws/aws-sdk-go-v2/config v1.26.1/go.mod h1:ZB+CuKHRbb5v5F0oJtGdhFTelmrxd4iWO1lf0rQwSAg= +github.com/aws/aws-sdk-go-v2/credentials v1.16.12 h1:v/WgB8NxprNvr5inKIiVVrXPuuTegM+K8nncFkr1usU= +github.com/aws/aws-sdk-go-v2/credentials v1.16.12/go.mod h1:X21k0FjEJe+/pauud82HYiQbEr9jRKY3kXEIQ4hXeTQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.7 h1:FnLf60PtjXp8ZOzQfhJVsqF0OtYKQZWQfqOLshh8YXg= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.7/go.mod h1:tDVvl8hyU6E9B8TrnNrZQEVkQlB8hjJwcgpPhgtlnNg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10 h1:vF+Zgd9s+H4vOXd5BMaPWykta2a6Ih0AKLq/X6NYKn4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.10/go.mod h1:6BkRjejp/GR4411UGqkX8+wFMbFbqsUIimfK4XjOKR4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10 h1:nYPe006ktcqUji8S2mqXf9c/7NdiKriOwMvWQHgYztw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.10/go.mod h1:6UV4SZkVvmODfXKql4LCbaZUpF7HO2BX38FgBf9ZOLw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10 h1:5oE2WzJE56/mVveuDZPJESKlg/00AaS2pY2QZcnxg4M= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.10/go.mod h1:FHbKWQtRBYUz4vO5WBWjzMD2by126ny5y/1EoaWoLfI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10 h1:L0ai8WICYHozIKK+OtPzVJBugL7culcuM4E4JOpIEm8= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.10/go.mod h1:byqfyxJBshFk0fF9YmK0M0ugIO8OWjzH2T3bPG4eGuA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10 h1:DBYTXwIGQSGs9w4jKm60F5dmCQ3EEruxdc0MFh+3EY4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.10/go.mod h1:wohMUQiFdzo0NtxbBg0mSRGZ4vL3n0dKjLTINdcIino= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10 h1:KOxnQeWy5sXyS37fdKEvAsGHOr9fa/qvwxfJurR/BzE= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.10/go.mod h1:jMx5INQFYFYB3lQD9W0D8Ohgq6Wnl7NYOJ2TQndbulI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1 h1:5XNlsBsEvBZBMO6p82y+sqpWg8j5aBCe+5C2GBFgqBQ= +github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1/go.mod h1:4qXHrG1Ne3VGIMZPCB8OjH/pLFO94sKABIusjh0KWPU= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 h1:5UYvv8JUvllZsRnfrcMQ+hJ9jNICmcgKPAO1CER25Wg= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.5/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= +github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= +github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= -github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crossplane/crossplane-runtime v0.20.0-rc.0.0.20230406155702-4e1673b7141f h1:wDRr6gaoiQstEdddrn0B5SSSgzdXreOQAbdmRH+9JeI= -github.com/crossplane/crossplane-runtime v0.20.0-rc.0.0.20230406155702-4e1673b7141f/go.mod h1:ebtUpmconMy8RKUEhrCXTUFSOpfGQqbKM2E+rjCCYJo= -github.com/crossplane/crossplane-tools v0.0.0-20230327091744-4236bf732aa5 h1:K9H55wcwfXcGroZApIgPmIGRGuZLszsLDCYB12p2yMo= -github.com/crossplane/crossplane-tools v0.0.0-20230327091744-4236bf732aa5/go.mod h1:+e4OaFlOcmr0JvINHl/yvEYBrZawzTgj6pQumOH1SS0= +github.com/crossplane/crossplane-runtime v1.14.2 h1:pV5JMzyzi/kcbeVBVPCat5MHH8zS94MBUapAyGx/Ry0= +github.com/crossplane/crossplane-runtime v1.14.2/go.mod h1:aOP+5W2wKpvthVs3pFNbVOe1jwrKYbJho0ThGNCVz9o= +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.1.0 h1:jfdag6qaF1/5mvlDT/8LdTc/vq1Iq0ASnmk3yV86I9U= +github.com/crossplane/upjet v1.1.0/go.mod h1:0bHLtnejZ9bDeyXuBb9MSOQLvKo3+aoTeUBO8N0dGSA= github.com/dave/jennifer v1.4.1 h1:XyqG6cn5RQsTj3qlWQTKlRGAyrTcsk1kUmWdZBzRjDw= github.com/dave/jennifer v1.4.1/go.mod h1:7jEdnm+qBcxl8PC0zyp7vxcpSRnzXSt9r39tpTVGlwA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= -github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/frankban/quicktest v1.13.0 h1:yNZif1OkDfNoDfb9zZa9aXIpejNR4F23Wely0c+Qdqk= -github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= -github.com/gobuffalo/flect v0.3.0 h1:erfPWM+K1rFNIQeRPdeEXxo8yFr/PO17lhRnS8FUrtk= -github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= +github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -203,15 +204,14 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/addlicense v0.0.0-20210428195630-6d92264d7170/go.mod h1:EMjYTRimagHs1FwlIqKyX3wAM0u3rA+McvlIIWmSamA= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -222,9 +222,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -241,123 +241,98 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 h1:pUa4ghanp6q4IJHwE9RwLgmVFfReJN+KbQ8ExNEUUoQ= +github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= -github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637 h1:Ud/6/AdmJ1R7ibdS0Wo5MWPj0T1R0fkpaD087bBaW8I= +github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-plugin v1.4.4 h1:NVdrSdFRt3SkZtNckJ6tog7gbpRrcbOjQi/rgF7JYWQ= -github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw= -github.com/hashicorp/go-secure-stdlib/mlock v0.1.1 h1:cCRo8gK7oq6A2L6LICkUZ+/a5rLiRXFMf1Qd4xSwxTc= -github.com/hashicorp/go-secure-stdlib/mlock v0.1.1/go.mod h1:zq93CJChV6L9QTfGKtfBxKqD7BqqXx5O04A/ns2p5+I= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1 h1:78ki3QBevHwYrVxnyVeaEz+7WtifHhauYF23es/0KlI= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/password v0.1.1/go.mod h1:9hH302QllNwu1o2TGYtSk8I8kTAN0ca1EHpwhm5Mmzo= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 h1:nd0HIW15E6FG1MsnArYaHfuw9C2zgzM8LxkG5Ty/788= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= -github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= +github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hc-install v0.6.2 h1:V1k+Vraqz4olgZ9UzKiAcbman9i9scg9GgSt/U3mw/M= +github.com/hashicorp/hc-install v0.6.2/go.mod h1:2JBpd+NCFKiHiu/yYCGaPyPHhZLxXTpz8oreHa/a3Ps= github.com/hashicorp/hcl/v2 v2.9.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= -github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= -github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= +github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= +github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s= -github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= -github.com/hashicorp/terraform-plugin-go v0.14.0 h1:ttnSlS8bz3ZPYbMb84DpcPhY4F5DsQtcAS7cHo8uvP4= -github.com/hashicorp/terraform-plugin-go v0.14.0/go.mod h1:2nNCBeRLaenyQEi78xrGrs9hMbulveqG/zDMQSvVJTE= -github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= -github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y= -github.com/hashicorp/vault/api v1.5.0 h1:Bp6yc2bn7CWkOrVIzFT/Qurzx528bdavF3nz590eu28= -github.com/hashicorp/vault/api v1.5.0/go.mod h1:LkMdrZnWNrFaQyYYazWVn7KshilfDidgVBq6YiTq/bM= -github.com/hashicorp/vault/sdk v0.4.1 h1:3SaHOJY687jY1fnB61PtL0cOkKItphrbLmux7T92HBo= -github.com/hashicorp/vault/sdk v0.4.1/go.mod h1:aZ3fNuL5VNydQk8GcLJ2TV8YCRVvyaakYkhZRoVuhj0= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/terraform-exec v0.20.0 h1:DIZnPsqzPGuUnq6cH8jWcPunBfY+C+M8JyYF3vpnuEo= +github.com/hashicorp/terraform-exec v0.20.0/go.mod h1:ckKGkJWbsNqFKV1itgMnE0hY9IYf1HoiekpuN0eWoDw= +github.com/hashicorp/terraform-json v0.21.0 h1:9NQxbLNqPbEMze+S6+YluEdXgJmhQykRyRNd+zTI05U= +github.com/hashicorp/terraform-json v0.21.0/go.mod h1:qdeBs11ovMzo5puhrRibdD6d2Dq6TyE/28JiU4tIQxk= +github.com/hashicorp/terraform-plugin-framework v1.5.0 h1:8kcvqJs/x6QyOFSdeAyEgsenVOUeC/IyKpi2ul4fjTg= +github.com/hashicorp/terraform-plugin-framework v1.5.0/go.mod h1:6waavirukIlFpVpthbGd2PUNYaFedB0RwW3MDzJ/rtc= +github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E= +github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY= +github.com/hashicorp/terraform-plugin-framework-timetypes v0.3.0 h1:egR4InfakWkgepZNUATWGwkrPhaAYOTEybPfEol+G/I= +github.com/hashicorp/terraform-plugin-framework-timetypes v0.3.0/go.mod h1:9vjvl36aY1p6KltaA5QCvGC5hdE/9t4YuhGftw6WOgE= +github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc= +github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg= +github.com/hashicorp/terraform-plugin-go v0.21.0 h1:VSjdVQYNDKR0l2pi3vsFK1PdMQrw6vGOshJXMNFeVc0= +github.com/hashicorp/terraform-plugin-go v0.21.0/go.mod h1:piJp8UmO1uupCvC9/H74l2C6IyKG0rW4FDedIpwW5RQ= +github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= +github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= +github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIih8gxiRJ6O0e7fS0U= +github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= +github.com/hashicorp/terraform-plugin-testing v1.6.0 h1:Wsnfh+7XSVRfwcr2jZYHsnLOnZl7UeaOBvsx6dl/608= +github.com/hashicorp/terraform-plugin-testing v1.6.0/go.mod h1:cJGG0/8j9XhHaJZRC+0sXFI4uzqQZ9Az4vh6C4GJpFE= +github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= +github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= +github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= +github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -365,161 +340,111 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/linode/linodego v1.28.0 h1:lzxxJebsYg5cCWRNDLyL2StW3sfMyAwf/FYfxFjFrlk= +github.com/linode/linodego v1.28.0/go.mod h1:5oAsx+uinHtVo6U77nXXXtox7MWzUW6aEkTOKXxA9uo= +github.com/linode/linodego/k8s v1.25.2 h1:PY6S0sAD3xANVvM9WY38bz9GqMTjIbytC8IJJ9Cv23o= +github.com/linode/linodego/k8s v1.25.2/go.mod h1:DC1XCSRZRGsmaa/ggpDPSDUmOM6aK1bhSIP6+f9Cwhc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/muvaf/typewriter v0.0.0-20220131201631-921e94e8e8d7 h1:CxRHKnh1YJXgNKxcos9rrKL6AcmOl1AS/fygmxFDzh4= github.com/muvaf/typewriter v0.0.0-20220131201631-921e94e8e8d7/go.mod h1:SAAdeMEiFXR8LcHffvIdiLI1w243DCH2DuHq7UrA5YQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc= -github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= +github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tchinmai7/terraform-provider-linode/v2 v2.0.0-20240212213046-468f25b69508 h1:u3jh3HD6dHK1AxGDCGVg6uIAXmiGxDCgylaco9n1wX8= +github.com/tchinmai7/terraform-provider-linode/v2 v2.0.0-20240212213046-468f25b69508/go.mod h1:aBTakKvYrwuKW1rCpFiW2pjvNnVXz3yJqUfDvtFiFOw= github.com/tmccombs/hcl2json v0.3.3 h1:+DLNYqpWE0CsOQiEZu+OZm5ZBImake3wtITYxQ8uLFQ= github.com/tmccombs/hcl2json v0.3.3/go.mod h1:Y2chtz2x9bAeRTvSibVRVgbLJhLJXKlUeIvjeVdnm4w= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/upbound/upjet v0.9.0-rc.0.0.20230502154751-645d7260d814 h1:lsVgo6tcAXmdHCoPgo0HT67rtYQ4DRzUeNJ2lh9Qhm0= -github.com/upbound/upjet v0.9.0-rc.0.0.20230502154751-645d7260d814/go.mod h1:CWxJ9YTMy7q+bDc2W504ocL/ZzBmWabwwcRjIaP7CKc= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -530,30 +455,27 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty v1.8.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.11.0 h1:726SxLdi2SDnjY+BStqB9J1hNp4+2WlzyXLuimibIe0= -github.com/zclconf/go-cty v1.11.0/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= +github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= +github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +github.com/zclconf/go-cty-yaml v1.0.3 h1:og/eOQ7lvA/WWhHGFETVWNduJM7Rjsv2RRpx1sdFMLc= +github.com/zclconf/go-cty-yaml v1.0.3/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -561,10 +483,11 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE= -golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -575,6 +498,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -599,13 +524,13 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -613,7 +538,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -638,12 +562,13 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -653,10 +578,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.1.0 h1:isLCZuhj4v+tYv7eskaN4v/TM+A1begWWgyVJDdl1+Y= -golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -668,16 +591,14 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -685,10 +606,8 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -702,8 +621,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -711,27 +628,31 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -741,12 +662,15 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -764,7 +688,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -800,14 +723,17 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -833,9 +759,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -859,7 +785,6 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -873,10 +798,8 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd h1:OjndDrsik+Gt+e6fs45z9AxiewiKyLKYpA45W5Kpkks= -google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -890,15 +813,11 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= +google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -911,34 +830,28 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= +gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -948,32 +861,32 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU= -k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= -k8s.io/apiextensions-apiserver v0.26.3 h1:5PGMm3oEzdB1W/FTMgGIDmm100vn7IaUP5er36dB+YE= -k8s.io/apiextensions-apiserver v0.26.3/go.mod h1:jdA5MdjNWGP+njw1EKMZc64xAT5fIhN6VJrElV3sfpQ= -k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k= -k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= -k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= -k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= -k8s.io/component-base v0.26.3 h1:oC0WMK/ggcbGDTkdcqefI4wIZRYdK3JySx9/HADpV0g= -k8s.io/component-base v0.26.3/go.mod h1:5kj1kZYwSC6ZstHJN7oHBqcJC6yyn41eR+Sqa/mQc8E= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= -k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= +k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= +k8s.io/apiextensions-apiserver v0.28.4 h1:AZpKY/7wQ8n+ZYDtNHbAJBb+N4AXXJvyZx6ww6yAJvU= +k8s.io/apiextensions-apiserver v0.28.4/go.mod h1:pgQIZ1U8eJSMQcENew/0ShUTlePcSGFq6dxSxf2mwPM= +k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= +k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= +k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= +k8s.io/client-go v0.28.4/go.mod h1:0VDZFpgoZfelyP5Wqu0/r/TRYcLYuJ2U1KEeoaPa1N4= +k8s.io/component-base v0.28.4 h1:c/iQLWPdUgI90O+T9TeECg8o7N3YJTiuz2sKxILYcYo= +k8s.io/component-base v0.28.4/go.mod h1:m9hR0uvqXDybiGL2nf/3Lf0MerAfQXzkfWhUY58JUbU= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA= -sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0= -sigs.k8s.io/controller-tools v0.11.3 h1:T1xzLkog9saiyQSLz1XOImu4OcbdXWytc5cmYsBeBiE= -sigs.k8s.io/controller-tools v0.11.3/go.mod h1:qcfX7jfcfYD/b7lAhvqAyTbt/px4GpvN88WKLFFv7p8= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= +sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= +sigs.k8s.io/controller-tools v0.13.0 h1:NfrvuZ4bxyolhDBt/rCZhDnx3M2hzlhgo5n3Iv2RykI= +sigs.k8s.io/controller-tools v0.13.0/go.mod h1:5vw3En2NazbejQGCeWKRrE7q4P+CW8/klfVqP8QZkgA= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/hack/prepare.sh b/hack/prepare.sh index 2386fe2..e9daf98 100755 --- a/hack/prepare.sh +++ b/hack/prepare.sh @@ -16,7 +16,7 @@ git grep -l "upbound/provider-${PROVIDER_NAME_LOWER}" -- ${REPLACE_FILES} | xarg git grep -l 'Template' -- ${REPLACE_FILES} | xargs sed -i.bak "s/Template/${PROVIDER_NAME_NORMAL}/g" # We need to be careful while replacing "template" keyword in go.mod as it could tamper # some imported packages under require section. -sed -i.bak "s|upbound/upjet-provider-template|${ORGANIZATION_NAME}/provider-${PROVIDER_NAME_LOWER}|g" go.mod +sed -i.bak "s|crossplane/upjet-provider-template|${ORGANIZATION_NAME}/provider-${PROVIDER_NAME_LOWER}|g" go.mod sed -i.bak "s|PROJECT_REPO := github.com/upbound/|PROJECT_REPO := github.com/${ORGANIZATION_NAME}/|g" Makefile # Clean up the .bak files created by sed diff --git a/internal/clients/linode.go b/internal/clients/linode.go index 8888be9..7c4f8bc 100644 --- a/internal/clients/linode.go +++ b/internal/clients/linode.go @@ -9,13 +9,19 @@ import ( "encoding/json" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/upbound/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/terraform" + terraformsdk "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/linode/provider-linode/apis/v1beta1" + + "github.com/linode/terraform-provider-linode/v2/linode" + "github.com/linode/terraform-provider-linode/v2/linode/helper" + "github.com/linode/terraform-provider-linode/v2/version" ) const ( @@ -33,9 +39,18 @@ const ( keyVersion = "api_version" ) +type SetupConfig struct { + NativeProviderPath *string + NativeProviderSource *string + NativeProviderVersion *string + TerraformVersion *string + DefaultScheduler terraform.ProviderScheduler + TerraformProvider *schema.Provider +} + // TerraformSetupBuilder builds Terraform a terraform.SetupFn function which // returns Terraform provider setup configuration -func TerraformSetupBuilder(version, providerSource, providerVersion string, scheduler terraform.ProviderScheduler) terraform.SetupFn { +func TerraformSetupBuilder(version, providerSource, providerVersion string, tfProvider *schema.Provider, scheduler terraform.ProviderScheduler) terraform.SetupFn { return func(ctx context.Context, client client.Client, mg resource.Managed) (terraform.Setup, error) { ps := terraform.Setup{ Version: version, @@ -80,6 +95,28 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string, sche if v, ok := creds[keyVersion]; ok { ps.Configuration[keyVersion] = v } - return ps, nil + + return ps, errors.Wrap(configureNoForkLinodeclient(ctx, &ps, *tfProvider), "failed to configure the no-fork linode client") } } + +func configureNoForkLinodeclient(ctx context.Context, ps *terraform.Setup, p schema.Provider) error { + // Please be aware that this implementation relies on the schema.Provider + // parameter `p` being a non-pointer. This is because normally + // the Terraform plugin SDK normally configures the provider + // only once and using a pointer argument here will cause + // race conditions between resources referring to different + // ProviderConfigs. + diag := p.Configure(context.WithoutCancel(ctx), &terraformsdk.ResourceConfig{ + Config: ps.Configuration, + }) + if diag != nil && diag.HasError() { + return errors.Errorf("failed to configure the provider: %v", diag) + } + + ps.Meta = p.Meta() + + fwProvider := linode.CreateFrameworkProviderWithMeta(version.ProviderVersion, p.Meta().(*helper.ProviderMeta)) + ps.FrameworkProvider = fwProvider + return nil +} diff --git a/internal/controller/database/accesscontrols/zz_controller.go b/internal/controller/database/accesscontrols/zz_controller.go index a86fead..deaf7b0 100755 --- a/internal/controller/database/accesscontrols/zz_controller.go +++ b/internal/controller/database/accesscontrols/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/database/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.AccessControls_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.AccessControls_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_database_access_controls"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.AccessControls_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_database_access_controls"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.AccessControls_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.AccessControls + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.AccessControls{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.AccessControls") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.AccessControls_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.AccessControls{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.AccessControls{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/database/mysql/zz_controller.go b/internal/controller/database/mysql/zz_controller.go index 143c167..965ca26 100755 --- a/internal/controller/database/mysql/zz_controller.go +++ b/internal/controller/database/mysql/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/database/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.MySQL_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.MySQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_database_mysql"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.MySQL_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_database_mysql"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.MySQL_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.MySQL + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.MySQL{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.MySQL") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.MySQL_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.MySQL{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.MySQL{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/database/postgresql/zz_controller.go b/internal/controller/database/postgresql/zz_controller.go index f5b18bb..ca1b1f7 100755 --- a/internal/controller/database/postgresql/zz_controller.go +++ b/internal/controller/database/postgresql/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/database/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.PostgreSQL_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PostgreSQL_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_database_postgresql"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PostgreSQL_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_database_postgresql"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.PostgreSQL_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.PostgreSQL + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PostgreSQL{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PostgreSQL") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PostgreSQL_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.PostgreSQL{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.PostgreSQL{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/domain/domain/zz_controller.go b/internal/controller/domain/domain/zz_controller.go index 7be0340..69fe260 100755 --- a/internal/controller/domain/domain/zz_controller.go +++ b/internal/controller/domain/domain/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/domain/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Domain_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Domain_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_domain"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Domain_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_domain"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Domain_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Domain + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Domain{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Domain") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Domain_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Domain{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Domain{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/domain/record/zz_controller.go b/internal/controller/domain/record/zz_controller.go index 6834907..98f79f1 100755 --- a/internal/controller/domain/record/zz_controller.go +++ b/internal/controller/domain/record/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/domain/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Record_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Record_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_domain_record"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Record_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_domain_record"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Record_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Record + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Record{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Record") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Record_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Record{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Record{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/firewall/device/zz_controller.go b/internal/controller/firewall/device/zz_controller.go index cdc459e..a103601 100755 --- a/internal/controller/firewall/device/zz_controller.go +++ b/internal/controller/firewall/device/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/firewall/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Device_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Device_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_firewall_device"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Device_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_firewall_device"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Device_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Device + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Device{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Device") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Device_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Device{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Device{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/firewall/firewall/zz_controller.go b/internal/controller/firewall/firewall/zz_controller.go index 1b37f87..f109776 100755 --- a/internal/controller/firewall/firewall/zz_controller.go +++ b/internal/controller/firewall/firewall/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/firewall/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Firewall_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Firewall_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_firewall"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Firewall_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_firewall"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Firewall_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Firewall + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Firewall{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Firewall") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Firewall_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Firewall{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Firewall{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/image/image/zz_controller.go b/internal/controller/image/image/zz_controller.go index 18f44dc..1752d2e 100755 --- a/internal/controller/image/image/zz_controller.go +++ b/internal/controller/image/image/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/image/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Image_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Image_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_image"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Image_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_image"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Image_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Image + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Image{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Image") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Image_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Image{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Image{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/instance/config/zz_controller.go b/internal/controller/instance/config/zz_controller.go index 4292cc2..8d92ceb 100755 --- a/internal/controller/instance/config/zz_controller.go +++ b/internal/controller/instance/config/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Config_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Config_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_instance_config"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Config_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_instance_config"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Config_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Config + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Config{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Config") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Config_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Config{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Config{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/instance/disk/zz_controller.go b/internal/controller/instance/disk/zz_controller.go index 6b0c147..13bb0a3 100755 --- a/internal/controller/instance/disk/zz_controller.go +++ b/internal/controller/instance/disk/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Disk_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Disk_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_instance_disk"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Disk_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_instance_disk"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Disk_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Disk + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Disk{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Disk") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Disk_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Disk{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Disk{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/instance/instance/zz_controller.go b/internal/controller/instance/instance/zz_controller.go index 92de955..450f0fe 100755 --- a/internal/controller/instance/instance/zz_controller.go +++ b/internal/controller/instance/instance/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Instance_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Instance_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_instance"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Instance_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_instance"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Instance_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Instance + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Instance{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Instance") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Instance_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Instance{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Instance{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/instance/ip/zz_controller.go b/internal/controller/instance/ip/zz_controller.go index 7c706cc..d30eb6b 100755 --- a/internal/controller/instance/ip/zz_controller.go +++ b/internal/controller/instance/ip/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.IP_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.IP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_instance_ip"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.IP_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_instance_ip"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.IP_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.IP + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.IP{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.IP") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.IP_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.IP{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.IP{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/instance/sharedips/zz_controller.go b/internal/controller/instance/sharedips/zz_controller.go index 8679ef7..22d621d 100755 --- a/internal/controller/instance/sharedips/zz_controller.go +++ b/internal/controller/instance/sharedips/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.SharedIPs_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SharedIPs_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_instance_shared_ips"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SharedIPs_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_instance_shared_ips"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.SharedIPs_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.SharedIPs + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.SharedIPs{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.SharedIPs") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.SharedIPs_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.SharedIPs{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.SharedIPs{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/ipv6/ipv6range/zz_controller.go b/internal/controller/ipv6/ipv6range/zz_controller.go index a8b79a1..65e4e45 100755 --- a/internal/controller/ipv6/ipv6range/zz_controller.go +++ b/internal/controller/ipv6/ipv6range/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/ipv6/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.IPv6Range_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.IPv6Range_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_ipv6_range"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.IPv6Range_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_ipv6_range"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.IPv6Range_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.IPv6Range + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.IPv6Range{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.IPv6Range") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.IPv6Range_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.IPv6Range{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.IPv6Range{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/lke/cluster/zz_controller.go b/internal/controller/lke/cluster/zz_controller.go index e0610a6..cb019f6 100755 --- a/internal/controller/lke/cluster/zz_controller.go +++ b/internal/controller/lke/cluster/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/lke/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Cluster_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Cluster_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_lke_cluster"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Cluster_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_lke_cluster"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Cluster_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Cluster + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Cluster{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Cluster") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Cluster_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Cluster{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Cluster{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/nodebalancer/config/zz_controller.go b/internal/controller/nodebalancer/config/zz_controller.go index 35e3fbc..c88571e 100755 --- a/internal/controller/nodebalancer/config/zz_controller.go +++ b/internal/controller/nodebalancer/config/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/nodebalancer/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Config_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Config_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_nodebalancer_config"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Config_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_nodebalancer_config"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Config_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Config + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Config{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Config") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Config_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Config{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Config{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/nodebalancer/node/zz_controller.go b/internal/controller/nodebalancer/node/zz_controller.go index 104259f..cb44d07 100755 --- a/internal/controller/nodebalancer/node/zz_controller.go +++ b/internal/controller/nodebalancer/node/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/nodebalancer/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Node_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Node_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_nodebalancer_node"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Node_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_nodebalancer_node"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Node_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Node + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Node{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Node") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Node_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Node{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Node{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/nodebalancer/nodebalancer/zz_controller.go b/internal/controller/nodebalancer/nodebalancer/zz_controller.go index ccddaf7..c995b20 100755 --- a/internal/controller/nodebalancer/nodebalancer/zz_controller.go +++ b/internal/controller/nodebalancer/nodebalancer/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/nodebalancer/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Nodebalancer_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Nodebalancer_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_nodebalancer"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Nodebalancer_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_nodebalancer"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Nodebalancer_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Nodebalancer + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Nodebalancer{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Nodebalancer") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Nodebalancer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Nodebalancer{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Nodebalancer{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/objectstorage/bucket/zz_controller.go b/internal/controller/objectstorage/bucket/zz_controller.go index 999600e..227c382 100755 --- a/internal/controller/objectstorage/bucket/zz_controller.go +++ b/internal/controller/objectstorage/bucket/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/objectstorage/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Bucket_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Bucket_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_object_storage_bucket"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Bucket_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_object_storage_bucket"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Bucket_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Bucket + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Bucket{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Bucket") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Bucket_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Bucket{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Bucket{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/objectstorage/key/zz_controller.go b/internal/controller/objectstorage/key/zz_controller.go index 23f00a3..b90091b 100755 --- a/internal/controller/objectstorage/key/zz_controller.go +++ b/internal/controller/objectstorage/key/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/objectstorage/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Key_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Key_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_object_storage_key"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Key_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_object_storage_key"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Key_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Key + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Key{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Key") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Key_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Key{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Key{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/objectstorage/object/zz_controller.go b/internal/controller/objectstorage/object/zz_controller.go index 742f0cb..e462a90 100755 --- a/internal/controller/objectstorage/object/zz_controller.go +++ b/internal/controller/objectstorage/object/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/objectstorage/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Object_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Object_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_object_storage_object"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Object_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_object_storage_object"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Object_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Object + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Object{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Object") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Object_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Object{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Object{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/providerconfig/config.go b/internal/controller/providerconfig/config.go index 2620325..cd19e11 100644 --- a/internal/controller/providerconfig/config.go +++ b/internal/controller/providerconfig/config.go @@ -5,13 +5,12 @@ Copyright 2021 Upbound Inc. package providerconfig import ( - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/source" - "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/providerconfig" "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/upbound/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller" + + ctrl "sigs.k8s.io/controller-runtime" "github.com/linode/provider-linode/apis/v1beta1" ) @@ -30,7 +29,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { Named(name). WithOptions(o.ForControllerRuntime()). For(&v1beta1.ProviderConfig{}). - Watches(&source.Kind{Type: &v1beta1.ProviderConfigUsage{}}, &resource.EnqueueRequestForProviderConfig{}). + Watches(&v1beta1.ProviderConfigUsage{}, &resource.EnqueueRequestForProviderConfig{}). Complete(providerconfig.NewReconciler(mgr, of, providerconfig.WithLogger(o.Logger.WithValues("controller", name)), providerconfig.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))))) diff --git a/internal/controller/rdns/rdns/zz_controller.go b/internal/controller/rdns/rdns/zz_controller.go index 6cdfdcf..f020ae3 100755 --- a/internal/controller/rdns/rdns/zz_controller.go +++ b/internal/controller/rdns/rdns/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/rdns/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.RDNS_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.RDNS_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_rdns"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.RDNS_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_rdns"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.RDNS_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.RDNS + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.RDNS{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.RDNS") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.RDNS_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.RDNS{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.RDNS{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/sshkey/sshkey/zz_controller.go b/internal/controller/sshkey/sshkey/zz_controller.go index 46af826..bbfbb4d 100755 --- a/internal/controller/sshkey/sshkey/zz_controller.go +++ b/internal/controller/sshkey/sshkey/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/sshkey/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.SSHKey_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SSHKey_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_sshkey"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SSHKey_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_sshkey"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.SSHKey_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.SSHKey + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.SSHKey{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.SSHKey") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.SSHKey_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.SSHKey{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.SSHKey{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/stackscript/stackscript/zz_controller.go b/internal/controller/stackscript/stackscript/zz_controller.go index 473ac98..3bff9f4 100755 --- a/internal/controller/stackscript/stackscript/zz_controller.go +++ b/internal/controller/stackscript/stackscript/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/stackscript/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Stackscript_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Stackscript_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_stackscript"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Stackscript_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_stackscript"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Stackscript_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Stackscript + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Stackscript{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Stackscript") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Stackscript_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Stackscript{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Stackscript{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/token/token/zz_controller.go b/internal/controller/token/token/zz_controller.go index b51d0dc..bb46247 100755 --- a/internal/controller/token/token/zz_controller.go +++ b/internal/controller/token/token/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/token/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Token_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Token_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_token"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Token_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_token"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Token_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Token + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Token{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Token") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Token_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Token{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Token{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/user/user/zz_controller.go b/internal/controller/user/user/zz_controller.go index 5594902..87d972b 100755 --- a/internal/controller/user/user/zz_controller.go +++ b/internal/controller/user/user/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/user/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.User_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_user"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_user"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.User_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.User + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.User{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.User") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.User{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.User{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/volume/volume/zz_controller.go b/internal/controller/volume/volume/zz_controller.go index eeba6af..188077e 100755 --- a/internal/controller/volume/volume/zz_controller.go +++ b/internal/controller/volume/volume/zz_controller.go @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + /* Copyright 2022 Upbound Inc. */ @@ -14,8 +18,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - tjcontroller "github.com/upbound/upjet/pkg/controller" - "github.com/upbound/upjet/pkg/terraform" + 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" v1alpha1 "github.com/linode/provider-linode/apis/volume/v1alpha1" @@ -29,23 +35,44 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1alpha1.Volume_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Volume_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["linode_volume"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Volume_GroupVersionKind))), - )), + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_volume"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.Volume_GroupVersionKind, mgr, o.PollInterval)), + )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + 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)) + } + + // register webhooks for the kind v1alpha1.Volume + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Volume{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Volume") + } + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Volume_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Volume{}). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Volume{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 3d74eb2..d79ca39 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -1,13 +1,13 @@ -/* -Copyright 2021 Upbound Inc. -*/ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 package controller import ( ctrl "sigs.k8s.io/controller-runtime" - "github.com/upbound/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller" accesscontrols "github.com/linode/provider-linode/internal/controller/database/accesscontrols" mysql "github.com/linode/provider-linode/internal/controller/database/mysql" diff --git a/internal/features/features.go b/internal/features/features.go index 420cd55..19f6624 100644 --- a/internal/features/features.go +++ b/internal/features/features.go @@ -1,5 +1,5 @@ /* - Copyright 2022 Upbound Inc + Copyright 2022 Upbound Inc. */ package features @@ -12,4 +12,9 @@ const ( // External Secret Stores. See the below design for more details. // https://github.com/crossplane/crossplane/blob/390ddd/design/design-doc-external-secret-stores.md EnableAlphaExternalSecretStores feature.Flag = "EnableAlphaExternalSecretStores" + + // EnableBetaManagementPolicies enables beta support for + // Management Policies. See the below design for more details. + // https://github.com/crossplane/crossplane/pull/3531 + EnableBetaManagementPolicies feature.Flag = "EnableBetaManagementPolicies" ) diff --git a/package/crds/database.linode.upbound.io_accesscontrols.yaml b/package/crds/database.linode.upbound.io_accesscontrols.yaml index 1a5f8cd..e8b8882 100644 --- a/package/crds/database.linode.upbound.io_accesscontrols.yaml +++ b/package/crds/database.linode.upbound.io_accesscontrols.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: accesscontrols.database.linode.upbound.io spec: group: database.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -77,6 +76,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set databaseId: description: The unique ID of the target database. The ID of the database to manage the allow list for. @@ -87,21 +87,63 @@ spec: for. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + allowList: + description: A list of IP addresses that can access the Managed + Database. Each item can be a single IP address or a range in + CIDR format. A list of IP addresses that can access the Managed + Database. Each item can be a single IP address or a range in + CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + databaseId: + description: The unique ID of the target database. The ID of the + database to manage the allow list for. + type: number + databaseType: + description: The unique type of the target database. (mysql, mongodb, + postgresql) The type of the database to manage the allow list + for. + 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 @@ -140,42 +182,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -274,12 +280,18 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: allowList is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.allowList) - - message: databaseId is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) - - message: databaseType is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseType) + - message: spec.forProvider.allowList is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.allowList) + || (has(self.initProvider) && has(self.initProvider.allowList))' + - message: spec.forProvider.databaseId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.databaseId) + || (has(self.initProvider) && has(self.initProvider.databaseId))' + - message: spec.forProvider.databaseType is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.databaseType) + || (has(self.initProvider) && has(self.initProvider.databaseType))' status: description: AccessControlsStatus defines the observed state of AccessControls. properties: @@ -294,6 +306,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set databaseId: description: The unique ID of the target database. The ID of the database to manage the allow list for. @@ -339,6 +352,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/database.linode.upbound.io_mysqls.yaml b/package/crds/database.linode.upbound.io_mysqls.yaml index 1ff2aaa..0cc2812 100644 --- a/package/crds/database.linode.upbound.io_mysqls.yaml +++ b/package/crds/database.linode.upbound.io_mysqls.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: mysqls.database.linode.upbound.io spec: group: database.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -78,6 +77,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set clusterSize: description: The number of Linode Instance nodes deployed to the Managed Database. (default 1) The number of Linode Instance @@ -146,29 +146,128 @@ spec: The week of the month to perform monthly frequency updates. Required for monthly frequency updates. type: number - required: - - dayOfWeek - - duration - - frequency - - hourOfDay type: object type: array type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + allowList: + description: A list of IP addresses that can access the Managed + Database. Each item can be a single IP address or a range in + CIDR format. Use linode_database_access_controls to manage your + allow list separately. A list of IP addresses that can access + the Managed Database. Each item can be a single IP address or + a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: The number of Linode Instance nodes deployed to the + Managed Database. (default 1) The number of Linode Instance + nodes deployed to the Managed Database. Defaults to 1. + type: number + encrypted: + description: Whether the Managed Databases is encrypted. (default + false) Whether the Managed Databases is encrypted. + type: boolean + engineId: + description: The Managed Database engine in engine/version format. + (e.g. mysql/8.0.30) The Managed Database engine in engine/version + format. (e.g. mysql/8.0.30) + type: string + label: + description: A unique, user-defined string referring to the Managed + Database. A unique, user-defined string referring to the Managed + Database. + type: string + region: + description: The region to use for the Managed Database. The region + to use for the Managed Database. + type: string + replicationType: + description: The replication method used for the Managed Database. + (none, asynch, semi_synch; default none) The replication method + used for the Managed Database. + type: string + sslConnection: + description: Whether to require SSL credentials to establish a + connection to the Managed Database. (default false) Whether + to require SSL credentials to establish a connection to the + Managed Database. + type: boolean + type: + description: The Linode Instance type used for the nodes of the Managed + Database instance. The Linode Instance type used by the Managed + Database for its nodes. + type: string + updates: + description: Configuration settings for automated patch update + maintenance for the Managed Database. + items: + properties: + dayOfWeek: + description: The day to perform maintenance. (monday, tuesday, + ...) The day to perform maintenance. + type: string + duration: + description: The maximum maintenance window time in hours. + (1..3) The maximum maintenance window time in hours. + type: number + frequency: + description: Whether maintenance occurs on a weekly or monthly + basis. (weekly, monthly) Whether maintenance occurs on + a weekly or monthly basis. + type: string + hourOfDay: + description: The hour to begin maintenance based in UTC + time. (0..23) The hour to begin maintenance based in UTC + time. + type: number + weekOfMonth: + description: The week of the month to perform monthly frequency + updates. Required for monthly frequency updates. (1..4) + The week of the month to perform monthly frequency updates. + Required for monthly frequency updates. + type: number + type: object + type: array + 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 @@ -207,42 +306,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -341,14 +404,22 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: engineId is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.engineId) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: region is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) - - message: type is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.type) + - message: spec.forProvider.engineId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.engineId) + || (has(self.initProvider) && has(self.initProvider.engineId))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.region is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.region) + || (has(self.initProvider) && has(self.initProvider.region))' + - message: spec.forProvider.type is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.type) + || (has(self.initProvider) && has(self.initProvider.type))' status: description: MySQLStatus defines the observed state of MySQL. properties: @@ -364,6 +435,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set clusterSize: description: The number of Linode Instance nodes deployed to the Managed Database. (default 1) The number of Linode Instance @@ -499,6 +571,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/database.linode.upbound.io_postgresqls.yaml b/package/crds/database.linode.upbound.io_postgresqls.yaml index 3ebf427..d7f5b2ed 100644 --- a/package/crds/database.linode.upbound.io_postgresqls.yaml +++ b/package/crds/database.linode.upbound.io_postgresqls.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: postgresqls.database.linode.upbound.io spec: group: database.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -78,6 +77,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set clusterSize: description: The number of Linode Instance nodes deployed to the Managed Database. (default 1) The number of Linode Instance @@ -155,29 +155,137 @@ spec: The week of the month to perform monthly frequency updates. Required for monthly frequency updates. type: number - required: - - dayOfWeek - - duration - - frequency - - hourOfDay type: object type: array type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + allowList: + description: A list of IP addresses that can access the Managed + Database. Each item can be a single IP address or a range in + CIDR format. Use linode_database_access_controls to manage your + allow list separately. A list of IP addresses that can access + the Managed Database. Each item can be a single IP address or + a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: The number of Linode Instance nodes deployed to the + Managed Database. (default 1) The number of Linode Instance + nodes deployed to the Managed Database. Defaults to 1. + type: number + encrypted: + description: Whether the Managed Databases is encrypted. (default + false) Whether the Managed Databases is encrypted. + type: boolean + engineId: + description: The Managed Database engine in engine/version format. + (e.g. postgresql/13.2) The Managed Database engine in engine/version + format. (e.g. mysql/8.0.30) + type: string + label: + description: A unique, user-defined string referring to the Managed + Database. A unique, user-defined string referring to the Managed + Database. + type: string + region: + description: The region to use for the Managed Database. The region + to use for the Managed Database. + type: string + replicationCommitType: + description: The synchronization level of the replicating server. + (on, local, remote_write, remote_apply, off; default off) The + synchronization level of the replicating server.Must be `local` + or `off` for the `asynch` replication type. Must be `on`, `remote_write`, + or `remote_apply` for the `semi_synch` replication type. + type: string + replicationType: + description: The replication method used for the Managed Database. + (none, asynch, semi_synch; default none) The replication method + used for the Managed Database. Must be `none` for a single node + cluster. Must be `asynch` or `semi_synch` for a high availability + cluster. + type: string + sslConnection: + description: Whether to require SSL credentials to establish a + connection to the Managed Database. (default false) Whether + to require SSL credentials to establish a connection to the + Managed Database. + type: boolean + type: + description: The Linode Instance type used for the nodes of the Managed + Database instance. The Linode Instance type used by the Managed + Database for its nodes. + type: string + updates: + description: Configuration settings for automated patch update + maintenance for the Managed Database. + items: + properties: + dayOfWeek: + description: The day to perform maintenance. (monday, tuesday, + ...) The day to perform maintenance. + type: string + duration: + description: The maximum maintenance window time in hours. + (1..3) The maximum maintenance window time in hours. + type: number + frequency: + description: Whether maintenance occurs on a weekly or monthly + basis. (weekly, monthly) Whether maintenance occurs on + a weekly or monthly basis. + type: string + hourOfDay: + description: The hour to begin maintenance based in UTC + time. (0..23) The hour to begin maintenance based in UTC + time. + type: number + weekOfMonth: + description: The week of the month to perform monthly frequency + updates. Required for monthly frequency updates. (1..4) + The week of the month to perform monthly frequency updates. + Required for monthly frequency updates. + type: number + type: object + type: array + 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 @@ -216,42 +324,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -350,14 +422,22 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: engineId is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.engineId) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: region is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) - - message: type is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.type) + - message: spec.forProvider.engineId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.engineId) + || (has(self.initProvider) && has(self.initProvider.engineId))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.region is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.region) + || (has(self.initProvider) && has(self.initProvider.region))' + - message: spec.forProvider.type is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.type) + || (has(self.initProvider) && has(self.initProvider.type))' status: description: PostgreSQLStatus defines the observed state of PostgreSQL. properties: @@ -373,6 +453,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set clusterSize: description: The number of Linode Instance nodes deployed to the Managed Database. (default 1) The number of Linode Instance @@ -520,6 +601,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/domain.linode.upbound.io_domains.yaml b/package/crds/domain.linode.upbound.io_domains.yaml index 4c66a60..d9a7a15 100644 --- a/package/crds/domain.linode.upbound.io_domains.yaml +++ b/package/crds/domain.linode.upbound.io_domains.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: domains.domain.linode.upbound.io spec: group: domain.linode.upbound.io @@ -57,7 +56,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -74,6 +73,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set description: description: A description for this Domain. This is for display purposes only. @@ -100,6 +100,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set refreshSec: description: The amount of time in seconds before this Domain should be refreshed. Valid values are 0, 30, 120, 300, 3600, @@ -128,6 +129,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set ttlSec: description: '''Time to Live'' - the amount of time in seconds that this Domain''s records may be cached by resolvers or other @@ -142,21 +144,121 @@ spec: copy of a master (also called a slave). type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + axfrIps: + description: The list of IPs that may perform a zone transfer + for this Domain. This is potentially dangerous, and should be + set to an empty list unless you intend to use it. + items: + type: string + type: array + x-kubernetes-list-type: set + description: + description: A description for this Domain. This is for display + purposes only. + type: string + domain: + description: The domain this Domain represents. These must be + unique in our system; you cannot have two Domains representing + the same domain. + type: string + expireSec: + description: The amount of time in seconds that may pass before + this Domain is no longer Valid values are 0, 30, 120, 300, 3600, + 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, + and 2419200 - any other value will be rounded to the nearest + valid value. + type: number + group: + description: The group this Domain belongs to. This is for display + purposes only. + type: string + masterIps: + description: The IP addresses representing the master DNS for + this Domain. + items: + type: string + type: array + x-kubernetes-list-type: set + refreshSec: + description: The amount of time in seconds before this Domain + should be refreshed. Valid values are 0, 30, 120, 300, 3600, + 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, + and 2419200 - any other value will be rounded to the nearest + valid value. + type: number + retrySec: + description: The interval, in seconds, at which a failed refresh + should be retried. Valid values are 0, 30, 120, 300, 3600, 7200, + 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, + and 2419200 - any other value will be rounded to the nearest + valid value. + type: number + soaEmail: + description: Start of Authority email address. This is required + for master Domains. + type: string + status: + description: Used to control whether this Domain is currently + being rendered. + type: string + tags: + description: An array of tags applied to this object. Tags are + for organizational purposes only. + items: + type: string + type: array + x-kubernetes-list-type: set + ttlSec: + description: '''Time to Live'' - the amount of time in seconds + that this Domain''s records may be cached by resolvers or other + domain servers. Valid values are 0, 30, 120, 300, 3600, 7200, + 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, + and 2419200 - any other value will be rounded to the nearest + valid value.' + type: number + type: + description: If this Domain represents the authoritative source + of information for the domain it describes, or if it is a read-only + copy of a master (also called a slave). + 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 @@ -195,42 +297,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -329,10 +395,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: domain is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.domain) - - message: type is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.type) + - message: spec.forProvider.domain is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.domain) + || (has(self.initProvider) && has(self.initProvider.domain))' + - message: spec.forProvider.type is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.type) + || (has(self.initProvider) && has(self.initProvider.type))' status: description: DomainStatus defines the observed state of Domain. properties: @@ -345,6 +415,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set description: description: A description for this Domain. This is for display purposes only. @@ -373,6 +444,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set refreshSec: description: The amount of time in seconds before this Domain should be refreshed. Valid values are 0, 30, 120, 300, 3600, @@ -401,6 +473,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set ttlSec: description: '''Time to Live'' - the amount of time in seconds that this Domain''s records may be cached by resolvers or other @@ -448,6 +521,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/domain.linode.upbound.io_records.yaml b/package/crds/domain.linode.upbound.io_records.yaml index 3e80d26..cb66371 100644 --- a/package/crds/domain.linode.upbound.io_records.yaml +++ b/package/crds/domain.linode.upbound.io_records.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: records.domain.linode.upbound.io spec: group: domain.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -214,21 +213,189 @@ spec: are preferred. type: number type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + domainId: + description: The ID of the Domain to access. Changing . The ID + of the Domain to access. + type: number + domainIdRef: + description: Reference to a Domain to populate domainId. + 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 + domainIdSelector: + description: Selector for a Domain to populate domainId. + 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 + name: + description: The name of this Record. Setting this is invalid + for SRV records as it is generated by the API. This field's + actual usage depends on the type of record this represents. + For A and AAAA records, this is the subdomain being associated + with an IP address. The name of this Record. This field's actual + usage depends on the type of record this represents. For A and + AAAA records, this is the subdomain being associated with an + IP address. Generated for SRV records. + type: string + port: + description: The port this Record points to. The port this Record + points to. + type: number + priority: + description: The priority of the target host. Lower values are + preferred. The priority of the target host. Lower values are + preferred. + type: number + protocol: + description: The protocol this Record's service communicates with. + Only valid for SRV records. The protocol this Record's service + communicates with. Only valid for SRV records. + type: string + recordType: + description: The type of Record this is in the DNS system. For + example, A records associate a domain name with an IPv4 address, + and AAAA records associate a domain name with an IPv6 address. + See all supported record types here. Changing . The type of + Record this is in the DNS system. For example, A records associate + a domain name with an IPv4 address, and AAAA records associate + a domain name with an IPv6 address. + type: string + service: + description: The service this Record identified. Only valid for + SRV records. The service this Record identified. Only valid + for SRV records. + type: string + tag: + description: The tag portion of a CAA record. It is invalid to + set this on other record types. The tag portion of a CAA record. + It is invalid to set this on other record types. + type: string + target: + description: The target for this Record. This field's actual usage + depends on the type of record this represents. For A and AAAA + records, this is the address the named Domain should resolve + to. The target for this Record. This field's actual usage depends + on the type of record this represents. For A and AAAA records, + this is the address the named Domain should resolve to. + type: string + ttlSec: + description: '''Time to Live'' - the amount of time in seconds + that this Domain''s records may be cached by resolvers or other + domain servers. Valid values are 30, 120, 300, 3600, 7200, 14400, + 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 + - any other value will be rounded to the nearest valid value. + ''Time to Live'' - the amount of time in seconds that this Domain''s + records may be cached by resolvers or other domain servers. + Valid values are 30, 120, 300, 3600, 7200, 14400, 28800, 57600, + 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other + value will be rounded to the nearest valid value.' + type: number + weight: + description: The relative weight of this Record. Higher values + are preferred. The relative weight of this Record. Higher values + are preferred. + type: number + 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 @@ -267,42 +434,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -401,10 +532,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: recordType is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.recordType) - - message: target is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.target) + - message: spec.forProvider.recordType is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.recordType) + || (has(self.initProvider) && has(self.initProvider.recordType))' + - message: spec.forProvider.target is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.target) + || (has(self.initProvider) && has(self.initProvider.target))' status: description: RecordStatus defines the observed state of Record. properties: @@ -518,6 +653,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/firewall.linode.upbound.io_devices.yaml b/package/crds/firewall.linode.upbound.io_devices.yaml index 5c776b3..bc5ac4e 100644 --- a/package/crds/firewall.linode.upbound.io_devices.yaml +++ b/package/crds/firewall.linode.upbound.io_devices.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: devices.firewall.linode.upbound.io spec: group: firewall.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -227,63 +226,208 @@ spec: type: object type: object type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. - type: string - policy: - description: Policies for referencing. + entityId: + description: The unique ID of the entity to attach. The ID of + the entity to create a Firewall device for. + type: number + entityIdRef: + description: Reference to a Instance in instance to populate entityId. 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 + name: + description: Name of the referenced object. 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 + 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 + entityIdSelector: + description: Selector for a Instance in instance to populate entityId. + 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 + entityType: + description: 'The type of the entity to attach. (default: linode) + The type of the entity to create a Firewall device for.' + type: string + firewallId: + description: The unique ID of the target Firewall. The ID of the + Firewall to access. + type: number + firewallIdRef: + description: Reference to a Device in firewall to populate firewallId. + 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 + firewallIdSelector: + description: Selector for a Device in firewall to populate firewallId. + 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 - required: - - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -474,6 +618,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/firewall.linode.upbound.io_firewalls.yaml b/package/crds/firewall.linode.upbound.io_firewalls.yaml index 31a3a4f..1330af7 100644 --- a/package/crds/firewall.linode.upbound.io_firewalls.yaml +++ b/package/crds/firewall.linode.upbound.io_firewalls.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: firewalls.firewall.linode.upbound.io spec: group: firewall.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -113,10 +112,6 @@ spec: description: The network protocol this rule controls. (TCP, UDP, ICMP) The network protocol this rule controls. type: string - required: - - action - - label - - protocol type: object type: array inboundPolicy: @@ -138,6 +133,7 @@ spec: items: type: number type: array + x-kubernetes-list-type: set linodesRefs: description: References to Instance in instance to populate linodes. items: @@ -222,6 +218,7 @@ spec: items: type: number type: array + x-kubernetes-list-type: set outbound: description: A firewall rule that specifies what outbound network traffic is allowed. @@ -263,10 +260,230 @@ spec: description: The network protocol this rule controls. (TCP, UDP, ICMP) The network protocol this rule controls. type: string + type: object + type: array + outboundPolicy: + description: The default behavior for outbound traffic. This setting + can be overridden by updating the outbound.action property for + an individual Firewall Rule. (ACCEPT, DROP) The default behavior + for outbound traffic. This setting can be overridden by updating + the outbound.action property for an individual Firewall Rule. + type: string + tags: + description: A list of tags applied to the Kubernetes cluster. + Tags are for organizational purposes only. An array of tags + applied to this object. Tags are for organizational purposes + only. + items: + type: string + type: array + x-kubernetes-list-type: set + 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: + disabled: + description: If true, the Firewall's rules are not enforced (defaults + to false). If true, the Firewall is inactive. + type: boolean + inbound: + description: A firewall rule that specifies what inbound network + traffic is allowed. + items: + properties: + action: + description: Controls whether traffic is accepted or dropped + by this rule (ACCEPT, DROP). Overrides the Firewall’s + inbound_policy if this is an inbound rule, or the outbound_policy + if this is an outbound rule. Controls whether traffic + is accepted or dropped by this rule. Overrides the Firewall’s + inbound_policy if this is an inbound rule, or the outbound_policy + if this is an outbound rule. + type: string + ipv4: + description: A list of IPv4 addresses or networks. Must + be in IP/mask (CIDR) format. A list of CIDR blocks or + 0.0.0.0/0 (to allow all) this rule applies to. + items: + type: string + type: array + ipv6: + description: A list of IPv6 addresses or networks. Must + be in IP/mask (CIDR) format. A list of IPv6 addresses + or networks this rule applies to. + items: + type: string + type: array + label: + description: This Firewall's unique label. Used to identify + this rule. For display purposes only. + type: string + ports: + description: A string representation of ports and/or port + ranges (i.e. "443" or "80-90, 91"). A string representation + of ports and/or port ranges (i.e. "443" or "80-90, 91"). + type: string + protocol: + description: The network protocol this rule controls. (TCP, + UDP, ICMP) The network protocol this rule controls. + type: string + type: object + type: array + inboundPolicy: + description: The default behavior for inbound traffic. This setting + can be overridden by updating the inbound.action property of + the Firewall Rule. (ACCEPT, DROP) The default behavior for inbound + traffic. This setting can be overridden by updating the inbound.action + property for an individual Firewall Rule. + type: string + label: + description: This Firewall's unique label. The label for the Firewall. + For display purposes only. If no label is provided, a default + will be assigned. + type: string + linodes: + description: A list of IDs of Linodes this Firewall should govern + network traffic for. The IDs of Linodes to apply this firewall + to. + items: + type: number + type: array + x-kubernetes-list-type: set + linodesRefs: + description: References to Instance in instance to populate linodes. + 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: - - action - - label - - protocol + - name + type: object + type: array + linodesSelector: + description: Selector for a list of Instance in instance to populate + linodes. + 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 + nodebalancers: + description: A list of IDs of NodeBalancers this Firewall should + govern network traffic for. The IDs of NodeBalancers to apply + this firewall to. + items: + type: number + type: array + x-kubernetes-list-type: set + outbound: + description: A firewall rule that specifies what outbound network + traffic is allowed. + items: + properties: + action: + description: Controls whether traffic is accepted or dropped + by this rule (ACCEPT, DROP). Overrides the Firewall’s + inbound_policy if this is an inbound rule, or the outbound_policy + if this is an outbound rule. Controls whether traffic + is accepted or dropped by this rule. Overrides the Firewall’s + inbound_policy if this is an inbound rule, or the outbound_policy + if this is an outbound rule. + type: string + ipv4: + description: A list of IPv4 addresses or networks. Must + be in IP/mask (CIDR) format. A list of CIDR blocks or + 0.0.0.0/0 (to allow all) this rule applies to. + items: + type: string + type: array + ipv6: + description: A list of IPv6 addresses or networks. Must + be in IP/mask (CIDR) format. A list of IPv6 addresses + or networks this rule applies to. + items: + type: string + type: array + label: + description: This Firewall's unique label. Used to identify + this rule. For display purposes only. + type: string + ports: + description: A string representation of ports and/or port + ranges (i.e. "443" or "80-90, 91"). A string representation + of ports and/or port ranges (i.e. "443" or "80-90, 91"). + type: string + protocol: + description: The network protocol this rule controls. (TCP, + UDP, ICMP) The network protocol this rule controls. + type: string type: object type: array outboundPolicy: @@ -284,22 +501,33 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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 @@ -338,42 +566,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -472,12 +664,18 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: inboundPolicy is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.inboundPolicy) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: outboundPolicy is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.outboundPolicy) + - message: spec.forProvider.inboundPolicy is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.inboundPolicy) + || (has(self.initProvider) && has(self.initProvider.inboundPolicy))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.outboundPolicy is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.outboundPolicy) + || (has(self.initProvider) && has(self.initProvider.outboundPolicy))' status: description: FirewallStatus defines the observed state of Firewall. properties: @@ -578,6 +776,7 @@ spec: items: type: number type: array + x-kubernetes-list-type: set nodebalancers: description: A list of IDs of NodeBalancers this Firewall should govern network traffic for. The IDs of NodeBalancers to apply @@ -585,6 +784,7 @@ spec: items: type: number type: array + x-kubernetes-list-type: set outbound: description: A firewall rule that specifies what outbound network traffic is allowed. @@ -646,6 +846,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set updated: description: When this firewall was last updated type: string @@ -683,6 +884,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/image.linode.upbound.io_images.yaml b/package/crds/image.linode.upbound.io_images.yaml index 613ee33..45c02be 100644 --- a/package/crds/image.linode.upbound.io_images.yaml +++ b/package/crds/image.linode.upbound.io_images.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: images.image.linode.upbound.io spec: group: image.linode.upbound.io @@ -57,7 +56,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -247,63 +246,229 @@ spec: region to upload to. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + cloudInit: + description: Whether this image supports cloud-init. + type: boolean + description: + description: A detailed description of this Image. A detailed + description of this Image. type: string - policy: - description: Policies for referencing. + diskId: + description: The ID of the Linode Disk that this Image will be + created from. The ID of the Linode Disk that this Image will + be created from. + type: number + diskIdRef: + description: Reference to a Disk in instance to populate diskId. 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 + name: + description: Name of the referenced object. 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 + 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 + diskIdSelector: + description: Selector for a Disk in instance to populate diskId. + 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 + fileHash: + description: The MD5 hash of the file to be uploaded. This is + used to trigger file updates. The MD5 hash of the image file. + type: string + filePath: + description: The path of the image file to be uploaded. The name + of the file to upload to this image. + type: string + label: + description: A short description of the Image. Labels cannot contain + special characters. A short description of the Image. Labels + cannot contain special characters. + type: string + linodeId: + description: The ID of the Linode that this Image will be created + from. The ID of the Linode that this Image will be created from. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. + 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 - required: - - name + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + 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 + region: + description: The region of the image. See all regions here. The + region to upload to. + type: string type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -434,8 +599,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' status: description: ImageStatus defines the observed state of Image. properties: @@ -559,6 +726,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/instance.linode.upbound.io_configs.yaml b/package/crds/instance.linode.upbound.io_configs.yaml index 998a9a7..15b93b0 100644 --- a/package/crds/instance.linode.upbound.io_configs.yaml +++ b/package/crds/instance.linode.upbound.io_configs.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: configs.instance.linode.upbound.io spec: group: instance.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -97,8 +96,6 @@ spec: description: The Volume ID to map to this device slot. The Block Storage volume ID to map to this disk slot type: number - required: - - deviceName type: object type: array devices: @@ -915,8 +912,6 @@ spec: description: The type of interface. (public, vlan) The type of interface. type: string - required: - - purpose type: object type: array kernel: @@ -1025,21 +1020,996 @@ spec: Controls the virtualization mode. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + booted: + description: If true, the Linode will be booted into this config. + If another config is booted, the Linode will be rebooted into + this config. If false, the Linode will be shutdown only if it + is currently booted into this config. If undefined, the config + will alter the boot status of the Linode. If true, the Linode + will be booted to running state. If false, the Linode will be + shutdown. If undefined, no action will be taken. + type: boolean + comments: + description: Optional field for arbitrary User comments on this + Config. Optional field for arbitrary User comments on this Config. + type: string + device: + description: Blocks for device disks in a Linode's configuration + profile. + items: + properties: + deviceName: + description: The Disk ID to map to this disk slot + type: string + diskId: + description: The Disk ID to map to this device slot The + Disk ID to map to this disk slot + type: number + volumeId: + description: The Volume ID to map to this device slot. The + Block Storage volume ID to map to this disk slot + type: number + type: object + type: array + devices: + description: A dictionary of device disks to use as a device map + in a Linode's configuration profile. + items: + properties: + sda: + description: The SDA-SDH slots, represent the Linux block + device nodes for the first 8 disks attached to the Linode. Each + device must be suplied sequentially. The device can be + either a Disk or a Volume identified by disk_id or volume_id. + Only one disk identifier is permitted per slot. Devices + mapped from sde through sdh are unavailable in "fullvirt" + virt_mode. Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sdb: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sdc: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sdd: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sde: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sdf: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sdg: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + sdh: + description: Device can be either a Disk or Volume identified + by disk_id or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: The Disk ID to map to this device slot + The Disk ID to map to this disk slot + type: number + diskIdRef: + description: Reference to a Disk to populate diskId. + 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 + diskIdSelector: + description: Selector for a Disk to populate diskId. + 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 + volumeId: + description: The Volume ID to map to this device slot. + The Block Storage volume ID to map to this disk + slot + type: number + type: object + type: array + type: object + type: array + helpers: + description: Helpers enabled when booting to this Linode Config. + items: + properties: + devtmpfsAutomount: + description: Populates the /dev directory early during boot + without udev. (default true) Populates the /dev directory + early during boot without udev. + type: boolean + distro: + description: Helps maintain correct inittab/upstart console + device. (default true) Helps maintain correct inittab/upstart + console device. + type: boolean + modulesDep: + description: Creates a modules dependency file for the Kernel + you run. (default true) Creates a modules dependency file + for the Kernel you run. + type: boolean + network: + description: Automatically configures static networking. + (default true) Automatically configures static networking. + type: boolean + updatedbDisabled: + description: Disables updatedb cron job to avoid disk thrashing. + (default true) Disables updatedb cron job to avoid disk + thrashing. + type: boolean + type: object + type: array + interface: + description: An array of Network Interfaces to add to this Linode's + Configuration Profile. + items: + properties: + ipamAddress: + description: This Network Interface’s private IP address + in Classless Inter-Domain Routing (CIDR) notation. (e.g. + 10.0.0.1/24) This Network Interface’s private IP address + in Classless Inter-Domain Routing (CIDR) notation. + type: string + label: + description: The Config’s label for display purposes only. + The name of this interface. + type: string + purpose: + description: The type of interface. (public, vlan) The type + of interface. + type: string + type: object + type: array + kernel: + description: A Kernel ID to boot a Linode with. (default linode/latest-64bit) + A Kernel ID to boot a Linode with. Defaults to “linode/latest-64bit”. + type: string + label: + description: The Config’s label for display purposes only. The + Config's label for display purposes only. + type: string + linodeId: + description: The ID of the Linode to create this configuration + profile under. The ID of the Linode to create this configuration + profile under. + type: number + linodeIdRef: + description: Reference to a Instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance to populate linodeId. + 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 + memoryLimit: + description: The memory limit of the Config. Defaults to the total + ram of the Linode. The memory limit of the Linode. + type: number + rootDevice: + description: The root device to boot. (default /dev/sda) The root + device to boot. If no value or an invalid value is provided, + root device will default to /dev/sda. If the device specified + at the root device location is not mounted, the Linode will + not boot until a device is mounted. + type: string + runLevel: + description: Defines the state of your Linode after booting. (default, + single, binbash) Defines the state of your Linode after booting. + type: string + virtMode: + description: Controls the virtualization mode. (paravirt, fullvirt) + Controls the virtualization mode. + 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 @@ -1078,42 +2048,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -1212,8 +2146,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' status: description: ConfigStatus defines the observed state of Config. properties: @@ -1510,6 +2446,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/instance.linode.upbound.io_disks.yaml b/package/crds/instance.linode.upbound.io_disks.yaml index 0173961..52c80f3 100644 --- a/package/crds/instance.linode.upbound.io_disks.yaml +++ b/package/crds/instance.linode.upbound.io_disks.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: disks.instance.linode.upbound.io spec: group: instance.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -77,6 +76,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set authorizedUsers: description: A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the A list of usernames. @@ -86,6 +86,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set filesystem: description: The filesystem of this disk. (raw, swap, ext3, ext4, initrd) The filesystem of this disk. @@ -300,63 +301,244 @@ spec: type: object type: object type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + authorizedKeys: + description: A list of public SSH keys that will be automatically + appended to the root user’s ~/.ssh/authorized_keys file when + deploying from an Image. A list of public SSH keys that will + be automatically appended to the root user’s ~/.ssh/authorized_keys + file when deploying from an Image. + items: + type: string + type: array + x-kubernetes-list-type: set + authorizedUsers: + description: A list of usernames. If the usernames have associated + SSH keys, the keys will be appended to the A list of usernames. + If the usernames have associated SSH keys, the keys will be + appended to the root users ~/.ssh/authorized_keys file automatically + when deploying from an Image. + items: + type: string + type: array + x-kubernetes-list-type: set + filesystem: + description: The filesystem of this disk. (raw, swap, ext3, ext4, + initrd) The filesystem of this disk. type: string - policy: - description: Policies for referencing. + image: + description: An Image ID to deploy the Linode Disk from. An Image + ID to deploy the Linode Disk from. + type: string + label: + description: The Disk's label for display purposes only. The Disk’s + label is for display purposes only. + type: string + linodeId: + description: The ID of the Linode to create this Disk under. The + ID of the Linode to assign this disk to. + type: number + linodeIdRef: + description: Reference to a Instance to populate linodeId. 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 + name: + description: Name of the referenced object. 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 + 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 + linodeIdSelector: + description: Selector for a Instance to populate linodeId. + 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 + size: + description: 'The size of the Disk in MB. NOTE: Resizing a disk + will trigger a Linode reboot. The size of the Disk in MB.' + type: number + stackscriptId: + description: A StackScript ID that will cause the referenced StackScript + to be run during deployment of this Disk. A StackScript ID that + will cause the referenced StackScript to be run during deployment + of this Linode. + type: number + stackscriptIdRef: + description: Reference to a Stackscript in stackscript to populate + stackscriptId. + 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 + stackscriptIdSelector: + description: Selector for a Stackscript in stackscript to populate + stackscriptId. + 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 - required: - - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -487,10 +669,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: size is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size) + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.size is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.size) + || (has(self.initProvider) && has(self.initProvider.size))' status: description: DiskStatus defines the observed state of Disk. properties: @@ -505,6 +691,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set authorizedUsers: description: A list of usernames. If the usernames have associated SSH keys, the keys will be appended to the A list of usernames. @@ -514,6 +701,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set created: description: When this disk was created. When this disk was created. type: string @@ -587,6 +775,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/instance.linode.upbound.io_instances.yaml b/package/crds/instance.linode.upbound.io_instances.yaml index bc1401c..02dd340 100644 --- a/package/crds/instance.linode.upbound.io_instances.yaml +++ b/package/crds/instance.linode.upbound.io_instances.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: instances.instance.linode.upbound.io spec: group: instance.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -478,8 +477,6 @@ spec: to "paravirt". Controls the virtualization mode. Defaults to paravirt.' type: string - required: - - label type: object type: array disk: @@ -588,9 +585,6 @@ spec: must also be provided, and must be an Image that is compatible with this StackScript. type: number - required: - - label - - size type: object type: array group: @@ -701,6 +695,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set stackscriptDataSecretRef: description: An object containing responses to any User Defined Fields present in the StackScript being deployed to this Linode. @@ -820,6 +815,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: description: The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", @@ -841,21 +837,734 @@ spec: have been more than 5 boot jobs issued within 15 minutes. type: boolean type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + alerts: + description: Configuration options for alert triggers on this + Linode. + items: + properties: + cpu: + description: The percentage of CPU usage required to trigger + an alert. If the average CPU usage over two hours exceeds + this value, we'll send you an alert. If this is set to + 0, the alert is disabled. The percentage of CPU usage + required to trigger an alert. If the average CPU usage + over two hours exceeds this value, we'll send you an alert. + If this is set to 0, the alert is disabled. + type: number + io: + description: The amount of disk IO operation per second + required to trigger an alert. If the average disk IO over + two hours exceeds this value, we'll send you an alert. + If set to 0, this alert is disabled. The amount of disk + IO operation per second required to trigger an alert. + If the average disk IO over two hours exceeds this value, + we'll send you an alert. If set to 0, this alert is disabled. + type: number + networkIn: + description: The amount of incoming traffic, in Mbit/s, + required to trigger an alert. If the average incoming + traffic over two hours exceeds this value, we'll send + you an alert. If this is set to 0 (zero), the alert is + disabled. The amount of incoming traffic, in Mbit/s, required + to trigger an alert. If the average incoming traffic over + two hours exceeds this value, we'll send you an alert. + If this is set to 0 (zero), the alert is disabled. + type: number + networkOut: + description: The amount of outbound traffic, in Mbit/s, + required to trigger an alert. If the average outbound + traffic over two hours exceeds this value, we'll send + you an alert. If this is set to 0 (zero), the alert is + disabled. The amount of outbound traffic, in Mbit/s, required + to trigger an alert. If the average outbound traffic over + two hours exceeds this value, we'll send you an alert. + If this is set to 0 (zero), the alert is disabled. + type: number + transferQuota: + description: The percentage of network transfer that may + be used before an alert is triggered. When this value + is exceeded, we'll alert you. If this is set to 0 (zero), + the alert is disabled. The percentage of network transfer + that may be used before an alert is triggered. When this + value is exceeded, we'll alert you. If this is set to + 0 (zero), the alert is disabled. + type: number + type: object + type: array + authorizedKeys: + description: A list of SSH public keys to deploy for the root + user on the newly created Linode. This value can not be imported. + Changing A list of SSH public keys to deploy for the root user + on the newly created Linode. Only accepted if 'image' is provided. + items: + type: string + type: array + authorizedUsers: + description: A list of Linode usernames. If the usernames have + associated SSH keys, the keys will be appended to the root user's + ~/.ssh/authorized_keys file automatically. This value can not + be imported. Changing A list of Linode usernames. If the usernames + have associated SSH keys, the keys will be appended to the `root` + user's `~/.ssh/authorized_keys` file automatically. Only accepted + if 'image' is provided. + items: + type: string + type: array + backupId: + description: A Backup ID from another Linode's available backups. + Your User must have read_write access to that Linode, the Backup + must have a status of successful, and the Linode must be deployed + to the same region as the Backup. See /linode/instances/{linodeId}/backups + for a Linode's available backups. This field and the image field + are mutually exclusive. This value can not be imported. Changing + A Backup ID from another Linode's available backups. Your User + must have read_write access to that Linode, the Backup must + have a status of successful, and the Linode must be deployed + to the same region as the Backup. See /linode/instances/{linodeId}/backups + for a Linode's available backups. This field and the image field + are mutually exclusive. + type: number + backupsEnabled: + description: If this field is set to true, the created Linode + will automatically be enrolled in the Linode Backup service. + This will incur an additional charge. The cost for the Backup + service is dependent on the Type of Linode deployed. If this + field is set to true, the created Linode will automatically + be enrolled in the Linode Backup service. This will incur an + additional charge. The cost for the Backup service is dependent + on the Type of Linode deployed. + type: boolean + bootConfigLabel: + description: The Label of the Instance Config that should be used + to boot the Linode instance. If there is only one config, the + label of that config will be used as the boot_config_label. + This value can not be imported. The Label of the Instance Config + that should be used to boot the Linode instance. + type: string + booted: + description: If true, then the instance is kept or converted into + in a running state. If false, the instance will be shutdown. + If unspecified, the Linode's power status will not be managed + by the Provider. + type: boolean + config: + description: block Configuration profiles define the VM settings + and boot behavior of the Linode Instance. + items: + properties: + comments: + description: '- Arbitrary user comments about this config. + Optional field for arbitrary User comments on this Config.' + type: string + devices: + description: A list of disk or volume attachments for this + config. If the boot_config_label omits a devices block, + the Linode will not be booted. Device sda-sdh can be either + a Disk or Volume identified by disk_label or volume_id. + Only one type per slot allowed. + items: + properties: + sda: + description: The SDA-SDH slots, represent the Linux + block device nodes for the first 8 disks attached + to the Linode. Each device must be suplied sequentially. The + device can be either a Disk or a Volume identified + by disk_label or volume_id. Only one disk identifier + is permitted per slot. Devices mapped from sde through + sdh are unavailable in "fullvirt" virt_mode. Device + can be either a Disk or Volume identified by disk_id + or volume_id. Only one type per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sdb: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sdc: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sdd: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sde: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sdf: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sdg: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + sdh: + description: Device can be either a Disk or Volume + identified by disk_id or volume_id. Only one type + per slot allowed. + items: + properties: + diskId: + description: (Computed) The Disk ID of the associated + disk_label, if used. The Disk ID to map to + this disk slot + type: number + diskLabel: + description: The label of the disk to map to + this device slot. The `label` of the `disk` + to map to this `device` slot. + type: string + volumeId: + description: The Volume ID to map to this device + slot. The Block Storage volume ID to map to + this disk slot + type: number + type: object + type: array + type: object + type: array + helpers: + description: (Options) Helpers enabled when booting to this + Linode Config. Helpers enabled when booting to this Linode + Config. + items: + properties: + devtmpfsAutomount: + description: Populates the /dev directory early during + boot without udev. Defaults to false. + type: boolean + distro: + description: Controls the behavior of the Linode Config's + Distribution Helper setting. Controls the behavior + of the Linode Config's Distribution Helper setting. + type: boolean + modulesDep: + description: Creates a modules dependency file for + the Kernel you run. Creates a modules dependency + file for the Kernel you run. + type: boolean + network: + description: Controls the behavior of the Linode Config's + Network Helper setting, used to automatically configure + additional IP addresses assigned to this instance. + Controls the behavior of the Linode Config's Network + Helper setting, used to automatically configure + additional IP addresses assigned to this instance. + type: boolean + updatedbDisabled: + description: Disables updatedb cron job to avoid disk + thrashing. Disables updatedb cron job to avoid disk + thrashing. + type: boolean + type: object + type: array + interface: + description: An array of Network Interfaces for this Linode’s + Configuration Profile. + items: + properties: + ipamAddress: + description: This Network Interface’s private IP address + in Classless Inter-Domain Routing (CIDR) notation. + The IPAM Address of this interface. + type: string + label: + description: The Linode's label is for display purposes + only. If no label is provided for a Linode, a default + will be assigned. The unique label of this interface. + type: string + purpose: + description: The type of interface. (public, vlan) + The purpose of this interface. + type: string + type: object + type: array + kernel: + description: '- A Kernel ID to boot a Linode with. Default + is based on image choice. Examples are linode/latest-64bit, + linode/grub2, linode/direct-disk, etc. See all kernels + here. Note that this is a paginated API endpoint (docs). + A Kernel ID to boot a Linode with. Default is based on + image choice. (examples: linode/latest-64bit, linode/grub2, + linode/direct-disk)' + type: string + label: + description: The Linode's label is for display purposes + only. If no label is provided for a Linode, a default + will be assigned. The Config's label for display purposes. Also + used by `boot_config_label`. + type: string + memoryLimit: + description: '- Defaults to the total RAM of the Linode + Defaults to the total RAM of the Linode' + type: number + rootDevice: + description: '- The root device to boot. The corresponding + disk must be attached to a device slot. Example: "/dev/sda" + The root device to boot. The corresponding disk must be + attached.' + type: string + runLevel: + description: '- Defines the state of your Linode after booting. + Defaults to "default". Defines the state of your Linode + after booting. Defaults to default.' + type: string + virtMode: + description: '- Controls the virtualization mode. Defaults + to "paravirt". Controls the virtualization mode. Defaults + to paravirt.' + type: string + type: object + type: array + disk: + description: The amount of storage space, in GB. this Linode has + access to. A typical Linode will divide this space between a + primary disk with an image deployed to it, and a swap disk, + usually 512 MB. This is the default configuration created when + deploying a Linode with an image through POST /linode/instances. + items: + properties: + authorizedKeys: + description: A list of SSH public keys to deploy for the + root user on the newly created Linode. This value can + not be imported. Changing A list of SSH public keys to + deploy for the root user on the newly created Linode. + Only accepted if 'image' is provided. + items: + type: string + type: array + authorizedUsers: + description: A list of Linode usernames. If the usernames + have associated SSH keys, the keys will be appended to + the root user's ~/.ssh/authorized_keys file automatically. + This value can not be imported. Changing A list of Linode + usernames. If the usernames have associated SSH keys, + the keys will be appended to the `root` user's `~/.ssh/authorized_keys` + file automatically. Only accepted if 'image' is provided. + items: + type: string + type: array + filesystem: + description: 'The Disk filesystem can be one of: raw, swap, + ext3, ext4, initrd (max 32mb)' + type: string + image: + description: An Image ID to deploy the Disk from. Official + Linode Images start with linode/, while your Images start + with private/. See images for more information on the + Images available for you to use. Examples are linode/debian9, + linode/fedora28, linode/ubuntu16.04lts, linode/arch, and + private/12345. See all images here (Requires a personal + access token; docs here). This value can not be imported. + Changing An Image ID to deploy the Disk from. Official + Linode Images start with linode/, while your Images start + with private/. + type: string + label: + description: The Linode's label is for display purposes + only. If no label is provided for a Linode, a default + will be assigned. + type: string + readOnly: + description: If true, this Disk is read-only. If true, this + Disk is read-only. + type: boolean + size: + description: The size of the Disk in MB. The size of the + Disk in MB. + type: number + stackscriptId: + description: The StackScript to deploy to the newly created + Linode. If provided, 'image' must also be provided, and + must be an Image that is compatible with this StackScript. + This value can not be imported. Changing The StackScript + to deploy to the newly created Linode. If provided, 'image' + must also be provided, and must be an Image that is compatible + with this StackScript. + type: number + type: object + type: array + group: + description: The display group of the Linode instance. The display + group of the Linode instance. + type: string + image: + description: An Image ID to deploy the Disk from. Official Linode + Images start with linode/, while your Images start with private/. + See images for more information on the Images available for + you to use. Examples are linode/debian9, linode/fedora28, linode/ubuntu16.04lts, + linode/arch, and private/12345. See all images here (Requires + a personal access token; docs here). This value can not be imported. + Changing An Image ID to deploy the Disk from. Official Linode + Images start with linode/, while your Images start with private/. + See /images for more information on the Images available for + you to use. + type: string + interface: + description: An array of Network Interfaces for this Linode to + be created with. If an explicit config or disk is defined, interfaces + must be declared in the config block. + items: + properties: + ipamAddress: + description: This Network Interface’s private IP address + in Classless Inter-Domain Routing (CIDR) notation. The + IPAM Address of this interface. + type: string + label: + description: The Linode's label is for display purposes + only. If no label is provided for a Linode, a default + will be assigned. The unique label of this interface. + type: string + purpose: + description: The type of interface. (public, vlan) The purpose + of this interface. + type: string + type: object + type: array + label: + description: The Linode's label is for display purposes only. + If no label is provided for a Linode, a default will be assigned. + The Linode's label is for display purposes only. If no label + is provided for a Linode, a default will be assigned + type: string + metadata: + description: Various fields related to the Linode Metadata service. + items: + properties: + userData: + description: The base64-encoded user-defined data exposed + to this instance through the Linode Metadata service. + Refer to the base64encode(...) function for information + on encoding content for this field. + type: string + type: object + type: array + privateIp: + description: If true, the created Linode will have private networking + enabled, allowing use of the 192.168.128.0/17 network within + the Linode's region. It can be enabled on an existing Linode + but it can't be disabled. If true, the created Linode will have + private networking enabled, allowing use of the 192.168.128.0/17 + network within the Linode's region. + type: boolean + region: + description: This is the location where the Linode is deployed. + Examples are "us-east", "us-west", "ap-south", etc. See all + regions here. Changing . This is the location where the Linode + was deployed. This cannot be changed without opening a support + ticket. + type: string + resizeDisk: + description: If true, changes in Linode type will attempt to upsize + or downsize implicitly created disks. This must be false if + explicit disks are defined. This is an irreversible action as + Linode disks cannot be automatically downsized. If true, changes + in Linode type will attempt to upsize or downsize implicitly + created disks. This must be false if explicit disks are defined. + This is an irreversible action as Linode disks cannot be automatically + downsized. + type: boolean + sharedIpv4: + description: A set of IPv4 addresses to be shared with the Instance. + These IP addresses can be both private and public, but must + be in the same region as the instance. A set of IPv4 addresses + to share with this Linode. + items: + type: string + type: array + x-kubernetes-list-type: set + stackscriptId: + description: The StackScript to deploy to the newly created Linode. + If provided, 'image' must also be provided, and must be an Image + that is compatible with this StackScript. This value can not + be imported. Changing The StackScript to deploy to the newly + created Linode. If provided, 'image' must also be provided, + and must be an Image that is compatible with this StackScript. + type: number + stackscriptIdRef: + description: Reference to a Stackscript in stackscript to populate + stackscriptId. + 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 + stackscriptIdSelector: + description: Selector for a Stackscript in stackscript to populate + stackscriptId. + 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 + swapSize: + description: When deploying from an Image, this field is optional + with a Linode API default of 512mb, otherwise it is ignored. + This is used to set the swap disk size for the newly-created + Linode. When deploying from an Image, this field is optional + with a Linode API default of 512mb, otherwise it is ignored. + This is used to set the swap disk size for the newly-created + Linode. + type: number + tags: + description: A list of tags applied to this object. Tags are for + organizational purposes only. An array of tags applied to this + object. Tags are for organizational purposes only. + items: + type: string + type: array + x-kubernetes-list-type: set + type: + description: The Linode type defines the pricing, CPU, disk, and + RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", + "g6-highmem-16", "g6-dedicated-16", etc. See all types here. + The type of instance to be deployed, determining the price and + size. + type: string + watchdogEnabled: + description: The watchdog, named Lassie, is a Shutdown Watchdog + that monitors your Linode and will reboot it if it powers off + unexpectedly. It works by issuing a boot job when your Linode + powers off without a shutdown job being responsible. To prevent + a loop, Lassie will give up if there have been more than 5 boot + jobs issued within 15 minutes. The watchdog, named Lassie, is + a Shutdown Watchdog that monitors your Linode and will reboot + it if it powers off unexpectedly. It works by issuing a boot + job when your Linode powers off without a shutdown job being + responsible. To prevent a loop, Lassie will give up if there + have been more than 5 boot jobs issued within 15 minutes. + type: boolean + 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 @@ -894,42 +1603,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -1028,8 +1701,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: region is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + - message: spec.forProvider.region is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.region) + || (has(self.initProvider) && has(self.initProvider.region))' status: description: InstanceStatus defines the observed state of Instance. properties: @@ -1625,6 +2300,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set ipv6: description: This Linode's IPv6 SLAAC addresses. This address is specific to a Linode, and may not be shared. The prefix @@ -1690,6 +2366,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set specs: description: Information about the resources available to this Linode. @@ -1750,6 +2427,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: description: The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. Examples are "g6-nanode-1", "g6-standard-2", @@ -1804,6 +2482,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/instance.linode.upbound.io_ips.yaml b/package/crds/instance.linode.upbound.io_ips.yaml index c672401..22bc7e4 100644 --- a/package/crds/instance.linode.upbound.io_ips.yaml +++ b/package/crds/instance.linode.upbound.io_ips.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ips.instance.linode.upbound.io spec: group: instance.linode.upbound.io @@ -57,7 +56,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -232,63 +231,214 @@ spec: type: object type: object type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. - type: string - policy: - description: Policies for referencing. + applyImmediately: + description: If true, the instance will be rebooted to update + network interfaces. If true, the instance will be rebooted to + update network interfaces. This functionality is not affected + by the `skip_implicit_reboots` provider argument. + type: boolean + linodeId: + description: The ID of the Linode to allocate an IPv4 address + for. The ID of the Linode to allocate an IPv4 address for. + type: number + linodeIdRef: + description: Reference to a Instance to populate linodeId. 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 + name: + description: Name of the referenced object. 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 + 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 + linodeIdSelector: + description: Selector for a Instance to populate linodeId. + 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 + public: + description: Whether the IPv4 address is public or private. Defaults + to true. Whether the IPv4 address is public or private. + type: boolean + rdns: + description: The reverse DNS assigned to this address. The reverse + DNS assigned to this address. + type: string + rdnsRef: + description: Reference to a RDNS in rdns to populate rdns. + 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 + rdnsSelector: + description: Selector for a RDNS in rdns to populate rdns. + 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 - required: - - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -501,6 +651,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/instance.linode.upbound.io_sharedips.yaml b/package/crds/instance.linode.upbound.io_sharedips.yaml index d5f9184..4b19709 100644 --- a/package/crds/instance.linode.upbound.io_sharedips.yaml +++ b/package/crds/instance.linode.upbound.io_sharedips.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: sharedips.instance.linode.upbound.io spec: group: instance.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -74,6 +73,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set linodeId: description: The ID of the Linode to share the IPs to. The ID of the Linode to share these IP addresses with. @@ -152,21 +152,128 @@ spec: type: object type: object type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + addresses: + description: The set of IPs to share with the Linode. A set of + IP addresses to share to the Linode + items: + type: string + type: array + x-kubernetes-list-type: set + linodeId: + description: The ID of the Linode to share the IPs to. The ID + of the Linode to share these IP addresses with. + type: number + linodeIdRef: + description: Reference to a Instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance to populate linodeId. + 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 + 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 @@ -205,42 +312,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -339,8 +410,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: addresses is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.addresses) + - message: spec.forProvider.addresses is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.addresses) + || (has(self.initProvider) && has(self.initProvider.addresses))' status: description: SharedIPsStatus defines the observed state of SharedIPs. properties: @@ -352,6 +425,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set id: type: string linodeId: @@ -392,6 +466,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/ipv6.linode.upbound.io_ipv6ranges.yaml b/package/crds/ipv6.linode.upbound.io_ipv6ranges.yaml index 1591861..1c56de5 100644 --- a/package/crds/ipv6.linode.upbound.io_ipv6ranges.yaml +++ b/package/crds/ipv6.linode.upbound.io_ipv6ranges.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: ipv6ranges.ipv6.linode.upbound.io spec: group: ipv6.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -155,21 +154,130 @@ spec: IPv6 SLAAC address to assign this range to. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + linodeId: + description: The ID of the Linode to assign this range to. This + field may be updated to reassign the IPv6 range. The ID of the + Linode to assign this range to. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + 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 + prefixLength: + description: The prefix length of the IPv6 range. The prefix length + of the IPv6 range. + type: number + routeTarget: + description: The IPv6 SLAAC address to assign this range to. The + IPv6 SLAAC address to assign this range to. + 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 @@ -208,42 +316,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -342,8 +414,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: prefixLength is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.prefixLength) + - message: spec.forProvider.prefixLength is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.prefixLength) + || (has(self.initProvider) && has(self.initProvider.prefixLength))' status: description: IPv6RangeStatus defines the observed state of IPv6Range. properties: @@ -367,6 +441,7 @@ spec: items: type: number type: array + x-kubernetes-list-type: set prefixLength: description: The prefix length of the IPv6 range. The prefix length of the IPv6 range. @@ -417,6 +492,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/linode.upbound.io_providerconfigs.yaml b/package/crds/linode.upbound.io_providerconfigs.yaml index d1471be..d7594aa 100644 --- a/package/crds/linode.upbound.io_providerconfigs.yaml +++ b/package/crds/linode.upbound.io_providerconfigs.yaml @@ -3,16 +3,15 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: providerconfigs.linode.upbound.io spec: group: linode.upbound.io names: categories: - crossplane - - provider - - template + - providerconfig + - linode kind: ProviderConfig listKind: ProviderConfigList plural: providerconfigs @@ -30,7 +29,7 @@ spec: name: v1beta1 schema: openAPIV3Schema: - description: A ProviderConfig configures a Template provider. + description: A ProviderConfig configures a Linode provider. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -139,6 +138,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map users: description: Users of this provider configuration. format: int64 diff --git a/package/crds/linode.upbound.io_providerconfigusages.yaml b/package/crds/linode.upbound.io_providerconfigusages.yaml index 16976a3..3e5a5ea 100644 --- a/package/crds/linode.upbound.io_providerconfigusages.yaml +++ b/package/crds/linode.upbound.io_providerconfigusages.yaml @@ -3,16 +3,15 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: providerconfigusages.linode.upbound.io spec: group: linode.upbound.io names: categories: - crossplane - - provider - - template + - providerconfig + - linode kind: ProviderConfigUsage listKind: ProviderConfigUsageList plural: providerconfigusages diff --git a/package/crds/linode.upbound.io_storeconfigs.yaml b/package/crds/linode.upbound.io_storeconfigs.yaml index e437808..ae2466e 100644 --- a/package/crds/linode.upbound.io_storeconfigs.yaml +++ b/package/crds/linode.upbound.io_storeconfigs.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: storeconfigs.linode.upbound.io spec: group: linode.upbound.io @@ -154,146 +153,6 @@ spec: - Vault - Plugin type: string - vault: - description: 'Vault configures a Vault secret store. Deprecated: This - API is scheduled to be removed in a future release. Vault should - be used as a plugin going forward. See https://github.com/crossplane-contrib/ess-plugin-vault - for more information.' - properties: - auth: - description: Auth configures an authentication method for Vault. - properties: - method: - description: Method configures which auth method will be used. - type: string - token: - description: Token configures Token Auth for Vault. - properties: - env: - description: Env is a reference to an environment variable - that contains credentials that must be used to connect - to the provider. - properties: - name: - description: Name is the name of an environment variable. - type: string - required: - - name - type: object - fs: - description: Fs is a reference to a filesystem location - that contains credentials that must be used to connect - to the provider. - properties: - path: - description: Path is a filesystem path. - type: string - required: - - path - type: object - secretRef: - description: A SecretRef is a reference to a secret key - that contains the credentials that must be used to connect - to the provider. - properties: - key: - description: The key to select. - type: string - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - key - - name - - namespace - type: object - source: - description: Source of the credentials. - enum: - - None - - Secret - - Environment - - Filesystem - type: string - required: - - source - type: object - required: - - method - type: object - caBundle: - description: CABundle configures CA bundle for Vault Server. - properties: - env: - description: Env is a reference to an environment variable - that contains credentials that must be used to connect to - the provider. - properties: - name: - description: Name is the name of an environment variable. - type: string - required: - - name - type: object - fs: - description: Fs is a reference to a filesystem location that - contains credentials that must be used to connect to the - provider. - properties: - path: - description: Path is a filesystem path. - type: string - required: - - path - type: object - secretRef: - description: A SecretRef is a reference to a secret key that - contains the credentials that must be used to connect to - the provider. - properties: - key: - description: The key to select. - type: string - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - key - - name - - namespace - type: object - source: - description: Source of the credentials. - enum: - - None - - Secret - - Environment - - Filesystem - type: string - required: - - source - type: object - mountPath: - description: MountPath is the mount path of the KV secrets engine. - type: string - server: - description: Server is the url of the Vault server, e.g. "https://vault.acme.org" - type: string - version: - default: v2 - description: Version of the KV Secrets engine of Vault. https://www.vaultproject.io/docs/secrets/kv - type: string - required: - - auth - - mountPath - - server - type: object required: - defaultScope type: object @@ -333,6 +192,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/lke.linode.upbound.io_clusters.yaml b/package/crds/lke.linode.upbound.io_clusters.yaml index e05baf3..a21bd8b 100644 --- a/package/crds/lke.linode.upbound.io_clusters.yaml +++ b/package/crds/lke.linode.upbound.io_clusters.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: clusters.lke.linode.upbound.io spec: group: lke.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -109,9 +108,6 @@ spec: description: The minimum number of nodes to autoscale to. The minimum number of nodes to autoscale to. type: number - required: - - max - - min type: object type: array count: @@ -123,9 +119,6 @@ spec: Pool. See all node types here. A Linode Type for all of the nodes in the Node Pool. type: string - required: - - count - - type type: object type: array region: @@ -140,22 +133,113 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + controlPlane: + description: Defines settings for the Kubernetes Control Plane. + items: + properties: + highAvailability: + description: Defines whether High Availability is enabled + for the cluster Control Plane. This is an irreversible + change. Defines whether High Availability is enabled for + the Control Plane Components of the cluster. + type: boolean + type: object + type: array + k8sVersion: + description: The desired Kubernetes version for this Kubernetes + cluster in the format of major.minor (e.g. 1.21), and the latest + supported patch version will be deployed. The desired Kubernetes + version for this Kubernetes cluster in the format of .. + The latest supported patch version will be deployed. + type: string + label: + description: This Kubernetes cluster's unique label. The unique + label for the cluster. + type: string + pool: + description: 'Additional nested attributes: A node pool in the + cluster.' + items: + properties: + autoscaler: + description: When specified, the number of nodes autoscales + within the defined minimum and maximum values. + items: + properties: + max: + description: The maximum number of nodes to autoscale + to. The maximum number of nodes to autoscale to. + type: number + min: + description: The minimum number of nodes to autoscale + to. The minimum number of nodes to autoscale to. + type: number + type: object + type: array + count: + description: The number of nodes in the Node Pool. The number + of nodes in the Node Pool. + type: number + type: + description: A Linode Type for all of the nodes in the Node + Pool. See all node types here. A Linode Type for all of + the nodes in the Node Pool. + type: string + type: object + type: array + region: + description: This Kubernetes cluster's location. This cluster's + location. + type: string + tags: + description: An array of tags applied to the Kubernetes cluster. + Tags are for organizational purposes only. An array of tags + applied to this object. Tags are for organizational purposes + only. + items: + type: string + type: array + x-kubernetes-list-type: set + 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 @@ -194,42 +278,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -328,14 +376,22 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: k8sVersion is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.k8sVersion) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: pool is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.pool) - - message: region is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + - message: spec.forProvider.k8sVersion is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.k8sVersion) + || (has(self.initProvider) && has(self.initProvider.k8sVersion))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.pool is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.pool) + || (has(self.initProvider) && has(self.initProvider.pool))' + - message: spec.forProvider.region is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.region) + || (has(self.initProvider) && has(self.initProvider.region))' status: description: ClusterStatus defines the observed state of Cluster. properties: @@ -441,6 +497,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: object conditions: description: Conditions of the resource. @@ -475,6 +532,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/nodebalancer.linode.upbound.io_configs.yaml b/package/crds/nodebalancer.linode.upbound.io_configs.yaml index cf5c0f7..8dad9de 100644 --- a/package/crds/nodebalancer.linode.upbound.io_configs.yaml +++ b/package/crds/nodebalancer.linode.upbound.io_configs.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: configs.nodebalancer.linode.upbound.io spec: group: nodebalancer.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -287,63 +286,223 @@ spec: is handled on this port: ''none'', ''table'', ''http_cookie''' type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + algorithm: + description: 'What algorithm this NodeBalancer should use for + routing traffic to backends. (roundrobin, leastconn, source) + What algorithm this NodeBalancer should use for routing traffic + to backends: roundrobin, leastconn, source' type: string - policy: - description: Policies for referencing. + check: + description: The type of check to perform against backends to + ensure they are serving requests. This is used to determine + if backends are up or down. If none no check is performed. connection + requires only a connection to the backend to succeed. http and + http_body rely on the backend serving HTTP, and that the response + returned matches what is expected. (none, connection, http, + http_body) The type of check to perform against backends to + ensure they are serving requests. This is used to determine + if backends are up or down. If none no check is performed. connection + requires only a connection to the backend to succeed. http and + http_body rely on the backend serving HTTP, and that the response + returned matches what is expected. + type: string + checkAttempts: + description: How many times to attempt a check before considering + a backend to be down. (1-30) How many times to attempt a check + before considering a backend to be down. (1-30) + type: number + checkBody: + description: This value must be present in the response body of + the check in order for it to pass. If this value is not present + in the response body of a check request, the backend is considered + to be down + type: string + checkInterval: + description: How often, in seconds, to check that backends are + up and serving requests. How often, in seconds, to check that + backends are up and serving requests. + type: number + checkPassive: + description: If true, any response from this backend with a 5xx + status code will be enough for it to be considered unhealthy + and taken out of rotation. If true, any response from this backend + with a 5xx status code will be enough for it to be considered + unhealthy and taken out of rotation. + type: boolean + checkPath: + description: The URL path to check on each backend. If the backend + does not respond to this request it is considered to be down. + The URL path to check on each backend. If the backend does not + respond to this request it is considered to be down. + type: string + checkTimeout: + description: How long, in seconds, to wait for a check attempt + before considering it failed. (1-30) How long, in seconds, to + wait for a check attempt before considering it failed. (1-30) + type: number + cipherSuite: + description: What ciphers to use for SSL connections served by + this NodeBalancer. legacy is considered insecure and should + only be used if necessary. What ciphers to use for SSL connections + served by this NodeBalancer. `legacy` is considered insecure + and should only be used if necessary. + type: string + nodebalancerId: + description: The ID of the NodeBalancer to access. The ID of the + NodeBalancer to access. + type: number + nodebalancerIdRef: + description: Reference to a Nodebalancer to populate nodebalancerId. 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 + 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 - required: - - name + nodebalancerIdSelector: + description: Selector for a Nodebalancer to populate nodebalancerId. + 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 + port: + description: The TCP port this Config is for. These values must + be unique across configs on a single NodeBalancer (you can't + have two configs for port 80, for example). While some ports + imply some protocols, no enforcement is done and you may configure + your NodeBalancer however is useful to you. For example, while + port 443 is generally used for HTTPS, you do not need SSL configured + to have a NodeBalancer listening on port 443. (Defaults to 80) + The TCP port this Config is for. These values must be unique + across configs on a single NodeBalancer (you can't have two + configs for port 80, for example). While some ports imply some + protocols, no enforcement is done and you may configure your + NodeBalancer however is useful to you. For example, while port + 443 is generally used for HTTPS, you do not need SSL configured + to have a NodeBalancer listening on port 443. + type: number + protocol: + description: The protocol this port is configured to serve. If + this is set to https you must include an ssl_cert and an ssl_key. + (http, https, tcp) (Defaults to http) The protocol this port + is configured to serve. If this is set to https you must include + an ssl_cert and an ssl_key. + type: string + proxyProtocol: + description: The version of ProxyProtocol to use for the underlying + NodeBalancer. This requires protocol to be tcp. (none, v1, v2) + (Defaults to none) The version of ProxyProtocol to use for the + underlying NodeBalancer. This requires protocol to be `tcp`. + Valid values are `none`, `v1`, and `v2`. + type: string + stickiness: + description: 'Controls how session stickiness is handled on this + port. (none, table, http_cookie) Controls how session stickiness + is handled on this port: ''none'', ''table'', ''http_cookie''' + type: string type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -649,6 +808,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/nodebalancer.linode.upbound.io_nodebalancers.yaml b/package/crds/nodebalancer.linode.upbound.io_nodebalancers.yaml index 175cde7..fe622dc 100644 --- a/package/crds/nodebalancer.linode.upbound.io_nodebalancers.yaml +++ b/package/crds/nodebalancer.linode.upbound.io_nodebalancers.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: nodebalancers.nodebalancer.linode.upbound.io spec: group: nodebalancer.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -92,22 +91,71 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + clientConnThrottle: + description: Throttle connections per second (0-20). Set to 0 + (default) to disable throttling. Throttle connections per second + (0-20). Set to 0 (zero) to disable throttling. + type: number + firewallId: + description: ID for the firewall you'd like to use with this NodeBalancer. + type: number + label: + description: The label of the Linode NodeBalancer The label of + the Linode NodeBalancer. + type: string + region: + description: The region where this NodeBalancer will be deployed. Examples + are "us-east", "us-west", "ap-south", etc. See all regions here. Changing + . The region where this NodeBalancer will be deployed. + type: string + tags: + description: A list of tags applied to this object. Tags are for + organizational purposes only. An array of tags applied to this + object. Tags are for organizational purposes only. + items: + type: string + type: array + x-kubernetes-list-type: set + 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 @@ -146,42 +194,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -326,6 +338,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set transfer: description: Information about the amount of transfer this NodeBalancer has had so far this month. @@ -383,6 +396,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/nodebalancer.linode.upbound.io_nodes.yaml b/package/crds/nodebalancer.linode.upbound.io_nodes.yaml index 1a5e396..64990fe 100644 --- a/package/crds/nodebalancer.linode.upbound.io_nodes.yaml +++ b/package/crds/nodebalancer.linode.upbound.io_nodes.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: nodes.nodebalancer.linode.upbound.io spec: group: nodebalancer.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -255,63 +254,236 @@ spec: Nodes with a higher weight will receive more traffic. (1-255) type: number type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + address: + description: The private IP Address where this backend can be + reached. This must be a private IP address. The private IP Address + and port (IP:PORT) where this backend can be reached. This must + be a private IP address. type: string - policy: - description: Policies for referencing. + configId: + description: The ID of the NodeBalancerConfig to access. The ID + of the NodeBalancerConfig to access. + type: number + configIdRef: + description: Reference to a Config to populate configId. 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 + name: + description: Name of the referenced object. 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 + 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 + configIdSelector: + description: Selector for a Config to populate configId. + 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 + label: + description: The label of the Linode NodeBalancer Node. This is + for display purposes only. The label for this node. This is + for display purposes only. + type: string + mode: + description: The mode this NodeBalancer should use when sending + traffic to this backend. If set to accept this backend is accepting + traffic. If set to reject this backend will not receive traffic. + If set to drain this backend will not receive new traffic, but + connections already pinned to it will continue to be routed + to it. (accept, reject, drain, backup) The mode this NodeBalancer + should use when sending traffic to this backend. If set to `accept` + this backend is accepting traffic. If set to `reject` this backend + will not receive traffic. If set to `drain` this backend will + not receive new traffic, but connections already pinned to it + will continue to be routed to it. If set to `backup` this backend + will only accept traffic if all other nodes are down. + type: string + nodebalancerId: + description: The ID of the NodeBalancer to access. The ID of the + NodeBalancer to access. + type: number + nodebalancerIdRef: + description: Reference to a Nodebalancer to populate nodebalancerId. + 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 - required: - - name + nodebalancerIdSelector: + description: Selector for a Nodebalancer to populate nodebalancerId. + 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 + weight: + description: Used when picking a backend to serve a request and + is not pinned to a single backend yet. Nodes with a higher weight + will receive more traffic. (1-255). Used when picking a backend + to serve a request and is not pinned to a single backend yet. + Nodes with a higher weight will receive more traffic. (1-255) + type: number type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -442,10 +614,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: address is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.address) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: spec.forProvider.address is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.address) + || (has(self.initProvider) && has(self.initProvider.address))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' status: description: NodeStatus defines the observed state of Node. properties: @@ -533,6 +709,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/objectstorage.linode.upbound.io_buckets.yaml b/package/crds/objectstorage.linode.upbound.io_buckets.yaml index c4cf164..68b392a 100644 --- a/package/crds/objectstorage.linode.upbound.io_buckets.yaml +++ b/package/crds/objectstorage.linode.upbound.io_buckets.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: buckets.objectstorage.linode.upbound.io spec: group: objectstorage.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -155,46 +154,15 @@ spec: description: The cert used by this Object Storage Bucket. items: properties: - certificateSecretRef: + certificate: description: The Base64 encoded and PEM formatted SSL certificate. The Base64 encoded and PEM formatted SSL certificate. - properties: - key: - description: The key to select. - type: string - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - key - - name - - namespace - type: object - privateKeySecretRef: + type: string + privateKey: description: The private key associated with the TLS/SSL certificate. The private key associated with the TLS/SSL certificate. - properties: - key: - description: The key to select. - type: string - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - key - - name - - namespace - type: object - required: - - certificateSecretRef - - privateKeySecretRef + type: string type: object type: array cluster: @@ -266,8 +234,6 @@ spec: Specifies the number of days non-current object versions expire. type: number - required: - - days type: object type: array prefix: @@ -275,8 +241,6 @@ spec: objects to which the rule applies. The object key prefix identifying one or more objects to which the rule applies. type: string - required: - - enabled type: object type: array secretKey: @@ -364,63 +328,310 @@ spec: and secret_key) Whether to enable versioning. type: boolean type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + accessKey: + description: The access key to authenticate with. The S3 access + key to use for this resource. (Required for lifecycle_rule and + versioning) type: string - policy: - description: Policies for referencing. + accessKeyRef: + description: Reference to a Key to populate accessKey. 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 + name: + description: Name of the referenced object. 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 + 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 + accessKeySelector: + description: Selector for a Key to populate accessKey. + 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 + acl: + description: The Access Control Level of the bucket using a canned + ACL string. See all ACL strings in the Linode API v4 documentation. + The Access Control Level of the bucket using a canned ACL string. + type: string + cert: + description: The cert used by this Object Storage Bucket. + items: + properties: + certificate: + description: The Base64 encoded and PEM formatted SSL certificate. + The Base64 encoded and PEM formatted SSL certificate. + type: string + privateKey: + description: The private key associated with the TLS/SSL + certificate. The private key associated with the TLS/SSL + certificate. + type: string + type: object + type: array + cluster: + description: The cluster of the Linode Object Storage Bucket. + The cluster of the Linode Object Storage Bucket. + type: string + corsEnabled: + description: If true, the bucket will have CORS enabled for all + origins. If true, the bucket will be created with CORS enabled + for all origins. + type: boolean + label: + description: The label of the Linode Object Storage Bucket. The + label of the Linode Object Storage Bucket. + type: string + lifecycleRule: + description: Lifecycle rules to be applied to the bucket. + items: + properties: + abortIncompleteMultipartUploadDays: + description: Specifies the number of days after initiating + a multipart upload when the multipart upload must be completed. + Specifies the number of days after initiating a multipart + upload when the multipart upload must be completed. + type: number + enabled: + description: Specifies whether the lifecycle rule is active. + Specifies whether the lifecycle rule is active. + type: boolean + expiration: + description: Specifies a period in the object's expire. + items: + properties: + date: + description: Specifies the date after which you want + the corresponding action to take effect. Specifies + the date after which you want the corresponding + action to take effect. + type: string + days: + description: Specifies the number of days after object + creation when the specific rule action takes effect. + Specifies the number of days after object creation + when the specific rule action takes effect. + type: number + expiredObjectDeleteMarker: + description: On a versioned bucket (versioning-enabled + or versioning-suspended bucket), you can add this + element in the lifecycle configuration to direct + Linode Object Storage to delete expired object delete + markers. This cannot be specified with Days or Date + in a Lifecycle Expiration Policy. Directs Linode + Object Storage to remove expired deleted markers. + type: boolean + type: object + type: array + id: + description: The unique identifier for the rule. The unique + identifier for the rule. + type: string + noncurrentVersionExpiration: + description: Specifies when non-current object versions + expire. + items: + properties: + days: + description: Specifies the number of days after object + creation when the specific rule action takes effect. + Specifies the number of days non-current object + versions expire. + type: number + type: object + type: array + prefix: + description: The object key prefix identifying one or more + objects to which the rule applies. The object key prefix + identifying one or more objects to which the rule applies. + type: string + type: object + type: array + secretKey: + description: The secret key to authenticate with. The S3 secret + key to use for this resource. (Required for lifecycle_rule and + versioning) + type: string + secretKeyRef: + description: Reference to a Key to populate secretKey. + 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 - required: - - name + secretKeySelector: + description: Selector for a Key to populate secretKey. + 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 + versioning: + description: Whether to enable versioning. Once you version-enable + a bucket, it can never return to an unversioned state. You can, + however, suspend versioning on that bucket. (Requires access_key + and secret_key) Whether to enable versioning. + type: boolean type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -551,10 +762,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: cluster is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.cluster) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: spec.forProvider.cluster is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.cluster) + || (has(self.initProvider) && has(self.initProvider.cluster))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' status: description: BucketStatus defines the observed state of Bucket. properties: @@ -574,46 +789,15 @@ spec: description: The cert used by this Object Storage Bucket. items: properties: - certificateSecretRef: + certificate: description: The Base64 encoded and PEM formatted SSL certificate. The Base64 encoded and PEM formatted SSL certificate. - properties: - key: - description: The key to select. - type: string - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - key - - name - - namespace - type: object - privateKeySecretRef: + type: string + privateKey: description: The private key associated with the TLS/SSL certificate. The private key associated with the TLS/SSL certificate. - properties: - key: - description: The key to select. - type: string - name: - description: Name of the secret. - type: string - namespace: - description: Namespace of the secret. - type: string - required: - - key - - name - - namespace - type: object - required: - - certificateSecretRef - - privateKeySecretRef + type: string type: object type: array cluster: @@ -747,6 +931,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/objectstorage.linode.upbound.io_keys.yaml b/package/crds/objectstorage.linode.upbound.io_keys.yaml index 358b4f9..6a2e07d 100644 --- a/package/crds/objectstorage.linode.upbound.io_keys.yaml +++ b/package/crds/objectstorage.linode.upbound.io_keys.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: keys.objectstorage.linode.upbound.io spec: group: objectstorage.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -93,10 +92,6 @@ spec: selected bucket. Changing (read_write, read_only) This Limited Access Key's permissions for the selected bucket. type: string - required: - - bucketName - - cluster - - permissions type: object type: array label: @@ -104,21 +99,75 @@ spec: only. The label given to this key. For display purposes only. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + bucketAccess: + description: Defines this key as a Limited Access Key. Limited + Access Keys restrict this Object Storage key’s access to only + the bucket(s) declared in this array and define their bucket-level + permissions. Not providing this block will not limit this Object + Storage Key. A list of permissions to grant this limited access + key. + items: + properties: + bucketName: + description: The unique label of the bucket to which the + key will grant limited access. The unique label of the + bucket to which the key will grant limited access. + type: string + cluster: + description: The Object Storage cluster where a bucket to + which the key is granting access is hosted. The Object + Storage cluster where a bucket to which the key is granting + access is hosted. + type: string + permissions: + description: This Limited Access Key’s permissions for the + selected bucket. Changing (read_write, read_only) This + Limited Access Key's permissions for the selected bucket. + type: string + type: object + type: array + label: + description: The label given to this key. For display purposes + only. The label given to this key. For display purposes only. + 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 @@ -157,42 +206,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -291,8 +304,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' status: description: KeyStatus defines the observed state of Key. properties: @@ -369,6 +384,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/objectstorage.linode.upbound.io_objects.yaml b/package/crds/objectstorage.linode.upbound.io_objects.yaml index a7084a4..f88be43 100644 --- a/package/crds/objectstorage.linode.upbound.io_objects.yaml +++ b/package/crds/objectstorage.linode.upbound.io_objects.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: objects.objectstorage.linode.upbound.io spec: group: objectstorage.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -216,6 +215,7 @@ spec: description: A map of keys/values to provision metadata. The metadata of this object type: object + x-kubernetes-map-type: granular secretKey: description: The secret key to authenitcate with. The S3 secret key with access to the target bucket. @@ -304,63 +304,286 @@ spec: website redirect location of this object. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + accessKey: + description: The access key to authenticate with. The S3 access + key with access to the target bucket. type: string - policy: - description: Policies for referencing. + accessKeyRef: + description: Reference to a Key to populate accessKey. 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 + name: + description: Name of the referenced object. 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 + 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 + accessKeySelector: + description: Selector for a Key to populate accessKey. + 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 + acl: + description: The canned ACL to apply. (private, public-read, authenticated-read, + public-read-write, custom) (defaults to private). The ACL config + given to this object. + type: string + bucket: + description: The name of the bucket to put the object in. The + target bucket to put this object in. + type: string + cacheControl: + description: Specifies caching behavior along the request/reply + chain Read w3c cache_control for further details. This cache_control + configuration of this object. + type: string + cluster: + description: The cluster the bucket is in. The target cluster + that the bucket is in. + type: string + content: + description: Literal string value to use as the object content, + which will be uploaded as UTF-8-encoded text. The contents of + the Object to upload. + type: string + contentBase64: + description: Base64-encoded data that will be decoded and uploaded + as raw bytes for the object content. This allows safely uploading + non-UTF8 binary data, but is recommended only for small content + such as the result of the gzipbase64 function with small text + strings. For larger objects, use source to stream the content + from a disk file. The base64 contents of the Object to upload. + type: string + contentDisposition: + description: Specifies presentational information for the object. + Read w3c content_disposition for further information. The content + disposition configuration of this object. + type: string + contentEncoding: + description: Specifies what content encodings have been applied + to the object and thus what decoding mechanisms must be applied + to obtain the media-type referenced by the Content-Type header + field. Read w3c content encoding for further information. The + encoding of the content of this object. + type: string + contentLanguage: + description: The language the content is in e.g. en-US or en-GB. + The language metadata of this object. + type: string + contentType: + description: A standard MIME type describing the format of the + object data, e.g. application/octet-stream. All Valid MIME Types + are valid for this input. The MIME type of the content. + type: string + etag: + description: Used to trigger updates.11.11.11 or earlier). The + specific version of this object. + type: string + forceDestroy: + description: Allow the object to be deleted regardless of any + legal hold or object lock (defaults to false). Whether the object + should bypass deletion restrictions. + type: boolean + key: + description: They name of the object once it is in the bucket. + The name of the uploaded object. + type: string + metadata: + additionalProperties: + type: string + description: A map of keys/values to provision metadata. The metadata + of this object + type: object + x-kubernetes-map-type: granular + secretKey: + description: The secret key to authenitcate with. The S3 secret + key with access to the target bucket. + type: string + secretKeyRef: + description: Reference to a Key to populate secretKey. + 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 - required: - - name + secretKeySelector: + description: Selector for a Key to populate secretKey. + 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 path to a file that will be read and uploaded + as raw bytes for the object content. The path must either be + relative to the root module or absolute. The source file to + upload. + type: string + websiteRedirect: + description: Specifies a target URL for website redirect. The + website redirect location of this object. + type: string type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -491,12 +714,18 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: bucket is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.bucket) - - message: cluster is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.cluster) - - message: key is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.key) + - message: spec.forProvider.bucket is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.bucket) + || (has(self.initProvider) && has(self.initProvider.bucket))' + - message: spec.forProvider.cluster is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.cluster) + || (has(self.initProvider) && has(self.initProvider.cluster))' + - message: spec.forProvider.key is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.key) + || (has(self.initProvider) && has(self.initProvider.key))' status: description: ObjectStatus defines the observed state of Object. properties: @@ -579,6 +808,7 @@ spec: description: A map of keys/values to provision metadata. The metadata of this object type: object + x-kubernetes-map-type: granular secretKey: description: The secret key to authenitcate with. The S3 secret key with access to the target bucket. @@ -631,6 +861,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/rdns.linode.upbound.io_rdns.yaml b/package/crds/rdns.linode.upbound.io_rdns.yaml index 3d7423e..7386cda 100644 --- a/package/crds/rdns.linode.upbound.io_rdns.yaml +++ b/package/crds/rdns.linode.upbound.io_rdns.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: rdns.rdns.linode.upbound.io spec: group: rdns.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -84,21 +83,59 @@ spec: be retried within the operation timeout period. type: boolean type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + address: + description: The Public IPv4 or IPv6 address that will receive + the PTR record. A matching A or AAAA record must exist. The + public Linode IPv4 or IPv6 address to operate on. + type: string + rdns: + description: The name of the RDNS address. The reverse DNS assigned + to this address. For public IPv4 addresses, this will be set + to a default value provided by Linode if not explicitly set. + type: string + waitForAvailable: + description: If true, the RDNS assignment will be retried within + the operation timeout period. If true, the RDNS assignment will + be retried within the operation timeout period. + type: boolean + 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 @@ -137,42 +174,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -271,10 +272,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: address is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.address) - - message: rdns is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.rdns) + - message: spec.forProvider.address is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.address) + || (has(self.initProvider) && has(self.initProvider.address))' + - message: spec.forProvider.rdns is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.rdns) + || (has(self.initProvider) && has(self.initProvider.rdns))' status: description: RDNSStatus defines the observed state of RDNS. properties: @@ -331,6 +336,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/sshkey.linode.upbound.io_sshkeys.yaml b/package/crds/sshkey.linode.upbound.io_sshkeys.yaml index bd052a3..116c91c 100644 --- a/package/crds/sshkey.linode.upbound.io_sshkeys.yaml +++ b/package/crds/sshkey.linode.upbound.io_sshkeys.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: sshkeys.sshkey.linode.upbound.io spec: group: sshkey.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -79,21 +78,54 @@ spec: you deploy. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + label: + description: A label for the SSH Key. The label of the Linode + SSH Key. + type: string + sshKey: + description: The public SSH Key, which is used to authenticate + to the root user of the Linodes you deploy. The public SSH Key, + which is used to authenticate to the root user of the Linodes + you deploy. + 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 @@ -132,42 +164,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -266,10 +262,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: sshKey is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.sshKey) + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.sshKey is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.sshKey) + || (has(self.initProvider) && has(self.initProvider.sshKey))' status: description: SSHKeyStatus defines the observed state of SSHKey. properties: @@ -325,6 +325,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/stackscript.linode.upbound.io_stackscripts.yaml b/package/crds/stackscript.linode.upbound.io_stackscripts.yaml index 6dd34c1..65b4db8 100644 --- a/package/crds/stackscript.linode.upbound.io_stackscripts.yaml +++ b/package/crds/stackscript.linode.upbound.io_stackscripts.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: stackscripts.stackscript.linode.upbound.io spec: group: stackscript.linode.upbound.io @@ -58,7 +57,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -82,6 +81,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set isPublic: description: This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be @@ -104,21 +104,80 @@ spec: a new Linode with this StackScript. type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: A description for the StackScript. A description + for the StackScript. + type: string + images: + description: A set of Image IDs representing the Images that this + StackScript is compatible for deploying with. any/all indicates + that all available image distributions, including private images, + are accepted. Currently private image IDs are not supported. + An array of Image IDs representing the Images that this StackScript + is compatible for deploying with. + items: + type: string + type: array + x-kubernetes-list-type: set + isPublic: + description: This determines whether other users can use your + StackScript. Once a StackScript is made public, it cannot be + made private. Changing This determines whether other users can + use your StackScript. Once a StackScript is made public, it + cannot be made private. + type: boolean + label: + description: The StackScript's label is for display purposes only. + The StackScript's label is for display purposes only. + type: string + revNote: + description: This field allows you to add notes for the set of + revisions made to this StackScript. This field allows you to + add notes for the set of revisions made to this StackScript. + type: string + script: + description: The script to execute when provisioning a new Linode + with this StackScript. The script to execute when provisioning + a new Linode with this StackScript. + 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 @@ -157,42 +216,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -291,14 +314,22 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: description is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.description) - - message: images is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.images) - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) - - message: script is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.script) + - message: spec.forProvider.description is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.description) + || (has(self.initProvider) && has(self.initProvider.description))' + - message: spec.forProvider.images is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.images) + || (has(self.initProvider) && has(self.initProvider.images))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.script is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.script) + || (has(self.initProvider) && has(self.initProvider.script))' status: description: StackscriptStatus defines the observed state of Stackscript. properties: @@ -334,6 +365,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set isPublic: description: This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be @@ -433,6 +465,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/token.linode.upbound.io_tokens.yaml b/package/crds/token.linode.upbound.io_tokens.yaml index 6d3f3aa..5fd257c 100644 --- a/package/crds/token.linode.upbound.io_tokens.yaml +++ b/package/crds/token.linode.upbound.io_tokens.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: tokens.token.linode.upbound.io spec: group: token.linode.upbound.io @@ -57,7 +56,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -96,21 +95,72 @@ spec: on Linode API docs site, https://www.linode.com/docs/api#oauth-reference type: string type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + expiry: + description: 'When this token will expire. Personal Access Tokens + cannot be renewed, so after this time the token will be completely + unusable and a new token will need to be generated. Tokens may + be created with ''null'' as their expiry and will never expire + unless revoked. When this token will expire. Personal Access + Tokens cannot be renewed, so after this time the token will + be completely unusable and a new token will need to be generated. + Tokens may be created with ''null'' as their expiry and will + never expire unless revoked. Format: 2006-01-02T15:04:05Z' + type: string + label: + description: A label for the Token. The label of the Linode Token. + type: string + scopes: + description: The scopes this token was created with. These define + what parts of the Account the token can be used to access. Many + command-line tools, such as the Linode CLI, require tokens with + access to *. Tokens with more restrictive scopes are generally + more secure. All scopes can be viewed in the Linode API documentation. + The scopes this token was created with. These define what parts + of the Account the token can be used to access. Many command-line + tools, such as the Linode CLI, require tokens with access to + *. Tokens with more restrictive scopes are generally more secure. + Multiple scopes are separated by a space character (e.g., "databases:read_only + events:read_only"). You can find the list of available scopes + on Linode API docs site, https://www.linode.com/docs/api#oauth-reference + 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 @@ -149,42 +199,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -283,8 +297,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: scopes is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.scopes) + - message: spec.forProvider.scopes is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.scopes) + || (has(self.initProvider) && has(self.initProvider.scopes))' status: description: TokenStatus defines the observed state of Token. properties: @@ -358,6 +374,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/user.linode.upbound.io_users.yaml b/package/crds/user.linode.upbound.io_users.yaml index 842bd2f..a230f70 100644 --- a/package/crds/user.linode.upbound.io_users.yaml +++ b/package/crds/user.linode.upbound.io_users.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: users.user.linode.upbound.io spec: group: user.linode.upbound.io @@ -57,7 +56,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -81,9 +80,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array email: @@ -103,9 +99,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array globalGrants: @@ -179,9 +172,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array linodeGrant: @@ -198,9 +188,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array longviewGrant: @@ -217,9 +204,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array nodebalancerGrant: @@ -236,9 +220,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array restricted: @@ -260,9 +241,6 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array username: @@ -282,27 +260,243 @@ spec: (read_only, read_write) The level of access this User has to this entity. If null, this User has no access. type: string - required: - - id - - permissions type: object type: array type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string + 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: + domainGrant: + description: The domains the user has permissions access to. A + set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + email: + description: The email address of the user. The email of the user. + type: string + firewallGrant: + description: The firewalls the user has permissions access to. + A set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + globalGrants: + description: A structure containing the Account-level grants a + User has. + items: + properties: + accountAccess: + description: The level of access this User has to Account-level + actions, like billing information. A restricted User will + never be able to manage users. + type: string + addDatabases: + description: If true, this User may add Databases. If true, + this User may add Databases. + type: boolean + addDomains: + description: If true, this User may add Domains. If true, + this User may add Domains. + type: boolean + addFirewalls: + description: If true, this User may add Firewalls. If true, + this User may add Firewalls. + type: boolean + addImages: + description: If true, this User may add Images. If true, + this User may add Images. + type: boolean + addLinodes: + description: If true, this User may create Linodes. If true, + this User may create Linodes. + type: boolean + addLongview: + description: If true, this User may create Longview clients + and view the current plan. If true, this User may create + Longview clients and view the current plan. + type: boolean + addNodebalancers: + description: If true, this User may add NodeBalancers. If + true, this User may add NodeBalancers. + type: boolean + addStackscripts: + description: If true, this User may add StackScripts. If + true, this User may add StackScripts. + type: boolean + addVolumes: + description: If true, this User may add Volumes. + type: boolean + cancelAccount: + description: If true, this User may cancel the entire Account. + If true, this User may cancel the entire Account. + type: boolean + longviewSubscription: + description: If true, this User may manage the Account’s + Longview subscription. If true, this User may manage the + Account’s Longview subscription. + type: boolean + type: object + type: array + imageGrant: + description: The images the user has permissions access to. A + set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + linodeGrant: + description: The Linodes the user has permissions access to. A + set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + longviewGrant: + description: The longview the user has permissions access to. + A set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + nodebalancerGrant: + description: The NodeBalancers the user has permissions access + to. A set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + restricted: + description: If true, this user will only have explicit permissions + granted. If true, the user must be explicitly granted access + to platform actions and entities. + type: boolean + stackscriptGrant: + description: The StackScripts the user has permissions access + to. A set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + username: + description: The username of the user. The username of the user. + type: string + volumeGrant: + description: The volumes the user has permissions access to. A + set containing all of the user's active grants. + items: + properties: + id: + description: The ID of the entity this grant applies to. + The ID of the entity this grant applies to. + type: number + permissions: + description: The level of access this User has to this entity. + (read_only, read_write) The level of access this User + has to this entity. If null, this User has no access. + type: string + type: object + type: array + 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 @@ -341,42 +535,6 @@ spec: required: - name type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' - 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 @@ -475,10 +633,14 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: email is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.email) - - message: username is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username) + - message: spec.forProvider.email is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.email) + || (has(self.initProvider) && has(self.initProvider.email))' + - message: spec.forProvider.username is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.username) + || (has(self.initProvider) && has(self.initProvider.username))' status: description: UserStatus defines the observed state of User. properties: @@ -727,6 +889,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec diff --git a/package/crds/volume.linode.upbound.io_volumes.yaml b/package/crds/volume.linode.upbound.io_volumes.yaml index ff28338..9f6139c 100644 --- a/package/crds/volume.linode.upbound.io_volumes.yaml +++ b/package/crds/volume.linode.upbound.io_volumes.yaml @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.13.0 name: volumes.volume.linode.upbound.io spec: group: volume.linode.upbound.io @@ -57,7 +56,7 @@ spec: 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 ManagementPolicy field in a future release. Currently, + 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' @@ -169,64 +168,155 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: object - managementPolicy: - default: FullControl - description: 'THIS IS AN ALPHA FIELD. Do not use it in production. - It is not honored unless the relevant Crossplane feature flag is - enabled, and may be changed or removed without notice. ManagementPolicy - specifies the level of control Crossplane has over the managed external - resource. 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. - 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: - - FullControl - - ObserveOnly - - OrphanOnDelete - type: string - 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. + 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: - name: - description: Name of the referenced object. + label: + description: The label of the Linode Volume The label of the Linode + Volume. type: string - policy: - description: Policies for referencing. + linodeId: + description: The ID of a Linode Instance where the Volume should + be attached. The Linode ID where the Volume should be attached. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. 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 + 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 - required: - - name + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + 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 + region: + description: The region where this volume will be deployed. Examples + are "us-east", "us-west", "ap-south", etc. See all regions here. + This field is optional for cloned volumes. Changing . The region + where this volume will be deployed. + type: string + size: + description: Size of the Volume in GB. Size of the Volume in GB + type: number + sourceVolumeId: + description: 'The ID of a Linode Volume to clone. NOTE: Cloned + volumes must be in the same region as the source volume. The + ID of a volume to clone.' + type: number + tags: + description: A list of tags applied to this object. Tags are for + organizational purposes only. An array of tags applied to this + object. Tags are for organizational purposes only. + items: + type: string + type: array + x-kubernetes-list-type: set type: object - providerRef: - description: 'ProviderReference specifies the provider that will be - used to create, observe, update, and delete this managed resource. - Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + 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. @@ -357,8 +447,10 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: label is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' status: description: VolumeStatus defines the observed state of Volume. properties: @@ -407,6 +499,7 @@ spec: items: type: string type: array + x-kubernetes-list-type: set type: object conditions: description: Conditions of the resource. @@ -441,6 +534,9 @@ spec: - type type: object type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map type: object required: - spec