diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6651f6225b1..18244da68d9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,7 +19,7 @@ jobs:
with:
go-version: '~1.19'
- name: Run GoReleaser
- uses: goreleaser/goreleaser-action@v3
+ uses: goreleaser/goreleaser-action@v4
with:
version: v1.11.2
args: release -f ./build/.goreleaser.yml --rm-dist
diff --git a/RELEASE.md b/RELEASE.md
index 4f00aad65b7..3c130a888b2 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -86,13 +86,8 @@ The releases occur in an account in the Google Cloud (See [here](https://console
### To build the Kubebuilder CLI binaries:
-A trigger `build-kb-release` is configured to call [build/cloudbuild.yaml](build/cloudbuild.yaml).
-This trigger will be executed when any new tag be published.
-The tags must be built from the release branch (Currently, `release-3`).
-
-Also, we have a trigger to generate snapshots builds from the master branch.
-This trigger will call [build/cloudbuild_snapshot.yaml](build/cloudbuild_snapshot.yaml)
-when any change needs to be performed on master.
+A trigger GitHub action [release](.github/workflows/release.yml) is trigged when a new tag is pushed.
+This action will caall the job [./build/.goreleaser.yml](./build/.goreleaser.yml).
### To build the Kubebuilder-tools: (Artifacts required to use ENV TEST)
diff --git a/build/.goreleaser.yml b/build/.goreleaser.yml
index 881dab0aa54..1b207212896 100644
--- a/build/.goreleaser.yml
+++ b/build/.goreleaser.yml
@@ -44,7 +44,7 @@ builds:
- darwin_amd64
- darwin_arm64
env:
- - KUBERNETES_VERSION=1.25.0
+ - KUBERNETES_VERSION=1.26.0
- CGO_ENABLED=0
# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.
diff --git a/build/build_kubebuilder.sh b/build/build_kubebuilder.sh
deleted file mode 100755
index 6569396b865..00000000000
--- a/build/build_kubebuilder.sh
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright 2018 The Kubernetes Authors.
-#
-# 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.
-
-# This script runs goreleaser using the build/.goreleaser.yml config.
-# While it can be run locally, it is intended to be run by cloudbuild
-# in the goreleaser/goreleaser image.
-
-function usage() {
- echo "
- This script runs goreleaser using the build/.goreleaser.yml config.
- While it can be run locally, it is intended to be run by cloudbuild
- in the goreleaser/goreleaser image.
-
- GORELEASER_FLAGS: contains flags to pass to the goreleaser binary (default: only --config is set).
-
- SNAPSHOT: if set to any value, runs goreleaser in snapshot mode with mock release notes (default: unset).
-
- NOTES_FLAGS: contains flags to pass to the notes binary (sigs.k8s.io/kubebuilder-release-tools/notes).
- Does nothing if SNAPSHOT is set. (default: unset).
-
- Examples:
-
- # Run in snapshot mode: fake release notes, nothing is published, binaries build in '$(pwd)/dist'
- \$ SNAPSHOT=1 $0
-
- # Add a release type to the release notes
- \$ NOTES_FLAGS=\"-r beta\" $0
-"
-}
-
-# GORELEASER_FLAGS contains flags for goreleaser such that the binary can be run
-# in local/snapshot/prod mode from the same script.
-# NOTE: if --snapshot is in GORELEASER_FLAGS, the release is not published to GitHub
-# and the build is available under $PWD/dist.
-GORELEASER_FLAGS="${GORELEASER_FLAGS:-}"
-# NOTES_FLAGS contains flags for the release notes generator (see install_notes for details).
-NOTES_FLAGS="${NOTES_FLAGS:-}"
-# SNAPSHOT is set by the CLI flag parser if --snapshot is a passed flag.
-# If not set, release notes are not generated.
-SNAPSHOT="${SNAPSHOT:-}"
-
-while [ $# -gt 0 ]; do
- case $1 in
- -h|--help)
- usage
- exit 0
- ;;
- esac
-done
-
-
-# install_notes installs kubebuilder's release notes generator globally with name "notes".
-function install_notes() {
- local tmp=$(mktemp -d)
- pushd "$tmp"
- go mod init tmp
- # Get by commit because v0.1.1 cannot be retrieved via `go get`.
- go get sigs.k8s.io/kubebuilder-release-tools/notes@4777888c377a26956f1831d5b9207eea1fa3bf29
- popd
- rm -rf "$tmp"
-}
-
-set -o errexit
-set -o pipefail
-
-# Generate real release notes.
-if [ -z "$SNAPSHOT" ]; then
- tmp_notes="$(mktemp)"
- trap "rm -f ${tmp_notes}" EXIT
- install_notes
- if [[ -n "${CLOUD_BUILD}" ]]; then
- # we refresh just before this, no point (plus, we fiddle with the current branch a bit)
- NOTES_FLAGS+=" --use-upstream=false"
- # we can look for tag alpha/beta here too
- # (TODO(directxman12): this should be in the tool)
- [[ "${TAG_NAME}" == "v"*"-alpha."* ]] && NOTES_FLAGS+=" -r alpha"
- [[ "${TAG_NAME}" == "v"*"-beta."* ]] && NOTES_FLAGS+=" -r beta"
- [[ "${TAG_NAME}" == "v"*"-rc."* ]] && NOTES_FLAGS+=" -r rc"
- fi
- # TODO(cmacedo): figure out how to download the release notes and let it available in the cloud build
- # Currently it does not work: https://github.com/kubernetes-sigs/kubebuilder/issues/2667
- # notes $NOTES_FLAGS | tee "$tmp_notes"
- notes="Mock Release Notes for $(git describe --tags --always --broken)"
- # we need to delete the tag for the release notes script, so restore it when done so that
- # go releaser can find the right tag
- if [[ -n "${TAG_NAME}" ]]; then
- git tag ${TAG_NAME}
- fi
- GORELEASER_FLAGS="${GORELEASER_FLAGS} --release-notes=${tmp_notes}"
-else
- # TODO(estroz): figure out how to generate snapshot release notes with the kubebuilder generator.
- echo "Running in snapshot mode. Release notes will not be generated from commits."
- notes="Mock Release Notes for $(git describe --tags --always --broken)"
- GORELEASER_FLAGS="${GORELEASER_FLAGS} --snapshot --rm-dist --skip-validate --release-notes <(echo \"${notes}\")"
-fi
-
-# eval to run process substitution.
-eval goreleaser release --config=build/.goreleaser.yml $GORELEASER_FLAGS
diff --git a/build/cloudbuild.yaml b/build/cloudbuild.yaml
deleted file mode 100644
index 70c62748c40..00000000000
--- a/build/cloudbuild.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2018 The Kubernetes Authors.
-#
-# 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.
-
-# Instructions to run locally:
-# Download google container builder: https://github.com/GoogleCloudPlatform/cloud-build-local
-# $ mkdir cloudbuild
-# $ cloud-build-local --config=build/cloudbuild_local.yaml --dryrun=false --write-workspace=./cloudbuild .
-# Release tar will be in ./cloudbuild
-
-steps:
-- name: "gcr.io/cloud-builders/git"
- entrypoint: 'bash'
- args:
- - '-c'
- - |
- git fetch --tags --unshallow
- git for-each-ref --contains HEAD
- # TAG_NAME is defined by GCB, so uses 1 dollar sign, BRANCH_NAME is bash, so we need to escape it
- # with two dollar signs
- export BRANCH_NAME=$(git for-each-ref --format="%(refname:strip=-1)" --contains HEAD 'refs/remotes/origin/release-*')
- export ALL_BRANCHES=$(git for-each-ref --format="%(refname:strip=-1)" 'refs/remotes/origin/release-*')
- echo "branch: $${BRANCH_NAME}, tag: ${TAG_NAME}, all release branches: $${ALL_BRANCHES}"
- for branch in $${ALL_BRANCHES}; do
- git branch $${branch} origin/$${branch}
- done
- git branch -f $${BRANCH_NAME} HEAD
- git checkout $${BRANCH_NAME}
- git branch --set-upstream-to=origin/$${BRANCH_NAME}
- git tag -d ${TAG_NAME}
-- name: "goreleaser/goreleaser:v1.11.2"
- entrypoint: "bash"
- args: ["build/build_kubebuilder.sh"]
- env:
- - 'TAG_NAME=$TAG_NAME'
- - 'CLOUD_BUILD=true'
- - 'GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}'
\ No newline at end of file
diff --git a/build/cloudbuild_local.yaml b/build/cloudbuild_local.yaml
deleted file mode 100644
index ed97f90aa34..00000000000
--- a/build/cloudbuild_local.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2018 The Kubernetes Authors.
-#
-# 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.
-
-# Instructions to run locally:
-# Download google container builder: https://github.com/GoogleCloudPlatform/cloud-build-local
-# $ mkdir cloudbuild
-# $ cloud-build-local --config=build/cloudbuild_local.yaml --dryrun=false --write-workspace=./cloudbuild .
-# Release tar will be in ./cloudbuild
-
-steps:
-- name: "goreleaser/goreleaser:v1.11.2"
- entrypoint: "bash"
- env: ["SNAPSHOT=1"]
- args: ["build/build_kubebuilder.sh"]
diff --git a/build/cloudbuild_snapshot.yaml b/build/cloudbuild_snapshot.yaml
deleted file mode 100644
index 9eaf2d4ffc4..00000000000
--- a/build/cloudbuild_snapshot.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2018 The Kubernetes Authors.
-#
-# 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.
-
-# Instructions to run locally:
-# Download google container builder: https://github.com/GoogleCloudPlatform/cloud-build-local
-# $ mkdir cloudbuild
-# $ cloud-build-local --config=build/cloudbuild_snapshot.yaml --dryrun=false --write-workspace=./cloudbuild .
-# Release tar will be in ./cloudbuild
-
-steps:
-- name: "goreleaser/goreleaser:v1.11.2"
- entrypoint: "bash"
- env: ["SNAPSHOT=1"]
- args: ["build/build_kubebuilder.sh"]
- timeout: 30m
-- name: "ubuntu"
- args: ["tar", "-zcvf", "kubebuilder_linux_amd64.tar.gz", "-C", "dist/kubebuilder_linux_amd64_v1", "kubebuilder"]
-- name: "gcr.io/cloud-builders/gsutil"
- args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_linux_amd64.tar.gz", "gs://kubebuilder-release/kubebuilder_master_linux_amd64.tar.gz"]
-- name: "ubuntu"
- args: ["tar", "-zcvf", "kubebuilder_linux_arm64.tar.gz", "-C", "dist/kubebuilder_linux_arm64", "kubebuilder"]
-- name: "gcr.io/cloud-builders/gsutil"
- args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_linux_arm64.tar.gz", "gs://kubebuilder-release/kubebuilder_master_linux_arm64.tar.gz"]
-- name: "ubuntu"
- args: ["tar", "-zcvf", "kubebuilder_linux_ppc64le.tar.gz", "-C", "dist/kubebuilder_linux_ppc64le", "kubebuilder"]
-- name: "gcr.io/cloud-builders/gsutil"
- args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_linux_ppc64le.tar.gz", "gs://kubebuilder-release/kubebuilder_master_linux_ppc64le.tar.gz"]
-- name: "ubuntu"
- args: ["tar", "-zcvf", "kubebuilder_darwin_amd64.tar.gz", "-C", "dist/kubebuilder_darwin_amd64_v1", "kubebuilder"]
-- name: "gcr.io/cloud-builders/gsutil"
- args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_darwin_amd64.tar.gz", "gs://kubebuilder-release/kubebuilder_master_darwin_amd64.tar.gz"]
-- name: "ubuntu"
- args: ["tar", "-zcvf", "kubebuilder_darwin_arm64.tar.gz", "-C", "dist/kubebuilder_darwin_arm64", "kubebuilder"]
-- name: "gcr.io/cloud-builders/gsutil"
- args: ["-h", "Content-Type:application/gzip", "cp", "kubebuilder_darwin_arm64.tar.gz", "gs://kubebuilder-release/kubebuilder_master_darwin_arm64.tar.gz"]
-
-
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index 3a90c65b218..a2eb8a02ae0 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -6,8 +6,6 @@
[Architecture](./architecture.md)
-[FAQ](./faq.md)
-
---
- [Tutorial: Building CronJob](cronjob-tutorial/cronjob-tutorial.md)
@@ -134,6 +132,8 @@
---
+[FAQ](./faq.md)
+
[Appendix: The TODO Landing Page](./TODO.md)
[plugins]: ./plugins/plugins.md
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index e833f6285ad..a551a6e1cca 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/docs/book/src/cronjob-tutorial/testdata/emptycontroller.go b/docs/book/src/cronjob-tutorial/testdata/emptycontroller.go
index 9a1fc29be4e..bc941060ec0 100644
--- a/docs/book/src/cronjob-tutorial/testdata/emptycontroller.go
+++ b/docs/book/src/cronjob-tutorial/testdata/emptycontroller.go
@@ -55,6 +55,16 @@ needed to run. As we add more functionality, we'll need to revisit these.
// +kubebuilder:rbac:groups=batch.tutorial.kubebuilder.io,resources=cronjobs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=batch.tutorial.kubebuilder.io,resources=cronjobs/status,verbs=get;update;patch
+/*
+The `ClusterRole` manifest at `config/rbac/role.yaml` is generated from the above markers via controller-gen with the following command:
+*/
+
+// make manifests
+
+/*
+NOTE: If you receive an error, please run the specified command in the error and re-run `make manifests`.
+*/
+
/*
`Reconcile` actually performs the reconciling for a single named object.
Our [Request](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile?tab=doc#Request) just has a name, but we can use the client to fetch
diff --git a/docs/book/src/migration/manually_migration_guide_gov3_to_gov4.md b/docs/book/src/migration/manually_migration_guide_gov3_to_gov4.md
index cae361c45ca..e776bb5beb9 100644
--- a/docs/book/src/migration/manually_migration_guide_gov3_to_gov4.md
+++ b/docs/book/src/migration/manually_migration_guide_gov3_to_gov4.md
@@ -16,11 +16,17 @@ The recommended upgrade approach is to follow the [Migration Guide go/v3 to go/v
## Migration from project config version "go/v3" to "go/v4"
-Update `PROJECT` file layout which stores the information about the resources are use to enable plugins to make useful decisions when scaffolding.
+Update the `PROJECT` file layout which stores information about the resources that are used to enable plugins make
+useful decisions while scaffolding. The `layout` field indicates the scaffolding and the primary plugin version in use.
-Furthermore, the `PROJECT` file itself is now versioned. The `version` field corresponds to the version of the `PROJECT` file itself, while the `layout` field indicates the scaffolding and the primary plugin version in use.
+### Steps to migrate
+
+#### Migrate the layout version into the PROJECT file
+
+The following steps describe the manual changes required to bring the project configuration file (`PROJECT`).
+These change will add the information that Kubebuilder would add when generating the file. This file can be found in the root directory.
-Update:
+Update the PROJECT file by replacing:
```yaml
layout:
@@ -35,16 +41,119 @@ layout:
```
-### Steps to migrate
+#### Changes to the layout
-- Update the `main.go` with the changes which can be found in the samples under testdata for the release tag used. (see for example `testdata/project-v4/main.go`).
-- Update the Makefile with the changes which can be found in the samples under testdata for the release tag used. (see for example `testdata/project-v4/Makefile`)
-- Update the `go.mod` with the changes which can be found in the samples under `testdata` for the release tag used. (see for example `testdata/project-v4/go.mod`). Then, run
-`go mod tidy` to ensure that you get the latest dependencies and your Golang code has no breaking changes.
-- Update the manifest under `config/` directory with all changes performed in the default scaffold done with `go/v4-alpha` plugin. (see for example `testdata/project-v4/config/`) to get all changes in the
-default scaffolds to be applied on your project
-- Create `config/samples/kustomization.yaml` with all CR samples specified. (see for example `testdata/project-v4/config/samples/kustomization.yaml`)
-- Replace the import `admissionv1beta1 "k8s.io/api/admission/v1beta1"` with `admissionv1 "k8s.io/api/admission/v1"` in the webhook test files
+##### New layout:
+
+- The directory `apis` was renamed to `api` to follow the standard
+- The `controller(s)` directory has been moved under a new directory called `internal` and renamed to singular as well `controller`
+- The `main.go` previously scaffolded in the root directory has been moved under a new directory called `cmd`
+
+Therefore, you can check the changes in the layout results into:
+
+```sh
+...
+├── cmd
+│ └── main.go
+├── internal
+│ └── controller
+└── api
+```
+
+##### Migrating to the new layout:
+
+- Create a new directory `cmd` and move the `main.go` under it.
+- If your project support multi-group the APIs are scaffold under a directory called `apis`. Rename this directory to `api`
+- Move the `controllers` directory under the `internal` and rename it for `controller`
+- Now ensure that the imports will be updated accordingly by:
+ - Update the `main.go` imports to look for the new path of your controllers under the `pkg` directory
+
+**Then, let's update the scaffolds paths**
+
+- Update the Dockerfile to ensure that you will have:
+
+```
+COPY cmd/main.go cmd/main.go
+COPY api/ api/
+COPY internal/controller/ internal/controller/
+```
+
+Then, replace:
+
+```
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+
+```
+
+With:
+
+```
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
+```
+
+- Update the Makefile targets to build and run the manager by replacing:
+
+```
+.PHONY: build
+build: manifests generate fmt vet ## Build manager binary.
+ go build -o bin/manager main.go
+
+.PHONY: run
+run: manifests generate fmt vet ## Run a controller from your host.
+ go run ./main.go
+```
+
+With:
+
+```
+.PHONY: build
+build: manifests generate fmt vet ## Build manager binary.
+ go build -o bin/manager cmd/main.go
+
+.PHONY: run
+run: manifests generate fmt vet ## Run a controller from your host.
+ go run ./cmd/main.go
+```
+
+- Update the `internal/controller/suite_test.go` to set the path for the `CRDDirectoryPaths`:
+
+Replace:
+
+```
+CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
+```
+
+With:
+
+```
+CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+```
+
+Note that if your project has multiple groups (`multigroup:true`) then the above update should result into `"..", "..", "..",` instead of `"..",".."`
+
+#### Now, let's update the PATHs in the PROJECT file accordingly
+
+The PROJECT tracks the paths of all APIs used in your project. Ensure that they now point to `api/...` as the following example:
+
+Before update:
+ group: crew
+ kind: Captain
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4/apis/crew/v1
+```
+
+After Update:
+
+```
+ group: crew
+ kind: Captain
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4/api/crew/v1
+```
+
+### Update kustomize manifests with the changes made so far
+
+- Update the manifest under `config/` directory with all changes performed in the default scaffold done with `go/v4-alpha` plugin. (see for example `testdata/project-v4/config/`) to get all changes in the
+ default scaffolds to be applied on your project
+- Create `config/samples/kustomization.yaml` with all Custom Resources samples specified into `config/samples`. _(see for example `testdata/project-v4/config/samples/kustomization.yaml`)_
`config/` directory with changes into the scaffold files
@@ -52,17 +161,30 @@ default scaffolds to be applied on your project
Note that under the `config/` directory you will find scaffolding changes since using
`go/v4-alpha` you will ensure that you are no longer using Kustomize v3x.
-You can mainly compare the `config/` directory from the samples scaffolded under the `testdata`directory by
+You can mainly compare the `config/` directory from the samples scaffolded under the `testdata`directory by
checking the differences between the `testdata/project-v3/config/` with `testdata/project-v4/config/` which
are samples created with the same commands with the only difference being versions.
However, note that if you create your project with Kubebuilder CLI 3.0.0, its scaffolds
-might change to accommodate changes up to the latest releases using `go/v3` which are not considered
-breaking for users and/or are forced by the changes introduced in the dependencies
-used by the project such as [controller-runtime][controller-runtime] and [controller-tools][controller-tools].
+might change to accommodate changes up to the latest releases using `go/v3` which are not considered
+breaking for users and/or are forced by the changes introduced in the dependencies
+used by the project such as [controller-runtime][controller-runtime] and [controller-tools][controller-tools].
+### If you have webhooks:
+
+Replace the import `admissionv1beta1 "k8s.io/api/admission/v1beta1"` with `admissionv1 "k8s.io/api/admission/v1"` in the webhook test files
+
+### Makefile updates
+
+Update the Makefile with the changes which can be found in the samples under testdata for the release tag used. (see for example `testdata/project-v4/Makefile`)
+
+### Update the dependencies
+
+Update the `go.mod` with the changes which can be found in the samples under `testdata` for the release tag used. (see for example `testdata/project-v4/go.mod`). Then, run
+`go mod tidy` to ensure that you get the latest dependencies and your Golang code has no breaking changes.
+
### Verification
In the steps above, you updated your project manually with the goal of ensuring that it follows
diff --git a/docs/book/src/migration/migration_guide_gov3_to_gov4.md b/docs/book/src/migration/migration_guide_gov3_to_gov4.md
index c7741e8b398..a62bb33cc91 100644
--- a/docs/book/src/migration/migration_guide_gov3_to_gov4.md
+++ b/docs/book/src/migration/migration_guide_gov3_to_gov4.md
@@ -50,7 +50,7 @@ module tutorial.kubebuilder.io/migration-project
Now, we can finish initializing the project with kubebuilder.
```bash
-kubebuilder init --domain tutorial.kubebuilder.io plugins=go/v4-alpha
+kubebuilder init --domain tutorial.kubebuilder.io --plugins=go/v4-alpha
```
diff --git a/docs/book/src/migration/v3vsv4.md b/docs/book/src/migration/v3vsv4.md
index 1cd0e39031f..403b21411ac 100644
--- a/docs/book/src/migration/v3vsv4.md
+++ b/docs/book/src/migration/v3vsv4.md
@@ -20,6 +20,8 @@ The details of all changes (breaking or otherwise) can be found in:
- no longer scaffold webhook test files with `"k8s.io/api/admission/v1beta1"` the k8s API which is no longer served since k8s `1.25`. By default
webhooks test files are scaffolding using `"k8s.io/api/admission/v1"` which is support from k8s `1.20`
- no longer provide backwards compatible support with k8s versions < `1.16`
+- change the layout to accommodate the community request to follow the [Standard Go Project Layout][standard-go-project]
+by moving the api(s) under a new directory called `api`, controller(s) under a new directory called `internal` and the `main.go` under a new directory named `cmd`
TL;DR of the New `go/v4-alpha` Plugin
@@ -86,3 +88,4 @@ This way is more complex, susceptible to errors, and success cannot be assured.
[go/v4-doc]: ./../plugins/go-v4-plugin.md
[migration-guide-gov3-to-gov4]: migration_guide_gov3_to_gov4.md
[manually-upgrade]: manually_migration_guide_gov3_to_gov4.md
+[standard-go-project]: https://github.com/golang-standards/project-layout
\ No newline at end of file
diff --git a/docs/book/src/plugins/creating-plugins.md b/docs/book/src/plugins/creating-plugins.md
index d347db71711..463e0d3b433 100644
--- a/docs/book/src/plugins/creating-plugins.md
+++ b/docs/book/src/plugins/creating-plugins.md
@@ -183,7 +183,7 @@ Alternatively, you can create a plugin bundle to include the target plugins. For
[example-of-deploy-image-1]: https://github.com/kubernetes-sigs/kubebuilder/blob/df1ed6ccf19df40bd929157a91eaae6a9215bfc6/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/api/types.go#L58
[example-of-deploy-image-2]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go#L170-L266
[example-of-deploy-image-3]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go#L77-L98
-[available-plugins]: https://github.com/kubernetes-sigs/kubebuilder/pull/available-plugins.md
+[available-plugins]: ./available-plugins.md
[operator-sdk-manifest]: https://github.com/operator-framework/operator-sdk/tree/v1.23.0/internal/plugins/manifests/v2
[operator-sdk-scorecard]: https://github.com/operator-framework/operator-sdk/tree/v1.23.0/internal/plugins/scorecard/v2
[operator-sdk-plugin-ref]: https://github.com/operator-framework/operator-sdk/blob/v1.23.0/internal/cmd/operator-sdk/cli/cli.go#L78-L160
diff --git a/docs/book/src/plugins/go-v4-plugin.md b/docs/book/src/plugins/go-v4-plugin.md
index 4b2fb1fa6d5..8f2a98b9fca 100644
--- a/docs/book/src/plugins/go-v4-plugin.md
+++ b/docs/book/src/plugins/go-v4-plugin.md
@@ -1,7 +1,7 @@
# go/v4-alpha (go.kubebuilder.io/v4-alpha)
Kubebuilder will scaffold using the `go/v4-alpha` plugin only if specified when initializing the project.
-This plugin is a composition of the plugins ` kustomize.common.kubebuilder.io/v2-alpha` and `base.go.kubebuilder.io/v4`.
+This plugin is a composition of the plugins ` kustomize.common.kubebuilder.io/v2-alpha` and `base.go.kubebuilder.io/v4-alpha`.
It scaffolds a project template that helps in constructing sets of [controllers][controller-runtime].
It scaffolds boilerplate code to create and design controllers.
@@ -24,6 +24,8 @@ under the [testdata][testdata] directory on the root directory of the Kubebuilde
- If you are looking to have your project update with the latest version available
- if you are not targeting k8s versions < `1.16` and `1.20` if you are using webhooks
- If you are looking to work on with scaffolds which are compatible with k8s `1.25+`
+- If you are looking for the new layout following the [Standard Go Project Layout][standard-go-project] where
+the "api(s)" are scaffold under the `api` directory, "controller(s)" under `internal`, and the `main.go` under `cmd`
@@ -61,4 +63,5 @@ kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io
[testdata]: https://github.com/kubernetes-sigs/kubebuilder/tree/master/testdata
[plugins-main]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/cmd/main.go
[kustomize-plugin]: ../plugins/kustomize-v2-alpha.md
-[kustomize]: https://github.com/kubernetes-sigs/kustomize
\ No newline at end of file
+[kustomize]: https://github.com/kubernetes-sigs/kustomize
+[standard-go-project]: https://github.com/golang-standards/project-layout
\ No newline at end of file
diff --git a/docs/book/src/quick-start.md b/docs/book/src/quick-start.md
index ceaefc7f913..d22fffcd0ec 100644
--- a/docs/book/src/quick-start.md
+++ b/docs/book/src/quick-start.md
@@ -31,7 +31,7 @@ Install [kubebuilder](https://sigs.k8s.io/kubebuilder):
```bash
# download kubebuilder and install locally.
-curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$\(go env GOOS\)/$\(go env GOARCH\)
+curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
chmod +x kubebuilder && mv kubebuilder /usr/local/bin/
```
@@ -106,7 +106,6 @@ logic. For more info see [Designing an API](/cronjob-tutorial/api-design.md) and
a Controller](cronjob-tutorial/controller-overview.md).
If you are editing the API definitions, generate the manifests such as Custom Resources (CRs) or Custom Resource Defintions (CRDs) using
-
```bash
make manifests
```
@@ -263,4 +262,4 @@ complexities of achieving this goal while allowing users to customize the genera
[go-modules-blogpost]: https://blog.golang.org/using-go-modules
[envtest]: https://book.kubebuilder.io/reference/testing/envtest.html
[architecture-concept-diagram]: architecture.md
-[kustomize]: https://github.com/kubernetes-sigs/kustomize
\ No newline at end of file
+[kustomize]: https://github.com/kubernetes-sigs/kustomize
diff --git a/docs/book/src/reference/completion.md b/docs/book/src/reference/completion.md
index 3e123de5d28..4e15dca47c6 100644
--- a/docs/book/src/reference/completion.md
+++ b/docs/book/src/reference/completion.md
@@ -25,7 +25,7 @@ The completion Bash script depends on [bash-completion](https://github.com/scop/
if [ -f /usr/local/share/bash-completion/bash_completion ]; then
. /usr/local/share/bash-completion/bash_completion
fi
-. <(kubebuilder completion)
+. <(kubebuilder completion bash)
```
- Restart terminal for the changes to be reflected.
diff --git a/docs/book/src/reference/envtest.md b/docs/book/src/reference/envtest.md
index 1099bf88cd1..7154f93108d 100644
--- a/docs/book/src/reference/envtest.md
+++ b/docs/book/src/reference/envtest.md
@@ -10,7 +10,7 @@ by default. `make test` is the one-stop shop for downloading the binaries, setti
The make targets require `bash` to run.
-## Installation in Air Gaped/disconnected environments
+## Installation in Air Gapped/disconnected environments
If you would like to download the tarball containing the binaries, to use in a disconnected environment you can use
[`setup-envtest`][setup-envtest] to download the required binaries locally. There are a lot of ways to configure `setup-envtest` to avoid talking to
the internet you can read about them [here](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest#what-if-i-dont-want-to-talk-to-the-internet).
@@ -184,6 +184,31 @@ expectedOwnerReference := v1.OwnerReference{
Expect(deployment.ObjectMeta.OwnerReferences).To(ContainElement(expectedOwnerReference))
```
+
+
+Namespace usage limitation
+
+EnvTest does not support namespace deletion. Deleting a namespace will seem to succeed, but the namespace will just be put in a Terminating state, and never actually be reclaimed. Trying to recreate the namespace will fail. This will cause your reconciler to continue reconciling any objects left behind, unless they are deleted.
+
+To overcome this limitation you can create a new namespace for each test. Even so, when one test completes (e.g. in "namespace-1") and another test starts (e.g. in "namespace-2"), the controller will still be reconciling any active objects from "namespace-1". This can be avoided by ensuring that all tests clean up after themselves as part of the test teardown. If teardown of a namespace is difficult, it may be possible to wire the reconciler in such a way that it ignores reconcile requests that come from namespaces other than the one being tested:
+
+```go
+type MyCoolReconciler struct {
+ client.Client
+ ...
+ Namespace string // restrict namespaces to reconcile
+}
+func (r *MyCoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = r.Log.WithValues("myreconciler", req.NamespacedName)
+ // Ignore requests for other namespaces, if specified
+ if r.Namespace != "" && req.Namespace != r.Namespace {
+ return ctrl.Result{}, nil
+ }
+```
+Whenever your tests create a new namespace, it can modify the value of reconciler.Namespace. The reconciler will effectively ignore the previous namespace.
+For further information see the issue raised in the controller-runtime [controller-runtime/issues/880](https://github.com/kubernetes-sigs/controller-runtime/issues/880) to add this support.
+
+
## Cert-Manager and Prometheus options
Projects scaffolded with Kubebuilder can enable the [`metrics`][metrics] and the [`cert-manager`][cert-manager] options. Note that when we are using the ENV TEST we are looking to test the controllers and their reconciliation. It is considered an integrated test because the ENV TEST API will do the test against a cluster and because of this the binaries are downloaded and used to configure its pre-requirements, however, its purpose is mainly to `unit` test the controllers.
@@ -293,42 +318,9 @@ testEnv = &envtest.Environment{
}
```
-
-
-Namespace usage limitation
-
-EnvTest does not support namespace deletion. Deleting a namespace will seem to succeed, but the namespace will just be put in a Terminating state, and never actually be reclaimed. Trying to recreate the namespace will fail. This will cause your reconciler to continue reconciling any objects left behind, unless they are deleted.
-
-To overcome this limitation you can create a new namespace for each test. Even so, when one test completes (e.g. in "namespace-1") and another test starts (e.g. in "namespace-2"), the controller will still be reconciling any active objects from "namespace-1". This can be avoided by ensuring that all tests clean up after themselves as part of the test teardown. If teardown of a namespace is difficult, it may be possible to wire the reconciler in such a way that it ignores reconcile requests that come from namespaces other than the one being tested:
-
-```go
-type MyCoolReconciler struct {
- client.Client
- ...
- Namespace string // restrict namespaces to reconcile
-}
-
-func (r *MyCoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
- _ = r.Log.WithValues("myreconciler", req.NamespacedName)
-
- // Ignore requests for other namespaces, if specified
- if r.Namespace != "" && req.Namespace != r.Namespace {
- return ctrl.Result{}, nil
- }
-```
-
-Whenever your tests create a new namespace, it can modify the value of reconciler.Namespace. The reconciler will effectively ignore the previous namespace.
-
-For further information see the issue raised in the controller-runtime [controller-runtime/issues/880](https://github.com/kubernetes-sigs/controller-runtime/issues/880) to add this support.
-
-
-
-[envtest]:https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest
-[setup-envtest]:https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest
[metrics]: https://book.kubebuilder.io/reference/metrics.html
[envtest]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest
[setup-envtest]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest
[cert-manager]: https://book.kubebuilder.io/cronjob-tutorial/cert-manager.html
[sdk-e2e-sample-example]: https://github.com/operator-framework/operator-sdk/tree/master/testdata/go/v3/memcached-operator/test/e2e
[sdk]: https://github.com/operator-framework/operator-sdk
-
diff --git a/go.mod b/go.mod
index 206ed5b89a8..3839d3d8354 100644
--- a/go.mod
+++ b/go.mod
@@ -3,15 +3,15 @@ module sigs.k8s.io/kubebuilder/v3
go 1.19
require (
- github.com/gobuffalo/flect v0.3.0
- github.com/onsi/ginkgo/v2 v2.5.1
- github.com/onsi/gomega v1.24.1
+ github.com/gobuffalo/flect v1.0.0
+ github.com/onsi/ginkgo/v2 v2.7.0
+ github.com/onsi/gomega v1.24.2
github.com/sirupsen/logrus v1.9.0
github.com/spf13/afero v1.9.3
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
- golang.org/x/text v0.4.0
- golang.org/x/tools v0.3.0
+ golang.org/x/text v0.6.0
+ golang.org/x/tools v0.5.0
sigs.k8s.io/yaml v1.3.0
)
@@ -22,8 +22,8 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
golang.org/x/mod v0.7.0 // indirect
- golang.org/x/net v0.2.0 // indirect
- golang.org/x/sys v0.2.0 // indirect
+ golang.org/x/net v0.5.0 // indirect
+ golang.org/x/sys v0.4.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
diff --git a/go.sum b/go.sum
index 8b2b9fc4be0..7ca30173f71 100644
--- a/go.sum
+++ b/go.sum
@@ -62,8 +62,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/gobuffalo/flect v0.3.0 h1:erfPWM+K1rFNIQeRPdeEXxo8yFr/PO17lhRnS8FUrtk=
-github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE=
+github.com/gobuffalo/flect v1.0.0 h1:eBFmskjXZgAOagiTXJH25Nt5sdFwNRcb8DKZsIsAUQI=
+github.com/gobuffalo/flect v1.0.0/go.mod h1:l9V6xSb4BlXwsxEMj3FVEub2nkdQjWhPvD8XTTlHPQc=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -138,10 +138,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
-github.com/onsi/ginkgo/v2 v2.5.1 h1:auzK7OI497k6x4OvWq+TKAcpcSAlod0doAH72oIN0Jw=
-github.com/onsi/ginkgo/v2 v2.5.1/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc=
-github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E=
-github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
+github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow=
+github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
+github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE=
+github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -159,12 +159,14 @@ 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=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -248,8 +250,8 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
-golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
+golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw=
+golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -305,8 +307,8 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
-golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
+golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -314,8 +316,8 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
-golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
+golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -366,8 +368,8 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
-golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=
-golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
+golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=
+golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k=
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=
diff --git a/pkg/config/store/yaml/store.go b/pkg/config/store/yaml/store.go
index 46223f1078d..8f3531dc65b 100644
--- a/pkg/config/store/yaml/store.go
+++ b/pkg/config/store/yaml/store.go
@@ -31,6 +31,13 @@ import (
const (
// DefaultPath is the default path for the configuration file
DefaultPath = "PROJECT"
+
+ // Comment for 'PROJECT' config file
+ commentStr = `# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
+`
)
// yamlStore implements store.Store using a YAML file as the storage backend
@@ -133,6 +140,9 @@ func (s yamlStore) SaveTo(path string) error {
return store.SaveError{Err: fmt.Errorf("unable to marshal to YAML: %w", err)}
}
+ // Prepend warning comment for the 'PROJECT' file
+ content = append([]byte(commentStr), content...)
+
// Write the marshalled configuration
err = afero.WriteFile(s.fs, path, content, 0600)
if err != nil {
diff --git a/pkg/config/store/yaml/store_test.go b/pkg/config/store/yaml/store_test.go
index 42bf58d69ca..be831a489eb 100644
--- a/pkg/config/store/yaml/store_test.go
+++ b/pkg/config/store/yaml/store_test.go
@@ -86,7 +86,7 @@ layout: ""
Context("Load", func() {
It("should load the Config from an existing file at the default path", func() {
- Expect(afero.WriteFile(s.fs, DefaultPath, []byte(v2File), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, DefaultPath, []byte(commentStr+v2File), os.ModePerm)).To(Succeed())
Expect(s.Load()).To(Succeed())
Expect(s.fs).NotTo(BeNil())
@@ -102,7 +102,7 @@ layout: ""
})
It("should fail if unable to identify the version of the file at the default path", func() {
- Expect(afero.WriteFile(s.fs, DefaultPath, []byte(unversionedFile), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, DefaultPath, []byte(commentStr+unversionedFile), os.ModePerm)).To(Succeed())
err := s.Load()
Expect(err).To(HaveOccurred())
@@ -110,7 +110,7 @@ layout: ""
})
It("should fail if unable to create a Config for the version of the file at the default path", func() {
- Expect(afero.WriteFile(s.fs, DefaultPath, []byte(nonexistentVersionFile), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, DefaultPath, []byte(commentStr+nonexistentVersionFile), os.ModePerm)).To(Succeed())
err := s.Load()
Expect(err).To(HaveOccurred())
@@ -118,7 +118,7 @@ layout: ""
})
It("should fail if unable to unmarshal the file at the default path", func() {
- Expect(afero.WriteFile(s.fs, DefaultPath, []byte(wrongFile), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, DefaultPath, []byte(commentStr+wrongFile), os.ModePerm)).To(Succeed())
err := s.Load()
Expect(err).To(HaveOccurred())
@@ -128,7 +128,7 @@ layout: ""
Context("LoadFrom", func() {
It("should load the Config from an existing file from the specified path", func() {
- Expect(afero.WriteFile(s.fs, path, []byte(v2File), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, path, []byte(commentStr+v2File), os.ModePerm)).To(Succeed())
Expect(s.LoadFrom(path)).To(Succeed())
Expect(s.fs).NotTo(BeNil())
@@ -144,7 +144,7 @@ layout: ""
})
It("should fail if unable to identify the version of the file at the specified path", func() {
- Expect(afero.WriteFile(s.fs, path, []byte(unversionedFile), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, path, []byte(commentStr+unversionedFile), os.ModePerm)).To(Succeed())
err := s.LoadFrom(path)
Expect(err).To(HaveOccurred())
@@ -152,7 +152,7 @@ layout: ""
})
It("should fail if unable to create a Config for the version of the file at the specified path", func() {
- Expect(afero.WriteFile(s.fs, path, []byte(nonexistentVersionFile), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, path, []byte(commentStr+nonexistentVersionFile), os.ModePerm)).To(Succeed())
err := s.LoadFrom(path)
Expect(err).To(HaveOccurred())
@@ -160,7 +160,7 @@ layout: ""
})
It("should fail if unable to unmarshal the file at the specified path", func() {
- Expect(afero.WriteFile(s.fs, path, []byte(wrongFile), os.ModePerm)).To(Succeed())
+ Expect(afero.WriteFile(s.fs, path, []byte(commentStr+wrongFile), os.ModePerm)).To(Succeed())
err := s.LoadFrom(path)
Expect(err).To(HaveOccurred())
@@ -175,7 +175,7 @@ layout: ""
cfgBytes, err := afero.ReadFile(s.fs, DefaultPath)
Expect(err).NotTo(HaveOccurred())
- Expect(string(cfgBytes)).To(Equal(v2File))
+ Expect(string(cfgBytes)).To(Equal(commentStr + v2File))
})
It("should succeed for a valid config that must not exist", func() {
@@ -185,7 +185,7 @@ layout: ""
cfgBytes, err := afero.ReadFile(s.fs, DefaultPath)
Expect(err).NotTo(HaveOccurred())
- Expect(string(cfgBytes)).To(Equal(v2File))
+ Expect(string(cfgBytes)).To(Equal(commentStr + v2File))
})
It("should fail for an empty config", func() {
@@ -212,8 +212,7 @@ layout: ""
cfgBytes, err := afero.ReadFile(s.fs, path)
Expect(err).NotTo(HaveOccurred())
- Expect(string(cfgBytes)).To(Equal(`version: "2"
-`))
+ Expect(string(cfgBytes)).To(Equal(commentStr + v2File))
})
It("should succeed for a valid config that must not exist", func() {
@@ -223,7 +222,7 @@ layout: ""
cfgBytes, err := afero.ReadFile(s.fs, path)
Expect(err).NotTo(HaveOccurred())
- Expect(string(cfgBytes)).To(Equal(v2File))
+ Expect(string(cfgBytes)).To(Equal(commentStr + v2File))
})
It("should fail for an empty config", func() {
diff --git a/pkg/model/resource/utils.go b/pkg/model/resource/utils.go
index a71ad71fb1e..3d8b858c8c4 100644
--- a/pkg/model/resource/utils.go
+++ b/pkg/model/resource/utils.go
@@ -50,6 +50,14 @@ func safeImport(unsafe string) string {
// APIPackagePath returns the default path
func APIPackagePath(repo, group, version string, multiGroup bool) string {
+ if multiGroup && group != "" {
+ return path.Join(repo, "api", group, version)
+ }
+ return path.Join(repo, "api", version)
+}
+
+// APIPackagePathLegacy returns the default path
+func APIPackagePathLegacy(repo, group, version string, multiGroup bool) string {
if multiGroup {
if group != "" {
return path.Join(repo, "apis", group, version)
diff --git a/pkg/model/resource/utils_test.go b/pkg/model/resource/utils_test.go
index cea003e4363..9e1451a3217 100644
--- a/pkg/model/resource/utils_test.go
+++ b/pkg/model/resource/utils_test.go
@@ -45,6 +45,23 @@ var _ = Describe("APIPackagePath", func() {
Expect(APIPackagePath(repo, group, version, multiGroup)).To(Equal(p))
},
Entry("single group setup", repo, group, version, false, path.Join(repo, "api", version)),
+ Entry("multiple group setup", repo, group, version, true, path.Join(repo, "api", group, version)),
+ Entry("multiple group setup with empty group", repo, "", version, true, path.Join(repo, "api", version)),
+ )
+})
+
+var _ = Describe("APIPackagePathLegacy", func() {
+ const (
+ repo = "github.com/kubernetes-sigs/kubebuilder"
+ group = "group"
+ version = "v1"
+ )
+
+ DescribeTable("should work",
+ func(repo, group, version string, multiGroup bool, p string) {
+ Expect(APIPackagePathLegacy(repo, group, version, multiGroup)).To(Equal(p))
+ },
+ Entry("single group setup", repo, group, version, false, path.Join(repo, "api", version)),
Entry("multiple group setup", repo, group, version, true, path.Join(repo, "apis", group, version)),
Entry("multiple group setup with empty group", repo, "", version, true, path.Join(repo, "apis", version)),
)
diff --git a/pkg/plugin/helpers.go b/pkg/plugin/helpers.go
index d2edfaa6db9..a957d4cb071 100644
--- a/pkg/plugin/helpers.go
+++ b/pkg/plugin/helpers.go
@@ -47,6 +47,19 @@ func GetShortName(name string) string {
return strings.SplitN(name, ".", 2)[0]
}
+// Deprecated: it was added to ensure backwards compatibility and should
+// be removed when we remove the go/v3 plugin
+// IsLegacyLayout returns true when is possible to identify that the project
+// was scaffolded with the previous layout
+func IsLegacyLayout(config config.Config) bool {
+ for _, pluginKey := range config.GetPluginChain() {
+ if strings.Contains(pluginKey, "go.kubebuilder.io/v3") || strings.Contains(pluginKey, "go.kubebuilder.io/v2") {
+ return true
+ }
+ }
+ return false
+}
+
// Validate ensures a Plugin is valid.
func Validate(p Plugin) error {
if err := validateName(p.Name()); err != nil {
diff --git a/pkg/plugin/util/helpers.go b/pkg/plugin/util/helpers.go
index db252d63d8d..87d953f268b 100644
--- a/pkg/plugin/util/helpers.go
+++ b/pkg/plugin/util/helpers.go
@@ -20,16 +20,19 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/config"
)
+// Deprecated: go/v4 no longer supports v1beta1 option
// HasDifferentCRDVersion returns true if any other CRD version is tracked in the project configuration.
func HasDifferentCRDVersion(config config.Config, crdVersion string) bool {
return hasDifferentAPIVersion(config.ListCRDVersions(), crdVersion)
}
+// Deprecated: go/v4 no longer supports v1beta1 option
// HasDifferentWebhookVersion returns true if any other webhook version is tracked in the project configuration.
func HasDifferentWebhookVersion(config config.Config, webhookVersion string) bool {
return hasDifferentAPIVersion(config.ListWebhookVersions(), webhookVersion)
}
+// Deprecated: go/v4 no longer supports v1beta1 option
func hasDifferentAPIVersion(versions []string, version string) bool {
return !(len(versions) == 0 || (len(versions) == 1 && versions[0] == version))
}
diff --git a/pkg/plugin/util/util.go b/pkg/plugin/util/util.go
index 71d800980e0..927ceb2d473 100644
--- a/pkg/plugin/util/util.go
+++ b/pkg/plugin/util/util.go
@@ -191,6 +191,25 @@ func EnsureExistAndReplace(input, match, replace string) (string, error) {
return strings.Replace(input, match, replace, -1), nil
}
+func HasFragment(path, target string) (bool, error) {
+ _, err := os.Stat(path)
+ if err != nil {
+ return false, err
+ }
+
+ // false positive
+ // nolint:gosec
+ b, err := os.ReadFile(path)
+ if err != nil {
+ return false, err
+ }
+
+ if !strings.Contains(string(b), target) {
+ return false, nil
+ }
+ return true, nil
+}
+
// ReplaceInFile replaces all instances of old with new in the file at path.
func ReplaceInFile(path, old, new string) error {
info, err := os.Stat(path)
diff --git a/pkg/plugins/common/kustomize/v2-alpha/scaffolds/api.go b/pkg/plugins/common/kustomize/v2-alpha/scaffolds/api.go
index 7b88dcd3338..4713f6f0150 100644
--- a/pkg/plugins/common/kustomize/v2-alpha/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v2-alpha/scaffolds/api.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
diff --git a/pkg/plugins/common/kustomize/v2-alpha/scaffolds/internal/templates/config/samples/kustomization.go b/pkg/plugins/common/kustomize/v2-alpha/scaffolds/internal/templates/config/samples/kustomization.go
index 7178982f216..e2be2044d5a 100644
--- a/pkg/plugins/common/kustomize/v2-alpha/scaffolds/internal/templates/config/samples/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2-alpha/scaffolds/internal/templates/config/samples/kustomization.go
@@ -19,6 +19,7 @@ package samples
import (
"fmt"
"path/filepath"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
diff --git a/pkg/plugins/golang/declarative/v1/api.go b/pkg/plugins/golang/declarative/v1/api.go
index fd0d6f44b25..c4efdb42a99 100644
--- a/pkg/plugins/golang/declarative/v1/api.go
+++ b/pkg/plugins/golang/declarative/v1/api.go
@@ -31,8 +31,8 @@ import (
const (
// kbDeclarativePattern is the sigs.k8s.io/kubebuilder-declarative-pattern version
- kbDeclarativePatternForV2 = "v0.0.0-20200522144838-848d48e5b073"
- kbDeclarativePatternForV3 = "e0605f0e1a40f97293cb3773f57de695c8bc76af"
+ kbDeclarativePatternForV2 = "v0.0.0-20200522144838-848d48e5b073"
+ kbDeclarativePatternForV3V4 = "18dbaf5fcd851e6adc3f2f8a8facb669a1420797"
)
var _ plugin.CreateAPISubcommand = &createAPISubcommand{}
@@ -100,7 +100,8 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
}
// Update Dockerfile
- err = updateDockerfile()
+ // nolint:staticcheck
+ err = updateDockerfile(plugin.IsLegacyLayout(p.config))
if err != nil {
return err
}
@@ -124,7 +125,7 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
// Ensure that we are pinning sigs.k8s.io/kubebuilder-declarative-pattern version
// Just pin an old value for go/v2. It shows fine for now. However, we should improve/change it
// if we see that more rules based on the plugins version are required.
- kbDeclarativePattern := kbDeclarativePatternForV3
+ kbDeclarativePattern := kbDeclarativePatternForV3V4
for _, pluginKey := range p.config.GetPluginChain() {
if pluginKey == plugin.KeyFor(goPluginV2.Plugin{}) {
kbDeclarativePattern = kbDeclarativePatternForV2
diff --git a/pkg/plugins/golang/declarative/v1/init.go b/pkg/plugins/golang/declarative/v1/init.go
index 5a6e0bf5df0..db15aa1bbac 100644
--- a/pkg/plugins/golang/declarative/v1/init.go
+++ b/pkg/plugins/golang/declarative/v1/init.go
@@ -41,7 +41,8 @@ func (p *initSubcommand) InjectConfig(c config.Config) error {
}
func (p *initSubcommand) Scaffold(_ machinery.Filesystem) error {
- err := updateDockerfile()
+ //nolint:staticcheck
+ err := updateDockerfile(plugin.IsLegacyLayout(p.config))
if err != nil {
return err
}
@@ -49,19 +50,23 @@ func (p *initSubcommand) Scaffold(_ machinery.Filesystem) error {
}
// updateDockerfile will add channels staging required for declarative plugin
-func updateDockerfile() error {
+func updateDockerfile(isLegacyLayout bool) error {
fmt.Println("updating Dockerfile to add channels/ directory in the image")
- managerFile := filepath.Join("Dockerfile")
+ dockerfile := filepath.Join("Dockerfile")
+ controllerPath := "internal/controller/"
+ if isLegacyLayout {
+ controllerPath = "controllers/"
+ }
// nolint:lll
- err := insertCodeIfDoesNotExist(managerFile,
- "COPY controllers/ controllers/",
+ err := insertCodeIfDoesNotExist(dockerfile,
+ fmt.Sprintf("COPY %s %s", controllerPath, controllerPath),
"\n# https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/docs/addon/walkthrough/README.md#adding-a-manifest\n# Stage channels and make readable\nCOPY channels/ /channels/\nRUN chmod -R a+rx /channels/")
if err != nil {
return err
}
- err = insertCodeIfDoesNotExist(managerFile,
+ err = insertCodeIfDoesNotExist(dockerfile,
"COPY --from=builder /workspace/manager .",
"\n# copy channels\nCOPY --from=builder /channels /channels\n")
if err != nil {
diff --git a/pkg/plugins/golang/declarative/v1/scaffolds/api.go b/pkg/plugins/golang/declarative/v1/scaffolds/api.go
index af0ab1907ed..10273b1958a 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/api.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/api.go
@@ -24,6 +24,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates"
)
@@ -70,9 +71,10 @@ func (s *apiScaffolder) Scaffold() error {
machinery.WithResource(&s.resource),
)
+ //nolint:staticcheck
err = scaffold.Execute(
- &templates.Types{},
- &templates.Controller{},
+ &templates.Types{IsLegacyLayout: plugin.IsLegacyLayout(s.config)},
+ &templates.Controller{IsLegacyLayout: plugin.IsLegacyLayout(s.config)},
&templates.Channel{ManifestVersion: exampleManifestVersion},
&templates.Manifest{ManifestVersion: exampleManifestVersion},
)
diff --git a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
index f0b32456748..23a1340b684 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
@@ -17,6 +17,7 @@ limitations under the License.
package templates
import (
+ "fmt"
"path/filepath"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -31,18 +32,36 @@ type Controller struct {
machinery.MultiGroupMixin
machinery.BoilerplateMixin
machinery.ResourceMixin
+
+ IsLegacyLayout bool
+ PackageName string
}
// SetTemplateDefaults implements file.Template
func (f *Controller) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller.go")
+ if f.IsLegacyLayout {
+ if f.MultiGroup {
+ f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller.go")
+ } else {
+ f.Path = filepath.Join("controllers", "%[kind]_controller.go")
+ }
} else {
- f.Path = filepath.Join("controllers", "%[kind]_controller.go")
+ if f.MultiGroup {
+ f.Path = filepath.Join("internal", "controller", "%[group]", "%[kind]_controller.go")
+ } else {
+ f.Path = filepath.Join("internal", "controller", "%[kind]_controller.go")
+ }
}
+
}
f.Path = f.Resource.Replacer().Replace(f.Path)
+ fmt.Println(f.Path)
+
+ f.PackageName = "controller"
+ if f.IsLegacyLayout {
+ f.PackageName = "controllers"
+ }
f.TemplateBody = controllerTemplate
@@ -54,7 +73,7 @@ func (f *Controller) SetTemplateDefaults() error {
//nolint:lll
const controllerTemplate = `{{ .Boilerplate }}
-package controllers
+package {{ .PackageName }}
import (
"github.com/go-logr/logr"
diff --git a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/types.go b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/types.go
index 4a3b063ba05..359c3bb0d34 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/types.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/types.go
@@ -33,18 +33,30 @@ type Types struct {
machinery.MultiGroupMixin
machinery.BoilerplateMixin
machinery.ResourceMixin
+
+ IsLegacyLayout bool
}
// SetTemplateDefaults implements file.Template
func (f *Types) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- f.Path = filepath.Join("apis", "%[group]", "%[version]", "%[kind]_types.go")
+ if f.IsLegacyLayout {
+ if f.MultiGroup {
+ f.Path = filepath.Join("apis", "%[group]", "%[version]", "%[kind]_types.go")
+ } else {
+ f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
+ }
} else {
- f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
+ if f.MultiGroup {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "%[kind]_types.go")
+ } else {
+ f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
+ }
}
+
}
f.Path = f.Resource.Replacer().Replace(f.Path)
+ fmt.Println(f.Path)
f.TemplateBody = typesTemplate
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/api.go b/pkg/plugins/golang/deploy-image/v1alpha1/api.go
index a0e6ee27a07..5e256343e5c 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/api.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/api.go
@@ -20,10 +20,10 @@ import (
"errors"
"fmt"
"os"
-
- goPlugin "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
+ "strings"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
+ goPlugin "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
"github.com/spf13/pflag"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -43,9 +43,6 @@ const deprecateMsg = "The v1beta1 API version for CRDs and Webhooks are deprecat
"recommend you no longer use these API versions." +
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22"
-// DefaultMainPath is default file path of main.go
-const DefaultMainPath = "main.go"
-
var _ plugin.CreateAPISubcommand = &createAPISubcommand{}
type createAPISubcommand struct {
@@ -152,6 +149,7 @@ func (p *createAPISubcommand) InjectResource(res *resource.Resource) error {
p.options.DoAPI = true
p.options.DoController = true
p.options.Namespaced = true
+
p.options.UpdateResource(p.resource, p.config)
if err := p.resource.Validate(); err != nil {
@@ -165,12 +163,14 @@ func (p *createAPISubcommand) InjectResource(res *resource.Resource) error {
}
// Check CRDVersion against all other CRDVersions in p.config for compatibility.
+ // nolint:staticcheck
if util.HasDifferentCRDVersion(p.config, p.resource.API.CRDVersion) {
return fmt.Errorf("only one CRD version can be used for all resources, cannot add %q",
p.resource.API.CRDVersion)
}
// Check CRDVersion against all other CRDVersions in p.config for compatibility.
+ // nolint:staticcheck
if util.HasDifferentCRDVersion(p.config, p.resource.API.CRDVersion) {
return fmt.Errorf("only one CRD version can be used for all resources, cannot add %q",
p.resource.API.CRDVersion)
@@ -184,9 +184,20 @@ func (p *createAPISubcommand) PreScaffold(machinery.Filesystem) error {
return fmt.Errorf("you MUST inform the image that will be used in the reconciliation")
}
- // check if main.go is present in the root directory
- if _, err := os.Stat(DefaultMainPath); os.IsNotExist(err) {
- return fmt.Errorf("%s file should present in the root directory", DefaultMainPath)
+ isGoV3 := false
+ for _, pluginKey := range p.config.GetPluginChain() {
+ if strings.Contains(pluginKey, "go.kubebuilder.io/v3") {
+ isGoV3 = true
+ }
+ }
+
+ defaultMainPath := "cmd/main.go"
+ if isGoV3 {
+ defaultMainPath = "main.go"
+ }
+ // check if main.go is present in the cmd/ directory
+ if _, err := os.Stat(defaultMainPath); os.IsNotExist(err) {
+ return fmt.Errorf("main.go file should be present in %s", defaultMainPath)
}
return nil
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
index 5fad1c14bfd..274d87a4eef 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
@@ -21,6 +21,8 @@ import (
"path/filepath"
"strings"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
+
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -77,13 +79,8 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
func (s *apiScaffolder) Scaffold() error {
fmt.Println("Writing scaffold for you to edit...")
- //nolint:staticcheck
- isGoV3 := false
- for _, pluginKey := range s.config.GetPluginChain() {
- if strings.Contains(pluginKey, "go.kubebuilder.io/v3") {
- isGoV3 = true
- }
- }
+ //nolint: staticcheck
+ isGoV3 := plugin.IsLegacyLayout(s.config)
if err := s.scaffoldCreateAPIFromPlugins(isGoV3); err != nil {
return err
@@ -103,7 +100,7 @@ func (s *apiScaffolder) Scaffold() error {
)
if err := scaffold.Execute(
- &api.Types{Port: s.port},
+ &api.Types{Port: s.port, IsLegacyLayout: isGoV3},
); err != nil {
return fmt.Errorf("error updating APIs: %v", err)
}
@@ -116,7 +113,13 @@ func (s *apiScaffolder) Scaffold() error {
controller := &controllers.Controller{
ControllerRuntimeVersion: golangv3scaffolds.ControllerRuntimeVersion,
+ IsLegacyLayout: isGoV3,
}
+
+ if !isGoV3 {
+ controller.ControllerRuntimeVersion = golangv4scaffolds.ControllerRuntimeVersion
+ }
+
if err := scaffold.Execute(
controller,
); err != nil {
@@ -127,14 +130,18 @@ func (s *apiScaffolder) Scaffold() error {
return fmt.Errorf("error updating controller: %v", err)
}
- if err := s.updateMainByAddingEventRecorder(); err != nil {
+ defaultMainPath := "cmd/main.go"
+ if isGoV3 {
+ defaultMainPath = "main.go"
+ }
+ if err := s.updateMainByAddingEventRecorder(isGoV3, defaultMainPath); err != nil {
return fmt.Errorf("error updating main.go: %v", err)
}
if err := scaffold.Execute(
- &controllers.ControllerTest{Port: s.port},
+ &controllers.ControllerTest{Port: s.port, IsLegacyLayout: isGoV3},
); err != nil {
- return fmt.Errorf("error creating controllers/**_controller_test.go: %v", err)
+ return fmt.Errorf("error creating controller/**_controller_test.go: %v", err)
}
if err := s.addEnvVarIntoManager(); err != nil {
@@ -181,18 +188,29 @@ func (s *apiScaffolder) scaffoldCreateAPIFromPlugins(isLegacyLayout bool) error
// TODO: replace this implementation by creating its own MainUpdater
// which will have its own controller template which set the recorder so that we can use it
// in the reconciliation to create an event inside for the finalizer
-func (s *apiScaffolder) updateMainByAddingEventRecorder() error {
- defaultMainPath := "main.go"
-
- if err := util.InsertCode(
- defaultMainPath,
- fmt.Sprintf(
- `if err = (&controllers.%sReconciler{
+func (s *apiScaffolder) updateMainByAddingEventRecorder(isGoV3 bool, defaultMainPath string) error {
+ if isGoV3 {
+ if err := util.InsertCode(
+ defaultMainPath,
+ fmt.Sprintf(
+ `if err = (&controllers.%sReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),`, s.resource.Kind),
- fmt.Sprintf(recorderTemplate, strings.ToLower(s.resource.Kind)),
- ); err != nil {
- return fmt.Errorf("error scaffolding event recorder in %s: %v", defaultMainPath, err)
+ fmt.Sprintf(recorderTemplate, strings.ToLower(s.resource.Kind)),
+ ); err != nil {
+ return fmt.Errorf("error scaffolding event recorder in %s: %v", defaultMainPath, err)
+ }
+ } else {
+ if err := util.InsertCode(
+ defaultMainPath,
+ fmt.Sprintf(
+ `if err = (&controller.%sReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),`, s.resource.Kind),
+ fmt.Sprintf(recorderTemplate, strings.ToLower(s.resource.Kind)),
+ ); err != nil {
+ return fmt.Errorf("error scaffolding event recorder in %s: %v", defaultMainPath, err)
+ }
}
return nil
@@ -276,13 +294,13 @@ func (s *apiScaffolder) updateControllerCode(controller controllers.Controller)
return nil
}
-func (s *apiScaffolder) scaffoldCreateAPIFromKustomize(isGoV3 bool) error {
+func (s *apiScaffolder) scaffoldCreateAPIFromKustomize(isLegacyLayout bool) error {
// Now we need call the kustomize/v1 plugin to do its scaffolds when we create a new API
// todo: when we have the go/v4-alpha plugin we will also need to check what is the plugin used
// in the Project layout to know if we should use kustomize/v1 OR kustomize/v2-alpha
var kustomizeScaffolder plugins.Scaffolder
- if isGoV3 {
+ if isLegacyLayout {
kustomizeScaffolder = kustomizev1scaffolds.NewAPIScaffolder(
s.config,
s.resource,
@@ -305,11 +323,11 @@ func (s *apiScaffolder) scaffoldCreateAPIFromKustomize(isGoV3 bool) error {
return nil
}
-func (s *apiScaffolder) scaffoldCreateAPIFromGolang(isGoV3 bool) error {
+func (s *apiScaffolder) scaffoldCreateAPIFromGolang(isLegacyLayout bool) error {
// Now we need call the kustomize/v1 plugin to do its scaffolds when we create a new API
// todo: when we have the go/v4-alpha plugin we will also need to check what is the plugin used
// in the Project layout to know if we should use kustomize/v1 OR kustomize/v2-alpha
- if isGoV3 {
+ if isLegacyLayout {
golangV3Scaffolder := golangv3scaffolds.NewAPIScaffolder(s.config,
s.resource, true)
golangV3Scaffolder.InjectFS(s.fs)
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/api/types.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/api/types.go
index 58efeeadf21..30779753ebd 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/api/types.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/api/types.go
@@ -35,21 +35,33 @@ type Types struct {
// Port if informed we will create the scaffold with this spec
Port string
+
+ IsLegacyLayout bool
}
// SetTemplateDefaults implements file.Template
func (f *Types) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- if f.Resource.Group != "" {
- f.Path = filepath.Join("apis", "%[group]", "%[version]", "%[kind]_types.go")
+
+ if f.IsLegacyLayout {
+ if f.MultiGroup {
+ if f.Resource.Group != "" {
+ f.Path = filepath.Join("apis", "%[group]", "%[version]", "%[kind]_types.go")
+ } else {
+ f.Path = filepath.Join("apis", "%[version]", "%[kind]_types.go")
+ }
} else {
- f.Path = filepath.Join("apis", "%[version]", "%[kind]_types.go")
+ f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
}
} else {
- f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "%[kind]_types.go")
+ } else {
+ f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
+ }
}
}
+
f.Path = f.Resource.Replacer().Replace(f.Path)
fmt.Println(f.Path)
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/config/samples/crd_sample.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/config/samples/crd_sample.go
index dbd94dab91c..a4344fd2e56 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/config/samples/crd_sample.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/config/samples/crd_sample.go
@@ -14,6 +14,7 @@ limitations under the License.
package samples
import (
+ "fmt"
"path/filepath"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -36,6 +37,7 @@ func (f *CRDSample) SetTemplateDefaults() error {
f.Path = filepath.Join("config", "samples", "%[group]_%[version]_%[kind].yaml")
}
f.Path = f.Resource.Replacer().Replace(f.Path)
+ fmt.Println(f.Path)
f.IfExistsAction = machinery.OverwriteFile
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller-test.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller-test.go
index 5bd6217bf2d..f39cdd0e8f1 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller-test.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller-test.go
@@ -33,19 +33,35 @@ type ControllerTest struct {
machinery.BoilerplateMixin
machinery.ResourceMixin
- Port string
+ Port string
+ IsLegacyLayout bool
+ PackageName string
}
// SetTemplateDefaults implements file.Template
func (f *ControllerTest) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
- f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller_test.go")
+ if f.IsLegacyLayout {
+ f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller_test.go")
+ } else {
+ f.Path = filepath.Join("internal", "controller", "%[group]", "%[kind]_controller_test.go")
+ }
} else {
- f.Path = filepath.Join("controllers", "%[kind]_controller_test.go")
+ if f.IsLegacyLayout {
+ f.Path = filepath.Join("controllers", "%[kind]_controller_test.go")
+ } else {
+ f.Path = filepath.Join("internal", "controller", "%[kind]_controller_test.go")
+ }
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
+ fmt.Println(f.Path)
+
+ f.PackageName = "controller"
+ if f.IsLegacyLayout {
+ f.PackageName = "controllers"
+ }
fmt.Println("creating import for %", f.Resource.Path)
f.TemplateBody = controllerTestTemplate
@@ -56,7 +72,7 @@ func (f *ControllerTest) SetTemplateDefaults() error {
//nolint:lll
const controllerTestTemplate = `{{ .Boilerplate }}
-package {{ if and .MultiGroup .Resource.Group }}{{ .Resource.PackageName }}{{ else }}controllers{{ end }}
+package {{ if and .MultiGroup .Resource.Group }}{{ .Resource.PackageName }}{{ else }}{{ .PackageName }}{{ end }}
import (
"context"
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller.go
index 4eac67bd723..1caaab444ac 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/controllers/controller.go
@@ -35,18 +35,37 @@ type Controller struct {
machinery.ProjectNameMixin
ControllerRuntimeVersion string
+
+ // IsLegacyLayout is added to ensure backwards compatibility and should
+ // be removed when we remove the go/v3 plugin
+ IsLegacyLayout bool
+ PackageName string
}
// SetTemplateDefaults implements file.Template
func (f *Controller) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
- f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller.go")
+ if f.IsLegacyLayout {
+ f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller.go")
+ } else {
+ f.Path = filepath.Join("internal", "controller", "%[group]", "%[kind]_controller.go")
+ }
} else {
- f.Path = filepath.Join("controllers", "%[kind]_controller.go")
+ if f.IsLegacyLayout {
+ f.Path = filepath.Join("controllers", "%[kind]_controller.go")
+ } else {
+ f.Path = filepath.Join("internal", "controller", "%[kind]_controller.go")
+ }
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
+ fmt.Println(f.Path)
+
+ f.PackageName = "controller"
+ if f.IsLegacyLayout {
+ f.PackageName = "controllers"
+ }
fmt.Println("creating import for %", f.Resource.Path)
f.TemplateBody = controllerTemplate
@@ -60,7 +79,7 @@ func (f *Controller) SetTemplateDefaults() error {
//nolint:lll
const controllerTemplate = `{{ .Boilerplate }}
-package {{ if and .MultiGroup .Resource.Group }}{{ .Resource.PackageName }}{{ else }}controllers{{ end }}
+package {{ if and .MultiGroup .Resource.Group }}{{ .Resource.PackageName }}{{ else }}{{ .PackageName }}{{ end }}
import (
"context"
diff --git a/pkg/plugins/golang/options.go b/pkg/plugins/golang/options.go
index b6a7338ee93..33665f747e6 100644
--- a/pkg/plugins/golang/options.go
+++ b/pkg/plugins/golang/options.go
@@ -22,6 +22,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/config"
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
)
var (
@@ -80,11 +81,18 @@ func (opts Options) UpdateResource(res *resource.Resource, c config.Config) {
}
if opts.DoAPI {
- res.Path = resource.APIPackagePath(c.GetRepository(), res.Group, res.Version, c.IsMultiGroup())
+ //nolint:staticcheck
+ if plugin.IsLegacyLayout(c) {
+ res.Path = resource.APIPackagePathLegacy(c.GetRepository(), res.Group, res.Version, c.IsMultiGroup())
+ } else {
+ res.Path = resource.APIPackagePath(c.GetRepository(), res.Group, res.Version, c.IsMultiGroup())
+ }
+
res.API = &resource.API{
CRDVersion: opts.CRDVersion,
Namespaced: opts.Namespaced,
}
+
}
if opts.DoController {
@@ -92,7 +100,14 @@ func (opts Options) UpdateResource(res *resource.Resource, c config.Config) {
}
if opts.DoDefaulting || opts.DoValidation || opts.DoConversion {
- res.Path = resource.APIPackagePath(c.GetRepository(), res.Group, res.Version, c.IsMultiGroup())
+ // IsLegacyLayout is added to ensure backwards compatibility and should
+ // be removed when we remove the go/v3 plugin
+ //nolint:staticcheck
+ if plugin.IsLegacyLayout(c) {
+ res.Path = resource.APIPackagePathLegacy(c.GetRepository(), res.Group, res.Version, c.IsMultiGroup())
+ } else {
+ res.Path = resource.APIPackagePath(c.GetRepository(), res.Group, res.Version, c.IsMultiGroup())
+ }
res.Webhooks.WebhookVersion = opts.WebhookVersion
if opts.DoDefaulting {
res.Webhooks.Defaulting = true
diff --git a/pkg/plugins/golang/options_test.go b/pkg/plugins/golang/options_test.go
index df87ee20748..19301100937 100644
--- a/pkg/plugins/golang/options_test.go
+++ b/pkg/plugins/golang/options_test.go
@@ -77,7 +77,7 @@ var _ = Describe("Options", func() {
if options.DoAPI || options.DoDefaulting || options.DoValidation || options.DoConversion {
if multiGroup {
Expect(res.Path).To(Equal(
- path.Join(cfg.GetRepository(), "apis", gvk.Group, gvk.Version)))
+ path.Join(cfg.GetRepository(), "api", gvk.Group, gvk.Version)))
} else {
Expect(res.Path).To(Equal(path.Join(cfg.GetRepository(), "api", gvk.Version)))
}
diff --git a/pkg/plugins/golang/v3/api.go b/pkg/plugins/golang/v3/api.go
index 30b81ca7f30..6e13838d7ef 100644
--- a/pkg/plugins/golang/v3/api.go
+++ b/pkg/plugins/golang/v3/api.go
@@ -161,6 +161,7 @@ func (p *createAPISubcommand) InjectResource(res *resource.Resource) error {
}
// Check CRDVersion against all other CRDVersions in p.config for compatibility.
+ // nolint:staticcheck
if util.HasDifferentCRDVersion(p.config, p.resource.API.CRDVersion) {
return fmt.Errorf("only one CRD version can be used for all resources, cannot add %q",
p.resource.API.CRDVersion)
diff --git a/pkg/plugins/golang/v3/commons.go b/pkg/plugins/golang/v3/commons.go
index 91508ab9544..1553c9c8f38 100644
--- a/pkg/plugins/golang/v3/commons.go
+++ b/pkg/plugins/golang/v3/commons.go
@@ -78,7 +78,7 @@ manifests: controller-gen`
}
if err := util.ReplaceInFile("Makefile",
- "ENVTEST_K8S_VERSION = 1.25.0",
+ "ENVTEST_K8S_VERSION = 1.26.0",
"ENVTEST_K8S_VERSION = 1.21"); err != nil {
log.Warnf("unable to update the Makefile with %s: %s", "ENVTEST_K8S_VERSION = 1.21", err)
}
diff --git a/pkg/plugins/golang/v3/scaffolds/init.go b/pkg/plugins/golang/v3/scaffolds/init.go
index 42ad3de5d40..c191cea832b 100644
--- a/pkg/plugins/golang/v3/scaffolds/init.go
+++ b/pkg/plugins/golang/v3/scaffolds/init.go
@@ -34,9 +34,9 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.13.1"
+ ControllerRuntimeVersion = "v0.14.1"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
- ControllerToolsVersion = "v0.10.0"
+ ControllerToolsVersion = "v0.11.1"
imageName = "controller:latest"
)
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
index fd614a3bfe2..2bc0d485b97 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
@@ -62,7 +62,7 @@ const makefileTemplate = `
# Image URL to use all building/pushing image targets
IMG ?= {{ .Image }}
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go
index 64d541bf170..fa5d003eb64 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go
@@ -74,9 +74,9 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
%s
2. Build and push your image to the location specified by ` + "`IMG`" + `:
-
+
%s
-
+
3. Deploy the controller to the cluster with the image specified by ` + "`IMG`" + `:
%s
@@ -87,7 +87,7 @@ To delete the CRDs from the cluster:
%s
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
%s
@@ -95,10 +95,10 @@ UnDeploy the controller to the cluster:
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
diff --git a/pkg/plugins/golang/v3/webhook.go b/pkg/plugins/golang/v3/webhook.go
index 1baba22aaba..6fa5d9dcbe9 100644
--- a/pkg/plugins/golang/v3/webhook.go
+++ b/pkg/plugins/golang/v3/webhook.go
@@ -113,6 +113,7 @@ func (p *createWebhookSubcommand) InjectResource(res *resource.Resource) error {
return fmt.Errorf("webhook resource already exists")
}
+ // nolint:staticcheck
if pluginutil.HasDifferentWebhookVersion(p.config, p.resource.Webhooks.WebhookVersion) {
return fmt.Errorf("only one webhook version can be used for all resources, cannot add %q",
p.resource.Webhooks.WebhookVersion)
diff --git a/pkg/plugins/golang/v4/api.go b/pkg/plugins/golang/v4/api.go
index 86720b20eaa..6e07ff7390f 100644
--- a/pkg/plugins/golang/v4/api.go
+++ b/pkg/plugins/golang/v4/api.go
@@ -39,7 +39,7 @@ const (
)
// DefaultMainPath is default file path of main.go
-const DefaultMainPath = "main.go"
+const DefaultMainPath = "cmd/main.go"
var _ plugin.CreateAPISubcommand = &createAPISubcommand{}
@@ -74,13 +74,14 @@ make generate will be run.
%[1]s create api --group ship --version v1beta1 --kind Frigate
# Edit the API Scheme
+
nano api/v1beta1/frigate_types.go
# Edit the Controller
- nano controllers/frigate/frigate_controller.go
+ nano internal/controller/frigate/frigate_controller.go
# Edit the Controller Test
- nano controllers/frigate/frigate_controller_test.go
+ nano internal/controller/frigate/frigate_controller_test.go
# Generate the manifests
make manifests
diff --git a/pkg/plugins/golang/v4/init.go b/pkg/plugins/golang/v4/init.go
index 21927ec0fe4..681a20d7ba1 100644
--- a/pkg/plugins/golang/v4/init.go
+++ b/pkg/plugins/golang/v4/init.go
@@ -66,13 +66,13 @@ func (p *initSubcommand) UpdateMetadata(cliMeta plugin.CLIMetadata, subcmdMeta *
- a "PROJECT" file that stores project configuration
- a "Makefile" with several useful make targets for the project
- several YAML files for project deployment under the "config" directory
- - a "main.go" file that creates the manager that will run the project controllers
+ - a "cmd/main.go" file that creates the manager that will run the project controllers
`
subcmdMeta.Examples = fmt.Sprintf(` # Initialize a new project with your domain and name in copyright
- %[1]s init --plugins go/v3 --domain example.org --owner "Your name"
+ %[1]s init --plugins go/v4-alpha --domain example.org --owner "Your name"
# Initialize a new project defining a specific project version
- %[1]s init --plugins go/v3 --project-version 3
+ %[1]s init --plugins go/v4-alpha --project-version 3
`, cliMeta.CommandName)
}
diff --git a/pkg/plugins/golang/v4/scaffolds/api.go b/pkg/plugins/golang/v4/scaffolds/api.go
index 69a5a02748d..6afcb040627 100644
--- a/pkg/plugins/golang/v4/scaffolds/api.go
+++ b/pkg/plugins/golang/v4/scaffolds/api.go
@@ -106,7 +106,7 @@ func (s *apiScaffolder) Scaffold() error {
if err := scaffold.Execute(
&templates.MainUpdater{WireResource: doAPI, WireController: doController},
); err != nil {
- return fmt.Errorf("error updating main.go: %v", err)
+ return fmt.Errorf("error updating cmd/main.go: %v", err)
}
return nil
diff --git a/pkg/plugins/golang/v4/scaffolds/edit.go b/pkg/plugins/golang/v4/scaffolds/edit.go
index 1fe5e6505e5..2d2ab1c563e 100644
--- a/pkg/plugins/golang/v4/scaffolds/edit.go
+++ b/pkg/plugins/golang/v4/scaffolds/edit.go
@@ -17,9 +17,6 @@ limitations under the License.
package scaffolds
import (
- "fmt"
- "strings"
-
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -59,20 +56,6 @@ func (s *editScaffolder) Scaffold() error {
}
str := string(bs)
- // update dockerfile
- if s.multigroup {
- str, err = ensureExistAndReplace(
- str,
- "COPY api/ api/",
- `COPY apis/ apis/`)
-
- } else {
- str, err = ensureExistAndReplace(
- str,
- "COPY apis/ apis/",
- `COPY api/ api/`)
- }
-
// Ignore the error encountered, if the file is already in desired format.
if err != nil && s.multigroup != s.config.IsMultiGroup() {
return err
@@ -93,10 +76,3 @@ func (s *editScaffolder) Scaffold() error {
return nil
}
-
-func ensureExistAndReplace(input, match, replace string) (string, error) {
- if !strings.Contains(input, match) {
- return "", fmt.Errorf("can't find %q", match)
- }
- return strings.Replace(input, match, replace, -1), nil
-}
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index b9e4134fc8b..447c2e9ff76 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -34,9 +34,9 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.13.1"
+ ControllerRuntimeVersion = "v0.14.1"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
- ControllerToolsVersion = "v0.10.0"
+ ControllerToolsVersion = "v0.11.1"
imageName = "controller:latest"
)
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/group.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/group.go
index c1acc9cfc63..15c8a67a7c6 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/group.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/group.go
@@ -36,12 +36,8 @@ type Group struct {
// SetTemplateDefaults implements file.Template
func (f *Group) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- if f.Resource.Group != "" {
- f.Path = filepath.Join("apis", "%[group]", "%[version]", "groupversion_info.go")
- } else {
- f.Path = filepath.Join("apis", "%[version]", "groupversion_info.go")
- }
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "groupversion_info.go")
} else {
f.Path = filepath.Join("api", "%[version]", "groupversion_info.go")
}
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go
index 567c165fa5f..3a27bf88d00 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go
@@ -39,12 +39,8 @@ type Types struct {
// SetTemplateDefaults implements file.Template
func (f *Types) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- if f.Resource.Group != "" {
- f.Path = filepath.Join("apis", "%[group]", "%[version]", "%[kind]_types.go")
- } else {
- f.Path = filepath.Join("apis", "%[version]", "%[kind]_types.go")
- }
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "%[kind]_types.go")
} else {
f.Path = filepath.Join("api", "%[version]", "%[kind]_types.go")
}
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
index 76561a5a794..bb9c26028f3 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
@@ -45,12 +45,8 @@ type Webhook struct { // nolint:maligned
// SetTemplateDefaults implements file.Template
func (f *Webhook) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- if f.Resource.Group != "" {
- f.Path = filepath.Join("apis", "%[group]", "%[version]", "%[kind]_webhook.go")
- } else {
- f.Path = filepath.Join("apis", "%[version]", "%[kind]_webhook.go")
- }
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "%[kind]_webhook.go")
} else {
f.Path = filepath.Join("api", "%[version]", "%[kind]_webhook.go")
}
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_suitetest.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_suitetest.go
index 2ebc091b9e2..3b13084e907 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_suitetest.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_suitetest.go
@@ -43,12 +43,8 @@ type WebhookSuite struct { //nolint:maligned
// SetTemplateDefaults implements file.Template
func (f *WebhookSuite) SetTemplateDefaults() error {
if f.Path == "" {
- if f.MultiGroup {
- if f.Resource.Group != "" {
- f.Path = filepath.Join("apis", "%[group]", "%[version]", "webhook_suite_test.go")
- } else {
- f.Path = filepath.Join("apis", "%[version]", "webhook_suite_test.go")
- }
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "webhook_suite_test.go")
} else {
f.Path = filepath.Join("api", "%[version]", "webhook_suite_test.go")
}
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller.go
index 5b5a30aa62e..fb4388f372b 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller.go
@@ -42,9 +42,9 @@ type Controller struct {
func (f *Controller) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
- f.Path = filepath.Join("controllers", "%[group]", "%[kind]_controller.go")
+ f.Path = filepath.Join("internal", "controller", "%[group]", "%[kind]_controller.go")
} else {
- f.Path = filepath.Join("controllers", "%[kind]_controller.go")
+ f.Path = filepath.Join("internal", "controller", "%[kind]_controller.go")
}
}
@@ -65,7 +65,7 @@ func (f *Controller) SetTemplateDefaults() error {
//nolint:lll
const controllerTemplate = `{{ .Boilerplate }}
-package {{ if and .MultiGroup .Resource.Group }}{{ .Resource.PackageName }}{{ else }}controllers{{ end }}
+package {{ if and .MultiGroup .Resource.Group }}{{ .Resource.PackageName }}{{ else }}controller{{ end }}
import (
"context"
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_suitetest.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_suitetest.go
index 20a574dd8ae..60bd156124f 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_suitetest.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_suitetest.go
@@ -44,9 +44,9 @@ type SuiteTest struct {
func (f *SuiteTest) SetTemplateDefaults() error {
if f.Path == "" {
if f.MultiGroup && f.Resource.Group != "" {
- f.Path = filepath.Join("controllers", "%[group]", "suite_test.go")
+ f.Path = filepath.Join("internal", "controller", "%[group]", "suite_test.go")
} else {
- f.Path = filepath.Join("controllers", "suite_test.go")
+ f.Path = filepath.Join("internal", "controller", "suite_test.go")
}
}
@@ -60,9 +60,9 @@ func (f *SuiteTest) SetTemplateDefaults() error {
// If is multigroup the path needs to be ../../ since it has
// the group dir.
- f.CRDDirectoryRelativePath = `".."`
+ f.CRDDirectoryRelativePath = `"..",".."`
if f.MultiGroup && f.Resource.Group != "" {
- f.CRDDirectoryRelativePath = `"..", ".."`
+ f.CRDDirectoryRelativePath = `"..", "..",".."`
}
if f.Force {
@@ -126,7 +126,7 @@ const controllerSuiteTestTemplate = `{{ .Boilerplate }}
{{if and .MultiGroup .Resource.Group }}
package {{ .Resource.PackageName }}
{{else}}
-package controllers
+package controller
{{end}}
import (
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go
index d8032525c8c..2ac315c30b5 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/dockerfile.go
@@ -52,16 +52,16 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
-COPY main.go main.go
+COPY cmd/main.go cmd/main.go
COPY api/ api/
-COPY controllers/ controllers/
+COPY internal/controller/ internal/controller/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
index f1122f5696a..f95541d69de 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
@@ -23,7 +23,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
-const defaultMainPath = "main.go"
+const defaultMainPath = "cmd/main.go"
var _ machinery.Template = &Main{}
@@ -53,7 +53,7 @@ func (f *Main) SetTemplateDefaults() error {
var _ machinery.Inserter = &MainUpdater{}
-// MainUpdater updates main.go to run Controllers
+// MainUpdater updates cmd/main.go to run Controllers
type MainUpdater struct { //nolint:maligned
machinery.RepositoryMixin
machinery.MultiGroupMixin
@@ -91,13 +91,13 @@ func (f *MainUpdater) GetMarkers() []machinery.Marker {
const (
apiImportCodeFragment = `%s "%s"
`
- controllerImportCodeFragment = `"%s/controllers"
+ controllerImportCodeFragment = `"%s/internal/controller"
`
- multiGroupControllerImportCodeFragment = `%scontrollers "%s/controllers/%s"
+ multiGroupControllerImportCodeFragment = `%scontroller "%s/internal/controller/%s"
`
addschemeCodeFragment = `utilruntime.Must(%s.AddToScheme(scheme))
`
- reconcilerSetupCodeFragment = `if err = (&controllers.%sReconciler{
+ reconcilerSetupCodeFragment = `if err = (&controller.%sReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -105,7 +105,7 @@ const (
os.Exit(1)
}
`
- multiGroupReconcilerSetupCodeFragment = `if err = (&%scontrollers.%sReconciler{
+ multiGroupReconcilerSetupCodeFragment = `if err = (&%scontroller.%sReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 101411755cf..ceded0c26d6 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -62,7 +62,7 @@ const makefileTemplate = `
# Image URL to use all building/pushing image targets
IMG ?= {{ .Image }}
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -122,11 +122,11 @@ test: manifests generate fmt vet envtest ## Run tests.
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
- go build -o bin/manager main.go
+ go build -o bin/manager cmd/main.go
.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
- go run ./main.go
+ go run ./cmd/main.go
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
index 64d541bf170..fa5d003eb64 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
@@ -74,9 +74,9 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
%s
2. Build and push your image to the location specified by ` + "`IMG`" + `:
-
+
%s
-
+
3. Deploy the controller to the cluster with the image specified by ` + "`IMG`" + `:
%s
@@ -87,7 +87,7 @@ To delete the CRDs from the cluster:
%s
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
%s
@@ -95,10 +95,10 @@ UnDeploy the controller to the cluster:
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
diff --git a/test/common.sh b/test/common.sh
index e213fb6ab07..7d744bb630c 100644
--- a/test/common.sh
+++ b/test/common.sh
@@ -28,6 +28,7 @@ function convert_to_tools_ver {
"1.23") echo "1.23.3";;
"1.24") echo "1.24.1";;
"1.25") echo "1.25.0";;
+ "1.26") echo "1.26.0";;
*)
echo "k8s version $k8s_ver not supported"
exit 1
@@ -47,7 +48,7 @@ if [ -n "$TRACE" ]; then
set -x
fi
-export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.25.0"}"
+export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.26.0"}"
tools_k8s_version=$(convert_to_tools_ver "${KIND_K8S_VERSION#v*}")
kind_version=0.15.0
goarch=amd64
diff --git a/test/e2e/v4/generate_test.go b/test/e2e/v4/generate_test.go
index f285bc2d794..eb8591d0414 100644
--- a/test/e2e/v4/generate_test.go
+++ b/test/e2e/v4/generate_test.go
@@ -21,16 +21,15 @@ import (
"path/filepath"
"strings"
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
//nolint:golint
//nolint:revive
- . "github.com/onsi/ginkgo/v2"
-
//nolint:golint
//nolint:revive
- . "github.com/onsi/gomega"
-
"sigs.k8s.io/kubebuilder/v3/test/e2e/utils"
)
diff --git a/test/testdata/generate.sh b/test/testdata/generate.sh
index 5f7424a89b2..11dce087c1d 100755
--- a/test/testdata/generate.sh
+++ b/test/testdata/generate.sh
@@ -113,7 +113,7 @@ function scaffold_test_project {
$kb create api --group example.com --version v1alpha1 --kind Busybox --image=busybox:1.28 --plugins="deploy-image/v1-alpha" --make=false
header_text 'Creating Memcached webhook ...'
$kb create webhook --group example.com --version v1alpha1 --kind Memcached --programmatic-validation
- elif [[ $project =~ "with-metrics" ]]; then
+ elif [[ $project =~ "with-grafana" ]]; then
header_text 'Editing project with Grafana plugin ...'
$kb edit --plugins=grafana.kubebuilder.io/v1-alpha
fi
@@ -132,16 +132,15 @@ scaffold_test_project project-v2 --project-version=2
# [Currently, default CLI plugin] - Project version 3 (default) uses plugin go/v3 (default).
scaffold_test_project project-v3
scaffold_test_project project-v3-multigroup
-scaffold_test_project project-v3-declarative-v1 --plugins="go/v3,declarative,grafana/v1-alpha"
+scaffold_test_project project-v3-declarative-v1 --plugins="go/v3,declarative"
scaffold_test_project project-v3-config --component-config
scaffold_test_project project-v3-with-deploy-image
-scaffold_test_project project-v3-with-metrics
+scaffold_test_project project-v3-with-grafana
# [Next version, alpha] Project version v4-alpha
scaffold_test_project project-v4 --plugins="go/v4-alpha"
scaffold_test_project project-v4-multigroup --plugins="go/v4-alpha"
-scaffold_test_project project-v4-declarative-v1 --plugins="go/v4-alpha,declarative,grafana/v1-alpha"
+scaffold_test_project project-v4-declarative-v1 --plugins="go/v4-alpha,declarative"
scaffold_test_project project-v4-config --component-config --plugins="go/v4-alpha"
scaffold_test_project project-v4-with-deploy-image --plugins="go/v4-alpha"
-scaffold_test_project project-v4-with-metrics
-
+scaffold_test_project project-v4-with-grafana
diff --git a/test/testdata/test.sh b/test/testdata/test.sh
index 690353face4..31e733dec8d 100755
--- a/test/testdata/test.sh
+++ b/test/testdata/test.sh
@@ -36,7 +36,7 @@ test_project project-v3-multigroup
test_project project-v3-declarative-v1
test_project project-v3-config
test_project project-v3-with-deploy-image
-test_project project-v3-with-metrics
+test_project project-v3-with-grafana
# Project version v4-alpha
test_project project-v4
@@ -44,4 +44,4 @@ test_project project-v4-multigroup
test_project project-v4-declarative-v1
test_project project-v4-config
test_project project-v4-with-deploy-image
-test_project project-v4-with-metrics
+test_project project-v4-with-grafana
diff --git a/testdata/project-v2/PROJECT b/testdata/project-v2/PROJECT
index 36aacd80d5b..53085282124 100644
--- a/testdata/project-v2/PROJECT
+++ b/testdata/project-v2/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
repo: sigs.k8s.io/kubebuilder/testdata/project-v2
resources:
diff --git a/testdata/project-v2/api/v1/admiral_types.go b/testdata/project-v2/api/v1/admiral_types.go
index 55d2b767089..5da39958449 100644
--- a/testdata/project-v2/api/v1/admiral_types.go
+++ b/testdata/project-v2/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/admiral_webhook.go b/testdata/project-v2/api/v1/admiral_webhook.go
index 9e10e8107d9..dd99299f4db 100644
--- a/testdata/project-v2/api/v1/admiral_webhook.go
+++ b/testdata/project-v2/api/v1/admiral_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/captain_types.go b/testdata/project-v2/api/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v2/api/v1/captain_types.go
+++ b/testdata/project-v2/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/captain_webhook.go b/testdata/project-v2/api/v1/captain_webhook.go
index 0c10648727b..08486fad84d 100644
--- a/testdata/project-v2/api/v1/captain_webhook.go
+++ b/testdata/project-v2/api/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/firstmate_types.go b/testdata/project-v2/api/v1/firstmate_types.go
index 7515759833a..59bcaf1e8e7 100644
--- a/testdata/project-v2/api/v1/firstmate_types.go
+++ b/testdata/project-v2/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/firstmate_webhook.go b/testdata/project-v2/api/v1/firstmate_webhook.go
index fda7fac46dc..fcba3cccdc2 100644
--- a/testdata/project-v2/api/v1/firstmate_webhook.go
+++ b/testdata/project-v2/api/v1/firstmate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/groupversion_info.go b/testdata/project-v2/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v2/api/v1/groupversion_info.go
+++ b/testdata/project-v2/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/api/v1/zz_generated.deepcopy.go b/testdata/project-v2/api/v1/zz_generated.deepcopy.go
index eb076ea05ea..3b442b7416a 100644
--- a/testdata/project-v2/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v2/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/controllers/admiral_controller.go b/testdata/project-v2/controllers/admiral_controller.go
index 986ad16922b..99589f6357f 100644
--- a/testdata/project-v2/controllers/admiral_controller.go
+++ b/testdata/project-v2/controllers/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/controllers/captain_controller.go b/testdata/project-v2/controllers/captain_controller.go
index 57e601b478c..3968aea8fcc 100644
--- a/testdata/project-v2/controllers/captain_controller.go
+++ b/testdata/project-v2/controllers/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/controllers/firstmate_controller.go b/testdata/project-v2/controllers/firstmate_controller.go
index 907cff57dce..6233fe99a51 100644
--- a/testdata/project-v2/controllers/firstmate_controller.go
+++ b/testdata/project-v2/controllers/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/controllers/laker_controller.go b/testdata/project-v2/controllers/laker_controller.go
index deef42ddca3..0ade945e369 100644
--- a/testdata/project-v2/controllers/laker_controller.go
+++ b/testdata/project-v2/controllers/laker_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/controllers/suite_test.go b/testdata/project-v2/controllers/suite_test.go
index 21bc0f9baad..b6d90662aca 100644
--- a/testdata/project-v2/controllers/suite_test.go
+++ b/testdata/project-v2/controllers/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/hack/boilerplate.go.txt b/testdata/project-v2/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v2/hack/boilerplate.go.txt
+++ b/testdata/project-v2/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v2/main.go b/testdata/project-v2/main.go
index 40f6c91c886..f81d0025118 100644
--- a/testdata/project-v2/main.go
+++ b/testdata/project-v2/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/Makefile b/testdata/project-v3-config/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v3-config/Makefile
+++ b/testdata/project-v3-config/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v3-config/PROJECT b/testdata/project-v3-config/PROJECT
index 83e7f357591..6ba744a8f09 100644
--- a/testdata/project-v3-config/PROJECT
+++ b/testdata/project-v3-config/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
componentConfig: true
domain: testproject.org
layout:
diff --git a/testdata/project-v3-config/README.md b/testdata/project-v3-config/README.md
index 253fcecbab2..f7d9e922605 100644
--- a/testdata/project-v3-config/README.md
+++ b/testdata/project-v3-config/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v3-config:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/admiral_types.go b/testdata/project-v3-config/api/v1/admiral_types.go
index 55d2b767089..5da39958449 100644
--- a/testdata/project-v3-config/api/v1/admiral_types.go
+++ b/testdata/project-v3-config/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/admiral_webhook.go b/testdata/project-v3-config/api/v1/admiral_webhook.go
index 52fbc5ce79f..55f44963848 100644
--- a/testdata/project-v3-config/api/v1/admiral_webhook.go
+++ b/testdata/project-v3-config/api/v1/admiral_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/captain_types.go b/testdata/project-v3-config/api/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v3-config/api/v1/captain_types.go
+++ b/testdata/project-v3-config/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/captain_webhook.go b/testdata/project-v3-config/api/v1/captain_webhook.go
index ba00000c137..1c8837b5e90 100644
--- a/testdata/project-v3-config/api/v1/captain_webhook.go
+++ b/testdata/project-v3-config/api/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/firstmate_types.go b/testdata/project-v3-config/api/v1/firstmate_types.go
index 7515759833a..59bcaf1e8e7 100644
--- a/testdata/project-v3-config/api/v1/firstmate_types.go
+++ b/testdata/project-v3-config/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/firstmate_webhook.go b/testdata/project-v3-config/api/v1/firstmate_webhook.go
index 5fa6046165d..941a86ed458 100644
--- a/testdata/project-v3-config/api/v1/firstmate_webhook.go
+++ b/testdata/project-v3-config/api/v1/firstmate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/groupversion_info.go b/testdata/project-v3-config/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v3-config/api/v1/groupversion_info.go
+++ b/testdata/project-v3-config/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/webhook_suite_test.go b/testdata/project-v3-config/api/v1/webhook_suite_test.go
index 06549f198e6..50d550ba906 100644
--- a/testdata/project-v3-config/api/v1/webhook_suite_test.go
+++ b/testdata/project-v3-config/api/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/api/v1/zz_generated.deepcopy.go b/testdata/project-v3-config/api/v1/zz_generated.deepcopy.go
index eb076ea05ea..3b442b7416a 100644
--- a/testdata/project-v3-config/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-config/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/config/crd/bases/crew.testproject.org_admirals.yaml b/testdata/project-v3-config/config/crd/bases/crew.testproject.org_admirals.yaml
index cb3c595b0ab..df8c76c0807 100644
--- a/testdata/project-v3-config/config/crd/bases/crew.testproject.org_admirals.yaml
+++ b/testdata/project-v3-config/config/crd/bases/crew.testproject.org_admirals.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: admirals.crew.testproject.org
spec:
diff --git a/testdata/project-v3-config/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v3-config/config/crd/bases/crew.testproject.org_captains.yaml
index 69ab9ccffcb..2caae573427 100644
--- a/testdata/project-v3-config/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v3-config/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v3-config/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v3-config/config/crd/bases/crew.testproject.org_firstmates.yaml
index e1d9bb02b2b..c5cd98dac32 100644
--- a/testdata/project-v3-config/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ b/testdata/project-v3-config/config/crd/bases/crew.testproject.org_firstmates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: firstmates.crew.testproject.org
spec:
diff --git a/testdata/project-v3-config/controllers/admiral_controller.go b/testdata/project-v3-config/controllers/admiral_controller.go
index 2d647610a04..7f51e1de506 100644
--- a/testdata/project-v3-config/controllers/admiral_controller.go
+++ b/testdata/project-v3-config/controllers/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type AdmiralReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-config/controllers/captain_controller.go b/testdata/project-v3-config/controllers/captain_controller.go
index 56dcbe0d594..4526ab69a51 100644
--- a/testdata/project-v3-config/controllers/captain_controller.go
+++ b/testdata/project-v3-config/controllers/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type CaptainReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-config/controllers/firstmate_controller.go b/testdata/project-v3-config/controllers/firstmate_controller.go
index 2b0e56269b1..01cf6686cc5 100644
--- a/testdata/project-v3-config/controllers/firstmate_controller.go
+++ b/testdata/project-v3-config/controllers/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type FirstMateReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-config/controllers/laker_controller.go b/testdata/project-v3-config/controllers/laker_controller.go
index 9e9536c1b2e..ecf8625d438 100644
--- a/testdata/project-v3-config/controllers/laker_controller.go
+++ b/testdata/project-v3-config/controllers/laker_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ type LakerReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-config/controllers/suite_test.go b/testdata/project-v3-config/controllers/suite_test.go
index a7f038011be..166201082cf 100644
--- a/testdata/project-v3-config/controllers/suite_test.go
+++ b/testdata/project-v3-config/controllers/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/go.mod b/testdata/project-v3-config/go.mod
index 37c06704385..7c0a6c27503 100644
--- a/testdata/project-v3-config/go.mod
+++ b/testdata/project-v3-config/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v3-config
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v3-config/hack/boilerplate.go.txt b/testdata/project-v3-config/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v3-config/hack/boilerplate.go.txt
+++ b/testdata/project-v3-config/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-config/main.go b/testdata/project-v3-config/main.go
index d3fd27640fe..53553b9ddbb 100644
--- a/testdata/project-v3-config/main.go
+++ b/testdata/project-v3-config/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/Makefile b/testdata/project-v3-declarative-v1/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v3-declarative-v1/Makefile
+++ b/testdata/project-v3-declarative-v1/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v3-declarative-v1/PROJECT b/testdata/project-v3-declarative-v1/PROJECT
index 27ea9d4afa0..7853be9c396 100644
--- a/testdata/project-v3-declarative-v1/PROJECT
+++ b/testdata/project-v3-declarative-v1/PROJECT
@@ -1,8 +1,11 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v3
- declarative.go.kubebuilder.io/v1
-- grafana.kubebuilder.io/v1-alpha
plugins:
declarative.go.kubebuilder.io/v1:
resources:
@@ -18,7 +21,6 @@ plugins:
group: crew
kind: Admiral
version: v1
- grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v3-declarative-v1
repo: sigs.k8s.io/kubebuilder/testdata/project-v3-declarative-v1
resources:
diff --git a/testdata/project-v3-declarative-v1/README.md b/testdata/project-v3-declarative-v1/README.md
index cb0effff6e1..78d691eae77 100644
--- a/testdata/project-v3-declarative-v1/README.md
+++ b/testdata/project-v3-declarative-v1/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v3-declarative-v1:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/api/v1/admiral_types.go b/testdata/project-v3-declarative-v1/api/v1/admiral_types.go
index 027432be46a..83f507b1913 100644
--- a/testdata/project-v3-declarative-v1/api/v1/admiral_types.go
+++ b/testdata/project-v3-declarative-v1/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/api/v1/captain_types.go b/testdata/project-v3-declarative-v1/api/v1/captain_types.go
index b4bea01a9fb..b82e24ec320 100644
--- a/testdata/project-v3-declarative-v1/api/v1/captain_types.go
+++ b/testdata/project-v3-declarative-v1/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/api/v1/firstmate_types.go b/testdata/project-v3-declarative-v1/api/v1/firstmate_types.go
index 12f64ad0697..a410f27f483 100644
--- a/testdata/project-v3-declarative-v1/api/v1/firstmate_types.go
+++ b/testdata/project-v3-declarative-v1/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/api/v1/groupversion_info.go b/testdata/project-v3-declarative-v1/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v3-declarative-v1/api/v1/groupversion_info.go
+++ b/testdata/project-v3-declarative-v1/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/api/v1/zz_generated.deepcopy.go b/testdata/project-v3-declarative-v1/api/v1/zz_generated.deepcopy.go
index d7d62dbdb1c..334a92168ca 100644
--- a/testdata/project-v3-declarative-v1/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-declarative-v1/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml b/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
index 21f1ac8d4fe..84f792ed656 100644
--- a/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
+++ b/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: admirals.crew.testproject.org
spec:
diff --git a/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
index d622a9bab29..b21c9578b85 100644
--- a/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
index 0799cde8419..3c277b3ad83 100644
--- a/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ b/testdata/project-v3-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: firstmates.crew.testproject.org
spec:
diff --git a/testdata/project-v3-declarative-v1/controllers/admiral_controller.go b/testdata/project-v3-declarative-v1/controllers/admiral_controller.go
index 344a7bbc766..6d1dc03351b 100644
--- a/testdata/project-v3-declarative-v1/controllers/admiral_controller.go
+++ b/testdata/project-v3-declarative-v1/controllers/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/controllers/captain_controller.go b/testdata/project-v3-declarative-v1/controllers/captain_controller.go
index a446ba34e43..e502d71129d 100644
--- a/testdata/project-v3-declarative-v1/controllers/captain_controller.go
+++ b/testdata/project-v3-declarative-v1/controllers/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/controllers/firstmate_controller.go b/testdata/project-v3-declarative-v1/controllers/firstmate_controller.go
index b4da34f82f8..0e27039c006 100644
--- a/testdata/project-v3-declarative-v1/controllers/firstmate_controller.go
+++ b/testdata/project-v3-declarative-v1/controllers/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/controllers/suite_test.go b/testdata/project-v3-declarative-v1/controllers/suite_test.go
index cdbc218f1ef..16a36fa43f3 100644
--- a/testdata/project-v3-declarative-v1/controllers/suite_test.go
+++ b/testdata/project-v3-declarative-v1/controllers/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/go.mod b/testdata/project-v3-declarative-v1/go.mod
index 6a8108005af..fbbead56fdc 100644
--- a/testdata/project-v3-declarative-v1/go.mod
+++ b/testdata/project-v3-declarative-v1/go.mod
@@ -4,38 +4,29 @@ go 1.19
require (
github.com/go-logr/logr v1.2.3
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
- sigs.k8s.io/kubebuilder-declarative-pattern v0.11.20220513-0.20220907223038-e0605f0e1a40
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
+ sigs.k8s.io/kubebuilder-declarative-pattern v0.13.0-beta.1.0.20230113160225-18dbaf5fcd85
)
require (
- cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/camelcase v1.0.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
@@ -43,21 +34,20 @@ require (
github.com/go-git/go-git/v5 v5.1.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.12 // indirect
- github.com/inconshreveable/mousetrap v1.0.0 // indirect
+ github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -65,55 +55,56 @@ require (
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
- github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
+ github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
- github.com/russross/blackfriday v1.5.2 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
+ github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
- github.com/spf13/cobra v1.4.0 // indirect
+ github.com/spf13/cobra v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/crypto v0.1.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.25.0 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/cli-runtime v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/kubectl v0.25.0 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/api v0.26.0 // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/cli-runtime v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/kubectl v0.26.0 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/cli-utils v0.33.0 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ sigs.k8s.io/kubebuilder-declarative-pattern/applylib v0.0.0-20221111030210-e034bc5469a5 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
diff --git a/testdata/project-v3-declarative-v1/hack/boilerplate.go.txt b/testdata/project-v3-declarative-v1/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v3-declarative-v1/hack/boilerplate.go.txt
+++ b/testdata/project-v3-declarative-v1/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-declarative-v1/main.go b/testdata/project-v3-declarative-v1/main.go
index 733fc4a994c..dbd0a7ee3ab 100644
--- a/testdata/project-v3-declarative-v1/main.go
+++ b/testdata/project-v3-declarative-v1/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/Makefile b/testdata/project-v3-multigroup/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v3-multigroup/Makefile
+++ b/testdata/project-v3-multigroup/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v3-multigroup/PROJECT b/testdata/project-v3-multigroup/PROJECT
index 938072fdc06..0022d46f1b4 100644
--- a/testdata/project-v3-multigroup/PROJECT
+++ b/testdata/project-v3-multigroup/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v3
diff --git a/testdata/project-v3-multigroup/README.md b/testdata/project-v3-multigroup/README.md
index 8593cb58c9a..d2e64d8180f 100644
--- a/testdata/project-v3-multigroup/README.md
+++ b/testdata/project-v3-multigroup/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v3-multigroup:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/crew/v1/captain_types.go b/testdata/project-v3-multigroup/apis/crew/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v3-multigroup/apis/crew/v1/captain_types.go
+++ b/testdata/project-v3-multigroup/apis/crew/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/crew/v1/captain_webhook.go b/testdata/project-v3-multigroup/apis/crew/v1/captain_webhook.go
index ba00000c137..1c8837b5e90 100644
--- a/testdata/project-v3-multigroup/apis/crew/v1/captain_webhook.go
+++ b/testdata/project-v3-multigroup/apis/crew/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/crew/v1/groupversion_info.go b/testdata/project-v3-multigroup/apis/crew/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v3-multigroup/apis/crew/v1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/crew/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/crew/v1/webhook_suite_test.go b/testdata/project-v3-multigroup/apis/crew/v1/webhook_suite_test.go
index 41c8c57de00..bafa2b49074 100644
--- a/testdata/project-v3-multigroup/apis/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v3-multigroup/apis/crew/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/crew/v1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/crew/v1/zz_generated.deepcopy.go
index 3d19f0cd037..fb38edc9099 100644
--- a/testdata/project-v3-multigroup/apis/crew/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/crew/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/fiz/v1/bar_types.go b/testdata/project-v3-multigroup/apis/fiz/v1/bar_types.go
index 398da384cda..7cc002b4610 100644
--- a/testdata/project-v3-multigroup/apis/fiz/v1/bar_types.go
+++ b/testdata/project-v3-multigroup/apis/fiz/v1/bar_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/fiz/v1/groupversion_info.go b/testdata/project-v3-multigroup/apis/fiz/v1/groupversion_info.go
index 94b9e4ebb56..15af8f01654 100644
--- a/testdata/project-v3-multigroup/apis/fiz/v1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/fiz/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/fiz/v1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/fiz/v1/zz_generated.deepcopy.go
index f46b6a1cb10..3ed74150b13 100644
--- a/testdata/project-v3-multigroup/apis/fiz/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/fiz/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/foo.policy/v1/groupversion_info.go b/testdata/project-v3-multigroup/apis/foo.policy/v1/groupversion_info.go
index a9274dfb2b2..33bf52ac801 100644
--- a/testdata/project-v3-multigroup/apis/foo.policy/v1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/foo.policy/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go b/testdata/project-v3-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go
index db63b3139a5..01e8d1765a6 100644
--- a/testdata/project-v3-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go
+++ b/testdata/project-v3-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go
index 384b31870fe..b6428f993a6 100644
--- a/testdata/project-v3-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/foo/v1/bar_types.go b/testdata/project-v3-multigroup/apis/foo/v1/bar_types.go
index 398da384cda..7cc002b4610 100644
--- a/testdata/project-v3-multigroup/apis/foo/v1/bar_types.go
+++ b/testdata/project-v3-multigroup/apis/foo/v1/bar_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/foo/v1/groupversion_info.go b/testdata/project-v3-multigroup/apis/foo/v1/groupversion_info.go
index c412c274381..d0d26e62293 100644
--- a/testdata/project-v3-multigroup/apis/foo/v1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/foo/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/foo/v1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/foo/v1/zz_generated.deepcopy.go
index f46b6a1cb10..3ed74150b13 100644
--- a/testdata/project-v3-multigroup/apis/foo/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/foo/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go
index a6406135967..9200968a3a5 100644
--- a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/kraken_types.go b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/kraken_types.go
index afb57fff4b0..4c4d33ef844 100644
--- a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/kraken_types.go
+++ b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/kraken_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go
index e8b5ea29fc8..9f7feb2fdc8 100644
--- a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go
index 43f160b83e6..c6059651fad 100644
--- a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go
index 47da45524f6..470019dc160 100644
--- a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go
+++ b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go
index e5a09f90a46..de27a7b3faa 100644
--- a/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1/destroyer_types.go b/testdata/project-v3-multigroup/apis/ship/v1/destroyer_types.go
index 8efa6fad827..f8cc80eefb5 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1/destroyer_types.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1/destroyer_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1/destroyer_webhook.go b/testdata/project-v3-multigroup/apis/ship/v1/destroyer_webhook.go
index e1c0a0a05db..67798c6e1f0 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1/destroyer_webhook.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1/destroyer_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1/groupversion_info.go b/testdata/project-v3-multigroup/apis/ship/v1/groupversion_info.go
index 260546cc282..7ca96e4ea8c 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1/webhook_suite_test.go b/testdata/project-v3-multigroup/apis/ship/v1/webhook_suite_test.go
index af22a1df03c..82e4e3086b6 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/ship/v1/zz_generated.deepcopy.go
index c02c174f0d0..8f4b33cd7c4 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_types.go b/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_types.go
index c8734a6cf9e..bd62ed8ed7d 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_types.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_webhook.go b/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_webhook.go
index 8cf9bc5b41a..028189c9eab 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_webhook.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1beta1/frigate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1beta1/groupversion_info.go b/testdata/project-v3-multigroup/apis/ship/v1beta1/groupversion_info.go
index b0c2cd9d938..a27e3ab1af0 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1beta1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1beta1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go
index d1ac770b5c7..aade9e605f2 100644
--- a/testdata/project-v3-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_types.go b/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_types.go
index 6160dc14b1d..b79187f2766 100644
--- a/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_types.go
+++ b/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_webhook.go b/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_webhook.go
index 877deb965a3..9fa6bc245d5 100644
--- a/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_webhook.go
+++ b/testdata/project-v3-multigroup/apis/ship/v2alpha1/cruiser_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v2alpha1/groupversion_info.go b/testdata/project-v3-multigroup/apis/ship/v2alpha1/groupversion_info.go
index 90fed0d1cc7..1b291530c6b 100644
--- a/testdata/project-v3-multigroup/apis/ship/v2alpha1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/ship/v2alpha1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v3-multigroup/apis/ship/v2alpha1/webhook_suite_test.go
index 23748cbe171..f3cbf1b6ce0 100644
--- a/testdata/project-v3-multigroup/apis/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v3-multigroup/apis/ship/v2alpha1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go
index e335a81bb7d..ce318aa131c 100644
--- a/testdata/project-v3-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/v1/groupversion_info.go b/testdata/project-v3-multigroup/apis/v1/groupversion_info.go
index 7c182dc49bc..49502eee2c5 100644
--- a/testdata/project-v3-multigroup/apis/v1/groupversion_info.go
+++ b/testdata/project-v3-multigroup/apis/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/v1/lakers_types.go b/testdata/project-v3-multigroup/apis/v1/lakers_types.go
index 5dca1f9accf..415b5bc3924 100644
--- a/testdata/project-v3-multigroup/apis/v1/lakers_types.go
+++ b/testdata/project-v3-multigroup/apis/v1/lakers_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/v1/lakers_webhook.go b/testdata/project-v3-multigroup/apis/v1/lakers_webhook.go
index c358e00ad67..315982132a6 100644
--- a/testdata/project-v3-multigroup/apis/v1/lakers_webhook.go
+++ b/testdata/project-v3-multigroup/apis/v1/lakers_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/v1/webhook_suite_test.go b/testdata/project-v3-multigroup/apis/v1/webhook_suite_test.go
index 0b451a74262..6ee31eed5a3 100644
--- a/testdata/project-v3-multigroup/apis/v1/webhook_suite_test.go
+++ b/testdata/project-v3-multigroup/apis/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/apis/v1/zz_generated.deepcopy.go b/testdata/project-v3-multigroup/apis/v1/zz_generated.deepcopy.go
index 523ce2ac7ac..3de5e2d9f31 100644
--- a/testdata/project-v3-multigroup/apis/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-multigroup/apis/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v3-multigroup/config/crd/bases/crew.testproject.org_captains.yaml
index 69ab9ccffcb..2caae573427 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml b/testdata/project-v3-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml
index 41359145155..bacaa3aa846 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: bars.fiz.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml b/testdata/project-v3-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
index e53814549ce..0d557cfb88a 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: healthcheckpolicies.foo.policy.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/foo.testproject.org_bars.yaml b/testdata/project-v3-multigroup/config/crd/bases/foo.testproject.org_bars.yaml
index 56d04c79e51..e7343b34027 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/foo.testproject.org_bars.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/foo.testproject.org_bars.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: bars.foo.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml b/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
index f2c5a498774..7234a8bc209 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: krakens.sea-creatures.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml b/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
index 3d4561fc3e1..71c8c60fb63 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: leviathans.sea-creatures.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml b/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml
index 2ff7d75cfa5..d617f467afe 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: cruisers.ship.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml b/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml
index 2ecdacdd889..6c33616396d 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: destroyers.ship.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml b/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml
index c0bf2420650..042f0b5a969 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: frigates.ship.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/config/crd/bases/testproject.org_lakers.yaml b/testdata/project-v3-multigroup/config/crd/bases/testproject.org_lakers.yaml
index 3a4e18ccfb9..f6cb15c6d50 100644
--- a/testdata/project-v3-multigroup/config/crd/bases/testproject.org_lakers.yaml
+++ b/testdata/project-v3-multigroup/config/crd/bases/testproject.org_lakers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: lakers.testproject.org
spec:
diff --git a/testdata/project-v3-multigroup/controllers/apps/deployment_controller.go b/testdata/project-v3-multigroup/controllers/apps/deployment_controller.go
index 2ef4cba3511..57b4f937c79 100644
--- a/testdata/project-v3-multigroup/controllers/apps/deployment_controller.go
+++ b/testdata/project-v3-multigroup/controllers/apps/deployment_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ type DeploymentReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/apps/suite_test.go b/testdata/project-v3-multigroup/controllers/apps/suite_test.go
index 08290b1d050..4b58e5e6b31 100644
--- a/testdata/project-v3-multigroup/controllers/apps/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/apps/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/crew/captain_controller.go b/testdata/project-v3-multigroup/controllers/crew/captain_controller.go
index 707d25c6d2c..d2be836d3c0 100644
--- a/testdata/project-v3-multigroup/controllers/crew/captain_controller.go
+++ b/testdata/project-v3-multigroup/controllers/crew/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type CaptainReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/crew/suite_test.go b/testdata/project-v3-multigroup/controllers/crew/suite_test.go
index a3f0ae2ced4..ab137c1dd1b 100644
--- a/testdata/project-v3-multigroup/controllers/crew/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/crew/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/fiz/bar_controller.go b/testdata/project-v3-multigroup/controllers/fiz/bar_controller.go
index 0c4739d4988..73a51a4867d 100644
--- a/testdata/project-v3-multigroup/controllers/fiz/bar_controller.go
+++ b/testdata/project-v3-multigroup/controllers/fiz/bar_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type BarReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *BarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/fiz/suite_test.go b/testdata/project-v3-multigroup/controllers/fiz/suite_test.go
index 3d5c9c1eb0b..4e8cbf27a0c 100644
--- a/testdata/project-v3-multigroup/controllers/fiz/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/fiz/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v3-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go
index ab12c32ad27..4d35c3e1b19 100644
--- a/testdata/project-v3-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v3-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type HealthCheckPolicyReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *HealthCheckPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/foo.policy/suite_test.go b/testdata/project-v3-multigroup/controllers/foo.policy/suite_test.go
index 30506b0a27e..99f65baabd6 100644
--- a/testdata/project-v3-multigroup/controllers/foo.policy/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/foo.policy/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/foo/bar_controller.go b/testdata/project-v3-multigroup/controllers/foo/bar_controller.go
index 528d3717d16..286bbce9ee1 100644
--- a/testdata/project-v3-multigroup/controllers/foo/bar_controller.go
+++ b/testdata/project-v3-multigroup/controllers/foo/bar_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type BarReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *BarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/foo/suite_test.go b/testdata/project-v3-multigroup/controllers/foo/suite_test.go
index 56ea336dc02..442df294664 100644
--- a/testdata/project-v3-multigroup/controllers/foo/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/foo/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/lakers_controller.go b/testdata/project-v3-multigroup/controllers/lakers_controller.go
index f4a14d8f687..51262cf7b80 100644
--- a/testdata/project-v3-multigroup/controllers/lakers_controller.go
+++ b/testdata/project-v3-multigroup/controllers/lakers_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type LakersReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LakersReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/sea-creatures/kraken_controller.go b/testdata/project-v3-multigroup/controllers/sea-creatures/kraken_controller.go
index 3e66824a499..be29eeae2ca 100644
--- a/testdata/project-v3-multigroup/controllers/sea-creatures/kraken_controller.go
+++ b/testdata/project-v3-multigroup/controllers/sea-creatures/kraken_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type KrakenReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *KrakenReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/sea-creatures/leviathan_controller.go b/testdata/project-v3-multigroup/controllers/sea-creatures/leviathan_controller.go
index ece63549d98..338572cf6fc 100644
--- a/testdata/project-v3-multigroup/controllers/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v3-multigroup/controllers/sea-creatures/leviathan_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type LeviathanReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LeviathanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/sea-creatures/suite_test.go b/testdata/project-v3-multigroup/controllers/sea-creatures/suite_test.go
index bc66133afb4..aa6e595de30 100644
--- a/testdata/project-v3-multigroup/controllers/sea-creatures/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/sea-creatures/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/ship/cruiser_controller.go b/testdata/project-v3-multigroup/controllers/ship/cruiser_controller.go
index 0f7771dde8e..757f05a90a1 100644
--- a/testdata/project-v3-multigroup/controllers/ship/cruiser_controller.go
+++ b/testdata/project-v3-multigroup/controllers/ship/cruiser_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type CruiserReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CruiserReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/ship/destroyer_controller.go b/testdata/project-v3-multigroup/controllers/ship/destroyer_controller.go
index 4fd9d0c0b66..4ab93e0f925 100644
--- a/testdata/project-v3-multigroup/controllers/ship/destroyer_controller.go
+++ b/testdata/project-v3-multigroup/controllers/ship/destroyer_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type DestroyerReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *DestroyerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/ship/frigate_controller.go b/testdata/project-v3-multigroup/controllers/ship/frigate_controller.go
index 978fa8de6d0..5b92ff70ba1 100644
--- a/testdata/project-v3-multigroup/controllers/ship/frigate_controller.go
+++ b/testdata/project-v3-multigroup/controllers/ship/frigate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type FrigateReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *FrigateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3-multigroup/controllers/ship/suite_test.go b/testdata/project-v3-multigroup/controllers/ship/suite_test.go
index 5f07687d7ab..4b0556cb9fe 100644
--- a/testdata/project-v3-multigroup/controllers/ship/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/ship/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/controllers/suite_test.go b/testdata/project-v3-multigroup/controllers/suite_test.go
index 019b2cbf417..e210d2b78cb 100644
--- a/testdata/project-v3-multigroup/controllers/suite_test.go
+++ b/testdata/project-v3-multigroup/controllers/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/go.mod b/testdata/project-v3-multigroup/go.mod
index b7272f7c983..b7153144f92 100644
--- a/testdata/project-v3-multigroup/go.mod
+++ b/testdata/project-v3-multigroup/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v3-multigroup
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v3-multigroup/hack/boilerplate.go.txt b/testdata/project-v3-multigroup/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v3-multigroup/hack/boilerplate.go.txt
+++ b/testdata/project-v3-multigroup/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-multigroup/main.go b/testdata/project-v3-multigroup/main.go
index 55e34cb64f2..9848da46c51 100644
--- a/testdata/project-v3-multigroup/main.go
+++ b/testdata/project-v3-multigroup/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/Makefile b/testdata/project-v3-with-deploy-image/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v3-with-deploy-image/Makefile
+++ b/testdata/project-v3-with-deploy-image/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v3-with-deploy-image/PROJECT b/testdata/project-v3-with-deploy-image/PROJECT
index cdc2fa5c3ab..970f41493fb 100644
--- a/testdata/project-v3-with-deploy-image/PROJECT
+++ b/testdata/project-v3-with-deploy-image/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v3
diff --git a/testdata/project-v3-with-deploy-image/README.md b/testdata/project-v3-with-deploy-image/README.md
index 08064c4cf66..5bafe88eade 100644
--- a/testdata/project-v3-with-deploy-image/README.md
+++ b/testdata/project-v3-with-deploy-image/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v3-with-deploy-image:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/api/v1alpha1/busybox_types.go b/testdata/project-v3-with-deploy-image/api/v1alpha1/busybox_types.go
index e54b6f4c368..440dd96baef 100644
--- a/testdata/project-v3-with-deploy-image/api/v1alpha1/busybox_types.go
+++ b/testdata/project-v3-with-deploy-image/api/v1alpha1/busybox_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/api/v1alpha1/groupversion_info.go b/testdata/project-v3-with-deploy-image/api/v1alpha1/groupversion_info.go
index 4f03dd8ab5f..9541616caff 100644
--- a/testdata/project-v3-with-deploy-image/api/v1alpha1/groupversion_info.go
+++ b/testdata/project-v3-with-deploy-image/api/v1alpha1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_types.go b/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_types.go
index bf27a5f7af9..aa82a833c00 100644
--- a/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_types.go
+++ b/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_webhook.go b/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_webhook.go
index 579f86841b6..e59456d58c4 100644
--- a/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_webhook.go
+++ b/testdata/project-v3-with-deploy-image/api/v1alpha1/memcached_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/api/v1alpha1/webhook_suite_test.go b/testdata/project-v3-with-deploy-image/api/v1alpha1/webhook_suite_test.go
index 91bbf3d07d5..7ef095cf487 100644
--- a/testdata/project-v3-with-deploy-image/api/v1alpha1/webhook_suite_test.go
+++ b/testdata/project-v3-with-deploy-image/api/v1alpha1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go b/testdata/project-v3-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go
index 264d519dd7f..a1b201c4512 100644
--- a/testdata/project-v3-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go
+++ b/testdata/project-v3-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml b/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml
index cf97e148058..a57094922b7 100644
--- a/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml
+++ b/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: busyboxes.example.com.testproject.org
spec:
diff --git a/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml b/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml
index 4e1cbc4b9fe..928e137481e 100644
--- a/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml
+++ b/testdata/project-v3-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: memcacheds.example.com.testproject.org
spec:
diff --git a/testdata/project-v3-with-deploy-image/controllers/busybox_controller.go b/testdata/project-v3-with-deploy-image/controllers/busybox_controller.go
index 3a95594f137..2cec26cca1c 100644
--- a/testdata/project-v3-with-deploy-image/controllers/busybox_controller.go
+++ b/testdata/project-v3-with-deploy-image/controllers/busybox_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ type BusyboxReconciler struct {
// For further info:
// - About Operator Pattern: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
// - About Controllers: https://kubernetes.io/docs/concepts/architecture/controller/
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *BusyboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go b/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go
index 41796b1caf1..75bf1292220 100644
--- a/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go
+++ b/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/controllers/memcached_controller.go b/testdata/project-v3-with-deploy-image/controllers/memcached_controller.go
index c33368e6103..4dcfd0a445a 100644
--- a/testdata/project-v3-with-deploy-image/controllers/memcached_controller.go
+++ b/testdata/project-v3-with-deploy-image/controllers/memcached_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ type MemcachedReconciler struct {
// For further info:
// - About Operator Pattern: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
// - About Controllers: https://kubernetes.io/docs/concepts/architecture/controller/
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go b/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go
index a0f5fe9f330..0d85e90fb19 100644
--- a/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go
+++ b/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/controllers/suite_test.go b/testdata/project-v3-with-deploy-image/controllers/suite_test.go
index d653607ab53..6201f7d12c5 100644
--- a/testdata/project-v3-with-deploy-image/controllers/suite_test.go
+++ b/testdata/project-v3-with-deploy-image/controllers/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/go.mod b/testdata/project-v3-with-deploy-image/go.mod
index c1f73d21d17..eda98672a98 100644
--- a/testdata/project-v3-with-deploy-image/go.mod
+++ b/testdata/project-v3-with-deploy-image/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v3-with-deploy-image
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v3-with-deploy-image/hack/boilerplate.go.txt b/testdata/project-v3-with-deploy-image/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v3-with-deploy-image/hack/boilerplate.go.txt
+++ b/testdata/project-v3-with-deploy-image/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-deploy-image/main.go b/testdata/project-v3-with-deploy-image/main.go
index 8d297f952d1..6174c02700a 100644
--- a/testdata/project-v3-with-deploy-image/main.go
+++ b/testdata/project-v3-with-deploy-image/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-metrics/.dockerignore b/testdata/project-v3-with-grafana/.dockerignore
similarity index 100%
rename from testdata/project-v3-with-metrics/.dockerignore
rename to testdata/project-v3-with-grafana/.dockerignore
diff --git a/testdata/project-v3-with-metrics/.gitignore b/testdata/project-v3-with-grafana/.gitignore
similarity index 100%
rename from testdata/project-v3-with-metrics/.gitignore
rename to testdata/project-v3-with-grafana/.gitignore
diff --git a/testdata/project-v3-with-metrics/Dockerfile b/testdata/project-v3-with-grafana/Dockerfile
similarity index 100%
rename from testdata/project-v3-with-metrics/Dockerfile
rename to testdata/project-v3-with-grafana/Dockerfile
diff --git a/testdata/project-v4-with-metrics/Makefile b/testdata/project-v3-with-grafana/Makefile
similarity index 99%
rename from testdata/project-v4-with-metrics/Makefile
rename to testdata/project-v3-with-grafana/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v4-with-metrics/Makefile
+++ b/testdata/project-v3-with-grafana/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v3-with-grafana/PROJECT b/testdata/project-v3-with-grafana/PROJECT
new file mode 100644
index 00000000000..d0e2feedf2f
--- /dev/null
+++ b/testdata/project-v3-with-grafana/PROJECT
@@ -0,0 +1,12 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
+domain: testproject.org
+layout:
+- go.kubebuilder.io/v3
+plugins:
+ grafana.kubebuilder.io/v1-alpha: {}
+projectName: project-v3-with-grafana
+repo: sigs.k8s.io/kubebuilder/testdata/project-v3-with-grafana
+version: "3"
diff --git a/testdata/project-v3-with-metrics/README.md b/testdata/project-v3-with-grafana/README.md
similarity index 85%
rename from testdata/project-v3-with-metrics/README.md
rename to testdata/project-v3-with-grafana/README.md
index 54d21100deb..f6f24fd0549 100644
--- a/testdata/project-v3-with-metrics/README.md
+++ b/testdata/project-v3-with-grafana/README.md
@@ -1,4 +1,4 @@
-# project-v3-with-metrics
+# project-v3-with-grafana
// TODO(user): Add simple overview of use/purpose
## Description
@@ -16,15 +16,15 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
-make docker-build docker-push IMG=/project-v3-with-metrics:tag
+make docker-build docker-push IMG=/project-v3-with-grafana:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
-make deploy IMG=/project-v3-with-metrics:tag
+make deploy IMG=/project-v3-with-grafana:tag
```
### Uninstall CRDs
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-metrics/config/default/kustomization.yaml b/testdata/project-v3-with-grafana/config/default/kustomization.yaml
similarity index 96%
rename from testdata/project-v4-with-metrics/config/default/kustomization.yaml
rename to testdata/project-v3-with-grafana/config/default/kustomization.yaml
index 477cc28c837..b6e6fb45302 100644
--- a/testdata/project-v4-with-metrics/config/default/kustomization.yaml
+++ b/testdata/project-v3-with-grafana/config/default/kustomization.yaml
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
-namespace: project-v4-with-metrics-system
+namespace: project-v3-with-grafana-system
# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
-namePrefix: project-v4-with-metrics-
+namePrefix: project-v3-with-grafana-
# Labels to add to all resources and selectors.
#commonLabels:
diff --git a/testdata/project-v3-with-metrics/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v3-with-grafana/config/default/manager_auth_proxy_patch.yaml
similarity index 100%
rename from testdata/project-v3-with-metrics/config/default/manager_auth_proxy_patch.yaml
rename to testdata/project-v3-with-grafana/config/default/manager_auth_proxy_patch.yaml
diff --git a/testdata/project-v3-with-metrics/config/default/manager_config_patch.yaml b/testdata/project-v3-with-grafana/config/default/manager_config_patch.yaml
similarity index 100%
rename from testdata/project-v3-with-metrics/config/default/manager_config_patch.yaml
rename to testdata/project-v3-with-grafana/config/default/manager_config_patch.yaml
diff --git a/testdata/project-v3-with-metrics/config/manager/kustomization.yaml b/testdata/project-v3-with-grafana/config/manager/kustomization.yaml
similarity index 100%
rename from testdata/project-v3-with-metrics/config/manager/kustomization.yaml
rename to testdata/project-v3-with-grafana/config/manager/kustomization.yaml
diff --git a/testdata/project-v3-with-metrics/config/manager/manager.yaml b/testdata/project-v3-with-grafana/config/manager/manager.yaml
similarity index 93%
rename from testdata/project-v3-with-metrics/config/manager/manager.yaml
rename to testdata/project-v3-with-grafana/config/manager/manager.yaml
index e717685182f..33e137a4559 100644
--- a/testdata/project-v3-with-metrics/config/manager/manager.yaml
+++ b/testdata/project-v3-with-grafana/config/manager/manager.yaml
@@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: system
---
@@ -21,8 +21,8 @@ metadata:
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
spec:
selector:
diff --git a/testdata/project-v3-with-metrics/config/prometheus/kustomization.yaml b/testdata/project-v3-with-grafana/config/prometheus/kustomization.yaml
similarity index 100%
rename from testdata/project-v3-with-metrics/config/prometheus/kustomization.yaml
rename to testdata/project-v3-with-grafana/config/prometheus/kustomization.yaml
diff --git a/testdata/project-v3-with-metrics/config/prometheus/monitor.yaml b/testdata/project-v3-with-grafana/config/prometheus/monitor.yaml
similarity index 85%
rename from testdata/project-v3-with-metrics/config/prometheus/monitor.yaml
rename to testdata/project-v3-with-grafana/config/prometheus/monitor.yaml
index f0e477c2b6f..3c5027fc3b3 100644
--- a/testdata/project-v3-with-metrics/config/prometheus/monitor.yaml
+++ b/testdata/project-v3-with-grafana/config/prometheus/monitor.yaml
@@ -8,8 +8,8 @@ metadata:
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/instance: controller-manager-metrics-monitor
app.kubernetes.io/component: metrics
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
diff --git a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_client_clusterrole.yaml
similarity index 75%
rename from testdata/project-v4-with-metrics/config/rbac/auth_proxy_client_clusterrole.yaml
rename to testdata/project-v3-with-grafana/config/rbac/auth_proxy_client_clusterrole.yaml
index a1e848419ba..1b5672c36cc 100644
--- a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_client_clusterrole.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_client_clusterrole.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: metrics-reader
rules:
diff --git a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_role.yaml b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_role.yaml
similarity index 80%
rename from testdata/project-v3-with-metrics/config/rbac/auth_proxy_role.yaml
rename to testdata/project-v3-with-grafana/config/rbac/auth_proxy_role.yaml
index 7d4f6f2b214..8402d6e1bce 100644
--- a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_role.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_role.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: proxy-role
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: proxy-role
rules:
diff --git a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_role_binding.yaml
similarity index 80%
rename from testdata/project-v4-with-metrics/config/rbac/auth_proxy_role_binding.yaml
rename to testdata/project-v3-with-grafana/config/rbac/auth_proxy_role_binding.yaml
index 713d2fd378e..cfa5856e8d6 100644
--- a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_role_binding.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_role_binding.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: proxy-rolebinding
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: proxy-rolebinding
roleRef:
diff --git a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_service.yaml b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_service.yaml
similarity index 81%
rename from testdata/project-v3-with-metrics/config/rbac/auth_proxy_service.yaml
rename to testdata/project-v3-with-grafana/config/rbac/auth_proxy_service.yaml
index b34bbb2e623..f300c8e493d 100644
--- a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_service.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/auth_proxy_service.yaml
@@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
diff --git a/testdata/project-v3-with-metrics/config/rbac/kustomization.yaml b/testdata/project-v3-with-grafana/config/rbac/kustomization.yaml
similarity index 100%
rename from testdata/project-v3-with-metrics/config/rbac/kustomization.yaml
rename to testdata/project-v3-with-grafana/config/rbac/kustomization.yaml
diff --git a/testdata/project-v3-with-metrics/config/rbac/leader_election_role.yaml b/testdata/project-v3-with-grafana/config/rbac/leader_election_role.yaml
similarity index 85%
rename from testdata/project-v3-with-metrics/config/rbac/leader_election_role.yaml
rename to testdata/project-v3-with-grafana/config/rbac/leader_election_role.yaml
index 29fdea97c56..86a522cc2c9 100644
--- a/testdata/project-v3-with-metrics/config/rbac/leader_election_role.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/leader_election_role.yaml
@@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
diff --git a/testdata/project-v4-with-metrics/config/rbac/leader_election_role_binding.yaml b/testdata/project-v3-with-grafana/config/rbac/leader_election_role_binding.yaml
similarity index 80%
rename from testdata/project-v4-with-metrics/config/rbac/leader_election_role_binding.yaml
rename to testdata/project-v3-with-grafana/config/rbac/leader_election_role_binding.yaml
index a93e505947e..13e5132ebc5 100644
--- a/testdata/project-v4-with-metrics/config/rbac/leader_election_role_binding.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/leader_election_role_binding.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
diff --git a/testdata/project-v3-with-metrics/config/rbac/role_binding.yaml b/testdata/project-v3-with-grafana/config/rbac/role_binding.yaml
similarity index 80%
rename from testdata/project-v3-with-metrics/config/rbac/role_binding.yaml
rename to testdata/project-v3-with-grafana/config/rbac/role_binding.yaml
index b31cc6ce4f2..663f1645896 100644
--- a/testdata/project-v3-with-metrics/config/rbac/role_binding.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/role_binding.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
diff --git a/testdata/project-v4-with-metrics/config/rbac/service_account.yaml b/testdata/project-v3-with-grafana/config/rbac/service_account.yaml
similarity index 71%
rename from testdata/project-v4-with-metrics/config/rbac/service_account.yaml
rename to testdata/project-v3-with-grafana/config/rbac/service_account.yaml
index 4f1fd6de738..69cf1072cb6 100644
--- a/testdata/project-v4-with-metrics/config/rbac/service_account.yaml
+++ b/testdata/project-v3-with-grafana/config/rbac/service_account.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v3-with-grafana
+ app.kubernetes.io/part-of: project-v3-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
diff --git a/testdata/project-v3-with-grafana/go.mod b/testdata/project-v3-with-grafana/go.mod
new file mode 100644
index 00000000000..45e7cdc6829
--- /dev/null
+++ b/testdata/project-v3-with-grafana/go.mod
@@ -0,0 +1,68 @@
+module sigs.k8s.io/kubebuilder/testdata/project-v3-with-grafana
+
+go 1.19
+
+require (
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
+)
+
+require (
+ github.com/beorn7/perks v1.0.1 // indirect
+ github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/evanphx/json-patch/v5 v5.6.0 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
+ github.com/go-logr/logr v1.2.3 // indirect
+ github.com/go-logr/zapr v1.2.3 // indirect
+ github.com/go-openapi/jsonpointer v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
+ github.com/go-openapi/swag v0.19.14 // indirect
+ github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
+ github.com/golang/protobuf v1.5.2 // indirect
+ github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/uuid v1.1.2 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
+ github.com/josharian/intern v1.0.0 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/mailru/easyjson v0.7.6 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ go.uber.org/atomic v1.7.0 // indirect
+ go.uber.org/multierr v1.6.0 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ google.golang.org/appengine v1.6.7 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
+ gopkg.in/inf.v0 v0.9.1 // indirect
+ gopkg.in/yaml.v2 v2.4.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+ k8s.io/api v0.26.0 // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
+ sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
+ sigs.k8s.io/yaml v1.3.0 // indirect
+)
diff --git a/testdata/project-v3-declarative-v1/grafana/controller-resources-metrics.json b/testdata/project-v3-with-grafana/grafana/controller-resources-metrics.json
similarity index 100%
rename from testdata/project-v3-declarative-v1/grafana/controller-resources-metrics.json
rename to testdata/project-v3-with-grafana/grafana/controller-resources-metrics.json
diff --git a/testdata/project-v3-declarative-v1/grafana/controller-runtime-metrics.json b/testdata/project-v3-with-grafana/grafana/controller-runtime-metrics.json
similarity index 100%
rename from testdata/project-v3-declarative-v1/grafana/controller-runtime-metrics.json
rename to testdata/project-v3-with-grafana/grafana/controller-runtime-metrics.json
diff --git a/testdata/project-v3-declarative-v1/grafana/custom-metrics/config.yaml b/testdata/project-v3-with-grafana/grafana/custom-metrics/config.yaml
similarity index 100%
rename from testdata/project-v3-declarative-v1/grafana/custom-metrics/config.yaml
rename to testdata/project-v3-with-grafana/grafana/custom-metrics/config.yaml
diff --git a/testdata/project-v4-with-metrics/hack/boilerplate.go.txt b/testdata/project-v3-with-grafana/hack/boilerplate.go.txt
similarity index 93%
rename from testdata/project-v4-with-metrics/hack/boilerplate.go.txt
rename to testdata/project-v3-with-grafana/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v4-with-metrics/hack/boilerplate.go.txt
+++ b/testdata/project-v3-with-grafana/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-metrics/main.go b/testdata/project-v3-with-grafana/main.go
similarity index 97%
rename from testdata/project-v4-with-metrics/main.go
rename to testdata/project-v3-with-grafana/main.go
index a60d58e8ea7..c12c088b5e6 100644
--- a/testdata/project-v4-with-metrics/main.go
+++ b/testdata/project-v3-with-grafana/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
- LeaderElectionID: "d2513bbd.testproject.org",
+ LeaderElectionID: "502fdbd3.testproject.org",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
diff --git a/testdata/project-v3-with-metrics/PROJECT b/testdata/project-v3-with-metrics/PROJECT
deleted file mode 100644
index 91653f71c69..00000000000
--- a/testdata/project-v3-with-metrics/PROJECT
+++ /dev/null
@@ -1,8 +0,0 @@
-domain: testproject.org
-layout:
-- go.kubebuilder.io/v3
-plugins:
- grafana.kubebuilder.io/v1-alpha: {}
-projectName: project-v3-with-metrics
-repo: sigs.k8s.io/kubebuilder/testdata/project-v3-with-metrics
-version: "3"
diff --git a/testdata/project-v3-with-metrics/go.mod b/testdata/project-v3-with-metrics/go.mod
deleted file mode 100644
index 3495fdc3c2b..00000000000
--- a/testdata/project-v3-with-metrics/go.mod
+++ /dev/null
@@ -1,79 +0,0 @@
-module sigs.k8s.io/kubebuilder/testdata/project-v3-with-metrics
-
-go 1.19
-
-require (
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
-)
-
-require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
- github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
- github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
- github.com/go-logr/logr v1.2.3 // indirect
- github.com/go-logr/zapr v1.2.3 // indirect
- github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
- github.com/go-openapi/swag v0.19.14 // indirect
- github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
- github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
- github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
- github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
- google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
- gopkg.in/inf.v0 v0.9.1 // indirect
- gopkg.in/yaml.v2 v2.4.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.25.0 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
- sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
- sigs.k8s.io/yaml v1.3.0 // indirect
-)
diff --git a/testdata/project-v3/Makefile b/testdata/project-v3/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v3/Makefile
+++ b/testdata/project-v3/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v3/PROJECT b/testdata/project-v3/PROJECT
index 8ef4c5b14ac..8376173de79 100644
--- a/testdata/project-v3/PROJECT
+++ b/testdata/project-v3/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v3
diff --git a/testdata/project-v3/README.md b/testdata/project-v3/README.md
index 478d112d4cf..b4c9056e073 100644
--- a/testdata/project-v3/README.md
+++ b/testdata/project-v3/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v3:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/admiral_types.go b/testdata/project-v3/api/v1/admiral_types.go
index 9cbac39e7d2..0902a0b6e5c 100644
--- a/testdata/project-v3/api/v1/admiral_types.go
+++ b/testdata/project-v3/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/admiral_webhook.go b/testdata/project-v3/api/v1/admiral_webhook.go
index acc74d793f0..b809f0feb0e 100644
--- a/testdata/project-v3/api/v1/admiral_webhook.go
+++ b/testdata/project-v3/api/v1/admiral_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/captain_types.go b/testdata/project-v3/api/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v3/api/v1/captain_types.go
+++ b/testdata/project-v3/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/captain_webhook.go b/testdata/project-v3/api/v1/captain_webhook.go
index ba00000c137..1c8837b5e90 100644
--- a/testdata/project-v3/api/v1/captain_webhook.go
+++ b/testdata/project-v3/api/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/firstmate_types.go b/testdata/project-v3/api/v1/firstmate_types.go
index 7515759833a..59bcaf1e8e7 100644
--- a/testdata/project-v3/api/v1/firstmate_types.go
+++ b/testdata/project-v3/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/firstmate_webhook.go b/testdata/project-v3/api/v1/firstmate_webhook.go
index 5fa6046165d..941a86ed458 100644
--- a/testdata/project-v3/api/v1/firstmate_webhook.go
+++ b/testdata/project-v3/api/v1/firstmate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/groupversion_info.go b/testdata/project-v3/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v3/api/v1/groupversion_info.go
+++ b/testdata/project-v3/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/webhook_suite_test.go b/testdata/project-v3/api/v1/webhook_suite_test.go
index 06549f198e6..50d550ba906 100644
--- a/testdata/project-v3/api/v1/webhook_suite_test.go
+++ b/testdata/project-v3/api/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/api/v1/zz_generated.deepcopy.go b/testdata/project-v3/api/v1/zz_generated.deepcopy.go
index eb076ea05ea..3b442b7416a 100644
--- a/testdata/project-v3/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v3/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/config/crd/bases/crew.testproject.org_admirales.yaml b/testdata/project-v3/config/crd/bases/crew.testproject.org_admirales.yaml
index 97533103752..8e63f663bff 100644
--- a/testdata/project-v3/config/crd/bases/crew.testproject.org_admirales.yaml
+++ b/testdata/project-v3/config/crd/bases/crew.testproject.org_admirales.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: admirales.crew.testproject.org
spec:
diff --git a/testdata/project-v3/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v3/config/crd/bases/crew.testproject.org_captains.yaml
index 69ab9ccffcb..2caae573427 100644
--- a/testdata/project-v3/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v3/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v3/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v3/config/crd/bases/crew.testproject.org_firstmates.yaml
index e1d9bb02b2b..c5cd98dac32 100644
--- a/testdata/project-v3/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ b/testdata/project-v3/config/crd/bases/crew.testproject.org_firstmates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: firstmates.crew.testproject.org
spec:
diff --git a/testdata/project-v3/controllers/admiral_controller.go b/testdata/project-v3/controllers/admiral_controller.go
index e9d90fa182c..5c7ea592fd6 100644
--- a/testdata/project-v3/controllers/admiral_controller.go
+++ b/testdata/project-v3/controllers/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type AdmiralReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3/controllers/captain_controller.go b/testdata/project-v3/controllers/captain_controller.go
index f73a25d6893..fa9e674afcf 100644
--- a/testdata/project-v3/controllers/captain_controller.go
+++ b/testdata/project-v3/controllers/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type CaptainReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3/controllers/firstmate_controller.go b/testdata/project-v3/controllers/firstmate_controller.go
index 57a723af4de..53b58934e30 100644
--- a/testdata/project-v3/controllers/firstmate_controller.go
+++ b/testdata/project-v3/controllers/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ type FirstMateReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3/controllers/laker_controller.go b/testdata/project-v3/controllers/laker_controller.go
index 9e9536c1b2e..ecf8625d438 100644
--- a/testdata/project-v3/controllers/laker_controller.go
+++ b/testdata/project-v3/controllers/laker_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ type LakerReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v3/controllers/suite_test.go b/testdata/project-v3/controllers/suite_test.go
index ea5a2a1999f..dca6464ebdc 100644
--- a/testdata/project-v3/controllers/suite_test.go
+++ b/testdata/project-v3/controllers/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/go.mod b/testdata/project-v3/go.mod
index a83e4627442..9ffa1619352 100644
--- a/testdata/project-v3/go.mod
+++ b/testdata/project-v3/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v3
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v3/hack/boilerplate.go.txt b/testdata/project-v3/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v3/hack/boilerplate.go.txt
+++ b/testdata/project-v3/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3/main.go b/testdata/project-v3/main.go
index 81da09f3887..0df043f2fbf 100644
--- a/testdata/project-v3/main.go
+++ b/testdata/project-v3/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/Dockerfile b/testdata/project-v4-config/Dockerfile
index 8f9cca18eb6..ef4cfaf90bd 100644
--- a/testdata/project-v4-config/Dockerfile
+++ b/testdata/project-v4-config/Dockerfile
@@ -12,16 +12,16 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
-COPY main.go main.go
+COPY cmd/main.go cmd/main.go
COPY api/ api/
-COPY controllers/ controllers/
+COPY internal/controller/ internal/controller/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
diff --git a/testdata/project-v4-config/Makefile b/testdata/project-v4-config/Makefile
index 2f361a625c7..971bfb70e69 100644
--- a/testdata/project-v4-config/Makefile
+++ b/testdata/project-v4-config/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -62,11 +62,11 @@ test: manifests generate fmt vet envtest ## Run tests.
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
- go build -o bin/manager main.go
+ go build -o bin/manager cmd/main.go
.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
- go run ./main.go
+ go run ./cmd/main.go
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v4-config/PROJECT b/testdata/project-v4-config/PROJECT
index 92f6555562e..dddcf4b57f7 100644
--- a/testdata/project-v4-config/PROJECT
+++ b/testdata/project-v4-config/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
componentConfig: true
domain: testproject.org
layout:
diff --git a/testdata/project-v4-config/README.md b/testdata/project-v4-config/README.md
index d9f81b9eec5..9487c83f6c5 100644
--- a/testdata/project-v4-config/README.md
+++ b/testdata/project-v4-config/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v4-config:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/admiral_types.go b/testdata/project-v4-config/api/v1/admiral_types.go
index 55d2b767089..5da39958449 100644
--- a/testdata/project-v4-config/api/v1/admiral_types.go
+++ b/testdata/project-v4-config/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/admiral_webhook.go b/testdata/project-v4-config/api/v1/admiral_webhook.go
index 52fbc5ce79f..55f44963848 100644
--- a/testdata/project-v4-config/api/v1/admiral_webhook.go
+++ b/testdata/project-v4-config/api/v1/admiral_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/captain_types.go b/testdata/project-v4-config/api/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v4-config/api/v1/captain_types.go
+++ b/testdata/project-v4-config/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/captain_webhook.go b/testdata/project-v4-config/api/v1/captain_webhook.go
index ba00000c137..1c8837b5e90 100644
--- a/testdata/project-v4-config/api/v1/captain_webhook.go
+++ b/testdata/project-v4-config/api/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/firstmate_types.go b/testdata/project-v4-config/api/v1/firstmate_types.go
index 7515759833a..59bcaf1e8e7 100644
--- a/testdata/project-v4-config/api/v1/firstmate_types.go
+++ b/testdata/project-v4-config/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/firstmate_webhook.go b/testdata/project-v4-config/api/v1/firstmate_webhook.go
index 5fa6046165d..941a86ed458 100644
--- a/testdata/project-v4-config/api/v1/firstmate_webhook.go
+++ b/testdata/project-v4-config/api/v1/firstmate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/groupversion_info.go b/testdata/project-v4-config/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v4-config/api/v1/groupversion_info.go
+++ b/testdata/project-v4-config/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/webhook_suite_test.go b/testdata/project-v4-config/api/v1/webhook_suite_test.go
index 91b9bf273c6..674dbd75261 100644
--- a/testdata/project-v4-config/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4-config/api/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/api/v1/zz_generated.deepcopy.go b/testdata/project-v4-config/api/v1/zz_generated.deepcopy.go
index eb076ea05ea..3b442b7416a 100644
--- a/testdata/project-v4-config/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-config/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/main.go b/testdata/project-v4-config/cmd/main.go
similarity index 93%
rename from testdata/project-v4-config/main.go
rename to testdata/project-v4-config/cmd/main.go
index 296c9d8af21..ba319663fa1 100644
--- a/testdata/project-v4-config/main.go
+++ b/testdata/project-v4-config/cmd/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-config/api/v1"
- "sigs.k8s.io/kubebuilder/testdata/project-v4-config/controllers"
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-config/internal/controller"
//+kubebuilder:scaffold:imports
)
@@ -78,7 +78,7 @@ func main() {
os.Exit(1)
}
- if err = (&controllers.CaptainReconciler{
+ if err = (&controller.CaptainReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -89,7 +89,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
os.Exit(1)
}
- if err = (&controllers.FirstMateReconciler{
+ if err = (&controller.FirstMateReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -100,7 +100,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "FirstMate")
os.Exit(1)
}
- if err = (&controllers.AdmiralReconciler{
+ if err = (&controller.AdmiralReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -111,7 +111,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Admiral")
os.Exit(1)
}
- if err = (&controllers.LakerReconciler{
+ if err = (&controller.LakerReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
diff --git a/testdata/project-v4-config/config/crd/bases/crew.testproject.org_admirals.yaml b/testdata/project-v4-config/config/crd/bases/crew.testproject.org_admirals.yaml
index cb3c595b0ab..df8c76c0807 100644
--- a/testdata/project-v4-config/config/crd/bases/crew.testproject.org_admirals.yaml
+++ b/testdata/project-v4-config/config/crd/bases/crew.testproject.org_admirals.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: admirals.crew.testproject.org
spec:
diff --git a/testdata/project-v4-config/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v4-config/config/crd/bases/crew.testproject.org_captains.yaml
index 69ab9ccffcb..2caae573427 100644
--- a/testdata/project-v4-config/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v4-config/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v4-config/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v4-config/config/crd/bases/crew.testproject.org_firstmates.yaml
index e1d9bb02b2b..c5cd98dac32 100644
--- a/testdata/project-v4-config/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ b/testdata/project-v4-config/config/crd/bases/crew.testproject.org_firstmates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: firstmates.crew.testproject.org
spec:
diff --git a/testdata/project-v4-config/go.mod b/testdata/project-v4-config/go.mod
index 040eefbd905..4f8d3180446 100644
--- a/testdata/project-v4-config/go.mod
+++ b/testdata/project-v4-config/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-config
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4-config/hack/boilerplate.go.txt b/testdata/project-v4-config/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v4-config/hack/boilerplate.go.txt
+++ b/testdata/project-v4-config/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-config/controllers/admiral_controller.go b/testdata/project-v4-config/internal/controller/admiral_controller.go
similarity index 94%
rename from testdata/project-v4-config/controllers/admiral_controller.go
rename to testdata/project-v4-config/internal/controller/admiral_controller.go
index feded9e9a3f..24530bb5462 100644
--- a/testdata/project-v4-config/controllers/admiral_controller.go
+++ b/testdata/project-v4-config/internal/controller/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -45,7 +45,7 @@ type AdmiralReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-config/controllers/captain_controller.go b/testdata/project-v4-config/internal/controller/captain_controller.go
similarity index 94%
rename from testdata/project-v4-config/controllers/captain_controller.go
rename to testdata/project-v4-config/internal/controller/captain_controller.go
index c6997086d7e..4e9c712b2ed 100644
--- a/testdata/project-v4-config/controllers/captain_controller.go
+++ b/testdata/project-v4-config/internal/controller/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -45,7 +45,7 @@ type CaptainReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-config/controllers/firstmate_controller.go b/testdata/project-v4-config/internal/controller/firstmate_controller.go
similarity index 94%
rename from testdata/project-v4-config/controllers/firstmate_controller.go
rename to testdata/project-v4-config/internal/controller/firstmate_controller.go
index 55e8d0dbba0..f068679e428 100644
--- a/testdata/project-v4-config/controllers/firstmate_controller.go
+++ b/testdata/project-v4-config/internal/controller/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -45,7 +45,7 @@ type FirstMateReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/controllers/laker_controller.go b/testdata/project-v4-config/internal/controller/laker_controller.go
similarity index 94%
rename from testdata/project-v4/controllers/laker_controller.go
rename to testdata/project-v4-config/internal/controller/laker_controller.go
index 9e9536c1b2e..d5e54232538 100644
--- a/testdata/project-v4/controllers/laker_controller.go
+++ b/testdata/project-v4-config/internal/controller/laker_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -43,7 +43,7 @@ type LakerReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/crew/suite_test.go b/testdata/project-v4-config/internal/controller/suite_test.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/crew/suite_test.go
rename to testdata/project-v4-config/internal/controller/suite_test.go
index 686e7eb5a0e..e5d3da932db 100644
--- a/testdata/project-v4-multigroup/controllers/crew/suite_test.go
+++ b/testdata/project-v4-config/internal/controller/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package crew
+package controller
import (
"path/filepath"
@@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/crew/v1"
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-config/api/v1"
//+kubebuilder:scaffold:imports
)
diff --git a/testdata/project-v4-declarative-v1/Dockerfile b/testdata/project-v4-declarative-v1/Dockerfile
index c4733c56e1b..0aaf979e1dc 100644
--- a/testdata/project-v4-declarative-v1/Dockerfile
+++ b/testdata/project-v4-declarative-v1/Dockerfile
@@ -12,9 +12,9 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
-COPY main.go main.go
+COPY cmd/main.go cmd/main.go
COPY api/ api/
-COPY controllers/ controllers/
+COPY internal/controller/ internal/controller/
# https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/blob/master/docs/addon/walkthrough/README.md#adding-a-manifest
# Stage channels and make readable
COPY channels/ /channels/
@@ -25,7 +25,7 @@ RUN chmod -R a+rx /channels/
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile
index 2f361a625c7..971bfb70e69 100644
--- a/testdata/project-v4-declarative-v1/Makefile
+++ b/testdata/project-v4-declarative-v1/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -62,11 +62,11 @@ test: manifests generate fmt vet envtest ## Run tests.
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
- go build -o bin/manager main.go
+ go build -o bin/manager cmd/main.go
.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
- go run ./main.go
+ go run ./cmd/main.go
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v4-declarative-v1/PROJECT b/testdata/project-v4-declarative-v1/PROJECT
index ec259f29223..28ef24efc50 100644
--- a/testdata/project-v4-declarative-v1/PROJECT
+++ b/testdata/project-v4-declarative-v1/PROJECT
@@ -1,8 +1,11 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v4-alpha
- declarative.go.kubebuilder.io/v1
-- grafana.kubebuilder.io/v1-alpha
plugins:
declarative.go.kubebuilder.io/v1:
resources:
@@ -18,7 +21,6 @@ plugins:
group: crew
kind: Admiral
version: v1
- grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v4-declarative-v1
repo: sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1
resources:
diff --git a/testdata/project-v4-declarative-v1/README.md b/testdata/project-v4-declarative-v1/README.md
index 1b79e35f088..c95b85c1e6c 100644
--- a/testdata/project-v4-declarative-v1/README.md
+++ b/testdata/project-v4-declarative-v1/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v4-declarative-v1:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/api/v1/admiral_types.go b/testdata/project-v4-declarative-v1/api/v1/admiral_types.go
index 027432be46a..83f507b1913 100644
--- a/testdata/project-v4-declarative-v1/api/v1/admiral_types.go
+++ b/testdata/project-v4-declarative-v1/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/api/v1/captain_types.go b/testdata/project-v4-declarative-v1/api/v1/captain_types.go
index b4bea01a9fb..b82e24ec320 100644
--- a/testdata/project-v4-declarative-v1/api/v1/captain_types.go
+++ b/testdata/project-v4-declarative-v1/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go b/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go
index 12f64ad0697..a410f27f483 100644
--- a/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go
+++ b/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go b/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go
+++ b/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go b/testdata/project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go
index d7d62dbdb1c..334a92168ca 100644
--- a/testdata/project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/main.go b/testdata/project-v4-declarative-v1/cmd/main.go
similarity index 94%
rename from testdata/project-v4-declarative-v1/main.go
rename to testdata/project-v4-declarative-v1/cmd/main.go
index 6bf66f320f2..4f90472a040 100644
--- a/testdata/project-v4-declarative-v1/main.go
+++ b/testdata/project-v4-declarative-v1/cmd/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1"
- "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/controllers"
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/internal/controller"
//+kubebuilder:scaffold:imports
)
@@ -89,21 +89,21 @@ func main() {
os.Exit(1)
}
- if err = (&controllers.CaptainReconciler{
+ if err = (&controller.CaptainReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Captain")
os.Exit(1)
}
- if err = (&controllers.FirstMateReconciler{
+ if err = (&controller.FirstMateReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "FirstMate")
os.Exit(1)
}
- if err = (&controllers.AdmiralReconciler{
+ if err = (&controller.AdmiralReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
diff --git a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml b/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
index 21f1ac8d4fe..84f792ed656 100644
--- a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
+++ b/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: admirals.crew.testproject.org
spec:
diff --git a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
index d622a9bab29..b21c9578b85 100644
--- a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
index 0799cde8419..3c277b3ad83 100644
--- a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ b/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: firstmates.crew.testproject.org
spec:
diff --git a/testdata/project-v4-declarative-v1/go.mod b/testdata/project-v4-declarative-v1/go.mod
index 6172e30cb40..3768a1c57e9 100644
--- a/testdata/project-v4-declarative-v1/go.mod
+++ b/testdata/project-v4-declarative-v1/go.mod
@@ -4,38 +4,29 @@ go 1.19
require (
github.com/go-logr/logr v1.2.3
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
- sigs.k8s.io/kubebuilder-declarative-pattern v0.11.20220513-0.20220907223038-e0605f0e1a40
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
+ sigs.k8s.io/kubebuilder-declarative-pattern v0.13.0-beta.1.0.20230113160225-18dbaf5fcd85
)
require (
- cloud.google.com/go v0.99.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
github.com/fatih/camelcase v1.0.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fvbommel/sortorder v1.0.1 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
@@ -43,21 +34,20 @@ require (
github.com/go-git/go-git/v5 v5.1.0 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.12 // indirect
- github.com/inconshreveable/mousetrap v1.0.0 // indirect
+ github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -65,55 +55,56 @@ require (
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/moby/spdystream v0.2.0 // indirect
- github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
+ github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
- github.com/russross/blackfriday v1.5.2 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
+ github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
- github.com/spf13/cobra v1.4.0 // indirect
+ github.com/spf13/cobra v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/crypto v0.1.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.25.0 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/cli-runtime v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/kubectl v0.25.0 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/api v0.26.0 // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/cli-runtime v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/kubectl v0.26.0 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/cli-utils v0.33.0 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ sigs.k8s.io/kubebuilder-declarative-pattern/applylib v0.0.0-20221111030210-e034bc5469a5 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
diff --git a/testdata/project-v4-declarative-v1/grafana/controller-resources-metrics.json b/testdata/project-v4-declarative-v1/grafana/controller-resources-metrics.json
deleted file mode 100644
index 629e0d3c9b1..00000000000
--- a/testdata/project-v4-declarative-v1/grafana/controller-resources-metrics.json
+++ /dev/null
@@ -1,306 +0,0 @@
-{
- "__inputs": [
- {
- "name": "DS_PROMETHEUS",
- "label": "Prometheus",
- "description": "",
- "type": "datasource",
- "pluginId": "prometheus",
- "pluginName": "Prometheus"
- }
- ],
- "__requires": [
- {
- "type": "datasource",
- "id": "prometheus",
- "name": "Prometheus",
- "version": "1.0.0"
- }
- ],
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": "-- Grafana --",
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "target": {
- "limit": 100,
- "matchAny": false,
- "tags": [],
- "type": "dashboard"
- },
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "links": [],
- "liveNow": false,
- "panels": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "percent"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 0
- },
- "id": 2,
- "interval": "1m",
- "links": [],
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.4.3",
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "rate(process_cpu_seconds_total{job=\"$job\", namespace=\"$namespace\", pod=\"$pod\"}[5m]) * 100",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "Pod: {{pod}} | Container: {{container}}",
- "refId": "A",
- "step": 10
- }
- ],
- "title": "Controller CPU Usage",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "bytes"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 0
- },
- "id": 4,
- "interval": "1m",
- "links": [],
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.4.3",
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "process_resident_memory_bytes{job=\"$job\", namespace=\"$namespace\", pod=\"$pod\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "Pod: {{pod}} | Container: {{container}}",
- "refId": "A",
- "step": 10
- }
- ],
- "title": "Controller Memory Usage",
- "type": "timeseries"
- }
- ],
- "refresh": "",
- "style": "dark",
- "tags": [],
- "templating": {
- "list": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "job",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": false,
- "text": "observability",
- "value": "observability"
- },
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total, namespace)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "namespace",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total, namespace)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": false,
- "text": "All",
- "value": "$__all"
- },
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "hide": 2,
- "includeAll": true,
- "label": "pod",
- "multi": true,
- "name": "pod",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-15m",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Controller-Resources-Metrics",
- "weekStart": ""
-}
diff --git a/testdata/project-v4-declarative-v1/grafana/controller-runtime-metrics.json b/testdata/project-v4-declarative-v1/grafana/controller-runtime-metrics.json
deleted file mode 100644
index 70023a42d82..00000000000
--- a/testdata/project-v4-declarative-v1/grafana/controller-runtime-metrics.json
+++ /dev/null
@@ -1,710 +0,0 @@
-{
- "__inputs": [
- {
- "name": "DS_PROMETHEUS",
- "label": "Prometheus",
- "description": "",
- "type": "datasource",
- "pluginId": "prometheus",
- "pluginName": "Prometheus"
- }
- ],
- "__requires": [
- {
- "type": "datasource",
- "id": "prometheus",
- "name": "Prometheus",
- "version": "1.0.0"
- }
- ],
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "datasource",
- "uid": "grafana"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "target": {
- "limit": 100,
- "matchAny": false,
- "tags": [],
- "type": "dashboard"
- },
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "links": [],
- "liveNow": false,
- "panels": [
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 0
- },
- "id": 9,
- "panels": [],
- "title": "Reconciliation Metrics",
- "type": "row"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "Total number of reconciliations per controller",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "cpm"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 1
- },
- "id": 7,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "editorMode": "code",
- "exemplar": true,
- "expr": "sum(rate(controller_runtime_reconcile_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, pod)",
- "interval": "",
- "legendFormat": "{{instance}} {{pod}}",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Total Reconciliation Count Per Controller",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "Total number of reconciliation errors per controller",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "cpm"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 1
- },
- "id": 6,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "editorMode": "code",
- "exemplar": true,
- "expr": "sum(rate(controller_runtime_reconcile_errors_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, pod)",
- "interval": "",
- "legendFormat": "{{instance}} {{pod}}",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Reconciliation Error Count Per Controller",
- "type": "timeseries"
- },
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 8
- },
- "id": 11,
- "panels": [],
- "title": "Work Queue Metrics",
- "type": "row"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "How long in seconds an item stays in workqueue before being requested",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "normal"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 9
- },
- "id": 13,
- "options": {
- "legend": {
- "calcs": [
- "max",
- "mean"
- ],
- "displayMode": "list",
- "placement": "right"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.50, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "interval": "",
- "legendFormat": "P50 {{name}} {{instance}} ",
- "refId": "A"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.90, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P90 {{name}} {{instance}} ",
- "refId": "B"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.99, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P99 {{name}} {{instance}} ",
- "refId": "C"
- }
- ],
- "title": "Seconds For Items Stay In Queue (before being requested) (P50, P90, P99)",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "ops"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 9
- },
- "id": 15,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.4.3",
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "sum(rate(workqueue_adds_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name)",
- "interval": "",
- "legendFormat": "{{name}} {{instance}}",
- "refId": "A"
- }
- ],
- "title": "Work Queue Add Rate",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "How long in seconds processing an item from workqueue takes.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 16
- },
- "id": 19,
- "options": {
- "legend": {
- "calcs": [
- "max",
- "mean"
- ],
- "displayMode": "table",
- "placement": "right"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.50, sum(rate(workqueue_work_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "interval": "",
- "legendFormat": "P50 {{name}} {{instance}} ",
- "refId": "A"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.90, sum(rate(workqueue_work_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P90 {{name}} {{instance}} ",
- "refId": "B"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.99, sum(rate(workqueue_work_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P99 {{name}} {{instance}} ",
- "refId": "C"
- }
- ],
- "title": "Seconds Processing Items From WorkQueue (P50, P90, P99)",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "Total number of retries handled by workqueue",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "ops"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 16
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "sum(rate(workqueue_retries_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name)",
- "interval": "",
- "legendFormat": "{{name}} {{instance}} ",
- "refId": "A"
- }
- ],
- "title": "Work Queue Retries Rate",
- "type": "timeseries"
- }
- ],
- "refresh": "",
- "style": "dark",
- "tags": [],
- "templating": {
- "list": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "job",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total, namespace)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "namespace",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total, namespace)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "hide": 2,
- "includeAll": true,
- "label": "pod",
- "multi": true,
- "name": "pod",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-15m",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Controller-Runtime-Metrics",
- "weekStart": ""
-}
diff --git a/testdata/project-v4-declarative-v1/grafana/custom-metrics/config.yaml b/testdata/project-v4-declarative-v1/grafana/custom-metrics/config.yaml
deleted file mode 100644
index 3ee1bebdf24..00000000000
--- a/testdata/project-v4-declarative-v1/grafana/custom-metrics/config.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-customMetrics:
-# - metric: # Raw custom metric (required)
-# type: # Metric type: counter/gauge/histogram (required)
-# expr: # Prom_ql for the metric (optional)
-# unit: # Unit of measurement, examples: s,none,bytes,percent,etc. (optional)
-#
-#
-# Example:
-# ---
-# customMetrics:
-# - metric: foo_bar
-# unit: none
-# type: histogram
-# expr: histogram_quantile(0.90, sum by(instance, le) (rate(foo_bar{job=\"$job\", namespace=\"$namespace\"}[5m])))
diff --git a/testdata/project-v4-declarative-v1/hack/boilerplate.go.txt b/testdata/project-v4-declarative-v1/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v4-declarative-v1/hack/boilerplate.go.txt
+++ b/testdata/project-v4-declarative-v1/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-declarative-v1/controllers/admiral_controller.go b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
similarity index 97%
rename from testdata/project-v4-declarative-v1/controllers/admiral_controller.go
rename to testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
index b36af579f73..b9a7f0fb350 100644
--- a/testdata/project-v4-declarative-v1/controllers/admiral_controller.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"github.com/go-logr/logr"
diff --git a/testdata/project-v4-declarative-v1/controllers/captain_controller.go b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
similarity index 97%
rename from testdata/project-v4-declarative-v1/controllers/captain_controller.go
rename to testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
index 38e58756a54..81ec7726e1c 100644
--- a/testdata/project-v4-declarative-v1/controllers/captain_controller.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"github.com/go-logr/logr"
diff --git a/testdata/project-v4-declarative-v1/controllers/firstmate_controller.go b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
similarity index 98%
rename from testdata/project-v4-declarative-v1/controllers/firstmate_controller.go
rename to testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
index 8cea99c2aea..089c069f6ac 100644
--- a/testdata/project-v4-declarative-v1/controllers/firstmate_controller.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"github.com/go-logr/logr"
diff --git a/testdata/project-v4-declarative-v1/controllers/suite_test.go b/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
similarity index 93%
rename from testdata/project-v4-declarative-v1/controllers/suite_test.go
rename to testdata/project-v4-declarative-v1/internal/controller/suite_test.go
index 960328975df..4b9dbd7be96 100644
--- a/testdata/project-v4-declarative-v1/controllers/suite_test.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"path/filepath"
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/Dockerfile b/testdata/project-v4-multigroup/Dockerfile
index 8e7dcf7a007..ef4cfaf90bd 100644
--- a/testdata/project-v4-multigroup/Dockerfile
+++ b/testdata/project-v4-multigroup/Dockerfile
@@ -12,16 +12,16 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
-COPY main.go main.go
-COPY apis/ apis/
-COPY controllers/ controllers/
+COPY cmd/main.go cmd/main.go
+COPY api/ api/
+COPY internal/controller/ internal/controller/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index 2f361a625c7..971bfb70e69 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -62,11 +62,11 @@ test: manifests generate fmt vet envtest ## Run tests.
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
- go build -o bin/manager main.go
+ go build -o bin/manager cmd/main.go
.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
- go run ./main.go
+ go run ./cmd/main.go
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v4-multigroup/PROJECT b/testdata/project-v4-multigroup/PROJECT
index ef652e90d9c..60096e6e453 100644
--- a/testdata/project-v4-multigroup/PROJECT
+++ b/testdata/project-v4-multigroup/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v4-alpha
@@ -12,7 +16,7 @@ resources:
domain: testproject.org
group: crew
kind: Captain
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/crew/v1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1
version: v1
webhooks:
defaulting: true
@@ -25,7 +29,7 @@ resources:
domain: testproject.org
group: ship
kind: Frigate
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1beta1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1beta1
version: v1beta1
webhooks:
conversion: true
@@ -36,7 +40,7 @@ resources:
domain: testproject.org
group: ship
kind: Destroyer
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1
version: v1
webhooks:
defaulting: true
@@ -47,7 +51,7 @@ resources:
domain: testproject.org
group: ship
kind: Cruiser
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v2alpha1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v2alpha1
version: v2alpha1
webhooks:
validation: true
@@ -59,7 +63,7 @@ resources:
domain: testproject.org
group: sea-creatures
kind: Kraken
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta1
version: v1beta1
- api:
crdVersion: v1
@@ -68,7 +72,7 @@ resources:
domain: testproject.org
group: sea-creatures
kind: Leviathan
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta2
version: v1beta2
- api:
crdVersion: v1
@@ -77,7 +81,7 @@ resources:
domain: testproject.org
group: foo.policy
kind: HealthCheckPolicy
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo.policy/v1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo.policy/v1
version: v1
- controller: true
group: apps
@@ -91,7 +95,7 @@ resources:
domain: testproject.org
group: foo
kind: Bar
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo/v1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo/v1
version: v1
- api:
crdVersion: v1
@@ -100,7 +104,7 @@ resources:
domain: testproject.org
group: fiz
kind: Bar
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/fiz/v1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/fiz/v1
version: v1
- api:
crdVersion: v1
@@ -108,7 +112,7 @@ resources:
controller: true
domain: testproject.org
kind: Lakers
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/v1
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/v1
version: v1
webhooks:
defaulting: true
diff --git a/testdata/project-v4-multigroup/README.md b/testdata/project-v4-multigroup/README.md
index f17e454dbed..f6dd72dd359 100644
--- a/testdata/project-v4-multigroup/README.md
+++ b/testdata/project-v4-multigroup/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v4-multigroup:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/crew/v1/captain_types.go b/testdata/project-v4-multigroup/api/crew/v1/captain_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/crew/v1/captain_types.go
rename to testdata/project-v4-multigroup/api/crew/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v4-multigroup/apis/crew/v1/captain_types.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/crew/v1/captain_webhook.go b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/crew/v1/captain_webhook.go
rename to testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
index ba00000c137..1c8837b5e90 100644
--- a/testdata/project-v4-multigroup/apis/crew/v1/captain_webhook.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/crew/v1/groupversion_info.go b/testdata/project-v4-multigroup/api/crew/v1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/crew/v1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/crew/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v4-multigroup/apis/crew/v1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/crew/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/crew/v1/webhook_suite_test.go
rename to testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
index 95d604fbf9e..49c94418569 100644
--- a/testdata/project-v4-multigroup/apis/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/crew/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/crew/v1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go
index 3d19f0cd037..fb38edc9099 100644
--- a/testdata/project-v4-multigroup/apis/crew/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/foo/v1/bar_types.go b/testdata/project-v4-multigroup/api/fiz/v1/bar_types.go
similarity index 97%
rename from testdata/project-v4-multigroup/apis/foo/v1/bar_types.go
rename to testdata/project-v4-multigroup/api/fiz/v1/bar_types.go
index 398da384cda..7cc002b4610 100644
--- a/testdata/project-v4-multigroup/apis/foo/v1/bar_types.go
+++ b/testdata/project-v4-multigroup/api/fiz/v1/bar_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/fiz/v1/groupversion_info.go b/testdata/project-v4-multigroup/api/fiz/v1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/fiz/v1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/fiz/v1/groupversion_info.go
index 94b9e4ebb56..15af8f01654 100644
--- a/testdata/project-v4-multigroup/apis/fiz/v1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/fiz/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/fiz/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/fiz/v1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go
index f46b6a1cb10..3ed74150b13 100644
--- a/testdata/project-v4-multigroup/apis/fiz/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/foo.policy/v1/groupversion_info.go b/testdata/project-v4-multigroup/api/foo.policy/v1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/foo.policy/v1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/foo.policy/v1/groupversion_info.go
index a9274dfb2b2..33bf52ac801 100644
--- a/testdata/project-v4-multigroup/apis/foo.policy/v1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/foo.policy/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go b/testdata/project-v4-multigroup/api/foo.policy/v1/healthcheckpolicy_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go
rename to testdata/project-v4-multigroup/api/foo.policy/v1/healthcheckpolicy_types.go
index db63b3139a5..01e8d1765a6 100644
--- a/testdata/project-v4-multigroup/apis/foo.policy/v1/healthcheckpolicy_types.go
+++ b/testdata/project-v4-multigroup/api/foo.policy/v1/healthcheckpolicy_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go
index 384b31870fe..b6428f993a6 100644
--- a/testdata/project-v4-multigroup/apis/foo.policy/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/fiz/v1/bar_types.go b/testdata/project-v4-multigroup/api/foo/v1/bar_types.go
similarity index 97%
rename from testdata/project-v4-multigroup/apis/fiz/v1/bar_types.go
rename to testdata/project-v4-multigroup/api/foo/v1/bar_types.go
index 398da384cda..7cc002b4610 100644
--- a/testdata/project-v4-multigroup/apis/fiz/v1/bar_types.go
+++ b/testdata/project-v4-multigroup/api/foo/v1/bar_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/foo/v1/groupversion_info.go b/testdata/project-v4-multigroup/api/foo/v1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/foo/v1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/foo/v1/groupversion_info.go
index c412c274381..d0d26e62293 100644
--- a/testdata/project-v4-multigroup/apis/foo/v1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/foo/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/foo/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/foo/v1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go
index f46b6a1cb10..3ed74150b13 100644
--- a/testdata/project-v4-multigroup/apis/foo/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/sea-creatures/v1beta1/groupversion_info.go
index a6406135967..9200968a3a5 100644
--- a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/kraken_types.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/kraken_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/kraken_types.go
rename to testdata/project-v4-multigroup/api/sea-creatures/v1beta1/kraken_types.go
index afb57fff4b0..4c4d33ef844 100644
--- a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/kraken_types.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/kraken_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
index e8b5ea29fc8..9f7feb2fdc8 100644
--- a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go
rename to testdata/project-v4-multigroup/api/sea-creatures/v1beta2/groupversion_info.go
index 43f160b83e6..c6059651fad 100644
--- a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/leviathan_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go
rename to testdata/project-v4-multigroup/api/sea-creatures/v1beta2/leviathan_types.go
index 47da45524f6..470019dc160 100644
--- a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/leviathan_types.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/leviathan_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
index e5a09f90a46..de27a7b3faa 100644
--- a/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1/destroyer_types.go b/testdata/project-v4-multigroup/api/ship/v1/destroyer_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v1/destroyer_types.go
rename to testdata/project-v4-multigroup/api/ship/v1/destroyer_types.go
index 8efa6fad827..f8cc80eefb5 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1/destroyer_types.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/destroyer_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1/destroyer_webhook.go b/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go
similarity index 97%
rename from testdata/project-v4-multigroup/apis/ship/v1/destroyer_webhook.go
rename to testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go
index e1c0a0a05db..67798c6e1f0 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1/destroyer_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1/groupversion_info.go b/testdata/project-v4-multigroup/api/ship/v1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/ship/v1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/ship/v1/groupversion_info.go
index 260546cc282..7ca96e4ea8c 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v1/webhook_suite_test.go
rename to testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
index b4228bbd462..2edd77dacfc 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go
index c02c174f0d0..8f4b33cd7c4 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1beta1/frigate_types.go b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v1beta1/frigate_types.go
rename to testdata/project-v4-multigroup/api/ship/v1beta1/frigate_types.go
index c8734a6cf9e..bd62ed8ed7d 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1beta1/frigate_types.go
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1beta1/frigate_webhook.go b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/ship/v1beta1/frigate_webhook.go
rename to testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go
index 8cf9bc5b41a..028189c9eab 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1beta1/frigate_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1beta1/groupversion_info.go b/testdata/project-v4-multigroup/api/ship/v1beta1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/ship/v1beta1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/ship/v1beta1/groupversion_info.go
index b0c2cd9d938..a27e3ab1af0 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1beta1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go
index d1ac770b5c7..aade9e605f2 100644
--- a/testdata/project-v4-multigroup/apis/ship/v1beta1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v2alpha1/cruiser_types.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v2alpha1/cruiser_types.go
rename to testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_types.go
index 6160dc14b1d..b79187f2766 100644
--- a/testdata/project-v4-multigroup/apis/ship/v2alpha1/cruiser_types.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v2alpha1/cruiser_webhook.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v2alpha1/cruiser_webhook.go
rename to testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
index 877deb965a3..9fa6bc245d5 100644
--- a/testdata/project-v4-multigroup/apis/ship/v2alpha1/cruiser_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v2alpha1/groupversion_info.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/ship/v2alpha1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/ship/v2alpha1/groupversion_info.go
index 90fed0d1cc7..1b291530c6b 100644
--- a/testdata/project-v4-multigroup/apis/ship/v2alpha1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v2alpha1/webhook_suite_test.go
rename to testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
index b31858834bf..d32e5ed78b1 100644
--- a/testdata/project-v4-multigroup/apis/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go
index e335a81bb7d..ce318aa131c 100644
--- a/testdata/project-v4-multigroup/apis/ship/v2alpha1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/v1/groupversion_info.go b/testdata/project-v4-multigroup/api/v1/groupversion_info.go
similarity index 96%
rename from testdata/project-v4-multigroup/apis/v1/groupversion_info.go
rename to testdata/project-v4-multigroup/api/v1/groupversion_info.go
index 7c182dc49bc..49502eee2c5 100644
--- a/testdata/project-v4-multigroup/apis/v1/groupversion_info.go
+++ b/testdata/project-v4-multigroup/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/v1/lakers_types.go b/testdata/project-v4-multigroup/api/v1/lakers_types.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/v1/lakers_types.go
rename to testdata/project-v4-multigroup/api/v1/lakers_types.go
index 5dca1f9accf..415b5bc3924 100644
--- a/testdata/project-v4-multigroup/apis/v1/lakers_types.go
+++ b/testdata/project-v4-multigroup/api/v1/lakers_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/v1/lakers_webhook.go b/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/v1/lakers_webhook.go
rename to testdata/project-v4-multigroup/api/v1/lakers_webhook.go
index c358e00ad67..315982132a6 100644
--- a/testdata/project-v4-multigroup/apis/v1/lakers_webhook.go
+++ b/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/v1/webhook_suite_test.go
rename to testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
index 1af25ebb4d0..f1511968296 100644
--- a/testdata/project-v4-multigroup/apis/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/apis/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go
similarity index 98%
rename from testdata/project-v4-multigroup/apis/v1/zz_generated.deepcopy.go
rename to testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go
index 523ce2ac7ac..3de5e2d9f31 100644
--- a/testdata/project-v4-multigroup/apis/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/main.go b/testdata/project-v4-multigroup/cmd/main.go
similarity index 82%
rename from testdata/project-v4-multigroup/main.go
rename to testdata/project-v4-multigroup/cmd/main.go
index fb53924ca8f..c773770f22e 100644
--- a/testdata/project-v4-multigroup/main.go
+++ b/testdata/project-v4-multigroup/cmd/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -31,24 +31,24 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/crew/v1"
- fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/fiz/v1"
- foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo.policy/v1"
- foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo/v1"
- seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1"
- seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2"
- shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1"
- shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1beta1"
- shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v2alpha1"
- testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/v1"
- "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers"
- appscontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/apps"
- crewcontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/crew"
- fizcontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/fiz"
- foocontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/foo"
- foopolicycontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/foo.policy"
- seacreaturescontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/sea-creatures"
- shipcontrollers "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/controllers/ship"
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/fiz/v1"
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo.policy/v1"
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo/v1"
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta1"
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta2"
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1"
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1beta1"
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v2alpha1"
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/v1"
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller"
+ appscontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/apps"
+ crewcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/crew"
+ fizcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/fiz"
+ foocontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/foo"
+ foopolicycontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/foo.policy"
+ seacreaturescontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/sea-creatures"
+ shipcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/ship"
//+kubebuilder:scaffold:imports
)
@@ -114,7 +114,7 @@ func main() {
os.Exit(1)
}
- if err = (&crewcontrollers.CaptainReconciler{
+ if err = (&crewcontroller.CaptainReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -125,7 +125,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
os.Exit(1)
}
- if err = (&shipcontrollers.FrigateReconciler{
+ if err = (&shipcontroller.FrigateReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -136,7 +136,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Frigate")
os.Exit(1)
}
- if err = (&shipcontrollers.DestroyerReconciler{
+ if err = (&shipcontroller.DestroyerReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -147,7 +147,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Destroyer")
os.Exit(1)
}
- if err = (&shipcontrollers.CruiserReconciler{
+ if err = (&shipcontroller.CruiserReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -158,49 +158,49 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Cruiser")
os.Exit(1)
}
- if err = (&seacreaturescontrollers.KrakenReconciler{
+ if err = (&seacreaturescontroller.KrakenReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Kraken")
os.Exit(1)
}
- if err = (&seacreaturescontrollers.LeviathanReconciler{
+ if err = (&seacreaturescontroller.LeviathanReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Leviathan")
os.Exit(1)
}
- if err = (&foopolicycontrollers.HealthCheckPolicyReconciler{
+ if err = (&foopolicycontroller.HealthCheckPolicyReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "HealthCheckPolicy")
os.Exit(1)
}
- if err = (&appscontrollers.DeploymentReconciler{
+ if err = (&appscontroller.DeploymentReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Deployment")
os.Exit(1)
}
- if err = (&foocontrollers.BarReconciler{
+ if err = (&foocontroller.BarReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Bar")
os.Exit(1)
}
- if err = (&fizcontrollers.BarReconciler{
+ if err = (&fizcontroller.BarReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Bar")
os.Exit(1)
}
- if err = (&controllers.LakersReconciler{
+ if err = (&controller.LakersReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
diff --git a/testdata/project-v4-multigroup/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v4-multigroup/config/crd/bases/crew.testproject.org_captains.yaml
index 69ab9ccffcb..2caae573427 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml b/testdata/project-v4-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml
index 41359145155..bacaa3aa846 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/fiz.testproject.org_bars.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: bars.fiz.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml b/testdata/project-v4-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
index e53814549ce..0d557cfb88a 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: healthcheckpolicies.foo.policy.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/foo.testproject.org_bars.yaml b/testdata/project-v4-multigroup/config/crd/bases/foo.testproject.org_bars.yaml
index 56d04c79e51..e7343b34027 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/foo.testproject.org_bars.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/foo.testproject.org_bars.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: bars.foo.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml b/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
index f2c5a498774..7234a8bc209 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: krakens.sea-creatures.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml b/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
index 3d4561fc3e1..71c8c60fb63 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: leviathans.sea-creatures.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml b/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml
index 2ff7d75cfa5..d617f467afe 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_cruisers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: cruisers.ship.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml b/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml
index 2ecdacdd889..6c33616396d 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_destroyers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: destroyers.ship.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml b/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml
index c0bf2420650..042f0b5a969 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/ship.testproject.org_frigates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: frigates.ship.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/config/crd/bases/testproject.org_lakers.yaml b/testdata/project-v4-multigroup/config/crd/bases/testproject.org_lakers.yaml
index 3a4e18ccfb9..f6cb15c6d50 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/testproject.org_lakers.yaml
+++ b/testdata/project-v4-multigroup/config/crd/bases/testproject.org_lakers.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: lakers.testproject.org
spec:
diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod
index 9eee8296ad8..b37a89f69b0 100644
--- a/testdata/project-v4-multigroup/go.mod
+++ b/testdata/project-v4-multigroup/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4-multigroup/hack/boilerplate.go.txt b/testdata/project-v4-multigroup/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v4-multigroup/hack/boilerplate.go.txt
+++ b/testdata/project-v4-multigroup/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-multigroup/controllers/apps/deployment_controller.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
similarity index 95%
rename from testdata/project-v4-multigroup/controllers/apps/deployment_controller.go
rename to testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
index 2ef4cba3511..57b4f937c79 100644
--- a/testdata/project-v4-multigroup/controllers/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ type DeploymentReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/apps/suite_test.go b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
similarity index 93%
rename from testdata/project-v4-multigroup/controllers/apps/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
index 08290b1d050..efd73704027 100644
--- a/testdata/project-v4-multigroup/controllers/apps/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
}
diff --git a/testdata/project-v4-multigroup/controllers/crew/captain_controller.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/crew/captain_controller.go
rename to testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
index a113bc63867..eda2541e5f5 100644
--- a/testdata/project-v4-multigroup/controllers/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/crew/v1"
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
)
// CaptainReconciler reconciles a Captain object
@@ -45,7 +45,7 @@ type CaptainReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-config/controllers/suite_test.go b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
similarity index 89%
rename from testdata/project-v4-config/controllers/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
index 1c61e38a95d..10330561187 100644
--- a/testdata/project-v4-config/controllers/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package crew
import (
"path/filepath"
@@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-config/api/v1"
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
//+kubebuilder:scaffold:imports
)
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/controllers/fiz/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/fiz/bar_controller.go
rename to testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
index 6ac7c405478..a1aa3d68ec8 100644
--- a/testdata/project-v4-multigroup/controllers/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/fiz/v1"
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/fiz/v1"
)
// BarReconciler reconciles a Bar object
@@ -45,7 +45,7 @@ type BarReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *BarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/fiz/suite_test.go b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
similarity index 93%
rename from testdata/project-v4-multigroup/controllers/fiz/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
index 0615d928f66..b3baaba801e 100644
--- a/testdata/project-v4-multigroup/controllers/fiz/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/fiz/v1"
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/fiz/v1"
//+kubebuilder:scaffold:imports
)
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go
rename to testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
index c6ebc03b47d..7e818b4d977 100644
--- a/testdata/project-v4-multigroup/controllers/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo.policy/v1"
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo.policy/v1"
)
// HealthCheckPolicyReconciler reconciles a HealthCheckPolicy object
@@ -45,7 +45,7 @@ type HealthCheckPolicyReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *HealthCheckPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/foo.policy/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
similarity index 92%
rename from testdata/project-v4-multigroup/controllers/foo.policy/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
index 213de495121..6e4f52f95eb 100644
--- a/testdata/project-v4-multigroup/controllers/foo.policy/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo.policy/v1"
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo.policy/v1"
//+kubebuilder:scaffold:imports
)
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/controllers/foo/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/foo/bar_controller.go
rename to testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
index 204721380b3..4f95bb5aa9a 100644
--- a/testdata/project-v4-multigroup/controllers/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo/v1"
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo/v1"
)
// BarReconciler reconciles a Bar object
@@ -45,7 +45,7 @@ type BarReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *BarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/foo/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
similarity index 93%
rename from testdata/project-v4-multigroup/controllers/foo/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
index d38918fbd67..5f434e57002 100644
--- a/testdata/project-v4-multigroup/controllers/foo/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/foo/v1"
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo/v1"
//+kubebuilder:scaffold:imports
)
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/controllers/lakers_controller.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
similarity index 93%
rename from testdata/project-v4-multigroup/controllers/lakers_controller.go
rename to testdata/project-v4-multigroup/internal/controller/lakers_controller.go
index 4de7301a1dd..8580c544d97 100644
--- a/testdata/project-v4-multigroup/controllers/lakers_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/v1"
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/v1"
)
// LakersReconciler reconciles a Lakers object
@@ -45,7 +45,7 @@ type LakersReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LakersReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
similarity index 93%
rename from testdata/project-v4-multigroup/controllers/sea-creatures/kraken_controller.go
rename to testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
index e1c4a323b63..355eb755417 100644
--- a/testdata/project-v4-multigroup/controllers/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1"
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta1"
)
// KrakenReconciler reconciles a Kraken object
@@ -45,7 +45,7 @@ type KrakenReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *KrakenReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
similarity index 93%
rename from testdata/project-v4-multigroup/controllers/sea-creatures/leviathan_controller.go
rename to testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
index 7ea938670f0..b81be1f526b 100644
--- a/testdata/project-v4-multigroup/controllers/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2"
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta2"
)
// LeviathanReconciler reconciles a Leviathan object
@@ -45,7 +45,7 @@ type LeviathanReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LeviathanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/sea-creatures/suite_test.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
similarity index 91%
rename from testdata/project-v4-multigroup/controllers/sea-creatures/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
index 968ad7e2587..000034c4c6e 100644
--- a/testdata/project-v4-multigroup/controllers/sea-creatures/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -30,8 +30,8 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta1"
- seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/sea-creatures/v1beta2"
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta1"
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta2"
//+kubebuilder:scaffold:imports
)
@@ -53,7 +53,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/controllers/ship/cruiser_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/ship/cruiser_controller.go
rename to testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
index afb06915704..e618f661108 100644
--- a/testdata/project-v4-multigroup/controllers/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v2alpha1"
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v2alpha1"
)
// CruiserReconciler reconciles a Cruiser object
@@ -45,7 +45,7 @@ type CruiserReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CruiserReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/ship/destroyer_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/ship/destroyer_controller.go
rename to testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
index 424e9ede9a1..45ba3f0e358 100644
--- a/testdata/project-v4-multigroup/controllers/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1"
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1"
)
// DestroyerReconciler reconciles a Destroyer object
@@ -45,7 +45,7 @@ type DestroyerReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *DestroyerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/ship/frigate_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
similarity index 94%
rename from testdata/project-v4-multigroup/controllers/ship/frigate_controller.go
rename to testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
index 5c744e8a3a6..fea3ffdce85 100644
--- a/testdata/project-v4-multigroup/controllers/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
- shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1beta1"
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1beta1"
)
// FrigateReconciler reconciles a Frigate object
@@ -45,7 +45,7 @@ type FrigateReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *FrigateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/controllers/ship/suite_test.go b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
similarity index 92%
rename from testdata/project-v4-multigroup/controllers/ship/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
index 1f3d1f1bfc4..2dd3f472c65 100644
--- a/testdata/project-v4-multigroup/controllers/ship/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -30,9 +30,9 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1"
- shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v1beta1"
- shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/ship/v2alpha1"
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1"
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1beta1"
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v2alpha1"
//+kubebuilder:scaffold:imports
)
@@ -54,7 +54,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-multigroup/controllers/suite_test.go b/testdata/project-v4-multigroup/internal/controller/suite_test.go
similarity index 92%
rename from testdata/project-v4-multigroup/controllers/suite_test.go
rename to testdata/project-v4-multigroup/internal/controller/suite_test.go
index 2cc3e726507..fc4d2f406e1 100644
--- a/testdata/project-v4-multigroup/controllers/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"path/filepath"
@@ -30,7 +30,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/apis/v1"
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/v1"
//+kubebuilder:scaffold:imports
)
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-with-deploy-image/Dockerfile b/testdata/project-v4-with-deploy-image/Dockerfile
index 8f9cca18eb6..ef4cfaf90bd 100644
--- a/testdata/project-v4-with-deploy-image/Dockerfile
+++ b/testdata/project-v4-with-deploy-image/Dockerfile
@@ -12,16 +12,16 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
-COPY main.go main.go
+COPY cmd/main.go cmd/main.go
COPY api/ api/
-COPY controllers/ controllers/
+COPY internal/controller/ internal/controller/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index 2f361a625c7..971bfb70e69 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -62,11 +62,11 @@ test: manifests generate fmt vet envtest ## Run tests.
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
- go build -o bin/manager main.go
+ go build -o bin/manager cmd/main.go
.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
- go run ./main.go
+ go run ./cmd/main.go
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v4-with-deploy-image/PROJECT b/testdata/project-v4-with-deploy-image/PROJECT
index ae6a0353e0a..3d0131505b5 100644
--- a/testdata/project-v4-with-deploy-image/PROJECT
+++ b/testdata/project-v4-with-deploy-image/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v4-alpha
diff --git a/testdata/project-v4-with-deploy-image/README.md b/testdata/project-v4-with-deploy-image/README.md
index 809112b12d0..73139b76a94 100644
--- a/testdata/project-v4-with-deploy-image/README.md
+++ b/testdata/project-v4-with-deploy-image/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v4-with-deploy-image:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/busybox_types.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/busybox_types.go
index e54b6f4c368..440dd96baef 100644
--- a/testdata/project-v4-with-deploy-image/api/v1alpha1/busybox_types.go
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/busybox_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/groupversion_info.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/groupversion_info.go
index 4f03dd8ab5f..9541616caff 100644
--- a/testdata/project-v4-with-deploy-image/api/v1alpha1/groupversion_info.go
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_types.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_types.go
index bf27a5f7af9..aa82a833c00 100644
--- a/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_types.go
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook.go
index 579f86841b6..e59456d58c4 100644
--- a/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook.go
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/webhook_suite_test.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/webhook_suite_test.go
index 9e3757a42f3..e2ffbb63fef 100644
--- a/testdata/project-v4-with-deploy-image/api/v1alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go
index 264d519dd7f..a1b201c4512 100644
--- a/testdata/project-v4-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/main.go b/testdata/project-v4-with-deploy-image/cmd/main.go
similarity index 96%
rename from testdata/project-v4-with-deploy-image/main.go
rename to testdata/project-v4-with-deploy-image/cmd/main.go
index 59d643f1727..c441f024dfe 100644
--- a/testdata/project-v4-with-deploy-image/main.go
+++ b/testdata/project-v4-with-deploy-image/cmd/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/api/v1alpha1"
- "sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/controllers"
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/internal/controller"
//+kubebuilder:scaffold:imports
)
@@ -89,7 +89,7 @@ func main() {
os.Exit(1)
}
- if err = (&controllers.MemcachedReconciler{
+ if err = (&controller.MemcachedReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("memcached-controller"),
@@ -97,7 +97,7 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Memcached")
os.Exit(1)
}
- if err = (&controllers.BusyboxReconciler{
+ if err = (&controller.BusyboxReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("busybox-controller"),
diff --git a/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml b/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml
index cf97e148058..a57094922b7 100644
--- a/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml
+++ b/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_busyboxes.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: busyboxes.example.com.testproject.org
spec:
diff --git a/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml b/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml
index 4e1cbc4b9fe..928e137481e 100644
--- a/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml
+++ b/testdata/project-v4-with-deploy-image/config/crd/bases/example.com.testproject.org_memcacheds.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: memcacheds.example.com.testproject.org
spec:
diff --git a/testdata/project-v4-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod
index e6b18de9a56..0fff116e651 100644
--- a/testdata/project-v4-with-deploy-image/go.mod
+++ b/testdata/project-v4-with-deploy-image/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4-with-deploy-image/hack/boilerplate.go.txt b/testdata/project-v4-with-deploy-image/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v4-with-deploy-image/hack/boilerplate.go.txt
+++ b/testdata/project-v4-with-deploy-image/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4-with-deploy-image/controllers/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
similarity index 99%
rename from testdata/project-v4-with-deploy-image/controllers/busybox_controller.go
rename to testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index 297fdf12af3..9078852c4d5 100644
--- a/testdata/project-v4-with-deploy-image/controllers/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -78,7 +78,7 @@ type BusyboxReconciler struct {
// For further info:
// - About Operator Pattern: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
// - About Controllers: https://kubernetes.io/docs/concepts/architecture/controller/
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *BusyboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go
similarity index 98%
rename from testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go
rename to testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go
index 655aaaac694..5af1372dd2f 100644
--- a/testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
diff --git a/testdata/project-v4-with-deploy-image/controllers/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
similarity index 99%
rename from testdata/project-v4-with-deploy-image/controllers/memcached_controller.go
rename to testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index a6950224103..8d3b67be9b6 100644
--- a/testdata/project-v4-with-deploy-image/controllers/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -78,7 +78,7 @@ type MemcachedReconciler struct {
// For further info:
// - About Operator Pattern: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
// - About Controllers: https://kubernetes.io/docs/concepts/architecture/controller/
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go
similarity index 98%
rename from testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go
rename to testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go
index cbedf08c7e7..c4eef67c60b 100644
--- a/testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
diff --git a/testdata/project-v4-with-deploy-image/controllers/suite_test.go b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
similarity index 93%
rename from testdata/project-v4-with-deploy-image/controllers/suite_test.go
rename to testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
index d98a393008f..bef37d780be 100644
--- a/testdata/project-v4-with-deploy-image/controllers/suite_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"path/filepath"
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}
diff --git a/testdata/project-v4-with-metrics/.dockerignore b/testdata/project-v4-with-grafana/.dockerignore
similarity index 100%
rename from testdata/project-v4-with-metrics/.dockerignore
rename to testdata/project-v4-with-grafana/.dockerignore
diff --git a/testdata/project-v4-with-metrics/.gitignore b/testdata/project-v4-with-grafana/.gitignore
similarity index 100%
rename from testdata/project-v4-with-metrics/.gitignore
rename to testdata/project-v4-with-grafana/.gitignore
diff --git a/testdata/project-v4-with-metrics/Dockerfile b/testdata/project-v4-with-grafana/Dockerfile
similarity index 100%
rename from testdata/project-v4-with-metrics/Dockerfile
rename to testdata/project-v4-with-grafana/Dockerfile
diff --git a/testdata/project-v3-with-metrics/Makefile b/testdata/project-v4-with-grafana/Makefile
similarity index 99%
rename from testdata/project-v3-with-metrics/Makefile
rename to testdata/project-v4-with-grafana/Makefile
index 9116f85220c..57f9988af70 100644
--- a/testdata/project-v3-with-metrics/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v4-with-grafana/PROJECT b/testdata/project-v4-with-grafana/PROJECT
new file mode 100644
index 00000000000..241a6cdefb9
--- /dev/null
+++ b/testdata/project-v4-with-grafana/PROJECT
@@ -0,0 +1,12 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
+domain: testproject.org
+layout:
+- go.kubebuilder.io/v3
+plugins:
+ grafana.kubebuilder.io/v1-alpha: {}
+projectName: project-v4-with-grafana
+repo: sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
+version: "3"
diff --git a/testdata/project-v4-with-metrics/README.md b/testdata/project-v4-with-grafana/README.md
similarity index 85%
rename from testdata/project-v4-with-metrics/README.md
rename to testdata/project-v4-with-grafana/README.md
index 82fa7788b1c..1a8632ec3e6 100644
--- a/testdata/project-v4-with-metrics/README.md
+++ b/testdata/project-v4-with-grafana/README.md
@@ -1,4 +1,4 @@
-# project-v4-with-metrics
+# project-v4-with-grafana
// TODO(user): Add simple overview of use/purpose
## Description
@@ -16,15 +16,15 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
-make docker-build docker-push IMG=/project-v4-with-metrics:tag
+make docker-build docker-push IMG=/project-v4-with-grafana:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
-make deploy IMG=/project-v4-with-metrics:tag
+make deploy IMG=/project-v4-with-grafana:tag
```
### Uninstall CRDs
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-metrics/config/default/kustomization.yaml b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
similarity index 96%
rename from testdata/project-v3-with-metrics/config/default/kustomization.yaml
rename to testdata/project-v4-with-grafana/config/default/kustomization.yaml
index 2bc32a3d519..ca19fadabb7 100644
--- a/testdata/project-v3-with-metrics/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
-namespace: project-v3-with-metrics-system
+namespace: project-v4-with-grafana-system
# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
-namePrefix: project-v3-with-metrics-
+namePrefix: project-v4-with-grafana-
# Labels to add to all resources and selectors.
#commonLabels:
diff --git a/testdata/project-v4-with-metrics/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
similarity index 100%
rename from testdata/project-v4-with-metrics/config/default/manager_auth_proxy_patch.yaml
rename to testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
diff --git a/testdata/project-v4-with-metrics/config/default/manager_config_patch.yaml b/testdata/project-v4-with-grafana/config/default/manager_config_patch.yaml
similarity index 100%
rename from testdata/project-v4-with-metrics/config/default/manager_config_patch.yaml
rename to testdata/project-v4-with-grafana/config/default/manager_config_patch.yaml
diff --git a/testdata/project-v4-with-metrics/config/manager/kustomization.yaml b/testdata/project-v4-with-grafana/config/manager/kustomization.yaml
similarity index 100%
rename from testdata/project-v4-with-metrics/config/manager/kustomization.yaml
rename to testdata/project-v4-with-grafana/config/manager/kustomization.yaml
diff --git a/testdata/project-v4-with-metrics/config/manager/manager.yaml b/testdata/project-v4-with-grafana/config/manager/manager.yaml
similarity index 93%
rename from testdata/project-v4-with-metrics/config/manager/manager.yaml
rename to testdata/project-v4-with-grafana/config/manager/manager.yaml
index ded55606300..220b518a748 100644
--- a/testdata/project-v4-with-metrics/config/manager/manager.yaml
+++ b/testdata/project-v4-with-grafana/config/manager/manager.yaml
@@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: system
---
@@ -21,8 +21,8 @@ metadata:
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
spec:
selector:
diff --git a/testdata/project-v4-with-metrics/config/prometheus/kustomization.yaml b/testdata/project-v4-with-grafana/config/prometheus/kustomization.yaml
similarity index 100%
rename from testdata/project-v4-with-metrics/config/prometheus/kustomization.yaml
rename to testdata/project-v4-with-grafana/config/prometheus/kustomization.yaml
diff --git a/testdata/project-v4-with-metrics/config/prometheus/monitor.yaml b/testdata/project-v4-with-grafana/config/prometheus/monitor.yaml
similarity index 85%
rename from testdata/project-v4-with-metrics/config/prometheus/monitor.yaml
rename to testdata/project-v4-with-grafana/config/prometheus/monitor.yaml
index 51dbbb13aaf..d71b79c554b 100644
--- a/testdata/project-v4-with-metrics/config/prometheus/monitor.yaml
+++ b/testdata/project-v4-with-grafana/config/prometheus/monitor.yaml
@@ -8,8 +8,8 @@ metadata:
app.kubernetes.io/name: servicemonitor
app.kubernetes.io/instance: controller-manager-metrics-monitor
app.kubernetes.io/component: metrics
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-monitor
namespace: system
diff --git a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_client_clusterrole.yaml
similarity index 75%
rename from testdata/project-v3-with-metrics/config/rbac/auth_proxy_client_clusterrole.yaml
rename to testdata/project-v4-with-grafana/config/rbac/auth_proxy_client_clusterrole.yaml
index 214a81354ee..1a349448805 100644
--- a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_client_clusterrole.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_client_clusterrole.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: metrics-reader
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: metrics-reader
rules:
diff --git a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_role.yaml b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_role.yaml
similarity index 80%
rename from testdata/project-v4-with-metrics/config/rbac/auth_proxy_role.yaml
rename to testdata/project-v4-with-grafana/config/rbac/auth_proxy_role.yaml
index 706129aea14..78751f31b46 100644
--- a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_role.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_role.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: proxy-role
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: proxy-role
rules:
diff --git a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_role_binding.yaml
similarity index 80%
rename from testdata/project-v3-with-metrics/config/rbac/auth_proxy_role_binding.yaml
rename to testdata/project-v4-with-grafana/config/rbac/auth_proxy_role_binding.yaml
index 1bbfbf30eb7..65e551ad032 100644
--- a/testdata/project-v3-with-metrics/config/rbac/auth_proxy_role_binding.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_role_binding.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: proxy-rolebinding
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: proxy-rolebinding
roleRef:
diff --git a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_service.yaml b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_service.yaml
similarity index 81%
rename from testdata/project-v4-with-metrics/config/rbac/auth_proxy_service.yaml
rename to testdata/project-v4-with-grafana/config/rbac/auth_proxy_service.yaml
index 9592531f6b4..55993935fab 100644
--- a/testdata/project-v4-with-metrics/config/rbac/auth_proxy_service.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/auth_proxy_service.yaml
@@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: service
app.kubernetes.io/instance: controller-manager-metrics-service
app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
diff --git a/testdata/project-v4-with-metrics/config/rbac/kustomization.yaml b/testdata/project-v4-with-grafana/config/rbac/kustomization.yaml
similarity index 100%
rename from testdata/project-v4-with-metrics/config/rbac/kustomization.yaml
rename to testdata/project-v4-with-grafana/config/rbac/kustomization.yaml
diff --git a/testdata/project-v4-with-metrics/config/rbac/leader_election_role.yaml b/testdata/project-v4-with-grafana/config/rbac/leader_election_role.yaml
similarity index 85%
rename from testdata/project-v4-with-metrics/config/rbac/leader_election_role.yaml
rename to testdata/project-v4-with-grafana/config/rbac/leader_election_role.yaml
index 0fbf3aefa42..90dec8af280 100644
--- a/testdata/project-v4-with-metrics/config/rbac/leader_election_role.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/leader_election_role.yaml
@@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
diff --git a/testdata/project-v3-with-metrics/config/rbac/leader_election_role_binding.yaml b/testdata/project-v4-with-grafana/config/rbac/leader_election_role_binding.yaml
similarity index 80%
rename from testdata/project-v3-with-metrics/config/rbac/leader_election_role_binding.yaml
rename to testdata/project-v4-with-grafana/config/rbac/leader_election_role_binding.yaml
index cb0cd7da0c3..d07e4f7a407 100644
--- a/testdata/project-v3-with-metrics/config/rbac/leader_election_role_binding.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/leader_election_role_binding.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
diff --git a/testdata/project-v4-with-metrics/config/rbac/role_binding.yaml b/testdata/project-v4-with-grafana/config/rbac/role_binding.yaml
similarity index 80%
rename from testdata/project-v4-with-metrics/config/rbac/role_binding.yaml
rename to testdata/project-v4-with-grafana/config/rbac/role_binding.yaml
index b3ccc1b6c24..45f4d19a378 100644
--- a/testdata/project-v4-with-metrics/config/rbac/role_binding.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/role_binding.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-with-metrics
- app.kubernetes.io/part-of: project-v4-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
diff --git a/testdata/project-v3-with-metrics/config/rbac/service_account.yaml b/testdata/project-v4-with-grafana/config/rbac/service_account.yaml
similarity index 71%
rename from testdata/project-v3-with-metrics/config/rbac/service_account.yaml
rename to testdata/project-v4-with-grafana/config/rbac/service_account.yaml
index f30bb8915fe..1fb853ae687 100644
--- a/testdata/project-v3-with-metrics/config/rbac/service_account.yaml
+++ b/testdata/project-v4-with-grafana/config/rbac/service_account.yaml
@@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v3-with-metrics
- app.kubernetes.io/part-of: project-v3-with-metrics
+ app.kubernetes.io/created-by: project-v4-with-grafana
+ app.kubernetes.io/part-of: project-v4-with-grafana
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
diff --git a/testdata/project-v4-with-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
new file mode 100644
index 00000000000..7566d8d010e
--- /dev/null
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -0,0 +1,68 @@
+module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
+
+go 1.19
+
+require (
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
+)
+
+require (
+ github.com/beorn7/perks v1.0.1 // indirect
+ github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/evanphx/json-patch/v5 v5.6.0 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
+ github.com/go-logr/logr v1.2.3 // indirect
+ github.com/go-logr/zapr v1.2.3 // indirect
+ github.com/go-openapi/jsonpointer v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
+ github.com/go-openapi/swag v0.19.14 // indirect
+ github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
+ github.com/golang/protobuf v1.5.2 // indirect
+ github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/uuid v1.1.2 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
+ github.com/josharian/intern v1.0.0 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/mailru/easyjson v0.7.6 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ go.uber.org/atomic v1.7.0 // indirect
+ go.uber.org/multierr v1.6.0 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ google.golang.org/appengine v1.6.7 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
+ gopkg.in/inf.v0 v0.9.1 // indirect
+ gopkg.in/yaml.v2 v2.4.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+ k8s.io/api v0.26.0 // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
+ sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
+ sigs.k8s.io/yaml v1.3.0 // indirect
+)
diff --git a/testdata/project-v3-with-metrics/grafana/controller-resources-metrics.json b/testdata/project-v4-with-grafana/grafana/controller-resources-metrics.json
similarity index 100%
rename from testdata/project-v3-with-metrics/grafana/controller-resources-metrics.json
rename to testdata/project-v4-with-grafana/grafana/controller-resources-metrics.json
diff --git a/testdata/project-v3-with-metrics/grafana/controller-runtime-metrics.json b/testdata/project-v4-with-grafana/grafana/controller-runtime-metrics.json
similarity index 100%
rename from testdata/project-v3-with-metrics/grafana/controller-runtime-metrics.json
rename to testdata/project-v4-with-grafana/grafana/controller-runtime-metrics.json
diff --git a/testdata/project-v3-with-metrics/grafana/custom-metrics/config.yaml b/testdata/project-v4-with-grafana/grafana/custom-metrics/config.yaml
similarity index 100%
rename from testdata/project-v3-with-metrics/grafana/custom-metrics/config.yaml
rename to testdata/project-v4-with-grafana/grafana/custom-metrics/config.yaml
diff --git a/testdata/project-v3-with-metrics/hack/boilerplate.go.txt b/testdata/project-v4-with-grafana/hack/boilerplate.go.txt
similarity index 93%
rename from testdata/project-v3-with-metrics/hack/boilerplate.go.txt
rename to testdata/project-v4-with-grafana/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v3-with-metrics/hack/boilerplate.go.txt
+++ b/testdata/project-v4-with-grafana/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v3-with-metrics/main.go b/testdata/project-v4-with-grafana/main.go
similarity index 97%
rename from testdata/project-v3-with-metrics/main.go
rename to testdata/project-v4-with-grafana/main.go
index 73d8e18d15c..9989e5b1a29 100644
--- a/testdata/project-v3-with-metrics/main.go
+++ b/testdata/project-v4-with-grafana/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
- LeaderElectionID: "d9e631ee.testproject.org",
+ LeaderElectionID: "bc2db930.testproject.org",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
diff --git a/testdata/project-v4-with-metrics/PROJECT b/testdata/project-v4-with-metrics/PROJECT
deleted file mode 100644
index 7329bb61460..00000000000
--- a/testdata/project-v4-with-metrics/PROJECT
+++ /dev/null
@@ -1,8 +0,0 @@
-domain: testproject.org
-layout:
-- go.kubebuilder.io/v3
-plugins:
- grafana.kubebuilder.io/v1-alpha: {}
-projectName: project-v4-with-metrics
-repo: sigs.k8s.io/kubebuilder/testdata/project-v4-with-metrics
-version: "3"
diff --git a/testdata/project-v4-with-metrics/go.mod b/testdata/project-v4-with-metrics/go.mod
deleted file mode 100644
index ff0828aa487..00000000000
--- a/testdata/project-v4-with-metrics/go.mod
+++ /dev/null
@@ -1,79 +0,0 @@
-module sigs.k8s.io/kubebuilder/testdata/project-v4-with-metrics
-
-go 1.19
-
-require (
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
-)
-
-require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
- github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
- github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
- github.com/go-logr/logr v1.2.3 // indirect
- github.com/go-logr/zapr v1.2.3 // indirect
- github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
- github.com/go-openapi/swag v0.19.14 // indirect
- github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
- github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
- github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
- github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
- google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
- gopkg.in/inf.v0 v0.9.1 // indirect
- gopkg.in/yaml.v2 v2.4.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/api v0.25.0 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
- sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
- sigs.k8s.io/yaml v1.3.0 // indirect
-)
diff --git a/testdata/project-v4-with-metrics/grafana/controller-resources-metrics.json b/testdata/project-v4-with-metrics/grafana/controller-resources-metrics.json
deleted file mode 100644
index 629e0d3c9b1..00000000000
--- a/testdata/project-v4-with-metrics/grafana/controller-resources-metrics.json
+++ /dev/null
@@ -1,306 +0,0 @@
-{
- "__inputs": [
- {
- "name": "DS_PROMETHEUS",
- "label": "Prometheus",
- "description": "",
- "type": "datasource",
- "pluginId": "prometheus",
- "pluginName": "Prometheus"
- }
- ],
- "__requires": [
- {
- "type": "datasource",
- "id": "prometheus",
- "name": "Prometheus",
- "version": "1.0.0"
- }
- ],
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": "-- Grafana --",
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "target": {
- "limit": 100,
- "matchAny": false,
- "tags": [],
- "type": "dashboard"
- },
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "links": [],
- "liveNow": false,
- "panels": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "percent"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 0
- },
- "id": 2,
- "interval": "1m",
- "links": [],
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.4.3",
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "rate(process_cpu_seconds_total{job=\"$job\", namespace=\"$namespace\", pod=\"$pod\"}[5m]) * 100",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "Pod: {{pod}} | Container: {{container}}",
- "refId": "A",
- "step": 10
- }
- ],
- "title": "Controller CPU Usage",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "bytes"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 0
- },
- "id": 4,
- "interval": "1m",
- "links": [],
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.4.3",
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "process_resident_memory_bytes{job=\"$job\", namespace=\"$namespace\", pod=\"$pod\"}",
- "format": "time_series",
- "interval": "",
- "intervalFactor": 2,
- "legendFormat": "Pod: {{pod}} | Container: {{container}}",
- "refId": "A",
- "step": 10
- }
- ],
- "title": "Controller Memory Usage",
- "type": "timeseries"
- }
- ],
- "refresh": "",
- "style": "dark",
- "tags": [],
- "templating": {
- "list": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "job",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": false,
- "text": "observability",
- "value": "observability"
- },
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total, namespace)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "namespace",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total, namespace)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": false,
- "text": "All",
- "value": "$__all"
- },
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "hide": 2,
- "includeAll": true,
- "label": "pod",
- "multi": true,
- "name": "pod",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-15m",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Controller-Resources-Metrics",
- "weekStart": ""
-}
diff --git a/testdata/project-v4-with-metrics/grafana/controller-runtime-metrics.json b/testdata/project-v4-with-metrics/grafana/controller-runtime-metrics.json
deleted file mode 100644
index 70023a42d82..00000000000
--- a/testdata/project-v4-with-metrics/grafana/controller-runtime-metrics.json
+++ /dev/null
@@ -1,710 +0,0 @@
-{
- "__inputs": [
- {
- "name": "DS_PROMETHEUS",
- "label": "Prometheus",
- "description": "",
- "type": "datasource",
- "pluginId": "prometheus",
- "pluginName": "Prometheus"
- }
- ],
- "__requires": [
- {
- "type": "datasource",
- "id": "prometheus",
- "name": "Prometheus",
- "version": "1.0.0"
- }
- ],
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "datasource",
- "uid": "grafana"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "target": {
- "limit": 100,
- "matchAny": false,
- "tags": [],
- "type": "dashboard"
- },
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "links": [],
- "liveNow": false,
- "panels": [
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 0
- },
- "id": 9,
- "panels": [],
- "title": "Reconciliation Metrics",
- "type": "row"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "Total number of reconciliations per controller",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "cpm"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 1
- },
- "id": 7,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "editorMode": "code",
- "exemplar": true,
- "expr": "sum(rate(controller_runtime_reconcile_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, pod)",
- "interval": "",
- "legendFormat": "{{instance}} {{pod}}",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Total Reconciliation Count Per Controller",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "Total number of reconciliation errors per controller",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "cpm"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 1
- },
- "id": 6,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "editorMode": "code",
- "exemplar": true,
- "expr": "sum(rate(controller_runtime_reconcile_errors_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, pod)",
- "interval": "",
- "legendFormat": "{{instance}} {{pod}}",
- "range": true,
- "refId": "A"
- }
- ],
- "title": "Reconciliation Error Count Per Controller",
- "type": "timeseries"
- },
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 8
- },
- "id": 11,
- "panels": [],
- "title": "Work Queue Metrics",
- "type": "row"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "How long in seconds an item stays in workqueue before being requested",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "normal"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 9
- },
- "id": 13,
- "options": {
- "legend": {
- "calcs": [
- "max",
- "mean"
- ],
- "displayMode": "list",
- "placement": "right"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.50, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "interval": "",
- "legendFormat": "P50 {{name}} {{instance}} ",
- "refId": "A"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.90, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P90 {{name}} {{instance}} ",
- "refId": "B"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.99, sum(rate(workqueue_queue_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P99 {{name}} {{instance}} ",
- "refId": "C"
- }
- ],
- "title": "Seconds For Items Stay In Queue (before being requested) (P50, P90, P99)",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "ops"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 9
- },
- "id": 15,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "8.4.3",
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "sum(rate(workqueue_adds_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name)",
- "interval": "",
- "legendFormat": "{{name}} {{instance}}",
- "refId": "A"
- }
- ],
- "title": "Work Queue Add Rate",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "How long in seconds processing an item from workqueue takes.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 16
- },
- "id": 19,
- "options": {
- "legend": {
- "calcs": [
- "max",
- "mean"
- ],
- "displayMode": "table",
- "placement": "right"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.50, sum(rate(workqueue_work_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "interval": "",
- "legendFormat": "P50 {{name}} {{instance}} ",
- "refId": "A"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.90, sum(rate(workqueue_work_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P90 {{name}} {{instance}} ",
- "refId": "B"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "histogram_quantile(0.99, sum(rate(workqueue_work_duration_seconds_bucket{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name, le))",
- "hide": false,
- "interval": "",
- "legendFormat": "P99 {{name}} {{instance}} ",
- "refId": "C"
- }
- ],
- "title": "Seconds Processing Items From WorkQueue (P50, P90, P99)",
- "type": "timeseries"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "description": "Total number of retries handled by workqueue",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-GrYlRd"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 20,
- "gradientMode": "scheme",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "smooth",
- "lineWidth": 3,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "ops"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 16
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "exemplar": true,
- "expr": "sum(rate(workqueue_retries_total{job=\"$job\", namespace=\"$namespace\"}[5m])) by (instance, name)",
- "interval": "",
- "legendFormat": "{{name}} {{instance}} ",
- "refId": "A"
- }
- ],
- "title": "Work Queue Retries Rate",
- "type": "timeseries"
- }
- ],
- "refresh": "",
- "style": "dark",
- "tags": [],
- "templating": {
- "list": [
- {
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "job",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\"}, job)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total, namespace)",
- "hide": 0,
- "includeAll": false,
- "multi": false,
- "name": "namespace",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total, namespace)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": "${DS_PROMETHEUS}",
- "definition": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "hide": 2,
- "includeAll": true,
- "label": "pod",
- "multi": true,
- "name": "pod",
- "options": [],
- "query": {
- "query": "label_values(controller_runtime_reconcile_total{namespace=~\"$namespace\", job=~\"$job\"}, pod)",
- "refId": "StandardVariableQuery"
- },
- "refresh": 2,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-15m",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Controller-Runtime-Metrics",
- "weekStart": ""
-}
diff --git a/testdata/project-v4-with-metrics/grafana/custom-metrics/config.yaml b/testdata/project-v4-with-metrics/grafana/custom-metrics/config.yaml
deleted file mode 100644
index 3ee1bebdf24..00000000000
--- a/testdata/project-v4-with-metrics/grafana/custom-metrics/config.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-customMetrics:
-# - metric: # Raw custom metric (required)
-# type: # Metric type: counter/gauge/histogram (required)
-# expr: # Prom_ql for the metric (optional)
-# unit: # Unit of measurement, examples: s,none,bytes,percent,etc. (optional)
-#
-#
-# Example:
-# ---
-# customMetrics:
-# - metric: foo_bar
-# unit: none
-# type: histogram
-# expr: histogram_quantile(0.90, sum by(instance, le) (rate(foo_bar{job=\"$job\", namespace=\"$namespace\"}[5m])))
diff --git a/testdata/project-v4/Dockerfile b/testdata/project-v4/Dockerfile
index 8f9cca18eb6..ef4cfaf90bd 100644
--- a/testdata/project-v4/Dockerfile
+++ b/testdata/project-v4/Dockerfile
@@ -12,16 +12,16 @@ COPY go.sum go.sum
RUN go mod download
# Copy the go source
-COPY main.go main.go
+COPY cmd/main.go cmd/main.go
COPY api/ api/
-COPY controllers/ controllers/
+COPY internal/controller/ internal/controller/
# Build
# the GOARCH has not a default value to allow the binary be built according to the host where the command
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
-RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager main.go
+RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index 2f361a625c7..971bfb70e69 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
-ENVTEST_K8S_VERSION = 1.25.0
+ENVTEST_K8S_VERSION = 1.26.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -62,11 +62,11 @@ test: manifests generate fmt vet envtest ## Run tests.
.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
- go build -o bin/manager main.go
+ go build -o bin/manager cmd/main.go
.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
- go run ./main.go
+ go run ./cmd/main.go
# If you wish built the manager image targeting other platforms you can use the --platform flag.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -133,7 +133,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.7
-CONTROLLER_TOOLS_VERSION ?= v0.10.0
+CONTROLLER_TOOLS_VERSION ?= v0.11.1
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
diff --git a/testdata/project-v4/PROJECT b/testdata/project-v4/PROJECT
index 2fdc4c243f0..c2e591df335 100644
--- a/testdata/project-v4/PROJECT
+++ b/testdata/project-v4/PROJECT
@@ -1,3 +1,7 @@
+# Code generated by tool. DO NOT EDIT.
+# This file is used to track the info used to scaffold your project
+# and allow the plugins properly work.
+# More info: https://book.kubebuilder.io/reference/project-config.html
domain: testproject.org
layout:
- go.kubebuilder.io/v4-alpha
diff --git a/testdata/project-v4/README.md b/testdata/project-v4/README.md
index 6d125e643a0..51b5315e4b0 100644
--- a/testdata/project-v4/README.md
+++ b/testdata/project-v4/README.md
@@ -16,11 +16,11 @@ kubectl apply -f config/samples/
```
2. Build and push your image to the location specified by `IMG`:
-
+
```sh
make docker-build docker-push IMG=/project-v4:tag
```
-
+
3. Deploy the controller to the cluster with the image specified by `IMG`:
```sh
@@ -35,7 +35,7 @@ make uninstall
```
### Undeploy controller
-UnDeploy the controller to the cluster:
+UnDeploy the controller from the cluster:
```sh
make undeploy
@@ -45,10 +45,10 @@ make undeploy
// TODO(user): Add detailed information on how you would like others to contribute to this project
### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
+This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
-It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
-which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
+It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
+which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.
### Test It Out
1. Install the CRDs into the cluster:
@@ -78,7 +78,7 @@ More information can be found via the [Kubebuilder Documentation](https://book.k
## License
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/admiral_types.go b/testdata/project-v4/api/v1/admiral_types.go
index 9cbac39e7d2..0902a0b6e5c 100644
--- a/testdata/project-v4/api/v1/admiral_types.go
+++ b/testdata/project-v4/api/v1/admiral_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/admiral_webhook.go b/testdata/project-v4/api/v1/admiral_webhook.go
index acc74d793f0..b809f0feb0e 100644
--- a/testdata/project-v4/api/v1/admiral_webhook.go
+++ b/testdata/project-v4/api/v1/admiral_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/captain_types.go b/testdata/project-v4/api/v1/captain_types.go
index e81debb719c..6eafa937b54 100644
--- a/testdata/project-v4/api/v1/captain_types.go
+++ b/testdata/project-v4/api/v1/captain_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/captain_webhook.go b/testdata/project-v4/api/v1/captain_webhook.go
index ba00000c137..1c8837b5e90 100644
--- a/testdata/project-v4/api/v1/captain_webhook.go
+++ b/testdata/project-v4/api/v1/captain_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/firstmate_types.go b/testdata/project-v4/api/v1/firstmate_types.go
index 7515759833a..59bcaf1e8e7 100644
--- a/testdata/project-v4/api/v1/firstmate_types.go
+++ b/testdata/project-v4/api/v1/firstmate_types.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/firstmate_webhook.go b/testdata/project-v4/api/v1/firstmate_webhook.go
index 5fa6046165d..941a86ed458 100644
--- a/testdata/project-v4/api/v1/firstmate_webhook.go
+++ b/testdata/project-v4/api/v1/firstmate_webhook.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/groupversion_info.go b/testdata/project-v4/api/v1/groupversion_info.go
index 36bb037b41a..fe267f232c5 100644
--- a/testdata/project-v4/api/v1/groupversion_info.go
+++ b/testdata/project-v4/api/v1/groupversion_info.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/webhook_suite_test.go b/testdata/project-v4/api/v1/webhook_suite_test.go
index 91b9bf273c6..674dbd75261 100644
--- a/testdata/project-v4/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4/api/v1/webhook_suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/api/v1/zz_generated.deepcopy.go b/testdata/project-v4/api/v1/zz_generated.deepcopy.go
index eb076ea05ea..3b442b7416a 100644
--- a/testdata/project-v4/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4/api/v1/zz_generated.deepcopy.go
@@ -2,7 +2,7 @@
// +build !ignore_autogenerated
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/main.go b/testdata/project-v4/cmd/main.go
similarity index 94%
rename from testdata/project-v4/main.go
rename to testdata/project-v4/cmd/main.go
index 1c44a24f4dc..297be2c2df6 100644
--- a/testdata/project-v4/main.go
+++ b/testdata/project-v4/cmd/main.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4/api/v1"
- "sigs.k8s.io/kubebuilder/testdata/project-v4/controllers"
+ "sigs.k8s.io/kubebuilder/testdata/project-v4/internal/controller"
//+kubebuilder:scaffold:imports
)
@@ -89,7 +89,7 @@ func main() {
os.Exit(1)
}
- if err = (&controllers.CaptainReconciler{
+ if err = (&controller.CaptainReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -100,7 +100,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
os.Exit(1)
}
- if err = (&controllers.FirstMateReconciler{
+ if err = (&controller.FirstMateReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -111,7 +111,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "FirstMate")
os.Exit(1)
}
- if err = (&controllers.AdmiralReconciler{
+ if err = (&controller.AdmiralReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
@@ -122,7 +122,7 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Admiral")
os.Exit(1)
}
- if err = (&controllers.LakerReconciler{
+ if err = (&controller.LakerReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
diff --git a/testdata/project-v4/config/crd/bases/crew.testproject.org_admirales.yaml b/testdata/project-v4/config/crd/bases/crew.testproject.org_admirales.yaml
index 97533103752..8e63f663bff 100644
--- a/testdata/project-v4/config/crd/bases/crew.testproject.org_admirales.yaml
+++ b/testdata/project-v4/config/crd/bases/crew.testproject.org_admirales.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: admirales.crew.testproject.org
spec:
diff --git a/testdata/project-v4/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v4/config/crd/bases/crew.testproject.org_captains.yaml
index 69ab9ccffcb..2caae573427 100644
--- a/testdata/project-v4/config/crd/bases/crew.testproject.org_captains.yaml
+++ b/testdata/project-v4/config/crd/bases/crew.testproject.org_captains.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: captains.crew.testproject.org
spec:
diff --git a/testdata/project-v4/config/crd/bases/crew.testproject.org_firstmates.yaml b/testdata/project-v4/config/crd/bases/crew.testproject.org_firstmates.yaml
index e1d9bb02b2b..c5cd98dac32 100644
--- a/testdata/project-v4/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ b/testdata/project-v4/config/crd/bases/crew.testproject.org_firstmates.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.10.0
+ controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: firstmates.crew.testproject.org
spec:
diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod
index 4016f793e76..660838b63a0 100644
--- a/testdata/project-v4/go.mod
+++ b/testdata/project-v4/go.mod
@@ -3,78 +3,67 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4
go 1.19
require (
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/client-go v0.25.0
- sigs.k8s.io/controller-runtime v0.13.1
+ github.com/onsi/ginkgo/v2 v2.6.0
+ github.com/onsi/gomega v1.24.1
+ k8s.io/api v0.26.0
+ k8s.io/apimachinery v0.26.0
+ k8s.io/client-go v0.26.0
+ sigs.k8s.io/controller-runtime v0.14.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
- github.com/fsnotify/fsnotify v1.5.4 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
- github.com/imdario/mergo v0.3.12 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.2 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.21.0 // indirect
- golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
+ go.uber.org/zap v1.24.0 // indirect
+ golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
+ golang.org/x/sys v0.3.0 // indirect
+ golang.org/x/term v0.3.0 // indirect
+ golang.org/x/text v0.5.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/apiextensions-apiserver v0.25.0 // indirect
- k8s.io/component-base v0.25.0 // indirect
- k8s.io/klog/v2 v2.70.1 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
+ k8s.io/apiextensions-apiserver v0.26.0 // indirect
+ k8s.io/component-base v0.26.0 // indirect
+ k8s.io/klog/v2 v2.80.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4/hack/boilerplate.go.txt b/testdata/project-v4/hack/boilerplate.go.txt
index b54e305f300..8c36d12450d 100644
--- a/testdata/project-v4/hack/boilerplate.go.txt
+++ b/testdata/project-v4/hack/boilerplate.go.txt
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/testdata/project-v4/controllers/admiral_controller.go b/testdata/project-v4/internal/controller/admiral_controller.go
similarity index 94%
rename from testdata/project-v4/controllers/admiral_controller.go
rename to testdata/project-v4/internal/controller/admiral_controller.go
index 66f23dc0b2f..1c5a120b228 100644
--- a/testdata/project-v4/controllers/admiral_controller.go
+++ b/testdata/project-v4/internal/controller/admiral_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -45,7 +45,7 @@ type AdmiralReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/controllers/captain_controller.go b/testdata/project-v4/internal/controller/captain_controller.go
similarity index 94%
rename from testdata/project-v4/controllers/captain_controller.go
rename to testdata/project-v4/internal/controller/captain_controller.go
index 88f53b380f3..f6ca4eb2fef 100644
--- a/testdata/project-v4/controllers/captain_controller.go
+++ b/testdata/project-v4/internal/controller/captain_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -45,7 +45,7 @@ type CaptainReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/controllers/firstmate_controller.go b/testdata/project-v4/internal/controller/firstmate_controller.go
similarity index 94%
rename from testdata/project-v4/controllers/firstmate_controller.go
rename to testdata/project-v4/internal/controller/firstmate_controller.go
index d5b5100ce81..8c8dcfcfbfa 100644
--- a/testdata/project-v4/controllers/firstmate_controller.go
+++ b/testdata/project-v4/internal/controller/firstmate_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -45,7 +45,7 @@ type FirstMateReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-config/controllers/laker_controller.go b/testdata/project-v4/internal/controller/laker_controller.go
similarity index 94%
rename from testdata/project-v4-config/controllers/laker_controller.go
rename to testdata/project-v4/internal/controller/laker_controller.go
index 9e9536c1b2e..d5e54232538 100644
--- a/testdata/project-v4-config/controllers/laker_controller.go
+++ b/testdata/project-v4/internal/controller/laker_controller.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"context"
@@ -43,7 +43,7 @@ type LakerReconciler struct {
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/controllers/suite_test.go b/testdata/project-v4/internal/controller/suite_test.go
similarity index 93%
rename from testdata/project-v4/controllers/suite_test.go
rename to testdata/project-v4/internal/controller/suite_test.go
index d17fdb2d4ad..a6742364412 100644
--- a/testdata/project-v4/controllers/suite_test.go
+++ b/testdata/project-v4/internal/controller/suite_test.go
@@ -1,5 +1,5 @@
/*
-Copyright 2022 The Kubernetes authors.
+Copyright 2023 The Kubernetes authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package controllers
+package controller
import (
"path/filepath"
@@ -52,7 +52,7 @@ var _ = BeforeSuite(func() {
By("bootstrapping test environment")
testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
}