diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4af948c5e..3b80d31b1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,37 +1,37 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - version: 2 updates: +# GitHub Actions +- package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "weekly" + groups: + all-github-actions: + patterns: [ "*" ] + commit-message: + prefix: ":seedling:" + labels: + - "ok-to-test" - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - # Workflow files stored in the - # default location of `.github/workflows` - directory: "/" - schedule: - interval: "weekly" - commit-message: - prefix: ":seedling:" - labels: - - "ok-to-test" - - # Maintain dependencies for go - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: "weekly" - commit-message: - prefix: ":seedling:" - # Ignore K8 packages as these are done manually - ignore: - - dependency-name: "k8s.io/api" - - dependency-name: "k8s.io/apiextensions-apiserver" - - dependency-name: "k8s.io/apimachinery" - - dependency-name: "k8s.io/client-go" - - dependency-name: "k8s.io/component-base" - labels: - - "ok-to-test" - +# Go modules +- package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" + # group all dependencies with a k8s.io prefix into a single PR. + groups: + all-go-mod-patch-and-minor: + patterns: [ "*" ] + update-types: [ "patch", "minor" ] + ignore: + # Ignore k8s and its transitives modules as they are upgraded manually. + - dependency-name: "k8s.io/*" + update-types: [ "version-update:semver-major", "version-update:semver-minor" ] + commit-message: + prefix: ":seedling:" + labels: + - "ok-to-test" diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3d9e3fda0..eb24f6b6b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -23,14 +23,16 @@ jobs: working-directory: - "" steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7 + - name: Calculate go version + id: vars + run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2 with: - go-version: "1.22" - cache: false - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 + go-version: ${{ steps.vars.outputs.go_version }} - name: golangci-lint - uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # tag=v4.0.0 + uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # tag=v6.1.0 with: version: v1.57.2 args: --out-format=colored-line-number diff --git a/.github/workflows/pr-dependabot.yaml b/.github/workflows/pr-dependabot.yaml index 0bb792081..a9bfb6431 100644 --- a/.github/workflows/pr-dependabot.yaml +++ b/.github/workflows/pr-dependabot.yaml @@ -19,11 +19,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7 + - name: Calculate go version + id: vars + run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT - name: Set up Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2 with: - go-version: '1.22' + go-version: ${{ steps.vars.outputs.go_version }} - name: Update all modules run: make modules - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # tag=v9.1.4 diff --git a/.github/workflows/pr-gh-workflow-approve.yaml b/.github/workflows/pr-gh-workflow-approve.yaml new file mode 100644 index 000000000..f493fd400 --- /dev/null +++ b/.github/workflows/pr-gh-workflow-approve.yaml @@ -0,0 +1,42 @@ +name: PR approve GH Workflows + +on: + pull_request_target: + types: + - edited + - labeled + - reopened + - synchronize + +permissions: {} + +jobs: + approve: + name: Approve ok-to-test + if: contains(github.event.pull_request.labels.*.name, 'ok-to-test') + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: Update PR + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + continue-on-error: true + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const result = await github.rest.actions.listWorkflowRunsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + event: "pull_request", + status: "action_required", + head_sha: context.payload.pull_request.head.sha, + per_page: 100 + }); + + for (var run of result.data.workflow_runs) { + await github.rest.actions.approveWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: run.id + }); + } diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..9adc4ebf6 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: Upload binaries to release + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 (not envtest-*) + +permissions: + contents: write + +jobs: + build: + name: Upload binaries to release + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7 + - name: Calculate go version + id: vars + run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT + - name: Set up Go + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2 + with: + go-version: ${{ steps.vars.outputs.go_version }} + - name: Generate release binaries + run: | + make release-controller-gen + - name: Release + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # tag=v2.0.8 + with: + draft: false + files: out/* diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index a652a8c13..d5f7946e0 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -17,10 +17,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # tag=v4.1.3 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # tag=v44.3.0 + uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c # tag=v44.5.7 with: files: | hack/envtest/_matrix/*.yaml @@ -40,7 +40,7 @@ jobs: run: | make release-envtest KUBERNETES_VERSION=${{ env.KUBERNETES_VERSION }} - name: Release - uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # tag=v2.0.4 + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # tag=v2.0.8 with: tag_name: envtest-${{ env.KUBERNETES_VERSION }} draft: false @@ -50,7 +50,7 @@ jobs: out/envtest-*.tar.gz.sha512 fail_on_unmatched_files: true - name: Create Pull Request - uses: peter-evans/create-pull-request@9153d834b60caba6d51c9b9510b087acf9f33f83 # tag=v6.0.4 + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # tag=v6.1.0 with: commit-message: Promote envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }} title: ":seedling: Promotion of envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}" diff --git a/Makefile b/Makefile index 3f07ea451..961ad9c41 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,11 @@ SHELL:=/usr/bin/env bash .DEFAULT_GOAL:=help +# +# Go. +# +GO_VERSION ?= 1.22.5 + # Use GOPROXY environment variable if set GOPROXY := $(shell go env GOPROXY) ifeq ($(GOPROXY),) @@ -34,6 +39,13 @@ export GOPROXY # Active module mode, as we use go modules to manage dependencies export GO111MODULE=on +# Hosts running SELinux need :z added to volume mounts +SELINUX_ENABLED := $(shell cat /sys/fs/selinux/enforce 2> /dev/null || echo 0) + +ifeq ($(SELINUX_ENABLED),1) + DOCKER_VOL_OPTS?=:z +endif + # Tools. ENVTEST_DIR := hack/envtest ENVTEST_MATRIX_DIR := $(ENVTEST_DIR)/_matrix @@ -76,12 +88,20 @@ test: ## Run the test.sh script which will check all. TRACE=1 ./test.sh test-all: + $(MAKE) verify-modules $(MAKE) test .PHONY: modules modules: ## Runs go mod to ensure modules are up to date. go mod tidy +.PHONY: verify-modules +verify-modules: modules ## Verify go modules are up to date + @if !(git diff --quiet HEAD -- go.sum go.mod); then \ + git diff; \ + echo "go module files are out of date, please run 'make modules'"; exit 1; \ + fi + ## -------------------------------------- ## Cleanup / Verification ## -------------------------------------- @@ -100,7 +120,7 @@ clean-release: ## Remove all generated release binaries. rm -rf $(RELEASE_DIR) ## -------------------------------------- -## Envtest Build +## Release ## -------------------------------------- RELEASE_DIR := out @@ -135,3 +155,37 @@ release-envtest-docker-build: $(RELEASE_DIR) ## Build the envtest binaries. --tag sigs.k8s.io/controller-tools/envtest:$(KUBERNETES_VERSION)-$(OS)-$(ARCH) \ --output type=local,dest=$(RELEASE_DIR) \ . + +.PHONY: release-controller-gen +release-controller-gen: clean-release ## Build controller-gen binaries. + RELEASE_BINARY=controller-gen-linux-amd64 GOOS=linux GOARCH=amd64 $(MAKE) release-binary + RELEASE_BINARY=controller-gen-linux-arm64 GOOS=linux GOARCH=arm64 $(MAKE) release-binary + RELEASE_BINARY=controller-gen-linux-ppc64le GOOS=linux GOARCH=ppc64le $(MAKE) release-binary + RELEASE_BINARY=controller-gen-linux-s390x GOOS=linux GOARCH=s390x $(MAKE) release-binary + RELEASE_BINARY=controller-gen-darwin-amd64 GOOS=darwin GOARCH=amd64 $(MAKE) release-binary + RELEASE_BINARY=controller-gen-darwin-arm64 GOOS=darwin GOARCH=arm64 $(MAKE) release-binary + RELEASE_BINARY=controller-gen-windows-amd64.exe GOOS=windows GOARCH=amd64 $(MAKE) release-binary + +.PHONY: release-binary +release-binary: $(RELEASE_DIR) + docker run \ + --rm \ + -e CGO_ENABLED=0 \ + -e GOOS=$(GOOS) \ + -e GOARCH=$(GOARCH) \ + -e GOCACHE=/tmp/ \ + --user $$(id -u):$$(id -g) \ + -v "$$(pwd):/workspace$(DOCKER_VOL_OPTS)" \ + -w /workspace \ + golang:$(GO_VERSION) \ + go build -a -trimpath -ldflags "-extldflags '-static'" \ + -o ./out/$(RELEASE_BINARY) ./cmd/controller-gen + +## -------------------------------------- +## Helpers +## -------------------------------------- + +##@ helpers: + +go-version: ## Print the go version we use to compile our binaries and images + @echo $(GO_VERSION) diff --git a/README.md b/README.md index 6029de6ad..878de69ee 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,26 @@ export `GO111MODULE=on`. See [VERSIONING.md](VERSIONING.md). + +## Compatibility + +Every minor version of controller-tools has been tested with a specific minor version of client-go. A controller-tools minor version *may* be compatible with +other client-go minor versions, but this is by chance and neither supported nor tested. In general, we create one minor version of controller-tools +for each minor version of client-go and other k8s.io/* dependencies. + +The minimum Go version of controller-tools is the highest minimum Go version of our Go dependencies. Usually, this will +be identical to the minimum Go version of the corresponding k8s.io/* dependencies. + +Compatible k8s.io/*, client-go and minimum Go versions can be looked up in our [go.mod](go.mod) file. + +| | k8s.io/*, client-go | minimum Go version | +|----------|:-------------------:|:------------------:| +| CR v0.16 | v0.31 | 1.22 | +| CR v0.15 | v0.30 | 1.22 | +| CR v0.14 | v0.29 | 1.20 | +| CR v0.13 | v0.28 | 1.20 | +| CR v0.12 | v0.27 | 1.20 | + ## Community, discussion, contribution, and support Learn how to engage with the Kubernetes community on the [community page](http://kubernetes.io/community/). diff --git a/envtest-releases.yaml b/envtest-releases.yaml index 22280d64a..6225b496f 100644 --- a/envtest-releases.yaml +++ b/envtest-releases.yaml @@ -65,3 +65,355 @@ releases: envtest-v1.30.0-windows-amd64.tar.gz: hash: bf0846337d2fb85b9676ae5eb47c676e9315612dccba2e4fc748d6c76bc1228321cfa182274e9773d649c2298f624f62278032c547736159a8695b1712de64d0 selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.0/envtest-v1.30.0-windows-amd64.tar.gz + v1.29.3: + envtest-v1.29.3-darwin-amd64.tar.gz: + hash: 56614d52e534520b03257c4c54977e6ece5f12dec135c3e469837dc06f0ff026208fe172d05e9b8d865daa4cdc033c2c85f3d7f547e0b2c385c7409896ed9b14 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-darwin-amd64.tar.gz + envtest-v1.29.3-darwin-arm64.tar.gz: + hash: e5c720980500915e720ff73b28d8b5a969f268030d0b7f9f3024337d8529160ac1ce3f740e62f37ed778420701c55f1006a87053be639fd5f307a29b0e9ff465 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-darwin-arm64.tar.gz + envtest-v1.29.3-linux-amd64.tar.gz: + hash: 69267f765305436306221abbf63597c3383ae22fb8b893ec5db28b12e00cf0a690236e9038cc33b475d46ce2c9ac12cae871442dac3ec92b0c58c21fc0d8c1bb + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-linux-amd64.tar.gz + envtest-v1.29.3-linux-arm64.tar.gz: + hash: a1a46ecbf3104957a74f2ed57df5a033530cc0123b1b893350d0fcabc2539ee884729ad2f3bbc216cfb1fcbdec11a2fcb239a0a04abbd3d712b98c46287f37a3 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-linux-arm64.tar.gz + envtest-v1.29.3-linux-ppc64le.tar.gz: + hash: 87fd6573f4a22e5764025c4c399cab1b5c6f338e4ebce17199095cd464140c1ddb659fc15251bef612f338a0ea2befc28e816a891501fd262de40ea165d4a9a5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-linux-ppc64le.tar.gz + envtest-v1.29.3-linux-s390x.tar.gz: + hash: 72fbe733a2758de7ad46994d60008c49e9f84796eed230179262ca1d91b6e2932069a7cc8b2fa9dda684fbdf73e6825bf5e5960f4706c009aa503480649487e7 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-linux-s390x.tar.gz + envtest-v1.29.3-windows-amd64.tar.gz: + hash: 4367ebbf1811e037f5e856743523559717880981bfc2e2a23afa54665474bc7c4a5a36f6f8c76fb8ce695e54886055a57b0d3e8f9073893b2f246a56232b44e4 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.3/envtest-v1.29.3-windows-amd64.tar.gz + v1.25.0: + envtest-v1.25.0-darwin-amd64.tar.gz: + hash: 8213ef1b160ccecb80cf67334b682d84886365c2a0f9864a17956d7c56a8244497364254cee57a81e3ce697a3feeeb0d27c55191dcbac54efa6f9a8b48769cce + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-darwin-amd64.tar.gz + envtest-v1.25.0-darwin-arm64.tar.gz: + hash: 0ee5aba210bb060745f82c48ad9bca6e166a9eeb684501a979fa3af6a75435ee1c4c78f851964724eb2b11da7967d4ea7d29be2a7c4bdf850237d6d881cfa2d3 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-darwin-arm64.tar.gz + envtest-v1.25.0-linux-amd64.tar.gz: + hash: 5ca5617298a78b958078ef108efc38bb73297b53c013537cc718ea5fc0f40e34cccf74fb0d281ab1069c8cfd271b7cec1dcd77ff7e371a2b98be4efb6a4985f1 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-linux-amd64.tar.gz + envtest-v1.25.0-linux-arm64.tar.gz: + hash: 2c743ce14b3cff2db651dbf009103d5a53da9890e6a6fec3bcbaf01c415017d29ad3e2c676797aad2991522a9a1b2ef72656f9a9b392f28f4892ce0ff3f99a08 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-linux-arm64.tar.gz + envtest-v1.25.0-linux-ppc64le.tar.gz: + hash: de4adf0fd2d806667c13f329e8775187bbb69b2717c462fb8b860301612587d833029a007e6df250620630f39f7fadcb5a7fdbca6d9dc4fcc68057e9654b5d7a + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-linux-ppc64le.tar.gz + envtest-v1.25.0-linux-s390x.tar.gz: + hash: aa34358ff97e62250b20fbc0dfc4657bc7b8a868d922ffd49244184370ccb21ff1449c92451c2981fa3883f9d641e61cea3c66ac2e00b3cbe8e2e1ca8d1a622e + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-linux-s390x.tar.gz + envtest-v1.25.0-windows-amd64.tar.gz: + hash: d2f4c4aafefef69f964605dbb951f0a1dd5740a20770e2ace3111cb8c98daf3d72f05ea2d53c1549f752e54c0d7d02f555d67016d6bc666271a7db22f2120c08 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.25.0/envtest-v1.25.0-windows-amd64.tar.gz + v1.26.0: + envtest-v1.26.0-darwin-amd64.tar.gz: + hash: 293615d95d12c0da47123caf8389bcc1b1d7ae3221c23b98bd26b9aa10d5608cc9c7f8d5c23a376cbe13683ab11e30142baefcbc8fbd8167f3fa615dacbf4350 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-darwin-amd64.tar.gz + envtest-v1.26.0-darwin-arm64.tar.gz: + hash: 9b975180dfa50f562e3e63125d077528358670af3a1e09eda12edd6cf29d8c6a6b1efdccbb07222d18e32014f7a50a9c9d66c050350a338115aa65bd37d84f41 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-darwin-arm64.tar.gz + envtest-v1.26.0-linux-amd64.tar.gz: + hash: 115275a461e5fb09515f4d87a12b07ccdf1662ed79a89af085ec965af1a2e9dd5ddcfa9399da0c409de29b7f2aede29d9af6cb91eeb80bebbeb09dc56a9ab36f + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-linux-amd64.tar.gz + envtest-v1.26.0-linux-arm64.tar.gz: + hash: 7703a8a5072bf8744436036e744cb93f79d91d49d3de5b407cdd59ee49894a3461a1eeb1bf4fe7afc4b2a2d505c62c058d5410fda95cf93a1a6fab8fd33a8687 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-linux-arm64.tar.gz + envtest-v1.26.0-linux-ppc64le.tar.gz: + hash: 8219631136509c862f25a5e12d768315d8f0d7b8ec3b35960c47c0a520ce2461932701156e1c1daa014a6f26161e2566937c53efb4a42a9a3240ee3ed3e35c98 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-linux-ppc64le.tar.gz + envtest-v1.26.0-linux-s390x.tar.gz: + hash: 5ebc3d1afa7361a38d3350506f23ae9aca25a6befa88f57eccc1e485785b86435287cda6fb5160d26f3ea812c018a859438d2bc5cd650d4a9af46f97a126b66d + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-linux-s390x.tar.gz + envtest-v1.26.0-windows-amd64.tar.gz: + hash: b80f33b5c50a80578907164e4825afeebef83744470e39e6005b35d56431de803a784d908f79f22bed80de0922932ac5121c3bdc6d67f283c03cb741b72d6776 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.0/envtest-v1.26.0-windows-amd64.tar.gz + v1.27.1: + envtest-v1.27.1-darwin-amd64.tar.gz: + hash: 663996ba95594c2ee97b63e43568567d48bad8bb04598bc27e23f0a64a6525d673bc403817a7bd4dfb043f7feb7f9f31e787e71123187e35344ccb17179b9215 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-darwin-amd64.tar.gz + envtest-v1.27.1-darwin-arm64.tar.gz: + hash: adea3db3aa2174743251a6184cfad0b74224073e618f19dfd80c4d031c1352a18810d652a5c42b10e13d8db85e40679dae83448238c22eeff04b5aacd6530011 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-darwin-arm64.tar.gz + envtest-v1.27.1-linux-amd64.tar.gz: + hash: 607ffc315583a654a7ce6d9ee1bc0ce18ba85750a13f7d972effe253a53e3bb9910f5fb083ebafd7802d39192226493013b9c88108ceeaaa8192323099cf7a9e + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-linux-amd64.tar.gz + envtest-v1.27.1-linux-arm64.tar.gz: + hash: 4505684de16e556fea03ea2a9c60bd543dd263b3d07e56bfa2391f09a05edb7c65da3c4544e1d6b6b14b05b9ed991df88385e59911399620ae9b660d56f4a848 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-linux-arm64.tar.gz + envtest-v1.27.1-linux-ppc64le.tar.gz: + hash: bf0f8258979400304bc7bd20f755bbe860240edd0f059b5aca8400d26a45b7d3aa0b2f3716bcfe07fedd33d96372d81e6e4563a4f960c7c1d090dd4b39730dbb + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-linux-ppc64le.tar.gz + envtest-v1.27.1-linux-s390x.tar.gz: + hash: fce63eb0ff3f440093f572eae10d3a97213ce713b81ab8dcc1dc59b6b62d72c496fbf51c8d2621a5238f1afea7f33f1e419ea30ec9681d15cfcdbd24c2d3674d + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-linux-s390x.tar.gz + envtest-v1.27.1-windows-amd64.tar.gz: + hash: a8bcd4586ed1d94da74588f909d79dab817cc729ee01ff499362d11a2c0355e065bf3ae1d1c801035a2b47920b0dab24c795991b7e4017512cf58a236ef496fe + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.27.1/envtest-v1.27.1-windows-amd64.tar.gz + v1.29.0: + envtest-v1.29.0-darwin-amd64.tar.gz: + hash: e18607924960a21ad72cc76a0af1dd07f027b5644e272956489a6e12c7e3bcb789a791127915733ccfa17cd1a4f1b7cb8192d57244b42a40ca9f8a5dce98bc31 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-darwin-amd64.tar.gz + envtest-v1.29.0-darwin-arm64.tar.gz: + hash: 27cac8ea6ffbd4ff625195697a83acf773a6b6f0ba76ef5d4af452f3ae1ce946f1d35944780c1e1340be19e1cfee9a948c8c900278ac1712db42aa3d7063bb4a + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-darwin-arm64.tar.gz + envtest-v1.29.0-linux-amd64.tar.gz: + hash: 256020ab84ee6d8d55bd7a25f6abbfeefebade0d8d17cd7c3d1c3b08a9b4859454e97f4972dae8ba31388a4c70c5cc0828c4ff91308d76d65286a592586fbf96 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-linux-amd64.tar.gz + envtest-v1.29.0-linux-arm64.tar.gz: + hash: f1041551205a5d2b55cea4a9b3c6ae00de554389bafd87351ac891cf2f01a48cc1f18033bdb83e6b4f73bc249a2081868cc9f8c1f26240587cd3885f1f3eccc2 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-linux-arm64.tar.gz + envtest-v1.29.0-linux-ppc64le.tar.gz: + hash: 641a1887c45adde184fca9cda44e63ea5928152a0aa1010713de8edd8034e2f092300d457db0d0456fce36f27b2904408018254689998e4c0b7df63752a3ed52 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-linux-ppc64le.tar.gz + envtest-v1.29.0-linux-s390x.tar.gz: + hash: 85770f39d0e2af74fe95f1e4521769eebe8060fbe605cd4e4df689b83b6d3d5cc9903f025c643e4ac3fac37528e90f0e4da91f3fa879c20e811f35f16ce8e259 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-linux-s390x.tar.gz + envtest-v1.29.0-windows-amd64.tar.gz: + hash: fd82a876f27a9b2888315e94c46da1704a3d9f1ebca14df3deab09eede7214c17a735d795fd2e2eaf62a6d6ec6c44a2ffc2d3bd5aa5b18889c61fbc64df9d1f9 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.0/envtest-v1.29.0-windows-amd64.tar.gz + v1.26.1: + envtest-v1.26.1-darwin-amd64.tar.gz: + hash: c41ff9d03763c5c08ce879a20480d9a9254a9e7f581056cf5cecf6521845f171e0ce17ec3ce236969e9e0c4cec792dc2d9b2afd71f6613ded192988f1e162b81 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-darwin-amd64.tar.gz + envtest-v1.26.1-darwin-arm64.tar.gz: + hash: e160a6c863b62c301582b6635d9dbea4275025639f5895b11fc61b11a9986d401cf56695ae8f7600dc17c5aa5900c90dafb5c900fb7166271458948eed6df68f + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-darwin-arm64.tar.gz + envtest-v1.26.1-linux-amd64.tar.gz: + hash: 9ddb3e172759be64b0748c0d103a976dfd6aecdcaa0c8fff7724a89b7426b3e00863b8782b3dff16f04768be9e56acbda3755e7c7c00571bc3a8d100b25e04b1 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-linux-amd64.tar.gz + envtest-v1.26.1-linux-arm64.tar.gz: + hash: 988f35b688c50ce49056d7549f0532523973b5e7e3629631cda74f2e7c7ad3715cfb8e746ce48e9b366aaad57ac1d191f9735e59e491986bb2d50ef85001bed4 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-linux-arm64.tar.gz + envtest-v1.26.1-linux-ppc64le.tar.gz: + hash: bf216cbb7bfe453c06d55c4d0dca9765bdede5485eccd67fb87a2178d41ab2f9a04be9e6c57b0031c3fa71b8e34490797b4f71a6bbcd5c324791c147ffd0fc53 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-linux-ppc64le.tar.gz + envtest-v1.26.1-linux-s390x.tar.gz: + hash: c9b4c833600aec7f5923690bd474eddcde75e75446e6324b0c800a5b089413cf3402cc7f72d2154dbbddb00b1e45972042e717af5a31473bcab12f072446c344 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-linux-s390x.tar.gz + envtest-v1.26.1-windows-amd64.tar.gz: + hash: a1394eae03b0eddaf04d08482d823a7f507db67ca9ed7dd775c6953457cd111f7042019a0fbbc07fcb8c52ec3804933a0c6d8643c8336fd8d66a063fa7a43d89 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.26.1/envtest-v1.26.1-windows-amd64.tar.gz + v1.29.1: + envtest-v1.29.1-darwin-amd64.tar.gz: + hash: c6c5065eef420239823288fe9d71a6fecf398737149ef32b38ba649b2b00ebf6ad2660dbd31f92bd92925cb82a93acc7464e0ff03354f60fb8feb2a204066895 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-darwin-amd64.tar.gz + envtest-v1.29.1-darwin-arm64.tar.gz: + hash: 402029dc5e15b9033e6046457269aac845f98b801dac7959d5e0390ee9ef95c8225094f7f2f3e9666fa2bf8beca75980030237383614088365bf7ea8006833f3 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-darwin-arm64.tar.gz + envtest-v1.29.1-linux-amd64.tar.gz: + hash: ee6d019d3f0209dea2c5871508137bba9b8d3dee7ea287a7dcdfa520aca9de62fe25ed36e9bd693e2633b86adc93944b34524d2686e9a2cfe0e3159ab04e2fcc + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-linux-amd64.tar.gz + envtest-v1.29.1-linux-arm64.tar.gz: + hash: 7a4aea49a69640466295600ff2d0e66d9f4f720a8247aa63ea84c8fc1fdea2312653b4ae92bf533e51783cc7fb1870da78689a2ef8747116a83bd4adda1d7c12 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-linux-arm64.tar.gz + envtest-v1.29.1-linux-ppc64le.tar.gz: + hash: 0feb6ca2d886bf9ebc917b8cc5ba0233072d92d220d335e8f1a0cc8d74d1d1591e55dfbfc605a9aa63d027a01d8cc5d1a860010cf7fe1d9d846f7868b4213550 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-linux-ppc64le.tar.gz + envtest-v1.29.1-linux-s390x.tar.gz: + hash: e36f7982c0e6507c2feec737d66875fd0daa95e4263f22f7311e07b29c953f89f192ca8ddaf6a0bc22c88ed38444012f590d6a84e8d01138c97a86916f4d7ce6 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-linux-s390x.tar.gz + envtest-v1.29.1-windows-amd64.tar.gz: + hash: c5b65cee850dcb70ea2ecea49b7411e3b83f640a54ea2ce6c029c22b802e083fbefd92989a3377917233a7d5157dc6fccbbf1916ce8008515641c32f2c9530c5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.1/envtest-v1.29.1-windows-amd64.tar.gz + v1.24.2: + envtest-v1.24.2-darwin-amd64.tar.gz: + hash: 8d0a73308daafbb65ed97449bce81e09d249045d4594ce4e4050cc8c5f2aa3147bf4a4fbda6b73a18b0a0cba4f88a01a4e0b9f66c371eba924e3bb36fe9860d5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-darwin-amd64.tar.gz + envtest-v1.24.2-darwin-arm64.tar.gz: + hash: f2eb57ac07a0eeb97d6a8e36bc397eb0b5bcaa432ccadb5a574d5684dd482d2121a193f3dfdf1ee04b4df7cdead8d899c5a57e753283ea406bad560063dbabb7 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-darwin-arm64.tar.gz + envtest-v1.24.2-linux-amd64.tar.gz: + hash: 2b330c1802f7fd858a8a6e97141b07a4260eec135712c8913d36bb8e48f8dbfa45a8e5b13c15e7c20127a55d75bfda5007bf018e853cf156e3ac2b019d492892 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-linux-amd64.tar.gz + envtest-v1.24.2-linux-arm64.tar.gz: + hash: 5cda1ba1f734a067e8b823130fca9c6bec151106aa1d32856ef7524afdfdd733e6c5c87b1b8d41c293083fd64ac668db8b74dca26554e0c99e0120e6f99f9e21 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-linux-arm64.tar.gz + envtest-v1.24.2-linux-ppc64le.tar.gz: + hash: c2b72f3dbdda268aadb86c3abe78af412c74a750b652b5c326cab6b06a8ede9c2f57dfad16c9e6fddc68c56228ab0a61b9da0131b53f4de6abcd465f272eaf0b + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-linux-ppc64le.tar.gz + envtest-v1.24.2-linux-s390x.tar.gz: + hash: 1dc3f4b7375fdb703c1dd84e302559c7245c0676250e26f7396ad145f14162897c327812a7e4336b3b233b329338b58d3340f288490918c25883f1c2df0689ad + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-linux-s390x.tar.gz + envtest-v1.24.2-windows-amd64.tar.gz: + hash: b9708002e6265eb72ee3ba8a229624dbb1328881f08e53855b2d22fb334d6b40af3de11b9598f3a4c6829bbb6c787aa4556479855354eda1e899df34a2e93a5c + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.2/envtest-v1.24.2-windows-amd64.tar.gz + v1.24.1: + envtest-v1.24.1-darwin-amd64.tar.gz: + hash: d00c0a8ac45d3c0bad1294ace3d8502681d84e48c7dbafb7f809371c8d2e517174fc5bf7ba23cd0b2b0965835abe9afc27b61725ffee90cce6119093f1428e73 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-darwin-amd64.tar.gz + envtest-v1.24.1-darwin-arm64.tar.gz: + hash: fa1dfc2fd6e53869f55880aa9eb8dc45281559dea31079ab6e8bd6a55ad0e138477d5e77662acaf4ed90543223e1fa7f699e607a4ea1325f7ed187eeda7047f8 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-darwin-arm64.tar.gz + envtest-v1.24.1-linux-amd64.tar.gz: + hash: bf99a87747430c7369fcfe63638f9a10c3b6a4581cfe93dec5fdd58036e270360b48bcceba1dc57b2439ba9c9d50dc330128737136893a0ed9b67babd82f3090 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-linux-amd64.tar.gz + envtest-v1.24.1-linux-arm64.tar.gz: + hash: f654eda063fa216230460664ab934ddb3f26816565bc3ff78a2fe6ad791a784c4fa5b097644e2215eb08d29fc84b7adf6bd3e88f1d868f1cc239ce2eff8c1faa + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-linux-arm64.tar.gz + envtest-v1.24.1-linux-ppc64le.tar.gz: + hash: 567075b7d40826539eaef36b4de78eb2b3007634d2925becf6144651b0fb7d523d116f3b0a3fc644a72e13d472410d6b9a5a36f0304e069d53709537c203db35 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-linux-ppc64le.tar.gz + envtest-v1.24.1-linux-s390x.tar.gz: + hash: 55c290a11e0cc7259bb4c4890781fb97c7e31ae35c727dea6403335d1df7f9104b4f765f5c3dd721a10393515928b5971ea5a310247ae04246db561021b0e287 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-linux-s390x.tar.gz + envtest-v1.24.1-windows-amd64.tar.gz: + hash: 0074a2ae634d9a6bc0e8282471c5908b0469f5d578672c99e89107cc436a4e1173e747ff6b500016ef41aceb2815b74156f1d0c4e2e5acb79e07614c5c3c8600 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.24.1/envtest-v1.24.1-windows-amd64.tar.gz + v1.28.3: + envtest-v1.28.3-darwin-amd64.tar.gz: + hash: 818ff0f9149338df6c15e42ecb88b24745a3f340a989d8a70b5e3c9706a12c19b4a7de873feb778020665dd7975ec9beddb7aa5e9c60dca3782962253b57a1db + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-darwin-amd64.tar.gz + envtest-v1.28.3-darwin-arm64.tar.gz: + hash: eb9aea2b6dd196b84d8bed76bb0da8b4c8e9f11dd96e5d7224ebdb3a63f61a4cceafe21774c78e555fc3b32505e7973e1cf3fa9e87103546e088f7e86128c5c6 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-darwin-arm64.tar.gz + envtest-v1.28.3-linux-amd64.tar.gz: + hash: db7aafadfa3c1cb5c7bd82f375425b11d6652129580ac507b2e2e290c1018ef18737352d506903503a1d47cc1569f050dff71ba22f06057f7a2ae318afd9f4e5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-linux-amd64.tar.gz + envtest-v1.28.3-linux-arm64.tar.gz: + hash: a5b9945d5b209c68cf88b8f5f4baacdd759d5b09536b4b05357a66bb85ee6da245bd1af1673b479075c7eb0b46041af1aae2a07cefaa5fcfe5f55dfe09984f96 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-linux-arm64.tar.gz + envtest-v1.28.3-linux-ppc64le.tar.gz: + hash: c3332e33361c333ec6cf525959ad26b8d854b6859714020b068a4340427eb9c88117825857808cbb31dc094c0fae2b47830427c6cd6b3be9d50e864cfedabab0 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-linux-ppc64le.tar.gz + envtest-v1.28.3-linux-s390x.tar.gz: + hash: 32dc0171444f762ef746d09b722cd421d56da514191197af59d8677281cd7aa9371cfc95f2f89781aa89eab967dd9405e89ecdc3ff69bd61b16366433870bd54 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-linux-s390x.tar.gz + envtest-v1.28.3-windows-amd64.tar.gz: + hash: 8ebe28deabbdd635477fec8b2d313dc4d4e9a871bfdbf36614d357dc4883d34523f9b7e4c21ddf665aaad5b99d9fdf5fb64eb3caf52e676b3720b45ec023028b + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.28.3/envtest-v1.28.3-windows-amd64.tar.gz + v1.23.5: + envtest-v1.23.5-darwin-amd64.tar.gz: + hash: 0a54def5dee969866694e38400f3daee052dc61fcdb8a93a402a957e9d8e297d934a82ea2a96de80c4e6a59858afc7ad577a6eebc422675933bc7632434b2d69 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-darwin-amd64.tar.gz + envtest-v1.23.5-darwin-arm64.tar.gz: + hash: cb40666cd83d8bbf464ef99835d353d7cd02622c29fcb2fdbbbcb8880bbe02b35bfb10667fb8e9dc6e00bc4ab50727e6ce1486b1e98442865f9daebc9eb58cd6 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-darwin-arm64.tar.gz + envtest-v1.23.5-linux-amd64.tar.gz: + hash: 9c9ef4082877558c28cc0b8f5bef7f20dbb62749865ae5397135df5c185d15d59cbb13b070813e2761e9de45b296909678856770148af5ee55a45d413246c44e + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-linux-amd64.tar.gz + envtest-v1.23.5-linux-arm64.tar.gz: + hash: 471bc06e7af168c34c06673d6ce5018eb43d7bb38a34bf50001e69b4e947d5b6350ae68887028985fd2566e6adfdc8637b4b97406ea87caf0cdc5fa28a832b59 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-linux-arm64.tar.gz + envtest-v1.23.5-linux-ppc64le.tar.gz: + hash: bf1e3b76a1ca2cc602c47d2cd6e517268d28f54ef4fab457938aeac6a0f721503341371ddeec14f186870be4fd16aaa175d780814589a79377ad165ef0f8c6e1 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-linux-ppc64le.tar.gz + envtest-v1.23.5-linux-s390x.tar.gz: + hash: f668d972e7d5715b8314c99804e33ce513411c41ef70b30df145fa10c1509e2f2b5493a99dddd63beba4b9f3c26b8389e03c74c46944077fdeb22b6d785958f6 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-linux-s390x.tar.gz + envtest-v1.23.5-windows-amd64.tar.gz: + hash: d69058b3dc4c785c2c2c6a7a650c909751150a769e8f6720774f4cb0645a120064d1b419edcd43406dfca7641d51ef18fd6f49c123fc70ecc6f54f569a651d79 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.23.5/envtest-v1.23.5-windows-amd64.tar.gz + v1.29.5: + envtest-v1.29.5-darwin-amd64.tar.gz: + hash: 7abeaf5c0f1c2b6fa2ab8ff0ffd8eb1bd1db638243fa8f2183cb9dbde84744c5e8ba4dd6636b53d1210c6e8731dc29419fceb1108f86b872cb3c1afacaa2a3c4 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-darwin-amd64.tar.gz + envtest-v1.29.5-darwin-arm64.tar.gz: + hash: 44d301abae4421b1e4427de4153b7305a2392302dfda79242633eb0c44029ce60f607a91da8412ae96ea8ef33d5fbe642f1c5a72e60ca5ffa8e606c2ef31f056 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-darwin-arm64.tar.gz + envtest-v1.29.5-linux-amd64.tar.gz: + hash: b11190b9dd52e473ce57f780a145fc6e2250794a2a9fed4db9b4b13043df436a5fc66c077f1eb4808761764066a1936da27660c62d02ab5925b264f3f7caf7b5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-linux-amd64.tar.gz + envtest-v1.29.5-linux-arm64.tar.gz: + hash: 7cb476a57076775faec1ef6ea264bd3bb954432da0166b93c92f517869bceb51336121b4ec050bef5e5a5a1ca4dfbf3d73d56fd90acc56c90c09ed064eb92d7a + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-linux-arm64.tar.gz + envtest-v1.29.5-linux-ppc64le.tar.gz: + hash: a63974204e3bbb911144b96a520e2f116d8627279b975423d86b24336267e47f3132a0f39d5105bc7d49cd2831c017ea8bdca62467438391c0fffd48f4468bd3 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-linux-ppc64le.tar.gz + envtest-v1.29.5-linux-s390x.tar.gz: + hash: 05340cc544e496c7ed5b900f82d3f5cf16c781aa00b187dce787900388e82515fe4aff818fc603f4a1faf514c9ae26179df53567a8f65b0d7f81f4f23903b4ce + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-linux-s390x.tar.gz + envtest-v1.29.5-windows-amd64.tar.gz: + hash: d440e3af67f4ea5f545981afb8ba8c56949d0a7d7b165347bac91338673b79024ff4137fe23344d0d685ee275efe5ef4066ba2d0bf84742cd8e2fe8ebeffa55c + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.29.5/envtest-v1.29.5-windows-amd64.tar.gz + v1.30.2: + envtest-v1.30.2-darwin-amd64.tar.gz: + hash: bfae3317e7aa03913d1435a08cd110ac4630224389234f14f29d1ff35337acb7039bf6421041da849c3e4cc6c2847d285c29c3eb5218d4e921efb073eb413bdc + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-darwin-amd64.tar.gz + envtest-v1.30.2-darwin-arm64.tar.gz: + hash: 559cb740f222825f4fd18933327d5d05760f0f55f9098cee0fca8880c6de10f66b71e6bba5841a7dff143a9ed2251e2d8904d88af79d5d7e3b901d21c1cc8c1c + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-darwin-arm64.tar.gz + envtest-v1.30.2-linux-amd64.tar.gz: + hash: be8da7b4707547b7ca0d9a1eb19c5687f462fef8a912f06d6a7fc0e6088ee1c2e64b23fb330a5b4e9ef3c3500a3b069f16645e501ae475f1e99805a5f30e5700 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-linux-amd64.tar.gz + envtest-v1.30.2-linux-arm64.tar.gz: + hash: 64840690a9d757a0f59f09f1a6d9b54e025d740d7a1cdc33785a5d05fb8f5de99a40ed6c8608bb846d3d9b803d4f393f9474e0174fc395e319042cfff36268c5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-linux-arm64.tar.gz + envtest-v1.30.2-linux-ppc64le.tar.gz: + hash: aa412c1a40ce3a9ac64c4e4278cc2485da480ac26750f372212139f6e93a5c999858b88661c8831740bc0a18ce3c0ca347336c6e81ddf3ac8b60cc3666f252cf + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-linux-ppc64le.tar.gz + envtest-v1.30.2-linux-s390x.tar.gz: + hash: 2316ceeffd0170c8b4d7c88a86eb2d14c012f2f6f17448052c0e891156706940b9c8df8b168b2f46506eff9d6ecdf807012ddc4307e8c55117b14f860a3b1ba5 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-linux-s390x.tar.gz + envtest-v1.30.2-windows-amd64.tar.gz: + hash: 0a2d6405cd4211bfbdabffe2146fd78dfaf7562ef7fdf5ef910efae202dec944f2514053e99dca9f9c3352ac20cff62881dcc0adb5f3d2251bf019c41e9605ef + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.2/envtest-v1.30.2-windows-amd64.tar.gz + v1.31.0-beta.0: + envtest-v1.31.0-beta.0-darwin-amd64.tar.gz: + hash: 8a37e38e6e590102c44d55b9fed36a011b03db24ddcb5f355cf6c4af1c70ffde338056d12ad809d0b0aa6f154cdb4372499bc68cc2e2944f4c5f97334e220a76 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-darwin-amd64.tar.gz + envtest-v1.31.0-beta.0-darwin-arm64.tar.gz: + hash: d50f73f7c4c1174f31c858dc1f9cbaf70cc4d1a119ce85d83cb876aa4d25433c38e8eb1235386ca249add1026aedb12777190777cadea369100e990411528fe9 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-darwin-arm64.tar.gz + envtest-v1.31.0-beta.0-linux-amd64.tar.gz: + hash: 11ca704b2072081fd651acd65f28f62e6595a56b59664877cbcd12eb7507a2fbbd02468eef9c5aeeea73ac906724011d40f5461ccb9143f15d8777058543f936 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-linux-amd64.tar.gz + envtest-v1.31.0-beta.0-linux-arm64.tar.gz: + hash: df90e1af8a8af485010a607164a7da87be8c13e7635d5b542cb68d402973e9e5cb41e9cfd76936eacd6199da638e6e37fbcc01f27e49a27dd98fa45abcd7e91f + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-linux-arm64.tar.gz + envtest-v1.31.0-beta.0-linux-ppc64le.tar.gz: + hash: 686cfbc1f8063533f6a5b3dae753e44d26fa41ed5d1106a111cda17a60d7b3ce417f6962ba1715ee5e8e14e9c4d6058e197cc4262f21577fd1f2253e2960ccf9 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-linux-ppc64le.tar.gz + envtest-v1.31.0-beta.0-linux-s390x.tar.gz: + hash: e74239d9d3de6a847732b432fb287e98db176bf9fd5126f999bf507365ad71d5b80e4eeee8d8b3b3be0ab2e9125eab4f5ab685a752acb06e0291b8749d566846 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-linux-s390x.tar.gz + envtest-v1.31.0-beta.0-windows-amd64.tar.gz: + hash: 547a6d5c224b7f5af534c3eb6b8a2fec8d4e19baf8550506d7aa6363f9f7ab639e41a7f546bf406ab77000c785aabd71eb3aa6beb8eb3a2d75fbb9e9c912f90a + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0-beta.0/envtest-v1.31.0-beta.0-windows-amd64.tar.gz + v1.30.3: + envtest-v1.30.3-darwin-amd64.tar.gz: + hash: 5635beb6e08a228318a43d9df27ba92879c8ce553a396e18330632b85b4724b3f2c49cb41c550c1629906f583bb3326f977c74145726b8727c846d14363d3373 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-darwin-amd64.tar.gz + envtest-v1.30.3-darwin-arm64.tar.gz: + hash: 878eed3016fbc505cab310b49be2badb2db88eaaa02fa21c448c0ff596d5cfd28f94db29432050eb27f1a7afea71157edcb4fe6148f28e63bf4668ab7d5d8b5b + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-darwin-arm64.tar.gz + envtest-v1.30.3-linux-amd64.tar.gz: + hash: 0e5948511e35156e8aba263fd878983b11aad82d0f74b5507a9804b9d101583f1c484281690c6ff1a3678ed038c874915592759374084b78b57ade3dd1266c1d + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-linux-amd64.tar.gz + envtest-v1.30.3-linux-arm64.tar.gz: + hash: b25c45d4737922e12343344b2824d2681c0066f92242d59bb9ca2f3d15253f1b0eaa88f565d98fc6fcb0df24e679169ed0ecdc47782a4e2587dde76b19abbb0d + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-linux-arm64.tar.gz + envtest-v1.30.3-linux-ppc64le.tar.gz: + hash: 9c7120196e67ac04f4f24ac27efad71d2c1384671d707efe5c6e6e02032530dc8b8f244462e1eff520287a50b513dd72b38c2caf97a3403a1f56cf13c997564b + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-linux-ppc64le.tar.gz + envtest-v1.30.3-linux-s390x.tar.gz: + hash: 0643a2ec875c386e8a252451f68392d966c5027b8af78a25f5660d7f4344ed8aa25cf8d8057459ebb18d039c494e1be393592a29724b154035e3c6541da3ea6e + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-linux-s390x.tar.gz + envtest-v1.30.3-windows-amd64.tar.gz: + hash: aaf756abb4e27335c791553865761af818097b48c6b602f096c1e0b850fa9ba0ab3f234cb487da3ff7646fc9aabb5288253d0210eb8071be2849eef29ced20af + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.30.3/envtest-v1.30.3-windows-amd64.tar.gz + v1.31.0: + envtest-v1.31.0-darwin-amd64.tar.gz: + hash: d681838609a1b0856e731888e0db0a1191003e1021801b5969b7d7084130076b30b2d99e53e460f1c5202b3308354a2118bd4a330d06d97797ef009dd56e256e + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-darwin-amd64.tar.gz + envtest-v1.31.0-darwin-arm64.tar.gz: + hash: e42c27e1ee90d13d56189e665d4c79b7a34f637581fc7e20b028a3c16b22b85060760eb91ca79901bc1c22dcd0d66ef41a0f760c2f1ae65265f0576e4109d87d + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-darwin-arm64.tar.gz + envtest-v1.31.0-linux-amd64.tar.gz: + hash: 5d96ae284610863ce5974e030aecd2eaad693f3210103ca778107aa0ea00f6f1d0a7b1b34aa74d7257cb0d7f713c2da365beba89b1d60823ce56c7b84b935423 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-linux-amd64.tar.gz + envtest-v1.31.0-linux-arm64.tar.gz: + hash: 72f5c8fd615c9db62eeb66e30edfda0f3879bffa3577c5776ec83363c018d7f51c174ac5ea807414072a21f8151a7bdf9826f414543f690686550e49db202ca0 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-linux-arm64.tar.gz + envtest-v1.31.0-linux-ppc64le.tar.gz: + hash: 378bf544d5976b2f98884d88452200e3cc60a951d286b5251361bdb1ae9aa136e1235cdb068f58e2e4153cd921d8ac365d15a4d78e850dd570787ac89bde461b + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-linux-ppc64le.tar.gz + envtest-v1.31.0-linux-s390x.tar.gz: + hash: 279c8c03cf06f6dc16d06e014f05f88ebee1bb64f5ca8877336ebe8dbc00457326d1765f20934b20be5ce1d3b84feb4a040675763ff5eb362848813666776172 + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-linux-s390x.tar.gz + envtest-v1.31.0-windows-amd64.tar.gz: + hash: 4303a8125c7cc3b2d6892413f71f5abc1fe2490f8f500c1a2b67f8e3d93aa15ea5cd89212fb356afade79032f626a66b676f433f0027ee4ec16f3049d87e27bf + selfLink: https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-v1.31.0/envtest-v1.31.0-windows-amd64.tar.gz diff --git a/go.mod b/go.mod index 281fe51c0..150bc54c4 100644 --- a/go.mod +++ b/go.mod @@ -3,25 +3,27 @@ module sigs.k8s.io/controller-tools go 1.22.0 require ( - github.com/fatih/color v1.16.0 + github.com/fatih/color v1.17.0 github.com/gobuffalo/flect v1.0.2 github.com/google/go-cmp v0.6.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.33.0 - github.com/spf13/cobra v1.8.0 + github.com/onsi/gomega v1.34.1 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - golang.org/x/tools v0.20.0 + golang.org/x/tools v0.24.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.30.0 - k8s.io/apiextensions-apiserver v0.30.0 - k8s.io/apimachinery v0.30.0 + k8s.io/api v0.31.0 + k8s.io/apiextensions-apiserver v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 sigs.k8s.io/yaml v1.4.0 ) require ( github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -31,15 +33,16 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nxadm/tail v1.4.8 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + github.com/x448/float16 v0.8.4 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/klog/v2 v2.130.1 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/go.sum b/go.sum index 4d24303cf..c3c468e0a 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,22 @@ -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= 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= @@ -33,8 +37,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -63,19 +67,20 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= -github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -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/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -86,31 +91,35 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -122,19 +131,19 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= 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= @@ -145,8 +154,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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= @@ -164,16 +173,16 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.0 h1:siWhRq7cNjy2iHssOB9SCGNCl2spiF1dO3dABqZ8niA= -k8s.io/api v0.30.0/go.mod h1:OPlaYhoHs8EQ1ql0R/TsUgaRPhpKNxIMrKQfWUp8QSE= -k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs= -k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y= -k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA= -k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= diff --git a/hack/envtest/_matrix/v1.23.5.yaml b/hack/envtest/_matrix/v1.23.5.yaml new file mode 100644 index 000000000..2582912e6 --- /dev/null +++ b/hack/envtest/_matrix/v1.23.5.yaml @@ -0,0 +1,2 @@ +go: 1.17 +etcd: v3.5.5 diff --git a/hack/envtest/_matrix/v1.24.1.yaml b/hack/envtest/_matrix/v1.24.1.yaml new file mode 100644 index 000000000..8e3e802a1 --- /dev/null +++ b/hack/envtest/_matrix/v1.24.1.yaml @@ -0,0 +1,2 @@ +go: 1.18 +etcd: v3.5.5 diff --git a/hack/envtest/_matrix/v1.24.2.yaml b/hack/envtest/_matrix/v1.24.2.yaml new file mode 100644 index 000000000..8e3e802a1 --- /dev/null +++ b/hack/envtest/_matrix/v1.24.2.yaml @@ -0,0 +1,2 @@ +go: 1.18 +etcd: v3.5.5 diff --git a/hack/envtest/_matrix/v1.25.0.yaml b/hack/envtest/_matrix/v1.25.0.yaml new file mode 100644 index 000000000..6d42e7484 --- /dev/null +++ b/hack/envtest/_matrix/v1.25.0.yaml @@ -0,0 +1,2 @@ +go: 1.19 +etcd: v3.5.5 diff --git a/hack/envtest/_matrix/v1.26.0.yaml b/hack/envtest/_matrix/v1.26.0.yaml new file mode 100644 index 000000000..4f62e0bdd --- /dev/null +++ b/hack/envtest/_matrix/v1.26.0.yaml @@ -0,0 +1,2 @@ +go: 1.19 +etcd: v3.5.6 diff --git a/hack/envtest/_matrix/v1.26.1.yaml b/hack/envtest/_matrix/v1.26.1.yaml new file mode 100644 index 000000000..4f62e0bdd --- /dev/null +++ b/hack/envtest/_matrix/v1.26.1.yaml @@ -0,0 +1,2 @@ +go: 1.19 +etcd: v3.5.6 diff --git a/hack/envtest/_matrix/v1.27.1.yaml b/hack/envtest/_matrix/v1.27.1.yaml new file mode 100644 index 000000000..21a82ff0c --- /dev/null +++ b/hack/envtest/_matrix/v1.27.1.yaml @@ -0,0 +1,2 @@ +go: 1.20 +etcd: v3.5.7 diff --git a/hack/envtest/_matrix/v1.28.3.yaml b/hack/envtest/_matrix/v1.28.3.yaml new file mode 100644 index 000000000..83bf3ddd8 --- /dev/null +++ b/hack/envtest/_matrix/v1.28.3.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.9 diff --git a/hack/envtest/_matrix/v1.29.0.yaml b/hack/envtest/_matrix/v1.29.0.yaml new file mode 100644 index 000000000..0fc8f0442 --- /dev/null +++ b/hack/envtest/_matrix/v1.29.0.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.10 diff --git a/hack/envtest/_matrix/v1.29.1.yaml b/hack/envtest/_matrix/v1.29.1.yaml new file mode 100644 index 000000000..0fc8f0442 --- /dev/null +++ b/hack/envtest/_matrix/v1.29.1.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.10 diff --git a/hack/envtest/_matrix/v1.29.3.yaml b/hack/envtest/_matrix/v1.29.3.yaml new file mode 100644 index 000000000..d35406399 --- /dev/null +++ b/hack/envtest/_matrix/v1.29.3.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.12 diff --git a/hack/envtest/_matrix/v1.29.5.yaml b/hack/envtest/_matrix/v1.29.5.yaml new file mode 100644 index 000000000..d35406399 --- /dev/null +++ b/hack/envtest/_matrix/v1.29.5.yaml @@ -0,0 +1,2 @@ +go: 1.21 +etcd: v3.5.12 diff --git a/hack/envtest/_matrix/v1.30.2.yaml b/hack/envtest/_matrix/v1.30.2.yaml new file mode 100644 index 000000000..ae8ee24db --- /dev/null +++ b/hack/envtest/_matrix/v1.30.2.yaml @@ -0,0 +1,2 @@ +go: 1.22 +etcd: v3.5.12 diff --git a/hack/envtest/_matrix/v1.30.3.yaml b/hack/envtest/_matrix/v1.30.3.yaml new file mode 100644 index 000000000..ae8ee24db --- /dev/null +++ b/hack/envtest/_matrix/v1.30.3.yaml @@ -0,0 +1,2 @@ +go: 1.22 +etcd: v3.5.12 diff --git a/hack/envtest/_matrix/v1.31.0-beta.0.yaml b/hack/envtest/_matrix/v1.31.0-beta.0.yaml new file mode 100644 index 000000000..75c3a1b8a --- /dev/null +++ b/hack/envtest/_matrix/v1.31.0-beta.0.yaml @@ -0,0 +1,2 @@ +go: 1.22 +etcd: v3.5.14 diff --git a/hack/envtest/_matrix/v1.31.0.yaml b/hack/envtest/_matrix/v1.31.0.yaml new file mode 100644 index 000000000..494f28bc0 --- /dev/null +++ b/hack/envtest/_matrix/v1.31.0.yaml @@ -0,0 +1,2 @@ +go: 1.22 +etcd: v3.5.15 diff --git a/pkg/crd/flatten.go b/pkg/crd/flatten.go index 9224c26b2..83e55398e 100644 --- a/pkg/crd/flatten.go +++ b/pkg/crd/flatten.go @@ -147,6 +147,8 @@ func flattenAllOfInto(dst *apiext.JSONSchemaProps, src apiext.JSONSchemaProps, e dstField.Set(srcField) case "XMapType": dstField.Set(srcField) + case "XValidations": + dstField.Set(reflect.AppendSlice(srcField, dstField)) // NB(directxman12): no need to explicitly handle nullable -- false is considered to be the zero value // TODO(directxman12): src isn't necessarily the field value -- it's just the most recent allOf entry default: diff --git a/pkg/crd/flatten_all_of_test.go b/pkg/crd/flatten_all_of_test.go index ae0499d45..fa1400e18 100644 --- a/pkg/crd/flatten_all_of_test.go +++ b/pkg/crd/flatten_all_of_test.go @@ -241,6 +241,25 @@ var _ = Describe("AllOf Flattening", func() { }, })) }) + + It("should merge XValidation fields", func() { + By("flattening a schema with multiple validation fields") + original := &apiext.JSONSchemaProps{ + AllOf: []apiext.JSONSchemaProps{ + {XValidations: apiext.ValidationRules{{Rule: "rule2"}, {Rule: "rule3"}}}, + {XValidations: apiext.ValidationRules{{Rule: "rule1"}}}, + }, + } + flattened := crd.FlattenEmbedded(original, errRec) + Expect(errRec.FirstError()).NotTo(HaveOccurred()) + + By("ensuring that the result lists all validation rules") + Expect(flattened).To(Equal(&apiext.JSONSchemaProps{ + XValidations: []apiext.ValidationRule{ + {Rule: "rule1"}, {Rule: "rule2"}, {Rule: "rule3"}, + }, + })) + }) }) It("should skip Title, Description, Example, and ExternalDocs, assuming they've been merged pre-AllOf flattening", func() { diff --git a/pkg/crd/known_types.go b/pkg/crd/known_types.go index 9e8decb28..1385f0b55 100644 --- a/pkg/crd/known_types.go +++ b/pkg/crd/known_types.go @@ -17,6 +17,7 @@ package crd import ( apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/utils/ptr" "sigs.k8s.io/controller-tools/pkg/loader" ) @@ -75,7 +76,7 @@ var KnownPackages = map[string]PackageOverride{ p.Schemata[TypeIdent{Name: "RawExtension", Package: pkg}] = apiext.JSONSchemaProps{ // TODO(directxman12): regexp validation for this (or get kube to support it as a format value) Type: "object", - XPreserveUnknownFields: boolPtr(true), + XPreserveUnknownFields: ptr.To(true), } p.AddPackage(pkg) // get the rest of the types }, @@ -100,13 +101,13 @@ var KnownPackages = map[string]PackageOverride{ "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1": func(p *Parser, pkg *loader.Package) { p.Schemata[TypeIdent{Name: "JSON", Package: pkg}] = apiext.JSONSchemaProps{ - XPreserveUnknownFields: boolPtr(true), + XPreserveUnknownFields: ptr.To(true), } p.AddPackage(pkg) // get the rest of the types }, "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1": func(p *Parser, pkg *loader.Package) { p.Schemata[TypeIdent{Name: "JSON", Package: pkg}] = apiext.JSONSchemaProps{ - XPreserveUnknownFields: boolPtr(true), + XPreserveUnknownFields: ptr.To(true), } p.AddPackage(pkg) // get the rest of the types }, @@ -159,10 +160,6 @@ var ObjectMetaPackages = map[string]PackageOverride{ }, } -func boolPtr(b bool) *bool { - return &b -} - // AddKnownTypes registers the packages overrides in KnownPackages with the given parser. func AddKnownTypes(parser *Parser) { // ensure everything is there before adding to PackageOverrides diff --git a/pkg/crd/markers/package.go b/pkg/crd/markers/package.go index cebe8fa4b..86851b2c4 100644 --- a/pkg/crd/markers/package.go +++ b/pkg/crd/markers/package.go @@ -22,7 +22,7 @@ import ( func init() { AllDefinitions = append(AllDefinitions, - must(markers.MakeDefinition("groupName", markers.DescribesPackage, "")). + mustOptional(markers.MakeDefinition("groupName", markers.DescribesPackage, "")). WithHelp(markers.SimpleHelp("CRD", "specifies the API group name for this package.")), must(markers.MakeDefinition("versionName", markers.DescribesPackage, "")). diff --git a/pkg/crd/markers/register.go b/pkg/crd/markers/register.go index 5988a1b5b..b5a2760b0 100644 --- a/pkg/crd/markers/register.go +++ b/pkg/crd/markers/register.go @@ -17,6 +17,7 @@ limitations under the License. package markers import ( + "fmt" "reflect" "sigs.k8s.io/controller-tools/pkg/markers" @@ -56,6 +57,19 @@ func must(def *markers.Definition, err error) *definitionWithHelp { } } +func mustOptional(def *markers.Definition, err error) *definitionWithHelp { + def = markers.Must(def, err) + if !def.AnonymousField() { + def = markers.Must(def, fmt.Errorf("not an anonymous field: %v", def)) + } + field := def.Fields[""] + field.Optional = true + def.Fields[""] = field + return &definitionWithHelp{ + Definition: def, + } +} + // AllDefinitions contains all marker definitions for this package. var AllDefinitions []*definitionWithHelp diff --git a/pkg/crd/markers/validation.go b/pkg/crd/markers/validation.go index 245c5ef92..08d28612c 100644 --- a/pkg/crd/markers/validation.go +++ b/pkg/crd/markers/validation.go @@ -80,17 +80,21 @@ var ValidationMarkers = mustMakeAllWithPrefix(validationPrefix, markers.Describe // sense on a type, and thus aren't in ValidationMarkers). var FieldOnlyMarkers = []*definitionWithHelp{ must(markers.MakeDefinition("kubebuilder:validation:Required", markers.DescribesField, struct{}{})). - WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is required, if fields are optional by default.")), + WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is required.")), must(markers.MakeDefinition("kubebuilder:validation:Optional", markers.DescribesField, struct{}{})). - WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is optional, if fields are required by default.")), + WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is optional.")), + must(markers.MakeDefinition("required", markers.DescribesField, struct{}{})). + WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is required.")), must(markers.MakeDefinition("optional", markers.DescribesField, struct{}{})). - WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is optional, if fields are required by default.")), + WithHelp(markers.SimpleHelp("CRD validation", "specifies that this field is optional.")), must(markers.MakeDefinition("nullable", markers.DescribesField, Nullable{})). WithHelp(Nullable{}.Help()), must(markers.MakeAnyTypeDefinition("kubebuilder:default", markers.DescribesField, Default{})). WithHelp(Default{}.Help()), + must(markers.MakeDefinition("default", markers.DescribesField, KubernetesDefault{})). + WithHelp(KubernetesDefault{}.Help()), must(markers.MakeAnyTypeDefinition("kubebuilder:example", markers.DescribesField, Example{})). WithHelp(Example{}.Help()), @@ -239,6 +243,20 @@ type Default struct { Value interface{} } +// +controllertools:marker:generateHelp:category="CRD validation" +// Default sets the default value for this field. +// +// A default value will be accepted as any value valid for the field. +// Only JSON-formatted values are accepted. `ref(...)` values are ignored. +// Formatting for common types include: boolean: `true`, string: +// `"Cluster"`, numerical: `1.24`, array: `[1,2]`, object: `{"policy": +// "delete"}`). Defaults should be defined in pruned form, and only best-effort +// validation will be performed. Full validation of a default requires +// submission of the containing CRD to an apiserver. +type KubernetesDefault struct { + Value interface{} +} + // +controllertools:marker:generateHelp:category="CRD validation" // Example sets the example value for this field. // @@ -280,7 +298,7 @@ type XEmbeddedResource struct{} // IntOrString marks a fields as an IntOrString. // // This is required when applying patterns or other validations to an IntOrString -// field. Knwon information about the type is applied during the collapse phase +// field. Known information about the type is applied during the collapse phase // and as such is not normally available during marker application. type XIntOrString struct{} @@ -312,6 +330,8 @@ type XValidation struct { Rule string Message string `marker:",optional"` MessageExpression string `marker:"messageExpression,optional"` + Reason string `marker:"reason,optional"` + FieldPath string `marker:"fieldPath,optional"` } func (m Maximum) ApplyToSchema(schema *apiext.JSONSchemaProps) error { @@ -501,6 +521,39 @@ func (m Default) ApplyToSchema(schema *apiext.JSONSchemaProps) error { return nil } +func (m Default) ApplyPriority() ApplyPriority { + // explicitly go after +default markers, so kubebuilder-specific defaults get applied last and stomp + return 10 +} + +func (m *KubernetesDefault) ParseMarker(_ string, _ string, restFields string) error { + if strings.HasPrefix(strings.TrimSpace(restFields), "ref(") { + // Skip +default=ref(...) values for now, since we don't have a good way to evaluate go constant values via AST. + // See https://github.com/kubernetes-sigs/controller-tools/pull/938#issuecomment-2096790018 + return nil + } + return json.Unmarshal([]byte(restFields), &m.Value) +} + +// Defaults are only valid CRDs created with the v1 API +func (m KubernetesDefault) ApplyToSchema(schema *apiext.JSONSchemaProps) error { + if m.Value == nil { + // only apply to the schema if we have a non-nil default value + return nil + } + marshalledDefault, err := json.Marshal(m.Value) + if err != nil { + return err + } + schema.Default = &apiext.JSON{Raw: marshalledDefault} + return nil +} + +func (m KubernetesDefault) ApplyPriority() ApplyPriority { + // explicitly go before +kubebuilder:default markers, so kubebuilder-specific defaults get applied last and stomp + return 9 +} + func (m Example) ApplyToSchema(schema *apiext.JSONSchemaProps) error { marshalledExample, err := json.Marshal(m.Value) if err != nil { @@ -534,10 +587,22 @@ func (m XIntOrString) ApplyPriority() ApplyPriority { } func (m XValidation) ApplyToSchema(schema *apiext.JSONSchemaProps) error { + var reason *apiext.FieldValueErrorReason + if m.Reason != "" { + switch m.Reason { + case string(apiext.FieldValueRequired), string(apiext.FieldValueInvalid), string(apiext.FieldValueForbidden), string(apiext.FieldValueDuplicate): + reason = (*apiext.FieldValueErrorReason)(&m.Reason) + default: + return fmt.Errorf("invalid reason %s, valid values are %s, %s, %s and %s", m.Reason, apiext.FieldValueRequired, apiext.FieldValueInvalid, apiext.FieldValueForbidden, apiext.FieldValueDuplicate) + } + } + schema.XValidations = append(schema.XValidations, apiext.ValidationRule{ Rule: m.Rule, Message: m.Message, MessageExpression: m.MessageExpression, + Reason: reason, + FieldPath: m.FieldPath, }) return nil } diff --git a/pkg/crd/markers/zz_generated.markerhelp.go b/pkg/crd/markers/zz_generated.markerhelp.go index c10ffb2fc..7fb1b2164 100644 --- a/pkg/crd/markers/zz_generated.markerhelp.go +++ b/pkg/crd/markers/zz_generated.markerhelp.go @@ -116,6 +116,22 @@ func (Format) Help() *markers.DefinitionHelp { } } +func (KubernetesDefault) Help() *markers.DefinitionHelp { + return &markers.DefinitionHelp{ + Category: "CRD validation", + DetailedHelp: markers.DetailedHelp{ + Summary: "Default sets the default value for this field.", + Details: "A default value will be accepted as any value valid for the field.\nOnly JSON-formatted values are accepted. `ref(...)` values are ignored.\nFormatting for common types include: boolean: `true`, string:\n`\"Cluster\"`, numerical: `1.24`, array: `[1,2]`, object: `{\"policy\":\n\"delete\"}`). Defaults should be defined in pruned form, and only best-effort\nvalidation will be performed. Full validation of a default requires\nsubmission of the containing CRD to an apiserver.", + }, + FieldHelp: map[string]markers.DetailedHelp{ + "Value": { + Summary: "", + Details: "", + }, + }, + } +} + func (ListMapKey) Help() *markers.DefinitionHelp { return &markers.DefinitionHelp{ Category: "CRD processing", @@ -523,6 +539,14 @@ func (XValidation) Help() *markers.DefinitionHelp { Summary: "", Details: "", }, + "Reason": { + Summary: "", + Details: "", + }, + "FieldPath": { + Summary: "", + Details: "", + }, }, } } diff --git a/pkg/crd/parser_integration_test.go b/pkg/crd/parser_integration_test.go index e6472e68d..7e020d07a 100644 --- a/pkg/crd/parser_integration_test.go +++ b/pkg/crd/parser_integration_test.go @@ -100,9 +100,9 @@ var _ = Describe("CRD Generation From Parsing to CustomResourceDefinition", func } }) - assertCRD := func(pkg *loader.Package, kind, fileName string) { - By(fmt.Sprintf("requesting that the %s CRD be generated", kind)) - groupKind := schema.GroupKind{Kind: kind, Group: "testdata.kubebuilder.io"} + assertCRDForGroupKind := func(pkg *loader.Package, groupKind schema.GroupKind, fileName string) { + kind := groupKind.Kind + By(fmt.Sprintf("requesting that the %s CRD be generated in group %s", kind, groupKind.Group)) parser.NeedCRDFor(groupKind, nil) By(fmt.Sprintf("fixing top level ObjectMeta on the %s CRD", kind)) @@ -131,6 +131,10 @@ var _ = Describe("CRD Generation From Parsing to CustomResourceDefinition", func ExpectWithOffset(1, parser.CustomResourceDefinitions[groupKind]).To(Equal(crd), "type not as expected, check pkg/crd/testdata/README.md for more details.\n\nDiff:\n\n%s", cmp.Diff(parser.CustomResourceDefinitions[groupKind], crd)) } + assertCRD := func(pkg *loader.Package, kind, fileName string) { + assertCRDForGroupKind(pkg, schema.GroupKind{Group: "testdata.kubebuilder.io", Kind: kind}, fileName) + } + assertError := func(pkg *loader.Package, kind, errorMsg string) { By(fmt.Sprintf("requesting that the %s CRD be generated", kind)) groupKind := schema.GroupKind{Kind: kind, Group: "testdata.kubebuilder.io"} @@ -183,6 +187,16 @@ var _ = Describe("CRD Generation From Parsing to CustomResourceDefinition", func assertError(pkgs[0], "CronJob", "is not in 'xxx=xxx' format") }) }) + + Context("CronJob API without group", func() { + BeforeEach(func() { + pkgPaths = []string{"./nogroup"} + expPkgLen = 1 + }) + It("should successfully generate the CronJob CRD", func() { + assertCRDForGroupKind(pkgs[0], schema.GroupKind{Kind: "CronJob"}, "testdata._cronjobs.yaml") + }) + }) }) It("should generate plural words for Kind correctly", func() { diff --git a/pkg/crd/schema.go b/pkg/crd/schema.go index a6e3cd601..2eaadb675 100644 --- a/pkg/crd/schema.go +++ b/pkg/crd/schema.go @@ -404,20 +404,28 @@ func structToSchema(ctx *schemaContext, structType *ast.StructType) *apiext.JSON defaultMode = "optional" } - switch defaultMode { + switch { + case field.Markers.Get("kubebuilder:validation:Optional") != nil: + // explicity optional - kubebuilder + case field.Markers.Get("kubebuilder:validation:Required") != nil: + // explicitly required - kubebuilder + props.Required = append(props.Required, fieldName) + case field.Markers.Get("optional") != nil: + // explicity optional - kubernetes + case field.Markers.Get("required") != nil: + // explicitly required - kubernetes + props.Required = append(props.Required, fieldName) + // if this package isn't set to optional default... - case "required": - // ...everything that's not inline, omitempty, or explicitly optional is required - if !inline && !omitEmpty && field.Markers.Get("kubebuilder:validation:Optional") == nil && field.Markers.Get("optional") == nil { + case defaultMode == "required": + // ...everything that's not inline / omitempty is required + if !inline && !omitEmpty { props.Required = append(props.Required, fieldName) } // if this package isn't set to required default... - case "optional": - // ...everything that isn't explicitly required is optional - if field.Markers.Get("kubebuilder:validation:Required") != nil { - props.Required = append(props.Required, fieldName) - } + case defaultMode == "optional": + // implicitly optional } var propSchema *apiext.JSONSchemaProps diff --git a/pkg/crd/testdata/cronjob_types.go b/pkg/crd/testdata/cronjob_types.go index d1754a8d3..42af267ab 100644 --- a/pkg/crd/testdata/cronjob_types.go +++ b/pkg/crd/testdata/cronjob_types.go @@ -38,7 +38,10 @@ import ( // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. +const DefaultRefValue = "defaultRefValue" + // CronJobSpec defines the desired state of CronJob +// +kubebuilder:validation:XValidation:rule="has(oldSelf.forbiddenInt) || !has(self.forbiddenInt)",message="forbiddenInt is not allowed",fieldPath=".forbiddenInt",reason="FieldValueForbidden" type CronJobSpec struct { // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. Schedule string `json:"schedule"` @@ -115,9 +118,9 @@ type CronJobSpec struct { // +kubebuilder:example={a,b} DefaultedSlice []string `json:"defaultedSlice"` - // This tests that object defaulting can be performed. - // +kubebuilder:default={{nested: {foo: "baz", bar: true}},{nested: {bar: false}}} - // +kubebuilder:example={{nested: {foo: "baz", bar: true}},{nested: {bar: false}}} + // This tests that slice and object defaulting can be performed. + // +kubebuilder:default={{nested: {foo: "baz", bar: true}},{nested: {foo: "qux", bar: false}}} + // +kubebuilder:example={{nested: {foo: "baz", bar: true}},{nested: {foo: "qux", bar: false}}} DefaultedObject []RootObject `json:"defaultedObject"` // This tests that empty slice defaulting can be performed. @@ -132,6 +135,39 @@ type CronJobSpec struct { // +kubebuilder:default={} DefaultedEmptyObject EmpiableObject `json:"defaultedEmptyObject"` + // This tests that kubebuilder defaulting takes precedence. + // +kubebuilder:default="kubebuilder-default" + // +default="kubernetes-default" + DoubleDefaultedString string `json:"doubleDefaultedString"` + + // This tests that primitive defaulting can be performed. + // +default="forty-two" + KubernetesDefaultedString string `json:"kubernetesDefaultedString"` + + // This tests that slice defaulting can be performed. + // +default=["a","b"] + KubernetesDefaultedSlice []string `json:"kubernetesDefaultedSlice"` + + // This tests that slice and object defaulting can be performed. + // +default=[{"nested": {"foo": "baz", "bar": true}},{"nested": {"foo": "qux", "bar": false}}] + KubernetesDefaultedObject []RootObject `json:"kubernetesDefaultedObject"` + + // This tests that empty slice defaulting can be performed. + // +default=[] + KubernetesDefaultedEmptySlice []string `json:"kubernetesDefaultedEmptySlice"` + + // This tests that an empty object defaulting can be performed on a map. + // +default={} + KubernetesDefaultedEmptyMap map[string]string `json:"kubernetesDefaultedEmptyMap"` + + // This tests that an empty object defaulting can be performed on an object. + // +default={} + KubernetesDefaultedEmptyObject EmpiableObject `json:"kubernetesDefaultedEmptyObject"` + + // This tests that use of +default=ref(...) doesn't break generation + // +default=ref(DefaultRefValue) + KubernetesDefaultedRef string `json:"kubernetesDefaultedRef,omitempty"` + // This tests that pattern validator is properly applied. // +kubebuilder:validation:Pattern=`^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$` PatternObject string `json:"patternObject"` @@ -188,6 +224,22 @@ type CronJobSpec struct { // +kubebuilder:validation:optional JustNestedObject *JustNestedObject `json:"justNestedObject,omitempty"` + // This tests explicitly optional kubebuilder fields + // +kubebuilder:validation:Optional + ExplicitlyOptionalKubebuilder string `json:"explicitlyOptionalKubebuilder"` + + // This tests explicitly optional kubernetes fields + // +optional + ExplicitlyOptionalKubernetes string `json:"explicitlyOptionalKubernetes"` + + // This tests explicitly required kubebuilder fields + // +kubebuilder:validation:Required + ExplicitlyRequiredKubebuilder string `json:"explicitlyRequiredKubebuilder,omitempty"` + + // This tests explicitly required kubernetes fields + // +required + ExplicitlyRequiredKubernetes string `json:"explicitlyRequiredKubernetes,omitempty"` + // This tests that min/max properties work MinMaxProperties MinMaxObject `json:"minMaxProperties,omitempty"` @@ -251,6 +303,14 @@ type CronJobSpec struct { // +kubebuilder:validation:XValidation:rule="self.size() % 2 == 0",messageExpression="'Length has to be even but is ' + len(self.stringWithEvenLengthAndMessageExpression) + ' instead'" StringWithEvenLengthAndMessageExpression string `json:"stringWithEvenLengthAndMessageExpression,omitempty"` + // Test of the expression-based validation on both field and type. + // +kubebuilder:validation:XValidation:rule="self.startsWith('good-')",message="must have good prefix" + StringWithEvenLengthAndGoodPrefix StringEvenType `json:"stringWithEvenLengthAndGoodPrefix,omitempty"` + + // Test that we can add a forbidden field using XValidation Reason and FieldPath. + // The validation is applied to the spec struct itself and not the field. + ForbiddenInt int `json:"forbiddenInt,omitempty"` + // Checks that fixed-length arrays work Array [3]int `json:"array,omitempty"` @@ -529,6 +589,10 @@ const ( ReplaceConcurrent ConcurrencyPolicy = "Replace" ) +// StringEvenType is a type that includes an expression-based validation. +// +kubebuilder:validation:XValidation:rule="self.size() % 2 == 0",message="must have even length" +type StringEvenType string + // CronJobStatus defines the observed state of CronJob type CronJobStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster diff --git a/pkg/crd/testdata/nogroup/types.go b/pkg/crd/testdata/nogroup/types.go new file mode 100644 index 000000000..0d6983c20 --- /dev/null +++ b/pkg/crd/testdata/nogroup/types.go @@ -0,0 +1,29 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +groupName= +package nogroup + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +kubebuilder:object:root=true + +// CronJob is the Schema for the cronjobs API +type CronJob struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` +} diff --git a/pkg/crd/testdata/testdata._cronjobs.yaml b/pkg/crd/testdata/testdata._cronjobs.yaml new file mode 100644 index 000000000..218674c4a --- /dev/null +++ b/pkg/crd/testdata/testdata._cronjobs.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: (devel) + name: cronjobs. +spec: + group: "" + names: + kind: CronJob + listKind: CronJobList + plural: cronjobs + singular: cronjob + scope: Namespaced + versions: + - name: nogroup + schema: + openAPIV3Schema: + description: CronJob is the Schema for the cronjobs API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + type: object + served: true + storage: true diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index ef633766e..dbf03e3ac 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -133,13 +133,15 @@ spec: foo: baz - nested: bar: false - description: This tests that object defaulting can be performed. + foo: qux + description: This tests that slice and object defaulting can be performed. example: - nested: bar: true foo: baz - nested: bar: false + foo: qux items: properties: nested: @@ -172,6 +174,86 @@ spec: description: This tests that primitive defaulting can be performed. example: forty-two type: string + explicitlyOptionalKubebuilder: + description: This tests explicitly optional kubebuilder fields + type: string + explicitlyOptionalKubernetes: + description: This tests explicitly optional kubernetes fields + type: string + explicitlyRequiredKubebuilder: + description: This tests explicitly required kubebuilder fields + type: string + explicitlyRequiredKubernetes: + description: This tests explicitly required kubernetes fields + type: string + doubleDefaultedString: + default: kubebuilder-default + description: This tests that kubebuilder defaulting takes precedence. + type: string + kubernetesDefaultedEmptyMap: + additionalProperties: + type: string + default: {} + description: This tests that an empty object defaulting can be performed + on a map. + type: object + kubernetesDefaultedEmptyObject: + default: {} + description: This tests that an empty object defaulting can be performed + on an object. + properties: + bar: + type: string + foo: + default: forty-two + type: string + type: object + kubernetesDefaultedEmptySlice: + default: [] + description: This tests that empty slice defaulting can be performed. + items: + type: string + type: array + kubernetesDefaultedObject: + default: + - nested: + bar: true + foo: baz + - nested: + bar: false + foo: qux + description: This tests that slice and object defaulting can be performed. + items: + properties: + nested: + properties: + bar: + type: boolean + foo: + type: string + required: + - bar + - foo + type: object + required: + - nested + type: object + type: array + kubernetesDefaultedSlice: + default: + - a + - b + description: This tests that slice defaulting can be performed. + items: + type: string + type: array + kubernetesDefaultedString: + default: forty-two + description: This tests that primitive defaulting can be performed. + type: string + kubernetesDefaultedRef: + description: This tests that use of +default=ref(...) doesn't break generation + type: string embeddedResource: type: object x-kubernetes-embedded-resource: true @@ -196,6 +278,11 @@ spec: description: This tests that exported fields are not skipped in the schema generation type: string + forbiddenInt: + description: |- + Test that we can add a forbidden field using XValidation Reason and FieldPath. + The validation is applied to the spec struct itself and not the field. + type: integer hosts: description: This tests string slice item validation. items: @@ -1024,7 +1111,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -1091,7 +1177,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -1124,7 +1209,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the ConfigMap @@ -1143,7 +1227,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret @@ -1251,7 +1334,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name @@ -1356,7 +1438,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name @@ -1480,7 +1561,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -1666,7 +1746,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -1843,7 +1922,6 @@ spec: type indicates which kind of seccomp profile will be applied. Valid options are: - Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied. @@ -1984,7 +2062,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -2267,7 +2344,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -2334,7 +2410,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -2367,7 +2442,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the ConfigMap @@ -2386,7 +2460,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret @@ -2491,7 +2564,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name @@ -2596,7 +2668,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name @@ -2717,7 +2788,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -2889,7 +2959,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -3063,7 +3132,6 @@ spec: type indicates which kind of seccomp profile will be applied. Valid options are: - Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied. @@ -3197,7 +3265,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -3404,7 +3471,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object type: array @@ -3491,7 +3557,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -3558,7 +3623,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -3591,7 +3655,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the ConfigMap @@ -3610,7 +3673,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the Secret @@ -3718,7 +3780,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name @@ -3823,7 +3884,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name @@ -3947,7 +4007,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -4133,7 +4192,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -4310,7 +4368,6 @@ spec: type indicates which kind of seccomp profile will be applied. Valid options are: - Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied. @@ -4451,7 +4508,6 @@ spec: description: |- TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported - TODO: implement a realistic TCP lifecycle hook properties: host: description: 'Optional: Host name to @@ -4703,12 +4759,10 @@ spec: Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: - 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- - If unset, the Kubelet will not modify the ownership and permissions of any volume. format: int64 type: integer @@ -4789,7 +4843,6 @@ spec: type indicates which kind of seccomp profile will be applied. Valid options are: - Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied. @@ -5065,7 +5118,6 @@ spec: Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore - TODO: how do we prevent errors in the filesystem from compromising the machine type: string partition: description: |- @@ -5185,7 +5237,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object user: @@ -5223,7 +5274,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object volumeID: @@ -5291,7 +5341,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the ConfigMap @@ -5326,7 +5375,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object readOnly: @@ -5469,7 +5517,6 @@ spec: The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. - Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity @@ -5480,17 +5527,14 @@ spec: information on the connection between this volume type and PersistentVolumeClaim). - Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. - Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. - A pod can use both types of ephemeral volumes and persistent volumes at the same time. properties: @@ -5509,7 +5553,6 @@ spec: entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). - An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until @@ -5519,11 +5562,9 @@ spec: this should not be necessary, but it may be useful when manually reconstructing a broken cluster. - This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. - Required, must not be nil. properties: metadata: @@ -5686,7 +5727,6 @@ spec: Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. - TODO: how do we prevent errors in the filesystem from compromising the machine type: string lun: description: 'Optional: FC target lun number' @@ -5749,7 +5789,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object required: @@ -5783,7 +5822,6 @@ spec: Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk - TODO: how do we prevent errors in the filesystem from compromising the machine type: string partition: description: |- @@ -5864,9 +5902,6 @@ spec: used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath - --- - TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not - mount host directories as read/write. properties: path: description: |- @@ -5903,7 +5938,6 @@ spec: Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi - TODO: how do we prevent errors in the filesystem from compromising the machine type: string initiatorName: description: |- @@ -5943,7 +5977,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object targetPortal: @@ -6115,7 +6148,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -6261,7 +6293,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string optional: description: Specify whether the @@ -6351,7 +6382,6 @@ spec: Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd - TODO: how do we prevent errors in the filesystem from compromising the machine type: string image: description: |- @@ -6394,7 +6424,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object user: @@ -6441,7 +6470,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object sslEnabled: @@ -6560,7 +6588,6 @@ spec: description: |- Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid? type: string type: object volumeName: @@ -6806,11 +6833,21 @@ spec: rule: self.size() % 2 == 0 - rule: "true" stringWithEvenLengthAndMessageExpression: - description: Test of the expression-based validation with - messageExpression marker. + description: Test of the expression-based validation with messageExpression + marker. type: string x-kubernetes-validations: - - messageExpression: "'Length has to be even but is ' + len(self.stringWithEvenLengthAndMessageExpression) + ' instead'" + - messageExpression: '''Length has to be even but is '' + len(self.stringWithEvenLengthAndMessageExpression) + + '' instead''' + rule: self.size() % 2 == 0 + stringWithEvenLengthAndGoodPrefix: + description: Test of the expression-based validation on both field + and type. + type: string + x-kubernetes-validations: + - message: must have good prefix + rule: self.startsWith('good-') + - message: must have even length rule: self.size() % 2 == 0 structWithSeveralFields: description: A struct that can only be entirely replaced @@ -6880,13 +6917,22 @@ spec: - defaultedObject - defaultedSlice - defaultedString + - doubleDefaultedString - embeddedResource + - explicitlyRequiredKubebuilder + - explicitlyRequiredKubernetes - float64WithValidations - floatWithValidations - foo - int32WithValidations - intWithValidations - jobTemplate + - kubernetesDefaultedEmptyMap + - kubernetesDefaultedEmptyObject + - kubernetesDefaultedEmptySlice + - kubernetesDefaultedObject + - kubernetesDefaultedSlice + - kubernetesDefaultedString - mapOfInfo - nestedMapOfInfo - nestedStructWithSeveralFields @@ -6903,28 +6949,19 @@ spec: - unprunedFomTypeAndField - unprunedJSON type: object + x-kubernetes-validations: + - fieldPath: .forbiddenInt + message: forbiddenInt is not allowed + reason: FieldValueForbidden + rule: has(oldSelf.forbiddenInt) || !has(self.forbiddenInt) status: description: CronJobStatus defines the observed state of CronJob properties: active: description: A list of pointers to currently running jobs. items: - description: |- - ObjectReference contains enough information to let you inspect or modify the referred object. - --- - New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. - 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. - 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular - restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". - Those cannot be well described when embedded. - 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. - 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity - during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple - and the version of the actual struct is irrelevant. - 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type - will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control. - Instead of using this type, create a locally provided and used type that is well-focused on your reference. - For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 . + description: ObjectReference contains enough information to let + you inspect or modify the referred object. properties: apiVersion: description: API version of the referent. @@ -6938,7 +6975,6 @@ spec: the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. - TODO: this design is not final and this field is subject to change in the future. type: string kind: description: |- diff --git a/pkg/markers/collect_test.go b/pkg/markers/collect_test.go index 3dadbf120..8ac0ce26b 100644 --- a/pkg/markers/collect_test.go +++ b/pkg/markers/collect_test.go @@ -141,12 +141,14 @@ var _ = Describe("Collecting", func() { Expect(docsByType).To(HaveKeyWithValue("HasNonAsteriskDocWithYamlEmbeeded", `This is a description this is an example as yaml: +~~~yaml --- foo: bar: dar: - value1 - - value2`)) + - value2 +~~~`)) }) }) diff --git a/pkg/markers/markers_suite_test.go b/pkg/markers/markers_suite_test.go index 36bd21e32..e977094c5 100644 --- a/pkg/markers/markers_suite_test.go +++ b/pkg/markers/markers_suite_test.go @@ -101,12 +101,14 @@ var _ = BeforeSuite(func() { // This is a description // this is an example as yaml: + // ~~~yaml // --- // foo: // bar: // dar: // - value1 // - value2 + // ~~~ type HasNonAsteriskDocWithYamlEmbeeded struct { } diff --git a/pkg/markers/parse.go b/pkg/markers/parse.go index 259bff027..01e8950fb 100644 --- a/pkg/markers/parse.go +++ b/pkg/markers/parse.go @@ -820,13 +820,23 @@ func parserScanner(raw string, err func(*sc.Scanner, string)) *sc.Scanner { return scanner } +type markerParser interface { + ParseMarker(name string, anonymousName string, restFields string) error +} + // Parse uses the type information in this Definition to parse the given // raw marker in the form `+a:b:c=arg,d=arg` into an output object of the // type specified in the definition. func (d *Definition) Parse(rawMarker string) (interface{}, error) { name, anonName, fields := splitMarker(rawMarker) - out := reflect.Indirect(reflect.New(d.Output)) + outPointer := reflect.New(d.Output) + out := reflect.Indirect(outPointer) + + if parser, ok := outPointer.Interface().(markerParser); ok { + err := parser.ParseMarker(name, anonName, fields) + return out.Interface(), err + } // if we're a not a struct or have no arguments, treat the full `a:b:c` as the name, // otherwise, treat `c` as a field name, and `a:b` as the marker name. diff --git a/pkg/markers/zip.go b/pkg/markers/zip.go index fd5b0035a..9e4d1b70a 100644 --- a/pkg/markers/zip.go +++ b/pkg/markers/zip.go @@ -69,13 +69,15 @@ func extractDoc(node ast.Node, decl *ast.GenDecl) string { // split lines, and re-join together as a single // paragraph, respecting double-newlines as // paragraph markers. - outLines := strings.Split(outGroup.Text(), "\n") - if outLines[len(outLines)-1] == "" { + lines := strings.Split(outGroup.Text(), "\n") + if lines[len(lines)-1] == "" { // chop off the extraneous last part - outLines = outLines[:len(outLines)-1] + lines = lines[:len(lines)-1] } - for i, line := range outLines { + var outLines []string + var insideCodeBlock bool + for i, line := range lines { if isAsteriskComment { // Trim any extranous whitespace, // for handling /*…*/-style comments, @@ -86,10 +88,33 @@ func extractDoc(node ast.Node, decl *ast.GenDecl) string { // Respect that double-newline means // actual newline: if line == "" { - outLines[i] = "\n" + lines[i] = "\n" } else { - outLines[i] = line + lines[i] = line } + + // Recognize markdown code blocks (``` or ~~~) + // https://spec.commonmark.org/0.27/#fenced-code-blocks + if strings.HasPrefix(line, "```") || strings.HasPrefix(line, "~~~") { + insideCodeBlock = !insideCodeBlock + } + + if !insideCodeBlock { + // If we are not inside markdown code block, follow the Kubernetes formatting conventions: + // - Lines after --- are comments and should be ignored. + // - Lines starting with TODO are comments and should be ignored. + // See function fmtRawDoc() in https://github.com/kubernetes/apimachinery/blob/master/pkg/runtime/swagger_doc_generator.go + + if strings.HasPrefix(line, "TODO") { + continue + } + + if strings.HasPrefix(line, "---") { + break + } + } + + outLines = append(outLines, line) } return strings.Join(outLines, "\n") } diff --git a/pkg/rbac/parser.go b/pkg/rbac/parser.go index 50bdf322c..51b4c043f 100644 --- a/pkg/rbac/parser.go +++ b/pkg/rbac/parser.go @@ -93,6 +93,18 @@ func (r *Rule) key() ruleKey { } } +func (r *Rule) keyWithGroupResourceNamesURLsVerbs() string { + key := r.key() + verbs := strings.Join(r.Verbs, "&") + return fmt.Sprintf("%s + %s + %s + %s", key.Groups, key.ResourceNames, key.URLs, verbs) +} + +func (r *Rule) keyWithResourcesResourceNamesURLsVerbs() string { + key := r.key() + verbs := strings.Join(r.Verbs, "&") + return fmt.Sprintf("%s + %s + %s + %s", key.Resources, key.ResourceNames, key.URLs, verbs) +} + // addVerbs adds new verbs into a Rule. // The duplicates in `r.Verbs` will be removed, and then `r.Verbs` will be sorted. func (r *Rule) addVerbs(verbs []string) { @@ -168,22 +180,28 @@ func (Generator) RegisterMarkers(into *markers.Registry) error { // GenerateRoles generate a slice of objs representing either a ClusterRole or a Role object // The order of the objs in the returned slice is stable and determined by their namespaces. func GenerateRoles(ctx *genall.GenerationContext, roleName string) ([]interface{}, error) { - rulesByNS := make(map[string][]*Rule) + rulesByNSResource := make(map[string][]*Rule) for _, root := range ctx.Roots { markerSet, err := markers.PackageMarkers(ctx.Collector, root) if err != nil { root.AddError(err) } - // group RBAC markers by namespace + // group RBAC markers by namespace and separate by resource for _, markerValue := range markerSet[RuleDefinition.Name] { rule := markerValue.(Rule) - namespace := rule.Namespace - if _, ok := rulesByNS[namespace]; !ok { - rules := make([]*Rule, 0) - rulesByNS[namespace] = rules + for _, resource := range rule.Resources { + r := Rule{ + Groups: rule.Groups, + Resources: []string{resource}, + ResourceNames: rule.ResourceNames, + URLs: rule.URLs, + Namespace: rule.Namespace, + Verbs: rule.Verbs, + } + namespace := r.Namespace + rulesByNSResource[namespace] = append(rulesByNSResource[namespace], &r) } - rulesByNS[namespace] = append(rulesByNS[namespace], &rule) } } @@ -200,6 +218,45 @@ func GenerateRoles(ctx *genall.GenerationContext, roleName string) ([]interface{ ruleMap[key].addVerbs(rule.Verbs) } + // deduplicate resources + // 1. create map based on key without resources + ruleMapWithoutResources := make(map[string][]*Rule) + for _, rule := range ruleMap { + // get key without Resources + key := rule.keyWithGroupResourceNamesURLsVerbs() + ruleMapWithoutResources[key] = append(ruleMapWithoutResources[key], rule) + } + // 2. merge to ruleMap + ruleMap = make(map[ruleKey]*Rule) + for _, rules := range ruleMapWithoutResources { + rule := rules[0] + for _, mergeRule := range rules[1:] { + rule.Resources = append(rule.Resources, mergeRule.Resources...) + } + + key := rule.key() + ruleMap[key] = rule + } + + // deduplicate groups + // 1. create map based on key without group + ruleMapWithoutGroup := make(map[string][]*Rule) + for _, rule := range ruleMap { + // get key without Group + key := rule.keyWithResourcesResourceNamesURLsVerbs() + ruleMapWithoutGroup[key] = append(ruleMapWithoutGroup[key], rule) + } + // 2. merge to ruleMap + ruleMap = make(map[ruleKey]*Rule) + for _, rules := range ruleMapWithoutGroup { + rule := rules[0] + for _, mergeRule := range rules[1:] { + rule.Groups = append(rule.Groups, mergeRule.Groups...) + } + key := rule.key() + ruleMap[key] = rule + } + // sort the Rules in rules according to their ruleKeys keys := make([]ruleKey, 0, len(ruleMap)) for key := range ruleMap { @@ -216,7 +273,7 @@ func GenerateRoles(ctx *genall.GenerationContext, roleName string) ([]interface{ // collect all the namespaces and sort them var namespaces []string - for ns := range rulesByNS { + for ns := range rulesByNSResource { namespaces = append(namespaces, ns) } sort.Strings(namespaces) @@ -224,7 +281,7 @@ func GenerateRoles(ctx *genall.GenerationContext, roleName string) ([]interface{ // process the items in rulesByNS by the order specified in `namespaces` to make sure that the Role order is stable var objs []interface{} for _, ns := range namespaces { - rules := rulesByNS[ns] + rules := rulesByNSResource[ns] policyRules := NormalizeRules(rules) if len(policyRules) == 0 { continue diff --git a/pkg/rbac/parser_integration_test.go b/pkg/rbac/parser_integration_test.go index f4f7bf45a..74f8a7b56 100644 --- a/pkg/rbac/parser_integration_test.go +++ b/pkg/rbac/parser_integration_test.go @@ -52,7 +52,7 @@ var _ = Describe("ClusterRole generated by the RBAC Generator", func() { Expect(err).NotTo(HaveOccurred()) By("parsing the desired YAML") - for i, expectedRoleBytes := range bytes.Split(expectedFile, []byte("\n---\n"))[1:] { + for i, expectedRoleBytes := range bytes.Split(expectedFile, []byte("\n---\n")) { By(fmt.Sprintf("comparing the generated Role and expected Role (Pair %d)", i)) obj := objs[i] switch obj := obj.(type) { diff --git a/pkg/rbac/testdata/controller.go b/pkg/rbac/testdata/controller.go index 27800d729..82125e015 100644 --- a/pkg/rbac/testdata/controller.go +++ b/pkg/rbac/testdata/controller.go @@ -11,3 +11,20 @@ package controller // +kubebuilder:rbac:groups=batch,resources=jobs/status,verbs=watch;watch // +kubebuilder:rbac:groups=art,resources=jobs,verbs=get,namespace=park // +kubebuilder:rbac:groups=batch.io,resources=cronjobs,resourceNames=foo;bar;baz,verbs=get;watch +// +kubebuilder:rbac:groups=deduplicate-verbs,resources=some,verbs=get;list +// +kubebuilder:rbac:groups=deduplicate-verbs,resources=some,verbs=get +// +kubebuilder:rbac:groups=deduplicate-verbs,resources=some,verbs=list +// +kubebuilder:rbac:groups=deduplicate-resources,resources=one,verbs=create +// +kubebuilder:rbac:groups=deduplicate-resources,resources=two,verbs=create +// +kubebuilder:rbac:groups=deduplicate-resources,resources=three,verbs=create +// +kubebuilder:rbac:groups=deduplicate-groups1,resources=foo,verbs=patch +// +kubebuilder:rbac:groups=deduplicate-groups2,resources=foo,verbs=patch +// +kubebuilder:rbac:groups=deduplicate-groups3,resources=foo,verbs=patch +// +kubebuilder:rbac:groups=deduplicate-all,resources=foo;bar,verbs=get;list +// +kubebuilder:rbac:groups=deduplicate-all,resources=foo,verbs=get +// +kubebuilder:rbac:groups=deduplicate-all,resources=bar,verbs=list +// +kubebuilder:rbac:groups=deduplicate-all-group,resources=foo;bar,verbs=get;list +// +kubebuilder:rbac:groups=not-deduplicate-resources,resources=some,verbs=get +// +kubebuilder:rbac:groups=not-deduplicate-resources,resources=another,verbs=list +// +kubebuilder:rbac:groups=not-deduplicate-groups1,resources=some,verbs=get +// +kubebuilder:rbac:groups=not-deduplicate-groups2,resources=some,verbs=list diff --git a/pkg/rbac/testdata/role.yaml b/pkg/rbac/testdata/role.yaml index 3c3d01a81..33dfc8052 100644 --- a/pkg/rbac/testdata/role.yaml +++ b/pkg/rbac/testdata/role.yaml @@ -1,4 +1,3 @@ - --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole @@ -52,7 +51,57 @@ rules: - get - patch - update - +- apiGroups: + - deduplicate-all + - deduplicate-all-group + resources: + - bar + - foo + verbs: + - get + - list +- apiGroups: + - deduplicate-groups1 + - deduplicate-groups2 + - deduplicate-groups3 + resources: + - foo + verbs: + - patch +- apiGroups: + - deduplicate-resources + resources: + - one + - three + - two + verbs: + - create +- apiGroups: + - deduplicate-verbs + resources: + - some + verbs: + - get + - list +- apiGroups: + - not-deduplicate-groups1 + - not-deduplicate-resources + resources: + - some + verbs: + - get +- apiGroups: + - not-deduplicate-groups2 + resources: + - some + verbs: + - list +- apiGroups: + - not-deduplicate-resources + resources: + - another + verbs: + - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -66,7 +115,6 @@ rules: - jobs verbs: - get - --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -76,11 +124,6 @@ metadata: rules: - apiGroups: - art - resources: - - jobs - verbs: - - get -- apiGroups: - wave resources: - jobs