Click here to see an example. (api/v1/guestbook_types.go)
```go
From 43e3e862553dbed277e32c7e01dfad7d8aac6533 Mon Sep 17 00:00:00 2001
From: Chok Yip Lau
Date: Sun, 14 May 2023 23:28:51 -0400
Subject: [PATCH 0186/1245] Added link for cronjob tutorial
---
docs/book/src/reference/webhook-for-core-types.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/book/src/reference/webhook-for-core-types.md b/docs/book/src/reference/webhook-for-core-types.md
index a27cc1f7e2e..692ef22fc35 100644
--- a/docs/book/src/reference/webhook-for-core-types.md
+++ b/docs/book/src/reference/webhook-for-core-types.md
@@ -1,7 +1,7 @@
# Admission Webhook for Core Types
It is very easy to build admission webhooks for CRDs, which has been covered in
-the CronJob tutorial. Given that kubebuilder doesn't support webhook scaffolding
+the [CronJob tutorial][cronjob-tutorial]. Given that kubebuilder doesn't support webhook scaffolding
for core types, you have to use the library from controller-runtime to handle it.
There is an [example](https://github.com/kubernetes-sigs/controller-runtime/tree/master/examples/builtins)
in controller-runtime.
@@ -71,3 +71,6 @@ Deploying it is just like deploying a webhook server for CRD. You need to
2) deploy the server
You can follow the [tutorial](/cronjob-tutorial/running.md).
+
+
+[cronjob-tutorial]: /cronjob-tutorial/cronjob-tutorial.md
\ No newline at end of file
From 72013a294da69684737bb5d09766bfe7ed54e8f8 Mon Sep 17 00:00:00 2001
From: Eileen
Date: Mon, 15 May 2023 17:01:40 -0400
Subject: [PATCH 0187/1245] chore: update go version for external plugin sample
---
.github/dependabot.yml | 9 ++++++++-
.../testdata/sampleexternalplugin/v1/go.mod | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 99a0002983e..12bdbe3a634 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -5,7 +5,6 @@
version: 2
updates:
-
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
# Workflow files stored in the
@@ -47,3 +46,11 @@ updates:
directory: "testdata/project-v4"
schedule:
interval: "weekly"
+
+ # Maintain dependencies for go in external plugin sample
+ - package-ecosystem: "gomod"
+ directory: "docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1"
+ schedule:
+ interval: "weekly"
+ labels:
+ - "ok-to-test"
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
index c9f770429cd..76dad555950 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
@@ -1,6 +1,6 @@
module v1
-go 1.19
+go 1.20
require (
github.com/spf13/pflag v1.0.5
From caae1bfb1e74b0af76e43c4cdd1510294bf75b76 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 15 May 2023 23:59:26 +0000
Subject: [PATCH 0188/1245] Bump github.com/onsi/ginkgo/v2 from 2.9.4 to 2.9.5
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.9.4 to 2.9.5.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.9.4...v2.9.5)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 8 ++++----
go.sum | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/go.mod b/go.mod
index 9d5f5f96eee..9c3b2feab64 100644
--- a/go.mod
+++ b/go.mod
@@ -4,14 +4,14 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.9.4
+ github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.6
github.com/sirupsen/logrus v1.9.0
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.9.0
- golang.org/x/tools v0.8.0
+ golang.org/x/tools v0.9.1
sigs.k8s.io/yaml v1.3.0
)
@@ -24,8 +24,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.10.0 // indirect
- golang.org/x/net v0.9.0 // indirect
- golang.org/x/sys v0.7.0 // indirect
+ golang.org/x/net v0.10.0 // indirect
+ golang.org/x/sys v0.8.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 5e56aeecf62..07c1aec3780 100644
--- a/go.sum
+++ b/go.sum
@@ -142,8 +142,8 @@ 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.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE=
-github.com/onsi/ginkgo/v2 v2.9.4/go.mod h1:gCQYp2Q+kSoIj7ykSVb9nskRSsR6PUj4AiLywzIhbKM=
+github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
+github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -256,8 +256,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
-golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
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=
@@ -277,7 +277,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
+golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -314,8 +314,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
-golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.8.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=
@@ -377,8 +377,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.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
-golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
+golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
+golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
From 6dfd867230040708334ac8a93124d707ccd43c4d Mon Sep 17 00:00:00 2001
From: Chok Yip Lau
Date: Tue, 16 May 2023 00:06:17 -0400
Subject: [PATCH 0189/1245] Added user prompt for doc
---
docs/book/src/multiversion-tutorial/api-changes.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/book/src/multiversion-tutorial/api-changes.md b/docs/book/src/multiversion-tutorial/api-changes.md
index 57a7495ac36..8bca9fc9148 100644
--- a/docs/book/src/multiversion-tutorial/api-changes.md
+++ b/docs/book/src/multiversion-tutorial/api-changes.md
@@ -40,6 +40,8 @@ We'll need a new API version for this change. Let's call it v2:
kubebuilder create api --group batch --version v2 --kind CronJob
```
+Press `y` for "Create Resource" and `n` for "Create Controller".
+
Now, let's copy over our existing types, and make the change:
{{#literatego ./testdata/project/api/v2/cronjob_types.go}}
From 215a51cdbdd3384ab3ebbdc16cbf4e8794c14ac1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 16 May 2023 06:48:10 +0000
Subject: [PATCH 0190/1245] Bump sigs.k8s.io/kubebuilder/v3
Bumps [sigs.k8s.io/kubebuilder/v3](https://github.com/kubernetes-sigs/kubebuilder) from 3.7.0 to 3.10.0.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder/compare/v3.7.0...v3.10.0)
---
updated-dependencies:
- dependency-name: sigs.k8s.io/kubebuilder/v3
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.../testdata/sampleexternalplugin/v1/go.mod | 15 +-
.../testdata/sampleexternalplugin/v1/go.sum | 468 +++++++++++++++++-
2 files changed, 453 insertions(+), 30 deletions(-)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
index 76dad555950..dc2d09bae2e 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
@@ -4,15 +4,14 @@ go 1.20
require (
github.com/spf13/pflag v1.0.5
- sigs.k8s.io/kubebuilder/v3 v3.7.0
+ sigs.k8s.io/kubebuilder/v3 v3.10.0
)
require (
- github.com/gobuffalo/flect v0.2.5 // indirect
- github.com/spf13/afero v1.6.0 // indirect
- golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
- golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
- golang.org/x/text v0.3.7 // indirect
- golang.org/x/tools v0.1.10 // indirect
- golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
+ github.com/gobuffalo/flect v1.0.2 // indirect
+ github.com/spf13/afero v1.9.5 // indirect
+ golang.org/x/mod v0.10.0 // indirect
+ golang.org/x/sys v0.7.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
+ golang.org/x/tools v0.8.0 // indirect
)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
index ad88ceccacf..20d24f771ed 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
@@ -1,46 +1,470 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
+cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
+cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
+cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
+cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
+cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
+cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
+cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
+cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
+cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
+cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
+cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
+cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
+cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
+cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
+cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
+cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
+cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
+cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
+cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
+cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
+cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
+cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
+cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
+cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
+cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
+cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
+cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
+cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
+cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
+cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
+cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
+cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
+cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
+cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
+dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/gobuffalo/flect v0.2.5 h1:H6vvsv2an0lalEaCDRThvtBfmg44W/QHXBCYUXf/6S4=
-github.com/gobuffalo/flect v0.2.5/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
+github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
+github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
+github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
+github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
+github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
+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=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
+github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
+github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
+github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
+github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
+github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
+github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
+github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
-github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
-github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
+github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
-github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
+github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
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.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+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/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=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
+go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
+go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
-golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
+golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
+golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
+golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
+golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
+golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
+golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
+golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
+golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
+golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
+golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
+golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
+golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
+golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
+golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
+golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
+golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
+golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-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.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 h1:OH54vjqzRWmbJ62fjuhxy7AxFFgoHN0/DPc/UrL8cAs=
-golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
+golang.org/x/sys v0.7.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=
+golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
+golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
-golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
+golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
+golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
+golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
+golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
+golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
+golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
+golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-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.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
+golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
+google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
+google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
+google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
+google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
+google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
+google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
+google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
+google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
+google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
+google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
+google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
+google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
+google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
+google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
+google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
+google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
+google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
+google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
+google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
-sigs.k8s.io/kubebuilder/v3 v3.7.0 h1:o1ZsPgnZB9ddS2wUqL2Nw812PQzaCccNyu83uRS09ws=
-sigs.k8s.io/kubebuilder/v3 v3.7.0/go.mod h1:3VwM89VsNnBbOuee1vhq7wOTh8oUwsk1IibeNaByqP4=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
+honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
+rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
+sigs.k8s.io/kubebuilder/v3 v3.10.0 h1:gLJpa7dlKYc3T/VICAyaSjLL5ECrcHMUYRZ6sPWeNdA=
+sigs.k8s.io/kubebuilder/v3 v3.10.0/go.mod h1:C65fAHNj0vVzPjMoVTjIBTHxAQal6qbg3ZA1gtMl5B4=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
From 3811dd75c1941004210b28617cd5d30d2d8d9d6c Mon Sep 17 00:00:00 2001
From: Yash Singh
Date: Sun, 19 Feb 2023 21:19:15 +0530
Subject: [PATCH 0191/1245] Added the test coverage for completion.go and
version.go
---
pkg/cli/completion_test.go | 83 ++++++++++++++++++++++++++++++++++++++
pkg/cli/version.go | 3 +-
pkg/cli/version_test.go | 47 +++++++++++++++++++++
3 files changed, 132 insertions(+), 1 deletion(-)
create mode 100644 pkg/cli/completion_test.go
create mode 100644 pkg/cli/version_test.go
diff --git a/pkg/cli/completion_test.go b/pkg/cli/completion_test.go
new file mode 100644
index 00000000000..ab235b4b0f3
--- /dev/null
+++ b/pkg/cli/completion_test.go
@@ -0,0 +1,83 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package cli
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+var _ = Describe("Completion", func() {
+ var (
+ c *CLI
+ )
+
+ BeforeEach(func() {
+ c = &CLI{}
+ })
+
+ When("newBashCmd", func() {
+ It("Testing the BashCompletion", func() {
+ cmd := c.newBashCmd()
+ Expect(cmd).NotTo(BeNil())
+ Expect(cmd.Use).NotTo(Equal(""))
+ Expect(cmd.Use).To(ContainSubstring("bash"))
+ Expect(cmd.Short).NotTo(Equal(""))
+ Expect(cmd.Short).To(ContainSubstring("Load bash completions"))
+ Expect(cmd.Example).NotTo(Equal(""))
+ Expect(cmd.Example).To(ContainSubstring("# To load completion for this session"))
+ })
+ })
+
+ Context("newZshCmd", func() {
+ It("Testing the ZshCompletion", func() {
+ cmd := c.newZshCmd()
+ Expect(cmd).NotTo(BeNil())
+ Expect(cmd.Use).NotTo(Equal(""))
+ Expect(cmd.Use).To(ContainSubstring("zsh"))
+ Expect(cmd.Short).NotTo(Equal(""))
+ Expect(cmd.Short).To(ContainSubstring("Load zsh completions"))
+ Expect(cmd.Example).NotTo(Equal(""))
+ Expect(cmd.Example).To(ContainSubstring("# If shell completion is not already enabled in your environment"))
+ })
+ })
+
+ Context("newFishCmd", func() {
+ It("Testing the FishCompletion", func() {
+ cmd := c.newFishCmd()
+ Expect(cmd).NotTo(BeNil())
+ Expect(cmd.Use).NotTo(Equal(""))
+ Expect(cmd.Use).To(ContainSubstring("fish"))
+ Expect(cmd.Short).NotTo(Equal(""))
+ Expect(cmd.Short).To(ContainSubstring("Load fish completions"))
+ Expect(cmd.Example).NotTo(Equal(""))
+ Expect(cmd.Example).To(ContainSubstring("# To load completion for this session, execute:"))
+ })
+ })
+
+ Context("newPowerShellCmd", func() {
+ It("Testing the PowerShellCompletion", func() {
+ cmd := c.newPowerShellCmd()
+ Expect(cmd).NotTo(BeNil())
+ Expect(cmd.Use).NotTo(Equal(""))
+ Expect(cmd.Use).To(ContainSubstring("powershell"))
+ Expect(cmd.Short).NotTo(Equal(""))
+ Expect(cmd.Short).To(ContainSubstring("Load powershell completions"))
+ })
+
+ })
+})
diff --git a/pkg/cli/version.go b/pkg/cli/version.go
index ad16d615cd8..f721c41ff0f 100644
--- a/pkg/cli/version.go
+++ b/pkg/cli/version.go
@@ -23,7 +23,7 @@ import (
)
func (c CLI) newVersionCmd() *cobra.Command {
- return &cobra.Command{
+ cmd := &cobra.Command{
Use: "version",
Short: fmt.Sprintf("Print the %s version", c.commandName),
Long: fmt.Sprintf("Print the %s version", c.commandName),
@@ -33,4 +33,5 @@ func (c CLI) newVersionCmd() *cobra.Command {
return nil
},
}
+ return cmd
}
diff --git a/pkg/cli/version_test.go b/pkg/cli/version_test.go
new file mode 100644
index 00000000000..e8f54b0fcd4
--- /dev/null
+++ b/pkg/cli/version_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package cli
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+var _ = Describe("Version", func() {
+ var (
+ c *CLI
+ )
+
+ BeforeEach(func() {
+ c = &CLI{}
+ })
+
+ Context("newVersionCmd", func() {
+ It("Test the version", func() {
+ cmd := c.newVersionCmd()
+ Expect(cmd).NotTo(BeNil())
+ Expect(cmd.Use).To(ContainSubstring("version"))
+ Expect(cmd.Use).NotTo(Equal(""))
+ Expect(cmd.Short).NotTo(Equal(""))
+ Expect(cmd.Short).To(ContainSubstring("Print the"))
+ Expect(cmd.Long).NotTo(Equal(""))
+ Expect(cmd.Long).To(ContainSubstring("Print the"))
+ Expect(cmd.Example).NotTo(Equal(""))
+ Expect(cmd.Example).To(ContainSubstring("version"))
+ })
+ })
+})
From 4444ab50e3de076077f087cbfde6b80f83396dbf Mon Sep 17 00:00:00 2001
From: James Turley
Date: Fri, 19 May 2023 21:48:28 +0100
Subject: [PATCH 0192/1245] Quote download URL in quickstart docs
Copying and pasting the `curl` line in the installation docs conflicts with zsh (or perhaps oh-my-zsh), which incorrectly escapes parentheses.
```sh
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
```
becomes:
```sh
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$\(go env GOOS)/$(go env GOARCH)
```
Which of course doesn't have the desired result and errors out.
Double-quoting the URL should ensure the interpolated shell commands have the desired outcome. Tested on zsh and bash.
---
docs/book/src/quick-start.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/quick-start.md b/docs/book/src/quick-start.md
index 63cd27fc844..9a158c1e05f 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/
```
From e87c207a71b52d39d2bc09fb05fbc00198393214 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 23 May 2023 00:00:47 +0000
Subject: [PATCH 0193/1245] Bump github.com/onsi/gomega from 1.27.6 to 1.27.7
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.6 to 1.27.7.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.27.6...v1.27.7)
---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 9c3b2feab64..18c11d32ff0 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.9.5
- github.com/onsi/gomega v1.27.6
+ github.com/onsi/gomega v1.27.7
github.com/sirupsen/logrus v1.9.0
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
diff --git a/go.sum b/go.sum
index 07c1aec3780..80e5b0dd206 100644
--- a/go.sum
+++ b/go.sum
@@ -144,8 +144,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
-github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
-github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
+github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
+github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4=
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=
From abcb7f350a08742b1cdacc266b25763962bac16e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 23 May 2023 16:09:01 +0000
Subject: [PATCH 0194/1245] Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.0...v1.9.2)
---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 18c11d32ff0..b129767bcc6 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.7
- github.com/sirupsen/logrus v1.9.0
+ github.com/sirupsen/logrus v1.9.2
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
diff --git a/go.sum b/go.sum
index 80e5b0dd206..a8b34b1476f 100644
--- a/go.sum
+++ b/go.sum
@@ -153,8 +153,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
-github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
-github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
+github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
+github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
From ebe2b08c9d1b8a021810a94fcb389fabe7031544 Mon Sep 17 00:00:00 2001
From: Gabe Alford
Date: Tue, 23 May 2023 09:39:43 -0600
Subject: [PATCH 0195/1245] =?UTF-8?q?=E2=9C=A8=20(go/v4):=20Allows=20kubec?=
=?UTF-8?q?tl=20to=20be=20configured=20in=20Makefile?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- This allows multiple different kubectl installs to be used.
Signed-off-by: Gabe Alford
---
.../component-config-tutorial/testdata/project/Makefile | 9 +++++----
docs/book/src/cronjob-tutorial/testdata/project/Makefile | 9 +++++----
.../golang/v4/scaffolds/internal/templates/makefile.go | 9 +++++----
testdata/project-v4-config/Makefile | 9 +++++----
testdata/project-v4-declarative-v1/Makefile | 9 +++++----
testdata/project-v4-multigroup/Makefile | 9 +++++----
testdata/project-v4-with-deploy-image/Makefile | 9 +++++----
testdata/project-v4-with-grafana/Makefile | 9 +++++----
testdata/project-v4/Makefile | 9 +++++----
9 files changed, 45 insertions(+), 36 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index a2882db925a..60603908794 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index a2882db925a..60603908794 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 208d6369bb8..aad92fb4ddb 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -174,20 +174,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -197,6 +197,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/testdata/project-v4-config/Makefile b/testdata/project-v4-config/Makefile
index a2882db925a..60603908794 100644
--- a/testdata/project-v4-config/Makefile
+++ b/testdata/project-v4-config/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile
index a2882db925a..60603908794 100644
--- a/testdata/project-v4-declarative-v1/Makefile
+++ b/testdata/project-v4-declarative-v1/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index a2882db925a..60603908794 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index a2882db925a..60603908794 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index a2882db925a..60603908794 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index a2882db925a..60603908794 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -110,20 +110,20 @@ endif
.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | kubectl apply -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | kubectl apply -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
##@ Build Dependencies
@@ -133,6 +133,7 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
+KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
From c9629c4ca9a67e93f3cac2df058f41a0af10e62f Mon Sep 17 00:00:00 2001
From: Chok Yip Lau
Date: Mon, 22 May 2023 15:47:40 -0400
Subject: [PATCH 0196/1245] Fixed manager_webhook_patch not uncommented
---
.../testdata/project/config/default/kustomization.yaml | 2 +-
hack/docs/internal/cronjob-tutorial/generate_cronjob.go | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
index d9dc63e0d2a..f91d0c64e09 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
@@ -36,7 +36,7 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 1b76a2f377c..9ab732e1779 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -569,6 +569,11 @@ func updateKustomization(sp *Sample) {
`#- ../certmanager`, `#`)
CheckError("fixing default/kustomization", err)
+ err = pluginutil.UncommentCode(
+ filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
+ `#- manager_webhook_patch.yaml`, `#`)
+ CheckError("fixing default/kustomization", err)
+
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
`#- webhookcainjection`, `#`)
From 7711b8f84067ff04fe4dc5dc0213c76bb8e9d14a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan-Luis=20de=20Sousa-Valadas=20Casta=C3=B1o?=
Date: Wed, 10 May 2023 16:01:48 +0200
Subject: [PATCH 0197/1245] doc: Fix multigroup migration guide for v4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Varsha
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Signed-off-by: Juan-Luis de Sousa-Valadas Castaño
---
docs/book/src/migration/multi-group.md | 108 ++++++++++++++-----------
1 file changed, 63 insertions(+), 45 deletions(-)
diff --git a/docs/book/src/migration/multi-group.md b/docs/book/src/migration/multi-group.md
index fd6a15266c6..6fcd1cd4aa6 100644
--- a/docs/book/src/migration/multi-group.md
+++ b/docs/book/src/migration/multi-group.md
@@ -4,32 +4,32 @@
Note
-Multi-group scaffolding support was not present in the initial version of
-the Kubebuilder v2 scaffolding (as of Kubebuilder v2.0.0).
+While Kubebuilder will not scaffold out a project structure compatible
+with multiple API groups in the same repository by default, it's possible
+to modify the default project structure to support it.
-To change the layout of your project to support Multi-Group run the command
-`kubebuilder edit --multigroup=true`. Once you switch to a multi-group layout, the new Kinds
-will be generated in the new layout but additional manual work is needed
-to move the old API groups to the new layout.
+Note that the process mainly is to ensure that your API(s) and controller(s) will be moved under new directories with their respective group name.
-While Kubebuilder v2 will not scaffold out a project structure compatible
-with multiple API groups in the same repository by default, it's possible
-to modify the default project structure to support it.
-
Let's migrate the [CronJob example][cronjob-tutorial].
+To change the layout of your project to support Multi-Group run the command
+`kubebuilder edit --multigroup=true`. Once you switch to a multi-group layout, the new Kinds
+will be generated in the new layout but additional manual work is needed
+to move the old API groups to the new layout.
+
Generally, we use the prefix for the API group as the directory name. We
can check `api/v1/groupversion_info.go` to find that out:
@@ -38,58 +38,75 @@ can check `api/v1/groupversion_info.go` to find that out:
package v1
```
-Then, we'll rename `api` to `apis` to be more clear, and we'll move our
-existing APIs into a new subdirectory, "batch":
+Then, we'll rename move our existing APIs into a new subdirectory, "batch":
```bash
-mkdir apis/batch
-mv api/* apis/batch
-# After ensuring that all was moved successfully remove the old directory `api/`
-rm -rf api/
+mkdir api/batch
+mv api/* api/batch
```
-
-After moving the APIs to a new directory, the same needs to be applied to the controllers:
+After moving the APIs to a new directory, the same needs to be applied to the controllers. For go/v4:
```bash
-mkdir controllers/batch
-mv controllers/* controllers/batch/
+mkdir internal/controller/batch
+mv internal/controller/* internal/controller/batch/
```
+
From cef5f4ca7af385780d1276af978da5ecf0c9662f Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Mon, 12 Jun 2023 14:01:07 +0800
Subject: [PATCH 0206/1245] =?UTF-8?q?=E2=9C=A8re-scaffold=20the=20project?=
=?UTF-8?q?=20with=20a=20new=20command=20=20(#3431)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pkg/cli/alpha.go | 2 +
pkg/cli/alpha/generate.go | 50 ++++++++++++++++++
pkg/rescaffold/migrate.go | 107 ++++++++++++++++++++++++++++++++++++++
3 files changed, 159 insertions(+)
create mode 100644 pkg/cli/alpha/generate.go
create mode 100644 pkg/rescaffold/migrate.go
diff --git a/pkg/cli/alpha.go b/pkg/cli/alpha.go
index 403a024ab59..7f4d1f12891 100644
--- a/pkg/cli/alpha.go
+++ b/pkg/cli/alpha.go
@@ -21,6 +21,7 @@ import (
"strings"
"github.com/spf13/cobra"
+ "sigs.k8s.io/kubebuilder/v3/pkg/cli/alpha"
)
const (
@@ -29,6 +30,7 @@ const (
var alphaCommands = []*cobra.Command{
newAlphaCommand(),
+ alpha.NewScaffoldCommand(),
}
func newAlphaCommand() *cobra.Command {
diff --git a/pkg/cli/alpha/generate.go b/pkg/cli/alpha/generate.go
new file mode 100644
index 00000000000..23c346f3216
--- /dev/null
+++ b/pkg/cli/alpha/generate.go
@@ -0,0 +1,50 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package alpha
+
+import (
+ "log"
+
+ "github.com/spf13/cobra"
+ "sigs.k8s.io/kubebuilder/v3/pkg/rescaffold"
+)
+
+// NewScaffoldCommand return a new scaffold command
+func NewScaffoldCommand() *cobra.Command {
+ opts := rescaffold.MigrateOptions{}
+ scaffoldCmd := &cobra.Command{
+ Use: "generate",
+ Short: "Re-scaffold an existing Kuberbuilder project",
+ Long: `It's an experimental feature that has the purpose of re-scaffolding the whole project from the scratch
+using the current version of KubeBuilder binary available.
+# make sure the PROJECT file is in the 'input-dir' argument, the default is the current directory.
+$ kubebuilder alpha generate --input-dir="./test" --output-dir="./my-output"
+Then we will re-scaffold the project by Kubebuilder in the directory specified by 'output-dir'.
+ `,
+ PreRunE: func(cmd *cobra.Command, _ []string) error {
+ return opts.Validate()
+ },
+ Run: func(cmd *cobra.Command, args []string) {
+ if err := opts.Rescaffold(); err != nil {
+ log.Fatalf("Failed to rescaffold %s", err)
+ }
+ },
+ }
+ scaffoldCmd.Flags().StringVar(&opts.InputDir, "input-dir", "",
+ "path to a Kubebuilder project file if not in the current working directory")
+ scaffoldCmd.Flags().StringVar(&opts.OutputDir, "output-dir", "",
+ "path to output the scaffolding. defaults a directory in the current working directory")
+
+ return scaffoldCmd
+}
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
new file mode 100644
index 00000000000..91854c24783
--- /dev/null
+++ b/pkg/rescaffold/migrate.go
@@ -0,0 +1,107 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package rescaffold
+
+import (
+ "fmt"
+ "log"
+ "os"
+ "os/exec"
+
+ "github.com/spf13/afero"
+ "sigs.k8s.io/kubebuilder/v3/pkg/config/store"
+ "sigs.k8s.io/kubebuilder/v3/pkg/config/store/yaml"
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
+)
+
+type MigrateOptions struct {
+ InputDir string
+ OutputDir string
+}
+
+const DefaultOutputDir = "output-dir"
+
+func (opts *MigrateOptions) Rescaffold() error {
+ config := yaml.New(machinery.Filesystem{FS: afero.NewOsFs()})
+ if err := config.LoadFrom(opts.InputDir); err != nil {
+ log.Fatal(err)
+ }
+ // create output directory
+ // nolint: gosec
+ if err := os.MkdirAll(opts.OutputDir, 0755); err != nil {
+ log.Fatal(err)
+ }
+ // use the new directory to set up the new project
+ if err := os.Chdir(opts.OutputDir); err != nil {
+ log.Fatal(err)
+ }
+ // init project with plugins
+ if err := kubebuilderInit(config); err != nil {
+ log.Fatal(err)
+ }
+ return nil
+}
+
+func (opts *MigrateOptions) Validate() error {
+ cwd, err := os.Getwd()
+ if err != nil {
+ log.Fatal(err)
+ }
+ // get PROJECT path from command args
+ inputPath, err := getInputPath(cwd, opts.InputDir)
+ if err != nil {
+ log.Fatal(err)
+ }
+ opts.InputDir = inputPath
+ // get output path from command args
+ opts.OutputDir, err = getOutputPath(cwd, opts.OutputDir)
+ if err != nil {
+ log.Fatal(err)
+ }
+ // check whether the kubebuilder binary is accessible
+ _, err = exec.LookPath("kubebuilder")
+ return err
+}
+
+func getInputPath(currentWorkingDirectory string, inputPath string) (string, error) {
+ if inputPath == "" {
+ inputPath = currentWorkingDirectory
+ }
+ projectPath := fmt.Sprintf("%s/%s", inputPath, yaml.DefaultPath)
+ if _, err := os.Stat(projectPath); os.IsNotExist(err) {
+ return "", fmt.Errorf("PROJECT path: %s does not exist. %v", projectPath, err)
+ }
+ return projectPath, nil
+}
+
+func getOutputPath(currentWorkingDirectory, outputPath string) (string, error) {
+ if outputPath == "" {
+ outputPath = fmt.Sprintf("%s/%s", currentWorkingDirectory, DefaultOutputDir)
+ }
+ _, err := os.Stat(outputPath)
+ if err == nil {
+ return "", fmt.Errorf("Output path: %s already exists. %v", outputPath, err)
+ }
+ if os.IsNotExist(err) {
+ return outputPath, nil
+ }
+ return "", err
+}
+
+func kubebuilderInit(_ store.Store) error {
+ var args []string
+ args = append(args, "init")
+ return util.RunCmd("kubebuilder init", "kubebuilder", args...)
+}
From da3322d5ff9d0fa449767632368e8dfc8ed4ce2c Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Fri, 9 Jun 2023 11:56:58 +0100
Subject: [PATCH 0207/1245] :warning: deprecate component config and no longer
able to ensure that it is functioning as intended
---
.../component-config-tutorial/api-changes.md | 12 +
.../component-config-tutorial/config-type.md | 12 +
.../component-config-tutorial/custom-type.md | 12 +
.../define-config.md | 12 +
.../define-custom-config.md | 12 +
.../src/component-config-tutorial/tutorial.md | 12 +
.../updating-main.md | 12 +
test/e2e/v4/generate_test.go | 171 ----------
test/e2e/v4/plugin_cluster_test.go | 7 -
test/testdata/generate.sh | 1 -
test/testdata/test.sh | 1 -
testdata/project-v4-config/.dockerignore | 3 -
testdata/project-v4-config/.gitignore | 25 --
testdata/project-v4-config/Dockerfile | 33 --
testdata/project-v4-config/Makefile | 163 ----------
testdata/project-v4-config/PROJECT | 53 ----
testdata/project-v4-config/README.md | 94 ------
.../project-v4-config/api/v1/admiral_types.go | 65 ----
.../api/v1/admiral_webhook.go | 45 ---
.../project-v4-config/api/v1/captain_types.go | 64 ----
.../api/v1/captain_webhook.go | 75 -----
.../api/v1/firstmate_types.go | 64 ----
.../api/v1/firstmate_webhook.go | 33 --
.../api/v1/groupversion_info.go | 36 ---
.../api/v1/webhook_suite_test.go | 135 --------
.../api/v1/zz_generated.deepcopy.go | 293 ------------------
testdata/project-v4-config/cmd/main.go | 137 --------
.../config/certmanager/certificate.yaml | 39 ---
.../config/certmanager/kustomization.yaml | 5 -
.../config/certmanager/kustomizeconfig.yaml | 8 -
.../bases/crew.testproject.org_admirals.yaml | 49 ---
.../bases/crew.testproject.org_captains.yaml | 49 ---
.../crew.testproject.org_firstmates.yaml | 49 ---
.../config/crd/kustomization.yaml | 27 --
.../config/crd/kustomizeconfig.yaml | 19 --
.../crd/patches/cainjection_in_admirals.yaml | 7 -
.../crd/patches/cainjection_in_captains.yaml | 7 -
.../patches/cainjection_in_firstmates.yaml | 7 -
.../crd/patches/webhook_in_admirals.yaml | 16 -
.../crd/patches/webhook_in_captains.yaml | 16 -
.../crd/patches/webhook_in_firstmates.yaml | 16 -
.../config/default/kustomization.yaml | 147 ---------
.../default/manager_auth_proxy_patch.yaml | 34 --
.../config/default/manager_config_patch.yaml | 20 --
.../config/default/manager_webhook_patch.yaml | 23 --
.../default/webhookcainjection_patch.yaml | 29 --
.../manager/controller_manager_config.yaml | 29 --
.../config/manager/kustomization.yaml | 10 -
.../config/manager/manager.yaml | 100 ------
.../config/prometheus/kustomization.yaml | 2 -
.../config/prometheus/monitor.yaml | 26 --
.../config/rbac/admiral_editor_role.yaml | 31 --
.../config/rbac/admiral_viewer_role.yaml | 27 --
.../rbac/auth_proxy_client_clusterrole.yaml | 16 -
.../config/rbac/auth_proxy_role.yaml | 24 --
.../config/rbac/auth_proxy_role_binding.yaml | 19 --
.../config/rbac/auth_proxy_service.yaml | 21 --
.../config/rbac/captain_editor_role.yaml | 31 --
.../config/rbac/captain_viewer_role.yaml | 27 --
.../config/rbac/firstmate_editor_role.yaml | 31 --
.../config/rbac/firstmate_viewer_role.yaml | 27 --
.../config/rbac/kustomization.yaml | 18 --
.../config/rbac/leader_election_role.yaml | 44 ---
.../rbac/leader_election_role_binding.yaml | 19 --
.../project-v4-config/config/rbac/role.yaml | 110 -------
.../config/rbac/role_binding.yaml | 19 --
.../config/rbac/service_account.yaml | 12 -
.../config/samples/crew_v1_admiral.yaml | 12 -
.../config/samples/crew_v1_captain.yaml | 12 -
.../config/samples/crew_v1_firstmate.yaml | 12 -
.../config/samples/kustomization.yaml | 6 -
.../config/webhook/kustomization.yaml | 6 -
.../config/webhook/kustomizeconfig.yaml | 22 --
.../config/webhook/manifests.yaml | 72 -----
.../config/webhook/service.yaml | 20 --
testdata/project-v4-config/go.mod | 70 -----
.../project-v4-config/hack/boilerplate.go.txt | 15 -
.../internal/controller/admiral_controller.go | 62 ----
.../internal/controller/captain_controller.go | 62 ----
.../controller/firstmate_controller.go | 62 ----
.../internal/controller/laker_controller.go | 61 ----
.../internal/controller/suite_test.go | 80 -----
82 files changed, 84 insertions(+), 3282 deletions(-)
delete mode 100644 testdata/project-v4-config/.dockerignore
delete mode 100644 testdata/project-v4-config/.gitignore
delete mode 100644 testdata/project-v4-config/Dockerfile
delete mode 100644 testdata/project-v4-config/Makefile
delete mode 100644 testdata/project-v4-config/PROJECT
delete mode 100644 testdata/project-v4-config/README.md
delete mode 100644 testdata/project-v4-config/api/v1/admiral_types.go
delete mode 100644 testdata/project-v4-config/api/v1/admiral_webhook.go
delete mode 100644 testdata/project-v4-config/api/v1/captain_types.go
delete mode 100644 testdata/project-v4-config/api/v1/captain_webhook.go
delete mode 100644 testdata/project-v4-config/api/v1/firstmate_types.go
delete mode 100644 testdata/project-v4-config/api/v1/firstmate_webhook.go
delete mode 100644 testdata/project-v4-config/api/v1/groupversion_info.go
delete mode 100644 testdata/project-v4-config/api/v1/webhook_suite_test.go
delete mode 100644 testdata/project-v4-config/api/v1/zz_generated.deepcopy.go
delete mode 100644 testdata/project-v4-config/cmd/main.go
delete mode 100644 testdata/project-v4-config/config/certmanager/certificate.yaml
delete mode 100644 testdata/project-v4-config/config/certmanager/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/certmanager/kustomizeconfig.yaml
delete mode 100644 testdata/project-v4-config/config/crd/bases/crew.testproject.org_admirals.yaml
delete mode 100644 testdata/project-v4-config/config/crd/bases/crew.testproject.org_captains.yaml
delete mode 100644 testdata/project-v4-config/config/crd/bases/crew.testproject.org_firstmates.yaml
delete mode 100644 testdata/project-v4-config/config/crd/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/crd/kustomizeconfig.yaml
delete mode 100644 testdata/project-v4-config/config/crd/patches/cainjection_in_admirals.yaml
delete mode 100644 testdata/project-v4-config/config/crd/patches/cainjection_in_captains.yaml
delete mode 100644 testdata/project-v4-config/config/crd/patches/cainjection_in_firstmates.yaml
delete mode 100644 testdata/project-v4-config/config/crd/patches/webhook_in_admirals.yaml
delete mode 100644 testdata/project-v4-config/config/crd/patches/webhook_in_captains.yaml
delete mode 100644 testdata/project-v4-config/config/crd/patches/webhook_in_firstmates.yaml
delete mode 100644 testdata/project-v4-config/config/default/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/default/manager_auth_proxy_patch.yaml
delete mode 100644 testdata/project-v4-config/config/default/manager_config_patch.yaml
delete mode 100644 testdata/project-v4-config/config/default/manager_webhook_patch.yaml
delete mode 100644 testdata/project-v4-config/config/default/webhookcainjection_patch.yaml
delete mode 100644 testdata/project-v4-config/config/manager/controller_manager_config.yaml
delete mode 100644 testdata/project-v4-config/config/manager/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/manager/manager.yaml
delete mode 100644 testdata/project-v4-config/config/prometheus/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/prometheus/monitor.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/admiral_editor_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/admiral_viewer_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/auth_proxy_client_clusterrole.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/auth_proxy_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/auth_proxy_role_binding.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/auth_proxy_service.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/captain_editor_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/captain_viewer_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/firstmate_editor_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/firstmate_viewer_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/leader_election_role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/leader_election_role_binding.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/role.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/role_binding.yaml
delete mode 100644 testdata/project-v4-config/config/rbac/service_account.yaml
delete mode 100644 testdata/project-v4-config/config/samples/crew_v1_admiral.yaml
delete mode 100644 testdata/project-v4-config/config/samples/crew_v1_captain.yaml
delete mode 100644 testdata/project-v4-config/config/samples/crew_v1_firstmate.yaml
delete mode 100644 testdata/project-v4-config/config/samples/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/webhook/kustomization.yaml
delete mode 100644 testdata/project-v4-config/config/webhook/kustomizeconfig.yaml
delete mode 100644 testdata/project-v4-config/config/webhook/manifests.yaml
delete mode 100644 testdata/project-v4-config/config/webhook/service.yaml
delete mode 100644 testdata/project-v4-config/go.mod
delete mode 100644 testdata/project-v4-config/hack/boilerplate.go.txt
delete mode 100644 testdata/project-v4-config/internal/controller/admiral_controller.go
delete mode 100644 testdata/project-v4-config/internal/controller/captain_controller.go
delete mode 100644 testdata/project-v4-config/internal/controller/firstmate_controller.go
delete mode 100644 testdata/project-v4-config/internal/controller/laker_controller.go
delete mode 100644 testdata/project-v4-config/internal/controller/suite_test.go
diff --git a/docs/book/src/component-config-tutorial/api-changes.md b/docs/book/src/component-config-tutorial/api-changes.md
index e65d6100b3e..edd39223edd 100644
--- a/docs/book/src/component-config-tutorial/api-changes.md
+++ b/docs/book/src/component-config-tutorial/api-changes.md
@@ -1,5 +1,17 @@
# Changing things up
+
+
This tutorial will show you how to create a custom configuration file for your
project by modifying a project generated with the `--component-config` flag
passed to the `init` command. The full tutorial's source can be found
diff --git a/docs/book/src/component-config-tutorial/config-type.md b/docs/book/src/component-config-tutorial/config-type.md
index d8d42925de3..518f360ed81 100644
--- a/docs/book/src/component-config-tutorial/config-type.md
+++ b/docs/book/src/component-config-tutorial/config-type.md
@@ -1,5 +1,17 @@
# Adding a new Config Type
+
+
To scaffold out a new config Kind, we can use `kubebuilder create api`.
```bash
diff --git a/docs/book/src/component-config-tutorial/custom-type.md b/docs/book/src/component-config-tutorial/custom-type.md
index 76dfeda43d2..55910168e48 100644
--- a/docs/book/src/component-config-tutorial/custom-type.md
+++ b/docs/book/src/component-config-tutorial/custom-type.md
@@ -1,5 +1,17 @@
# Using a Custom Type
+
+
-## How to be able to raise Events?
+### How to be able to raise Events?
Following are the steps with examples to help you raise events in your controller's reconciliations.
-Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`,
+Events are published from a Controller using an [EventRecorder][Events]`type CorrelatorOptions struct`,
which can be created for a Controller by calling `GetRecorder(name string)` on a Manager. See that we will change the implementation scaffolded in `cmd/main.go`:
```go
@@ -60,6 +60,7 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a
```
### Allowing usage of EventRecorder on the Controller
+
To raise an event, you must have access to `record.EventRecorder` in the Controller. Therefore, firstly let's update the controller implementation:
```go
import (
@@ -89,6 +90,7 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a
}
```
### Granting the required permissions
+
You must also grant the RBAC rules permissions to allow your project to create Events. Therefore, ensure that you add the [RBAC][rbac-markers] into your controller:
```go
...
From cf78f513bf030c8fa340f008c689f6c715f86c68 Mon Sep 17 00:00:00 2001
From: Kun Zhang
Date: Wed, 14 Jun 2023 03:10:22 +0800
Subject: [PATCH 0213/1245] =?UTF-8?q?=E2=9C=A8=20bump=20controller-runtime?=
=?UTF-8?q?=20and=20K8s=201.27=20(#3444)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...utorial.kubebuilder.io_projectconfigs.yaml | 2 +-
.../testdata/project/go.mod | 62 +--
.../testdata/project/go.sum | 515 +++--------------
.../project/api/v1/cronjob_webhook.go | 13 +-
...atch.tutorial.kubebuilder.io_cronjobs.yaml | 267 ++++++---
.../cronjob-tutorial/testdata/project/go.mod | 69 +--
.../cronjob-tutorial/testdata/project/go.sum | 519 ++++--------------
.../internal/controller/cronjob_controller.go | 2 +-
.../cronjob-tutorial/generate_cronjob.go | 53 +-
.../webhook_implementation.go | 1 +
pkg/plugin/util/util.go | 4 +-
pkg/plugins/golang/declarative/v1/api.go | 12 +-
.../internal/templates/controller.go | 4 +-
pkg/plugins/golang/v4/scaffolds/init.go | 2 +-
.../internal/templates/api/webhook.go | 14 +-
testdata/project-v4-declarative-v1/go.mod | 84 +--
.../internal/controller/admiral_controller.go | 4 +-
.../internal/controller/captain_controller.go | 4 +-
.../controller/firstmate_controller.go | 4 +-
.../api/crew/v1/captain_webhook.go | 13 +-
.../api/ship/v2alpha1/cruiser_webhook.go | 13 +-
.../api/v1/lakers_webhook.go | 13 +-
testdata/project-v4-multigroup/go.mod | 69 +--
.../controller/apps/deployment_controller.go | 2 +-
.../controller/crew/captain_controller.go | 2 +-
.../internal/controller/fiz/bar_controller.go | 2 +-
.../healthcheckpolicy_controller.go | 2 +-
.../internal/controller/foo/bar_controller.go | 2 +-
.../internal/controller/lakers_controller.go | 2 +-
.../sea-creatures/kraken_controller.go | 2 +-
.../sea-creatures/leviathan_controller.go | 2 +-
.../controller/ship/cruiser_controller.go | 2 +-
.../controller/ship/destroyer_controller.go | 2 +-
.../controller/ship/frigate_controller.go | 2 +-
.../api/v1alpha1/memcached_webhook.go | 13 +-
testdata/project-v4-with-deploy-image/go.mod | 69 +--
.../internal/controller/busybox_controller.go | 2 +-
.../controller/memcached_controller.go | 2 +-
testdata/project-v4-with-grafana/go.mod | 62 +--
testdata/project-v4/api/v1/captain_webhook.go | 13 +-
testdata/project-v4/go.mod | 69 +--
.../internal/controller/admiral_controller.go | 2 +-
.../internal/controller/captain_controller.go | 2 +-
.../controller/firstmate_controller.go | 2 +-
.../internal/controller/laker_controller.go | 2 +-
45 files changed, 732 insertions(+), 1271 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml
index 54d33f77055..34ad6f3cbd0 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml
@@ -138,7 +138,7 @@ spec:
metadata:
type: object
metrics:
- description: Metrics contains thw controller metrics configuration
+ description: Metrics contains the controller metrics configuration
properties:
bindAddress:
description: BindAddress is the TCP address that the controller should
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod
index a07c7af6068..f7378473622 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.mod
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod
@@ -3,66 +3,66 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/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/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/swag v0.22.3 // 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/golang/protobuf v1.5.3 // 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/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
+ github.com/prometheus/procfs v0.9.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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.5.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.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.26.1 // indirect
- k8s.io/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/component-base v0.26.1 // indirect
- k8s.io/klog/v2 v2.80.1 // indirect
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
- k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ k8s.io/api v0.27.2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.90.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum
index 8cbf8ba6496..47fc076f513 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.sum
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum
@@ -1,58 +1,13 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
-cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
-cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
-cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
-cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
-cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
-cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
-cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
-cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
-cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
-cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
-cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
-cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
-cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
-cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
-cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
-cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
-cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
-cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
-cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
-cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
-cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
-cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
-cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
-cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
-cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
-cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
-cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
-dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
-github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
-github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
+github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -60,553 +15,257 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
-github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
-github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
-github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
-github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A=
-github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
-github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
-github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
-github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
-github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng=
-github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
+github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
+github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
+github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
+github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
+github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8=
+github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
+github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
+github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
-github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
-github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
-github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
-github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
-github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
-github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM=
-github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
+github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
+github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
+github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/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.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc=
-github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
+github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
-github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
-github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
+github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
-github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
-github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
-github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
-github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
-github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
-github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
-github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
+github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
+github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
+github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
+github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
+github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
-github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
-github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
-go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
-go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
-go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
+go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
+go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
-go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
-golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
-golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
-golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
-golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
-golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
-golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
-golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
-golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
-golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc=
-golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg=
-golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
+golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
-golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
-golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
-golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
-golang.org/x/text v0.5.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=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
-golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY=
-gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY=
-google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
-google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
-google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
-google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
+gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
+gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
-google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
-google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
-google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
-google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
-google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
-google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ=
-k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg=
-k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI=
-k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM=
-k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ=
-k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74=
-k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU=
-k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE=
-k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4=
-k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU=
-k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
-k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E=
-k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
-k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y=
-k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
-rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
-rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M=
-sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
-sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
-sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
+k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo=
+k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4=
+k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo=
+k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ=
+k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg=
+k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
+k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE=
+k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ=
+k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo=
+k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo=
+k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
+k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
+k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
+k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
+k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
+sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
+sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
+sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go
index 96b000d7751..909469c09c7 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go
@@ -27,6 +27,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// +kubebuilder:docs-gen:collapse=Go imports
@@ -116,25 +117,25 @@ validate anything on deletion.
var _ webhook.Validator = &CronJob{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *CronJob) ValidateCreate() error {
+func (r *CronJob) ValidateCreate() (admission.Warnings, error) {
cronjoblog.Info("validate create", "name", r.Name)
- return r.validateCronJob()
+ return nil, r.validateCronJob()
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *CronJob) ValidateUpdate(old runtime.Object) error {
+func (r *CronJob) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
cronjoblog.Info("validate update", "name", r.Name)
- return r.validateCronJob()
+ return nil, r.validateCronJob()
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *CronJob) ValidateDelete() error {
+func (r *CronJob) ValidateDelete() (admission.Warnings, error) {
cronjoblog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}
/*
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
index 0e905e15fdd..dc2dfc5220f 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
@@ -78,7 +78,7 @@ spec:
format: int32
type: integer
completionMode:
- description: "CompletionMode specifies how Pod completions
+ description: "completionMode specifies how Pod completions
are tracked. It can be `NonIndexed` (default) or `Indexed`.
\n `NonIndexed` means that the Job is considered complete
when there have been .spec.completions successfully completed
@@ -99,7 +99,7 @@ spec:
type: string
completions:
description: 'Specifies the desired number of successfully
- finished pods the job should be run with. Setting to nil
+ finished pods the job should be run with. Setting to null
means that the success of any pod signals the success of
all pods, and allows parallelism to have any positive value. Setting
to 1 means that parallelism is limited to 1 and the success
@@ -135,9 +135,8 @@ spec:
of failed pods, represented by the jobs's .status.failed
field, is incremented and it is checked against the backoffLimit.
This field cannot be used in combination with restartPolicy=OnFailure.
- \n This field is alpha-level. To use this field, you must
- enable the `JobPodFailurePolicy` feature gate (disabled
- by default)."
+ \n This field is beta-level. It can be used when the `JobPodFailurePolicy`
+ feature gate is enabled (enabled by default)."
properties:
rules:
description: A list of pod failure policy rules. The rules
@@ -150,13 +149,13 @@ spec:
items:
description: PodFailurePolicyRule describes how a pod
failure is handled when the requirements are met.
- One of OnExitCodes and onPodConditions, but not both,
+ One of onExitCodes and onPodConditions, but not both,
can be used in each rule.
properties:
action:
- description: 'Specifies the action taken on a pod
+ description: "Specifies the action taken on a pod
failure when the requirements are satisfied. Possible
- values are: - FailJob: indicates that the pod''s
+ values are: \n - FailJob: indicates that the pod's
job is marked as Failed and all running pods are
terminated. - Ignore: indicates that the counter
towards the .backoffLimit is not incremented and
@@ -165,7 +164,7 @@ spec:
counter towards the .backoffLimit is incremented.
Additional values are considered to be added in
the future. Clients should react to an unknown
- action by skipping the rule.'
+ action by skipping the rule."
type: string
onExitCodes:
description: Represents the requirement on the container
@@ -179,23 +178,23 @@ spec:
or initContainer names in the pod template.
type: string
operator:
- description: 'Represents the relationship between
+ description: "Represents the relationship between
the container exit code(s) and the specified
values. Containers completed with success
(exit code 0) are excluded from the requirement
- check. Possible values are: - In: the requirement
+ check. Possible values are: \n - In: the requirement
is satisfied if at least one container exit
code (might be multiple if there are multiple
- containers not restricted by the ''containerName''
+ containers not restricted by the 'containerName'
field) is in the set of specified values.
- NotIn: the requirement is satisfied if at
least one container exit code (might be multiple
if there are multiple containers not restricted
- by the ''containerName'' field) is not in
- the set of specified values. Additional values
+ by the 'containerName' field) is not in the
+ set of specified values. Additional values
are considered to be added in the future.
Clients should react to an unknown operator
- by assuming the requirement is not satisfied.'
+ by assuming the requirement is not satisfied."
type: string
values:
description: Specifies the set of values. Each
@@ -304,7 +303,7 @@ spec:
type: object
x-kubernetes-map-type: atomic
suspend:
- description: Suspend specifies whether the Job controller
+ description: suspend specifies whether the Job controller
should create Pods or not. If a Job is created with suspend
set to true, no Pods are created by the Job controller.
If a Job is suspended after creation (i.e. the flag goes
@@ -316,7 +315,8 @@ spec:
type: boolean
template:
description: 'Describes the pod that will be created when
- executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/'
+ executing a job. The only allowed template.spec.restartPolicy
+ values are "Never" or "OnFailure". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/'
properties:
metadata:
description: 'Standard object''s metadata. More info:
@@ -1669,7 +1669,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood
+ as the same header.
type: string
value:
description: The header field
@@ -1787,7 +1790,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood
+ as the same header.
type: string
value:
description: The header field
@@ -1879,9 +1885,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -1920,7 +1924,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -2115,9 +2122,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -2156,7 +2161,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -2256,6 +2264,29 @@ spec:
format: int32
type: integer
type: object
+ resizePolicy:
+ description: Resources resize policy for the
+ container.
+ items:
+ description: ContainerResizePolicy represents
+ resource resize policy for the container.
+ properties:
+ resourceName:
+ description: 'Name of the resource to
+ which this resource resize policy applies.
+ Supported values: cpu, memory.'
+ type: string
+ restartPolicy:
+ description: Restart policy to apply when
+ specified resource is resized. If not
+ specified, it defaults to NotRequired.
+ type: string
+ required:
+ - resourceName
+ - restartPolicy
+ type: object
+ type: array
+ x-kubernetes-list-type: atomic
resources:
description: 'Compute Resources required by
this container. Cannot be updated. More info:
@@ -2267,7 +2298,8 @@ spec:
that are used by this container. \n This
is an alpha field and requires enabling
the DynamicResourceAllocation feature
- gate. \n This field is immutable."
+ gate. \n This field is immutable. It can
+ only be set for containers."
items:
description: ResourceClaim references
one entry in PodSpec.ResourceClaims.
@@ -2309,7 +2341,8 @@ spec:
If Requests is omitted for a container,
it defaults to Limits if that is explicitly
specified, otherwise to an implementation-defined
- value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
+ value. Requests cannot exceed Limits.
+ More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
securityContext:
@@ -2562,9 +2595,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -2603,7 +2634,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -3189,7 +3223,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood
+ as the same header.
type: string
value:
description: The header field
@@ -3307,7 +3344,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood
+ as the same header.
type: string
value:
description: The header field
@@ -3398,9 +3438,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -3439,7 +3477,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -3624,9 +3665,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -3665,7 +3704,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -3765,6 +3807,29 @@ spec:
format: int32
type: integer
type: object
+ resizePolicy:
+ description: Resources resize policy for the
+ container.
+ items:
+ description: ContainerResizePolicy represents
+ resource resize policy for the container.
+ properties:
+ resourceName:
+ description: 'Name of the resource to
+ which this resource resize policy applies.
+ Supported values: cpu, memory.'
+ type: string
+ restartPolicy:
+ description: Restart policy to apply when
+ specified resource is resized. If not
+ specified, it defaults to NotRequired.
+ type: string
+ required:
+ - resourceName
+ - restartPolicy
+ type: object
+ type: array
+ x-kubernetes-list-type: atomic
resources:
description: Resources are not allowed for ephemeral
containers. Ephemeral containers use spare
@@ -3776,7 +3841,8 @@ spec:
that are used by this container. \n This
is an alpha field and requires enabling
the DynamicResourceAllocation feature
- gate. \n This field is immutable."
+ gate. \n This field is immutable. It can
+ only be set for containers."
items:
description: ResourceClaim references
one entry in PodSpec.ResourceClaims.
@@ -3818,7 +3884,8 @@ spec:
If Requests is omitted for a container,
it defaults to Limits if that is explicitly
specified, otherwise to an implementation-defined
- value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
+ value. Requests cannot exceed Limits.
+ More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
securityContext:
@@ -4062,9 +4129,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -4103,7 +4168,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -4728,7 +4796,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood
+ as the same header.
type: string
value:
description: The header field
@@ -4846,7 +4917,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood
+ as the same header.
type: string
value:
description: The header field
@@ -4938,9 +5012,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -4979,7 +5051,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -5174,9 +5249,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -5215,7 +5288,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -5315,6 +5391,29 @@ spec:
format: int32
type: integer
type: object
+ resizePolicy:
+ description: Resources resize policy for the
+ container.
+ items:
+ description: ContainerResizePolicy represents
+ resource resize policy for the container.
+ properties:
+ resourceName:
+ description: 'Name of the resource to
+ which this resource resize policy applies.
+ Supported values: cpu, memory.'
+ type: string
+ restartPolicy:
+ description: Restart policy to apply when
+ specified resource is resized. If not
+ specified, it defaults to NotRequired.
+ type: string
+ required:
+ - resourceName
+ - restartPolicy
+ type: object
+ type: array
+ x-kubernetes-list-type: atomic
resources:
description: 'Compute Resources required by
this container. Cannot be updated. More info:
@@ -5326,7 +5425,8 @@ spec:
that are used by this container. \n This
is an alpha field and requires enabling
the DynamicResourceAllocation feature
- gate. \n This field is immutable."
+ gate. \n This field is immutable. It can
+ only be set for containers."
items:
description: ResourceClaim references
one entry in PodSpec.ResourceClaims.
@@ -5368,7 +5468,8 @@ spec:
If Requests is omitted for a container,
it defaults to Limits if that is explicitly
specified, otherwise to an implementation-defined
- value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
+ value. Requests cannot exceed Limits.
+ More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
securityContext:
@@ -5621,9 +5722,7 @@ spec:
type: integer
grpc:
description: GRPC specifies an action involving
- a GRPC port. This is a beta field and
- requires enabling GRPCContainerProbe feature
- gate.
+ a GRPC port.
properties:
port:
description: Port number of the gRPC
@@ -5662,7 +5761,10 @@ spec:
properties:
name:
description: The header field
- name
+ name. This will be canonicalized
+ upon output, so case-variant
+ names will be understood as
+ the same header.
type: string
value:
description: The header field
@@ -6066,8 +6168,9 @@ spec:
x-kubernetes-list-type: map
restartPolicy:
description: 'Restart policy for all containers within
- the pod. One of Always, OnFailure, Never. Default
- to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy'
+ the pod. One of Always, OnFailure, Never. In some
+ contexts, only a subset of those values may be permitted.
+ Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy'
type: string
runtimeClassName:
description: 'RuntimeClassName refers to a RuntimeClass
@@ -6087,9 +6190,12 @@ spec:
schedulingGates:
description: "SchedulingGates is an opaque list of
values that if specified will block scheduling the
- pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness.
- \n This is an alpha-level feature enabled by PodSchedulingReadiness
- feature gate."
+ pod. If schedulingGates is not empty, the pod will
+ stay in the SchedulingGated state and the scheduler
+ will not attempt to schedule the pod. \n SchedulingGates
+ can only be set at pod creation time, and be removed
+ only afterwards. \n This is a beta feature enabled
+ by the PodSchedulingReadiness feature gate."
items:
description: PodSchedulingGate is associated to
a Pod to guard its scheduling.
@@ -6471,16 +6577,21 @@ spec:
type: object
x-kubernetes-map-type: atomic
matchLabelKeys:
- description: MatchLabelKeys is a set of pod
+ description: "MatchLabelKeys is a set of pod
label keys to select the pods over which spreading
will be calculated. The keys are used to lookup
values from the incoming pod labels, those
key-value labels are ANDed with labelSelector
to select the group of existing pods over
which spreading will be calculated for the
- incoming pod. Keys that don't exist in the
- incoming pod labels will be ignored. A null
- or empty list means only match against labelSelector.
+ incoming pod. The same key is forbidden to
+ exist in both MatchLabelKeys and LabelSelector.
+ MatchLabelKeys cannot be set when LabelSelector
+ isn't set. Keys that don't exist in the incoming
+ pod labels will be ignored. A null or empty
+ list means only match against labelSelector.
+ \n This is a beta field and requires the MatchLabelKeysInPodTopologySpread
+ feature gate to be enabled (enabled by default)."
items:
type: string
type: array
@@ -7086,7 +7197,7 @@ spec:
here and the sum of memory limits of all
containers in a pod. The default is nil
which means that the limit is undefined.
- More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
+ More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
@@ -7310,7 +7421,8 @@ spec:
and requires enabling the
DynamicResourceAllocation
feature gate. \n This field
- is immutable."
+ is immutable. It can only
+ be set for containers."
items:
description: ResourceClaim
references one entry in
@@ -7358,7 +7470,8 @@ spec:
it defaults to Limits if that
is explicitly specified, otherwise
to an implementation-defined
- value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
+ value. Requests cannot exceed
+ Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
selector:
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
index b654e02a30b..d1a6a71fbe1 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
@@ -3,69 +3,72 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.6.0
- github.com/onsi/gomega v1.24.1
- k8s.io/api v0.26.1
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
+ github.com/onsi/ginkgo/v2 v2.9.5
+ github.com/onsi/gomega v1.27.7
+ k8s.io/api v0.27.2
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/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/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
+ github.com/golang/protobuf v1.5.3 // 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/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
+ github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
+ github.com/prometheus/procfs v0.9.0 // indirect
github.com/robfig/cron v1.2.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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.5.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ golang.org/x/tools v0.9.1 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/component-base v0.26.1 // indirect
- k8s.io/klog/v2 v2.80.1 // indirect
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
- k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.90.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index 4c702bb0401..2f447cdbd84 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -1,58 +1,16 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
-cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
-cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
-cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
-cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
-cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
-cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
-cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
-cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
-cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
-cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
-cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
-cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
-cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
-cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
-cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
-cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
-cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
-cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
-cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
-cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
-cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
-cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
-cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
-cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
-cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
-cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
-cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
-dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
-github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
-github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
+github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -60,557 +18,268 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
-github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
-github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
-github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
-github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A=
-github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
-github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
-github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
-github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
-github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng=
-github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
+github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
+github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
+github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
+github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
+github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8=
+github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
+github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
+github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
-github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
-github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
-github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
+github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
-github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
-github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
-github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
-github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM=
-github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
+github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
+github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
+github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
+github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/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.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc=
-github.com/onsi/ginkgo/v2 v2.6.0/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/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
+github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
+github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
+github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
-github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
-github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
+github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
-github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
-github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
-github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
-github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
-github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
-github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
-github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
+github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
+github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
+github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
+github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
+github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
+github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
-github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
-github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
-go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
-go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
-go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
+go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
+go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
-go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI=
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
-golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
-golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
-golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
-golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
-golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
-golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
-golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
-golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
-golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10 h1:Frnccbp+ok2GkUS2tC84yAq/U9Vg+0sIO7aRL3T4Xnc=
-golang.org/x/net v0.3.1-0.20221206200815-1e63c2f08a10/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
+golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
+golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg=
-golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
+golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
-golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
-golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
-golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
+golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
-golang.org/x/text v0.5.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=
+golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
+golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
-golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
+golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY=
-gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY=
-google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
-google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
-google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
-google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
+gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
+gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
-google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
-google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
-google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
-google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
-google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
-google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ=
-k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg=
-k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI=
-k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM=
-k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ=
-k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74=
-k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU=
-k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE=
-k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4=
-k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU=
-k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
-k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E=
-k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
-k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y=
-k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
-rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
-rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M=
-sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
-sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
-sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
+k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo=
+k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4=
+k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo=
+k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ=
+k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg=
+k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
+k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE=
+k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ=
+k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo=
+k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo=
+k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
+k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
+k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
+k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
+k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
+sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
+sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
+sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
index ede73f11402..05c436784d0 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
@@ -95,7 +95,7 @@ var (
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 9ab732e1779..9a404a6fc2a 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -372,7 +372,7 @@ func updateWebhook(sp *Sample) {
*/`,
`
// +kubebuilder:docs-gen:collapse=Apache License`)
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by adding collapse", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
@@ -381,6 +381,7 @@ func updateWebhook(sp *Sample) {
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// log is for logging in this package.
@@ -394,27 +395,27 @@ func updateWebhook(sp *Sample) {
/*
Then, we set up the webhook with the manager.
*/`)
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by setting webhook with manager comment", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
`// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!`, WebhookMarker)
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by replacing TODO", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
`// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.`, "")
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by replace TODO to change verbs", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
`//+kubebuilder:webhook:path=/mutate-batch-tutorial-kubebuilder-io-v1-cronjob,mutating=true,failurePolicy=fail,sideEffects=None,groups=batch.tutorial.kubebuilder.io,resources=cronjobs,verbs=create;update,versions=v1,name=mcronjob.kb.io,admissionReviewVersions=v1`, "")
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by replacing marker", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
`//+kubebuilder:webhook:path=/validate-batch-tutorial-kubebuilder-io-v1-cronjob,mutating=false,failurePolicy=fail,sideEffects=None,groups=batch.tutorial.kubebuilder.io,resources=cronjobs,verbs=create;update,versions=v1,name=vcronjob.kb.io,admissionReviewVersions=v1`, "")
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go validate batch marker", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
@@ -422,43 +423,31 @@ Then, we set up the webhook with the manager.
// TODO(user): fill in your defaulting logic.
`, WebhookValidate)
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by adding logic", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
- `func (r *CronJob) ValidateCreate() error {
- cronjoblog.Info("validate create", "name", r.Name)
-
- // TODO(user): fill in your validation logic upon object creation.
- return nil
-}`, `func (r *CronJob) ValidateCreate() error {
- cronjoblog.Info("validate create", "name", r.Name)
-
- return r.validateCronJob()
-}`)
- CheckError("fixing cronjob_webhook.go", err)
+ `// TODO(user): fill in your validation logic upon object creation.
+ return nil, nil`,
+ `
+ return nil, r.validateCronJob()`)
+ CheckError("fixing cronjob_webhook.go by fill in your validation", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
- `func (r *CronJob) ValidateUpdate(old runtime.Object) error {
- cronjoblog.Info("validate update", "name", r.Name)
-
- // TODO(user): fill in your validation logic upon object update.
- return nil
-}`, `func (r *CronJob) ValidateUpdate(old runtime.Object) error {
- cronjoblog.Info("validate update", "name", r.Name)
-
- return r.validateCronJob()
-}`)
- CheckError("fixing cronjob_webhook.go", err)
+ `// TODO(user): fill in your validation logic upon object update.
+ return nil, nil`,
+ `
+ return nil, r.validateCronJob()`)
+ CheckError("fixing cronjob_webhook.go by adding validation logic upon object update", err)
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "api/v1/cronjob_webhook.go"),
- `func (r *CronJob) ValidateDelete() error {
+ `func (r *CronJob) ValidateDelete() (admission.Warnings, error) {
cronjoblog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}`, WebhookValidateSpec)
CheckError("fixing cronjob_webhook.go", err)
@@ -468,7 +457,7 @@ Then, we set up the webhook with the manager.
*/
}`, `validate anything on deletion.
*/`)
- CheckError("fixing cronjob_webhook.go", err)
+ CheckError("fixing cronjob_webhook.go by adding comments to validate on deletion", err)
}
func updateSuiteTest(sp *Sample) {
diff --git a/hack/docs/internal/cronjob-tutorial/webhook_implementation.go b/hack/docs/internal/cronjob-tutorial/webhook_implementation.go
index 8283021ae1e..c65171fefa4 100644
--- a/hack/docs/internal/cronjob-tutorial/webhook_implementation.go
+++ b/hack/docs/internal/cronjob-tutorial/webhook_implementation.go
@@ -26,6 +26,7 @@ const WebhookIntro = `import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// +kubebuilder:docs-gen:collapse=Go imports
diff --git a/pkg/plugin/util/util.go b/pkg/plugin/util/util.go
index 927ceb2d473..d4b34d5d616 100644
--- a/pkg/plugin/util/util.go
+++ b/pkg/plugin/util/util.go
@@ -164,7 +164,7 @@ func ImplementWebhooks(filename string) error {
str,
"// TODO(user): fill in your validation logic upon object creation.",
`if r.Spec.Count < 0 {
- return errors.New(".spec.count must >= 0")
+ return nil, errors.New(".spec.count must >= 0")
}`)
if err != nil {
return err
@@ -173,7 +173,7 @@ func ImplementWebhooks(filename string) error {
str,
"// TODO(user): fill in your validation logic upon object update.",
`if r.Spec.Count < 0 {
- return errors.New(".spec.count must >= 0")
+ return nil, errors.New(".spec.count must >= 0")
}`)
if err != nil {
return err
diff --git a/pkg/plugins/golang/declarative/v1/api.go b/pkg/plugins/golang/declarative/v1/api.go
index c4efdb42a99..5970595d688 100644
--- a/pkg/plugins/golang/declarative/v1/api.go
+++ b/pkg/plugins/golang/declarative/v1/api.go
@@ -19,6 +19,7 @@ package v1
import (
"errors"
"fmt"
+ goPluginV3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -31,8 +32,9 @@ import (
const (
// kbDeclarativePattern is the sigs.k8s.io/kubebuilder-declarative-pattern version
- kbDeclarativePatternForV2 = "v0.0.0-20200522144838-848d48e5b073"
- kbDeclarativePatternForV3V4 = "18dbaf5fcd851e6adc3f2f8a8facb669a1420797"
+ kbDeclarativePatternForV2 = "v0.0.0-20200522144838-848d48e5b073"
+ kbDeclarativePatternForV3 = "18dbaf5fcd851e6adc3f2f8a8facb669a1420797"
+ kbDeclarativePatternForV4 = "9a410556b95de526e12acfe0d6f56fd35c0b0135"
)
var _ plugin.CreateAPISubcommand = &createAPISubcommand{}
@@ -125,12 +127,16 @@ 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 := kbDeclarativePatternForV3V4
+ kbDeclarativePattern := kbDeclarativePatternForV4
for _, pluginKey := range p.config.GetPluginChain() {
if pluginKey == plugin.KeyFor(goPluginV2.Plugin{}) {
kbDeclarativePattern = kbDeclarativePatternForV2
break
}
+ if pluginKey == plugin.KeyFor(goPluginV3.Plugin{}) {
+ kbDeclarativePattern = kbDeclarativePatternForV3
+ break
+ }
}
err = util.RunCmd("Get declarative pattern", "go", "get",
"sigs.k8s.io/kubebuilder-declarative-pattern@"+kbDeclarativePattern)
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 23a1340b684..8687cf7c420 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
@@ -133,13 +133,13 @@ func (r *{{ .Resource.Kind }}Reconciler) SetupWithManager(mgr ctrl.Manager) erro
}
// Watch for changes to {{ .Resource.Kind }}
- err = c.Watch(&source.Kind{Type: &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{}}, &handler.EnqueueRequestForObject{})
+ err = c.Watch(source.Kind(mgr.GetCache(), &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{}), &handler.EnqueueRequestForObject{})
if err != nil {
return err
}
// Watch for changes to deployed objects
- _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
+ err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
if err != nil {
return err
}
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index d6c546cb4a4..0af667b17cf 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -34,7 +34,7 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.14.4"
+ ControllerRuntimeVersion = "v0.15.0"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.12.0"
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 bb9c26028f3..f55f039fa82 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
@@ -86,10 +86,12 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
{{- if .Resource.HasValidationWebhook }}
"k8s.io/apimachinery/pkg/runtime"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
{{- end }}
{{- if or .Resource.HasValidationWebhook .Resource.HasDefaultingWebhook }}
"sigs.k8s.io/controller-runtime/pkg/webhook"
{{- end }}
+
)
// log is for logging in this package.
@@ -126,27 +128,27 @@ func (r *{{ .Resource.Kind }}) Default() {
var _ webhook.Validator = &{{ .Resource.Kind }}{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *{{ .Resource.Kind }}) ValidateCreate() error {
+func (r *{{ .Resource.Kind }}) ValidateCreate() (admission.Warnings, error) {
{{ lower .Resource.Kind }}log.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
- return nil
+ return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *{{ .Resource.Kind }}) ValidateUpdate(old runtime.Object) error {
+func (r *{{ .Resource.Kind }}) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
{{ lower .Resource.Kind }}log.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
- return nil
+ return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *{{ .Resource.Kind }}) ValidateDelete() error {
+func (r *{{ .Resource.Kind }}) ValidateDelete() (admission.Warnings, error) {
{{ lower .Resource.Kind }}log.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil,nil
}
`
)
diff --git a/testdata/project-v4-declarative-v1/go.mod b/testdata/project-v4-declarative-v1/go.mod
index f4d5400ce07..b93d3bb786a 100644
--- a/testdata/project-v4-declarative-v1/go.mod
+++ b/testdata/project-v4-declarative-v1/go.mod
@@ -3,13 +3,13 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1
go 1.20
require (
- github.com/go-logr/logr v1.2.3
- github.com/onsi/ginkgo/v2 v2.6.0
- github.com/onsi/gomega v1.24.1
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
- sigs.k8s.io/kubebuilder-declarative-pattern v0.13.0-beta.1.0.20230113160225-18dbaf5fcd85
+ github.com/go-logr/logr v1.2.4
+ github.com/onsi/ginkgo/v2 v2.9.5
+ github.com/onsi/gomega v1.27.7
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
+ sigs.k8s.io/kubebuilder-declarative-pattern v0.13.0-beta.1.0.20230604223042-9a410556b95d
)
require (
@@ -17,10 +17,10 @@ require (
github.com/MakeNowJust/heredoc v1.0.0 // 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/cespare/xxhash/v2 v2.2.0 // 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.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.10.2 // 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
@@ -32,21 +32,23 @@ require (
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.0.0 // indirect
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.20.0 // indirect
- github.com/go-openapi/swag v0.19.14 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
+ github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
+ github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
+ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/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/imdario/mergo v0.3.15 // 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
@@ -54,22 +56,22 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
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 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // 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-20220808134915-39b0c02b01ae // indirect
+ github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // 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.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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.43.0 // indirect
+ github.com/prometheus/procfs v0.9.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.6.0 // indirect
@@ -81,31 +83,33 @@ require (
go.uber.org/multierr v1.6.0 // 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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ golang.org/x/tools v0.9.1 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.0 // 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.26.1 // indirect
- k8s.io/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/cli-runtime v0.26.0 // indirect
- k8s.io/component-base v0.26.1 // 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
+ k8s.io/api v0.27.2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/cli-runtime v0.26.3 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/kubectl v0.26.3 // indirect
+ k8s.io/utils v0.0.0-20230505201702-9f6742963106 // 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/json v0.0.0-20221116044647-bc3834ca7abd // indirect
+ sigs.k8s.io/kubebuilder-declarative-pattern/applylib v0.0.0-20230420203711-4abaa68e1923 // indirect
sigs.k8s.io/kustomize/api v0.12.1 // indirect
+ sigs.k8s.io/kustomize/kstatus v0.0.2-0.20200509233124-065f70705d4d // indirect
sigs.k8s.io/kustomize/kyaml v0.13.9 // 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-declarative-v1/internal/controller/admiral_controller.go b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
index b9a7f0fb350..126171a2a18 100644
--- a/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
@@ -74,13 +74,13 @@ func (r *AdmiralReconciler) SetupWithManager(mgr ctrl.Manager) error {
}
// Watch for changes to Admiral
- err = c.Watch(&source.Kind{Type: &crewv1.Admiral{}}, &handler.EnqueueRequestForObject{})
+ err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.Admiral{}), &handler.EnqueueRequestForObject{})
if err != nil {
return err
}
// Watch for changes to deployed objects
- _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
+ err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
if err != nil {
return err
}
diff --git a/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
index 81ec7726e1c..5de7552186b 100644
--- a/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
@@ -74,13 +74,13 @@ func (r *CaptainReconciler) SetupWithManager(mgr ctrl.Manager) error {
}
// Watch for changes to Captain
- err = c.Watch(&source.Kind{Type: &crewv1.Captain{}}, &handler.EnqueueRequestForObject{})
+ err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.Captain{}), &handler.EnqueueRequestForObject{})
if err != nil {
return err
}
// Watch for changes to deployed objects
- _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
+ err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
if err != nil {
return err
}
diff --git a/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
index 089c069f6ac..28d592cad9a 100644
--- a/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
@@ -74,13 +74,13 @@ func (r *FirstMateReconciler) SetupWithManager(mgr ctrl.Manager) error {
}
// Watch for changes to FirstMate
- err = c.Watch(&source.Kind{Type: &crewv1.FirstMate{}}, &handler.EnqueueRequestForObject{})
+ err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.FirstMate{}), &handler.EnqueueRequestForObject{})
if err != nil {
return err
}
// Watch for changes to deployed objects
- _, err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
+ err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
if err != nil {
return err
}
diff --git a/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
index 1c8837b5e90..7948f0387a6 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
@@ -21,6 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// log is for logging in this package.
@@ -51,25 +52,25 @@ func (r *Captain) Default() {
var _ webhook.Validator = &Captain{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *Captain) ValidateCreate() error {
+func (r *Captain) ValidateCreate() (admission.Warnings, error) {
captainlog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
- return nil
+ return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *Captain) ValidateUpdate(old runtime.Object) error {
+func (r *Captain) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
captainlog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
- return nil
+ return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *Captain) ValidateDelete() error {
+func (r *Captain) ValidateDelete() (admission.Warnings, error) {
captainlog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
index 9fa6bc245d5..030b6937640 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
@@ -21,6 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// log is for logging in this package.
@@ -40,25 +41,25 @@ func (r *Cruiser) SetupWebhookWithManager(mgr ctrl.Manager) error {
var _ webhook.Validator = &Cruiser{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *Cruiser) ValidateCreate() error {
+func (r *Cruiser) ValidateCreate() (admission.Warnings, error) {
cruiserlog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
- return nil
+ return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *Cruiser) ValidateUpdate(old runtime.Object) error {
+func (r *Cruiser) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
cruiserlog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
- return nil
+ return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *Cruiser) ValidateDelete() error {
+func (r *Cruiser) ValidateDelete() (admission.Warnings, error) {
cruiserlog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}
diff --git a/testdata/project-v4-multigroup/api/v1/lakers_webhook.go b/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
index 315982132a6..f1b3ac61a91 100644
--- a/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
+++ b/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
@@ -21,6 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// log is for logging in this package.
@@ -51,25 +52,25 @@ func (r *Lakers) Default() {
var _ webhook.Validator = &Lakers{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *Lakers) ValidateCreate() error {
+func (r *Lakers) ValidateCreate() (admission.Warnings, error) {
lakerslog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
- return nil
+ return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *Lakers) ValidateUpdate(old runtime.Object) error {
+func (r *Lakers) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
lakerslog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
- return nil
+ return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *Lakers) ValidateDelete() error {
+func (r *Lakers) ValidateDelete() (admission.Warnings, error) {
lakerslog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}
diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod
index 5ea8090e27f..214e2ac4fd2 100644
--- a/testdata/project-v4-multigroup/go.mod
+++ b/testdata/project-v4-multigroup/go.mod
@@ -3,68 +3,71 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.6.0
- github.com/onsi/gomega v1.24.1
- k8s.io/api v0.26.1
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
+ github.com/onsi/ginkgo/v2 v2.9.5
+ github.com/onsi/gomega v1.27.7
+ k8s.io/api v0.27.2
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/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/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
+ github.com/golang/protobuf v1.5.3 // 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/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
+ github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
+ github.com/prometheus/procfs v0.9.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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.5.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ golang.org/x/tools v0.9.1 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/component-base v0.26.1 // indirect
- k8s.io/klog/v2 v2.80.1 // indirect
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
- k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.90.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
index 603903bd821..87e7ecea478 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
index f729468fc7b..c598df71e0f 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
index 962e675558c..aa1a9b99674 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
index 8463b3d6aad..b8956d2cd8c 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
index a587227278f..ac6c10fe6dd 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
index 879bbfb6b2a..bfdeb6c10c7 100644
--- a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
index 7754fb657d5..f3b9462818f 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
index 13d1cc6d67e..3f63e3532c4 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
index 2217e1acd96..50ea249caf8 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
index 523e5c8a5af..6541a721136 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
index 6e02a70bcbe..9b051c99e3a 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *FrigateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
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 e59456d58c4..9dde8721abe 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
@@ -21,6 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// log is for logging in this package.
@@ -40,25 +41,25 @@ func (r *Memcached) SetupWebhookWithManager(mgr ctrl.Manager) error {
var _ webhook.Validator = &Memcached{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *Memcached) ValidateCreate() error {
+func (r *Memcached) ValidateCreate() (admission.Warnings, error) {
memcachedlog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
- return nil
+ return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *Memcached) ValidateUpdate(old runtime.Object) error {
+func (r *Memcached) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
memcachedlog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
- return nil
+ return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *Memcached) ValidateDelete() error {
+func (r *Memcached) ValidateDelete() (admission.Warnings, error) {
memcachedlog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}
diff --git a/testdata/project-v4-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod
index 1b5a236c42d..2b6851dc820 100644
--- a/testdata/project-v4-with-deploy-image/go.mod
+++ b/testdata/project-v4-with-deploy-image/go.mod
@@ -3,68 +3,71 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.6.0
- github.com/onsi/gomega v1.24.1
- k8s.io/api v0.26.1
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
+ github.com/onsi/ginkgo/v2 v2.9.5
+ github.com/onsi/gomega v1.27.7
+ k8s.io/api v0.27.2
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/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/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
+ github.com/golang/protobuf v1.5.3 // 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/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
+ github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
+ github.com/prometheus/procfs v0.9.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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.5.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ golang.org/x/tools v0.9.1 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/component-base v0.26.1 // indirect
- k8s.io/klog/v2 v2.80.1 // indirect
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
- k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.90.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index d9ebb1b8c7e..1299edd04b6 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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/internal/controller/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index f5a1bfe358e..18a1f9d43f5 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/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-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
index d88e1ae5f50..9e92684bf83 100644
--- a/testdata/project-v4-with-grafana/go.mod
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -3,66 +3,66 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
go 1.20
require (
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/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/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/swag v0.22.3 // 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/golang/protobuf v1.5.3 // 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/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
+ github.com/prometheus/procfs v0.9.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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.5.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.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.26.1 // indirect
- k8s.io/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/component-base v0.26.1 // indirect
- k8s.io/klog/v2 v2.80.1 // indirect
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
- k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ k8s.io/api v0.27.2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.90.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/testdata/project-v4/api/v1/captain_webhook.go b/testdata/project-v4/api/v1/captain_webhook.go
index 1c8837b5e90..7948f0387a6 100644
--- a/testdata/project-v4/api/v1/captain_webhook.go
+++ b/testdata/project-v4/api/v1/captain_webhook.go
@@ -21,6 +21,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)
// log is for logging in this package.
@@ -51,25 +52,25 @@ func (r *Captain) Default() {
var _ webhook.Validator = &Captain{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *Captain) ValidateCreate() error {
+func (r *Captain) ValidateCreate() (admission.Warnings, error) {
captainlog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
- return nil
+ return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *Captain) ValidateUpdate(old runtime.Object) error {
+func (r *Captain) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
captainlog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
- return nil
+ return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *Captain) ValidateDelete() error {
+func (r *Captain) ValidateDelete() (admission.Warnings, error) {
captainlog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
- return nil
+ return nil, nil
}
diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod
index c5af1efbb01..af7d863a445 100644
--- a/testdata/project-v4/go.mod
+++ b/testdata/project-v4/go.mod
@@ -3,68 +3,71 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.6.0
- github.com/onsi/gomega v1.24.1
- k8s.io/api v0.26.1
- k8s.io/apimachinery v0.26.1
- k8s.io/client-go v0.26.1
- sigs.k8s.io/controller-runtime v0.14.4
+ github.com/onsi/ginkgo/v2 v2.9.5
+ github.com/onsi/gomega v1.27.7
+ k8s.io/api v0.27.2
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ sigs.k8s.io/controller-runtime v0.15.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/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/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.2 // indirect
+ github.com/golang/protobuf v1.5.3 // 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/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
+ github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/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/prometheus/client_golang v1.15.1 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.42.0 // indirect
+ github.com/prometheus/procfs v0.9.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/net v0.10.0 // indirect
+ golang.org/x/oauth2 v0.5.0 // indirect
+ golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/term v0.8.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
+ golang.org/x/tools v0.9.1 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.28.1 // indirect
+ google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.26.1 // indirect
- k8s.io/component-base v0.26.1 // indirect
- k8s.io/klog/v2 v2.80.1 // indirect
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
- k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
+ k8s.io/apiextensions-apiserver v0.27.2 // indirect
+ k8s.io/component-base v0.27.2 // indirect
+ k8s.io/klog/v2 v2.90.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
+ k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/testdata/project-v4/internal/controller/admiral_controller.go b/testdata/project-v4/internal/controller/admiral_controller.go
index 2b0fab5c32e..5aecf4aa66d 100644
--- a/testdata/project-v4/internal/controller/admiral_controller.go
+++ b/testdata/project-v4/internal/controller/admiral_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/captain_controller.go b/testdata/project-v4/internal/controller/captain_controller.go
index 9b6fb4fa5d6..8d568e9127f 100644
--- a/testdata/project-v4/internal/controller/captain_controller.go
+++ b/testdata/project-v4/internal/controller/captain_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/firstmate_controller.go b/testdata/project-v4/internal/controller/firstmate_controller.go
index f7028bb5187..e5c602eb6d5 100644
--- a/testdata/project-v4/internal/controller/firstmate_controller.go
+++ b/testdata/project-v4/internal/controller/firstmate_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/laker_controller.go b/testdata/project-v4/internal/controller/laker_controller.go
index 86b009cc0b9..ff4d74dd2fb 100644
--- a/testdata/project-v4/internal/controller/laker_controller.go
+++ b/testdata/project-v4/internal/controller/laker_controller.go
@@ -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.14.4/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
From 235d1e1b66b0d26fb21d28922d5021f793972742 Mon Sep 17 00:00:00 2001
From: Eileen
Date: Thu, 1 Jun 2023 18:32:51 -0400
Subject: [PATCH 0214/1245] feat: make external plugin path configurable
Co-authored-by: Bryce Palmer
---
go.mod | 2 +
go.sum | 6 ++
pkg/cli/options.go | 21 ++++-
pkg/cli/options_test.go | 198 +++++++++++++++++++++++++++++++++++-----
4 files changed, 200 insertions(+), 27 deletions(-)
diff --git a/go.mod b/go.mod
index bd72ac9ec60..09aad87a280 100644
--- a/go.mod
+++ b/go.mod
@@ -18,6 +18,7 @@ require (
require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
+ github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -26,6 +27,7 @@ require (
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
+ google.golang.org/protobuf v1.28.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 67ecd916bb7..9314541a5a3 100644
--- a/go.sum
+++ b/go.sum
@@ -91,7 +91,9 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -103,6 +105,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@@ -471,7 +474,10 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
+google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
diff --git a/pkg/cli/options.go b/pkg/cli/options.go
index 9ae3ac3c7fb..a720239eda3 100644
--- a/pkg/cli/options.go
+++ b/pkg/cli/options.go
@@ -181,13 +181,29 @@ func isHostSupported(host string) bool {
return false
}
-// getPluginsRoot detects the host system and gets the plugins root based on the host.
+// getPluginsRoot gets the plugin root path.
func getPluginsRoot(host string) (pluginsRoot string, err error) {
if !isHostSupported(host) {
// freebsd, openbsd, windows...
return "", fmt.Errorf("host not supported: %v", host)
}
+ // if user provides specific path, return
+ if pluginsPath := os.Getenv("EXTERNAL_PLUGINS_PATH"); pluginsPath != "" {
+ // verify if the path actually exists
+ if _, err := os.Stat(pluginsPath); err != nil {
+ if os.IsNotExist(err) {
+ // the path does not exist
+ return "", fmt.Errorf("the specified path %s does not exist", pluginsPath)
+ }
+ // some other error
+ return "", fmt.Errorf("error checking the path: %v", err)
+ }
+ // the path exists
+ return pluginsPath, nil
+ }
+
+ // if no specific path, detects the host system and gets the plugins root based on the host.
pluginsRelativePath := filepath.Join("kubebuilder", "plugins")
if xdgHome := os.Getenv("XDG_CONFIG_HOME"); xdgHome != "" {
return filepath.Join(xdgHome, pluginsRelativePath), nil
@@ -206,9 +222,8 @@ func getPluginsRoot(host string) (pluginsRoot string, err error) {
if err != nil {
return "", fmt.Errorf("error retrieving home dir: %v", err)
}
- pluginsRoot = filepath.Join(userHomeDir, pluginsRoot)
- return
+ return filepath.Join(userHomeDir, pluginsRoot), nil
}
// DiscoverExternalPlugins discovers the external plugins in the plugins root directory
diff --git a/pkg/cli/options_test.go b/pkg/cli/options_test.go
index 71974831005..ee6f70b9a55 100644
--- a/pkg/cli/options_test.go
+++ b/pkg/cli/options_test.go
@@ -18,6 +18,7 @@ package cli
import (
"errors"
+ "fmt"
"os"
"path/filepath"
"runtime"
@@ -34,6 +35,179 @@ import (
)
var _ = Describe("Discover external plugins", func() {
+ Context("with valid plugins root path", func() {
+ var (
+ homePath string = os.Getenv("HOME")
+ customPath string = "/tmp/myplugins"
+ // store user's original EXTERNAL_PLUGINS_PATH
+ originalPluginPath string
+ xdghome string
+ // store user's original XDG_CONFIG_HOME
+ originalXdghome string
+ )
+
+ When("XDG_CONFIG_HOME is not set and using the $HOME environment variable", func() {
+ // store and unset the XDG_CONFIG_HOME
+ BeforeEach(func() {
+ originalXdghome = os.Getenv("XDG_CONFIG_HOME")
+ err := os.Unsetenv("XDG_CONFIG_HOME")
+ Expect(err).To(BeNil())
+ })
+
+ AfterEach(func() {
+ if originalXdghome != "" {
+ // restore the original value
+ err := os.Setenv("XDG_CONFIG_HOME", originalXdghome)
+ Expect(err).To(BeNil())
+ }
+ })
+
+ It("should return the correct path for the darwin OS", func() {
+ plgPath, err := getPluginsRoot("darwin")
+ Expect(err).To(BeNil())
+ Expect(plgPath).To(Equal(fmt.Sprintf("%s/Library/Application Support/kubebuilder/plugins", homePath)))
+ })
+
+ It("should return the correct path for the linux OS", func() {
+ plgPath, err := getPluginsRoot("linux")
+ Expect(err).To(BeNil())
+ Expect(plgPath).To(Equal(fmt.Sprintf("%s/.config/kubebuilder/plugins", homePath)))
+ })
+
+ It("should return error when the host is not darwin / linux", func() {
+ plgPath, err := getPluginsRoot("random")
+ Expect(plgPath).To(Equal(""))
+ Expect(err).ToNot(BeNil())
+ Expect(err.Error()).To(ContainSubstring("host not supported"))
+ })
+ })
+
+ When("XDG_CONFIG_HOME is set", func() {
+ BeforeEach(func() {
+ // store and set the XDG_CONFIG_HOME
+ originalXdghome = os.Getenv("XDG_CONFIG_HOME")
+ err := os.Setenv("XDG_CONFIG_HOME", fmt.Sprintf("%s/.config", homePath))
+ Expect(err).To(BeNil())
+
+ xdghome = os.Getenv("XDG_CONFIG_HOME")
+ })
+
+ AfterEach(func() {
+ if originalXdghome != "" {
+ // restore the original value
+ err := os.Setenv("XDG_CONFIG_HOME", originalXdghome)
+ Expect(err).To(BeNil())
+ } else {
+ // unset if it was originally unset
+ err := os.Unsetenv("XDG_CONFIG_HOME")
+ Expect(err).To(BeNil())
+ }
+ })
+
+ It("should return the correct path for the darwin OS", func() {
+ plgPath, err := getPluginsRoot("darwin")
+ Expect(err).To(BeNil())
+ Expect(plgPath).To(Equal(fmt.Sprintf("%s/kubebuilder/plugins", xdghome)))
+ })
+
+ It("should return the correct path for the linux OS", func() {
+ plgPath, err := getPluginsRoot("linux")
+ Expect(err).To(BeNil())
+ Expect(plgPath).To(Equal(fmt.Sprintf("%s/kubebuilder/plugins", xdghome)))
+ })
+
+ It("should return error when the host is not darwin / linux", func() {
+ plgPath, err := getPluginsRoot("random")
+ Expect(plgPath).To(Equal(""))
+ Expect(err).ToNot(BeNil())
+ Expect(err.Error()).To(ContainSubstring("host not supported"))
+ })
+ })
+
+ When("using the custom path", func() {
+ BeforeEach(func() {
+ err := os.MkdirAll(customPath, 0750)
+ Expect(err).To(BeNil())
+
+ // store and set the EXTERNAL_PLUGINS_PATH
+ originalPluginPath = os.Getenv("EXTERNAL_PLUGINS_PATH")
+ err = os.Setenv("EXTERNAL_PLUGINS_PATH", customPath)
+ Expect(err).To(BeNil())
+ })
+
+ AfterEach(func() {
+ if originalPluginPath != "" {
+ // restore the original value
+ err := os.Setenv("EXTERNAL_PLUGINS_PATH", originalPluginPath)
+ Expect(err).To(BeNil())
+ } else {
+ // unset if it was originally unset
+ err := os.Unsetenv("EXTERNAL_PLUGINS_PATH")
+ Expect(err).To(BeNil())
+ }
+ })
+
+ It("should return the user given path for darwin OS", func() {
+ plgPath, err := getPluginsRoot("darwin")
+ Expect(plgPath).To(Equal(customPath))
+ Expect(err).To(BeNil())
+ })
+
+ It("should return the user given path for linux OS", func() {
+ plgPath, err := getPluginsRoot("linux")
+ Expect(plgPath).To(Equal(customPath))
+ Expect(err).To(BeNil())
+ })
+
+ It("should report error when the host is not darwin / linux", func() {
+ plgPath, err := getPluginsRoot("random")
+ Expect(plgPath).To(Equal(""))
+ Expect(err).ToNot(BeNil())
+ Expect(err.Error()).To(ContainSubstring("host not supported"))
+ })
+ })
+ })
+
+ Context("with invalid plugins root path", func() {
+ var originalPluginPath string
+
+ BeforeEach(func() {
+ originalPluginPath = os.Getenv("EXTERNAL_PLUGINS_PATH")
+ err := os.Setenv("EXTERNAL_PLUGINS_PATH", "/non/existent/path")
+ Expect(err).To(BeNil())
+ })
+
+ AfterEach(func() {
+ if originalPluginPath != "" {
+ // restore the original value
+ err := os.Setenv("EXTERNAL_PLUGINS_PATH", originalPluginPath)
+ Expect(err).To(BeNil())
+ } else {
+ // unset if it was originally unset
+ err := os.Unsetenv("EXTERNAL_PLUGINS_PATH")
+ Expect(err).To(BeNil())
+ }
+ })
+
+ It("should return an error for the darwin OS", func() {
+ plgPath, err := getPluginsRoot("darwin")
+ Expect(err).ToNot(BeNil())
+ Expect(plgPath).To(Equal(""))
+ })
+
+ It("should return an error for the linux OS", func() {
+ plgPath, err := getPluginsRoot("linux")
+ Expect(err).ToNot(BeNil())
+ Expect(plgPath).To(Equal(""))
+ })
+
+ It("should return an error when the host is not darwin / linux", func() {
+ plgPath, err := getPluginsRoot("random")
+ Expect(err).ToNot(BeNil())
+ Expect(plgPath).To(Equal(""))
+ })
+ })
+
Context("when plugin executables exist in the expected plugin directories", func() {
const (
filePermissions os.FileMode = 755
@@ -219,18 +393,6 @@ var _ = Describe("Discover external plugins", func() {
Expect(err).To(Equal(errPluginsRoot))
})
- It("should fail for any other host that is not supported", func() {
- _, err := getPluginsRoot("darwin")
- Expect(err).To(BeNil())
-
- _, err = getPluginsRoot("linux")
- Expect(err).To(BeNil())
-
- _, err = getPluginsRoot("random")
- Expect(err).ToNot(BeNil())
- Expect(err.Error()).To(ContainSubstring("host not supported"))
- })
-
It("should skip parsing of directories if plugins root is not a directory", func() {
retrievePluginsRoot = func(host string) (string, error) {
return "externalplugin.sh", nil
@@ -240,18 +402,6 @@ var _ = Describe("Discover external plugins", func() {
Expect(err).To(BeNil())
})
- It("should fail for any other host that is not supported", func() {
- _, err := getPluginsRoot("darwin")
- Expect(err).To(BeNil())
-
- _, err = getPluginsRoot("linux")
- Expect(err).To(BeNil())
-
- _, err = getPluginsRoot("random")
- Expect(err).ToNot(BeNil())
- Expect(err.Error()).To(ContainSubstring("host not supported"))
- })
-
It("should return full path to the external plugins without XDG_CONFIG_HOME", func() {
if _, ok := os.LookupEnv("XDG_CONFIG_HOME"); ok {
err = os.Setenv("XDG_CONFIG_HOME", "")
From b1b087e483988dee574c14bb990d5fe8949b3d0a Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Tue, 20 Jun 2023 08:48:32 +0100
Subject: [PATCH 0215/1245] :seedling: fix ci testdata gets outdated because go
version and remove job to open PR
---
.github/workflows/apidiff.yml | 9 ---------
.github/workflows/lint.yml | 9 ---------
.github/workflows/testdata.yml | 9 ---------
.github/workflows/unit-tests-legacy.yml | 9 ---------
.github/workflows/unit-tests.yml | 9 ---------
docs/book/src/cronjob-tutorial/testdata/project/go.sum | 4 ++++
go.mod | 2 --
go.sum | 6 ------
pkg/plugins/golang/declarative/v1/api.go | 1 +
9 files changed, 5 insertions(+), 53 deletions(-)
diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml
index 9fb2ec977d9..bc7ab234085 100644
--- a/.github/workflows/apidiff.yml
+++ b/.github/workflows/apidiff.yml
@@ -25,12 +25,3 @@ jobs:
with:
compare-imports: true
print-compatible: true
- - name: Report failure
- uses: nashmaniac/create-issue-action@v1.1
- # Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
- if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
- with:
- title: 🐛 go-apidiff failed for ${{ github.sha }}
- token: ${{ secrets.GITHUB_TOKEN }}
- labels: kind/bug
- body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index e0e10f94398..b4276d63d91 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -23,15 +23,6 @@ jobs:
with:
version: v1.51
only-new-issues: true # Show only new issues if it's a pull request
- - name: Report failure
- uses: nashmaniac/create-issue-action@v1.1
- # Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
- if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
- with:
- title: 🐛 Lint failed for ${{ github.sha }}
- token: ${{ secrets.GITHUB_TOKEN }}
- labels: kind/bug
- body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
yamllint:
runs-on: ubuntu-latest
diff --git a/.github/workflows/testdata.yml b/.github/workflows/testdata.yml
index cfdf47689a8..a9873c867a2 100644
--- a/.github/workflows/testdata.yml
+++ b/.github/workflows/testdata.yml
@@ -27,12 +27,3 @@ jobs:
run: make check-testdata
- name: Verify docs update
run: make check-docs
- - name: Report failure
- uses: nashmaniac/create-issue-action@v1.1
- # Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
- if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
- with:
- title: 🐛 Testadata verification failed for ${{ github.sha }}
- token: ${{ secrets.GITHUB_TOKEN }}
- labels: kind/bug
- body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/.github/workflows/unit-tests-legacy.yml b/.github/workflows/unit-tests-legacy.yml
index 1de7b9e4745..ca2a4751174 100644
--- a/.github/workflows/unit-tests-legacy.yml
+++ b/.github/workflows/unit-tests-legacy.yml
@@ -30,12 +30,3 @@ jobs:
run: sudo rm -f /usr/local/bin/kustomize
- name: Perform the test
run: make test-legacy
- - name: Report failure
- uses: nashmaniac/create-issue-action@v1.1
- # Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
- if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
- with:
- title: 🐛 Unit tests failed on ${{ matrix.os }} for ${{ github.sha }}
- token: ${{ secrets.GITHUB_TOKEN }}
- labels: kind/bug
- body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index bdb6b535ef9..cf6c3789aa0 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -59,12 +59,3 @@ jobs:
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage-all.out
- - name: Report failure
- uses: nashmaniac/create-issue-action@v1.1
- # Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
- if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
- with:
- title: 🐛 Coverage report failed for ${{ github.sha }}
- token: ${{ secrets.GITHUB_TOKEN }}
- labels: kind/bug
- body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index 2f447cdbd84..da86b48f019 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -25,6 +25,7 @@ github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJ
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
+github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -79,8 +80,10 @@ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
+github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
+github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -102,6 +105,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
diff --git a/go.mod b/go.mod
index 09aad87a280..bd72ac9ec60 100644
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,6 @@ require (
require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
- github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -27,7 +26,6 @@ require (
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
- google.golang.org/protobuf v1.28.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 9314541a5a3..67ecd916bb7 100644
--- a/go.sum
+++ b/go.sum
@@ -91,9 +91,7 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -105,7 +103,6 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@@ -474,10 +471,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
-google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
diff --git a/pkg/plugins/golang/declarative/v1/api.go b/pkg/plugins/golang/declarative/v1/api.go
index 5970595d688..ee70095da32 100644
--- a/pkg/plugins/golang/declarative/v1/api.go
+++ b/pkg/plugins/golang/declarative/v1/api.go
@@ -19,6 +19,7 @@ package v1
import (
"errors"
"fmt"
+
goPluginV3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
From cb19df6011ceef443ae9c6ed8adaf7e4e73cc3ae Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 20 Jun 2023 08:25:00 +0000
Subject: [PATCH 0216/1245] :seedling: Bump nashmaniac/create-issue-action from
1.1 to 1.2
Bumps [nashmaniac/create-issue-action](https://github.com/nashmaniac/create-issue-action) from 1.1 to 1.2.
- [Release notes](https://github.com/nashmaniac/create-issue-action/releases)
- [Commits](https://github.com/nashmaniac/create-issue-action/compare/v1.1...v1.2)
---
updated-dependencies:
- dependency-name: nashmaniac/create-issue-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.github/workflows/unit-tests.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index cf6c3789aa0..a6b88c4f1dc 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -30,7 +30,7 @@ jobs:
- name: Perform the test
run: make test
- name: Report failure
- uses: nashmaniac/create-issue-action@v1.1
+ uses: nashmaniac/create-issue-action@v1.2
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
with:
From 06d4e8c534009da38cd8e7c2af28a5c5e6ae05d3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 20 Jun 2023 08:25:05 +0000
Subject: [PATCH 0217/1245] build(deps): bump golang.org/x/tools from 0.9.3 to
0.10.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.9.3 to 0.10.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.9.3...v0.10.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 8 ++++----
go.sum | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/go.mod b/go.mod
index bd72ac9ec60..b8f4db8660a 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.10.0
- golang.org/x/tools v0.9.3
+ golang.org/x/tools v0.10.0
sigs.k8s.io/yaml v1.3.0
)
@@ -23,9 +23,9 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
- golang.org/x/mod v0.10.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/mod v0.11.0 // indirect
+ golang.org/x/net v0.11.0 // indirect
+ golang.org/x/sys v0.9.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 67ecd916bb7..8b6dc564185 100644
--- a/go.sum
+++ b/go.sum
@@ -222,8 +222,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
-golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
+golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -256,8 +256,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
-golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
+golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
+golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
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=
@@ -277,7 +277,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
+golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -314,8 +314,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
-golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
+golang.org/x/sys v0.9.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=
@@ -377,8 +377,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.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
-golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
+golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
+golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
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=
From d6c796aa4805579c7968b314a25e9272dd113dfa Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 20 Jun 2023 09:07:13 +0000
Subject: [PATCH 0218/1245] build(deps): bump github.com/onsi/ginkgo/v2 from
2.10.0 to 2.11.0
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.10.0...v2.11.0)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index b8f4db8660a..8c8194ce535 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.10.0
+ github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.9.5
diff --git a/go.sum b/go.sum
index 8b6dc564185..4dfe90a2d63 100644
--- a/go.sum
+++ b/go.sum
@@ -142,8 +142,8 @@ 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.10.0 h1:sfUl4qgLdvkChZrWCYndY2EAu9BRIw1YphNAzy1VNWs=
-github.com/onsi/ginkgo/v2 v2.10.0/go.mod h1:UDQOh5wbQUlMnkLfVaIUMtQ1Vus92oM+P2JX1aulgcE=
+github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
+github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc=
github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
From 75d3f3ebc31f7e05582212e0da18e49f00b32ac3 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Tue, 20 Jun 2023 13:07:33 +0100
Subject: [PATCH 0219/1245] (kustomize/v2) - deprecate component-config flag
---
pkg/machinery/interfaces.go | 8 ++++++++
pkg/machinery/mixins.go | 8 ++++++++
pkg/plugins/common/kustomize/v2/init.go | 5 +++++
3 files changed, 21 insertions(+)
diff --git a/pkg/machinery/interfaces.go b/pkg/machinery/interfaces.go
index 8e285339119..cf28d9c8fb6 100644
--- a/pkg/machinery/interfaces.go
+++ b/pkg/machinery/interfaces.go
@@ -83,6 +83,14 @@ type HasMultiGroup interface {
InjectMultiGroup(bool)
}
+// Deprecated: The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0.
+// Fur further information see: https://github.com/kubernetes-sigs/controller-runtime/issues/895
+// Moreover, it has undergone breaking changes and is no longer functioning as intended.
+// As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
+// no longer guaranteeing its functionality from version 3.11.0 onwards.
+//
+// Please, be aware that it will force Kubebuilder remove this option soon in future release.
+//
// HasComponentConfig allows the component-config flag to be used on a template
type HasComponentConfig interface {
// InjectComponentConfig sets the template component-config flag
diff --git a/pkg/machinery/mixins.go b/pkg/machinery/mixins.go
index 1b38f8da4c8..a4045f56e52 100644
--- a/pkg/machinery/mixins.go
+++ b/pkg/machinery/mixins.go
@@ -129,6 +129,14 @@ func (m *MultiGroupMixin) InjectMultiGroup(flag bool) {
m.MultiGroup = flag
}
+// Deprecated: The ComponentConfig has been deprecated in the Controller-Runtime since its version 0.15.0.
+// Fur further information see: https://github.com/kubernetes-sigs/controller-runtime/issues/895
+// Moreover, it has undergone breaking changes and is no longer functioning as intended.
+// As a result, Kubebuilder, which heavily relies on the Controller Runtime, has also deprecated this feature,
+// no longer guaranteeing its functionality from version 3.11.0 onwards.
+//
+// Please, be aware that it will force Kubebuilder remove this option soon in future release.
+//
// ComponentConfigMixin provides templates with a injectable component-config flag field
type ComponentConfigMixin struct {
// ComponentConfig is the component-config flag
diff --git a/pkg/plugins/common/kustomize/v2/init.go b/pkg/plugins/common/kustomize/v2/init.go
index 2d40b4dcd50..fbe022ce016 100644
--- a/pkg/plugins/common/kustomize/v2/init.go
+++ b/pkg/plugins/common/kustomize/v2/init.go
@@ -62,6 +62,11 @@ func (p *initSubcommand) BindFlags(fs *pflag.FlagSet) {
fs.StringVar(&p.name, "project-name", "", "name of this project")
fs.BoolVar(&p.componentConfig, "component-config", false,
"create a versioned ComponentConfig file, may be 'true' or 'false'")
+ _ = fs.MarkDeprecated("component-config", "the ComponentConfig has been deprecated in the "+
+ "Controller-Runtime since its version 0.15.0. Moreover, it has undergone breaking changes and is no longer "+
+ "functioning as intended. As a result, this tool, which heavily relies on the Controller Runtime, "+
+ "has also deprecated this feature, no longer guaranteeing its functionality from version 3.11.0 onwards. "+
+ "You can find additional details on https://github.com/kubernetes-sigs/controller-runtime/issues/895.")
}
func (p *initSubcommand) InjectConfig(c config.Config) error {
From f7d980d4c0226ff5a28ff8542db909d664c0cc83 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Tue, 20 Jun 2023 13:17:04 +0100
Subject: [PATCH 0220/1245] Adding checks to e2e tests to verify make manifest
and generate command
---
test/e2e/deployimage/plugin_cluster_test.go | 12 ++++++++----
test/e2e/v4/plugin_cluster_test.go | 8 ++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/test/e2e/deployimage/plugin_cluster_test.go b/test/e2e/deployimage/plugin_cluster_test.go
index e7630106dc4..9ab26fffddb 100644
--- a/test/e2e/deployimage/plugin_cluster_test.go
+++ b/test/e2e/deployimage/plugin_cluster_test.go
@@ -159,14 +159,18 @@ func Run(kbc *utils.TestContext) {
err = kbc.Tidy()
ExpectWithOffset(1, err).NotTo(HaveOccurred())
- By("run make all")
- err = kbc.Make("all")
- ExpectWithOffset(1, err).NotTo(HaveOccurred())
-
By("run make manifests")
err = kbc.Make("manifests")
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("run make generate")
+ err = kbc.Make("generate")
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("run make all")
+ err = kbc.Make("all")
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("run make install")
err = kbc.Make("install")
ExpectWithOffset(1, err).NotTo(HaveOccurred())
diff --git a/test/e2e/v4/plugin_cluster_test.go b/test/e2e/v4/plugin_cluster_test.go
index 3f7b7b4980a..65679b6a9b7 100644
--- a/test/e2e/v4/plugin_cluster_test.go
+++ b/test/e2e/v4/plugin_cluster_test.go
@@ -107,6 +107,14 @@ func Run(kbc *utils.TestContext) {
err = kbc.Tidy()
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("run make manifests")
+ err = kbc.Make("manifests")
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("run make generate")
+ err = kbc.Make("generate")
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("building the controller image")
err = kbc.Make("docker-build", "IMG="+kbc.ImageName)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
From 90c3b1b74e6971d183c4dc2cabc92f39dd224364 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sun, 23 Apr 2023 18:07:28 +0100
Subject: [PATCH 0221/1245] :bug: fix scaffold to allow run the tests directly
---
.../project/api/v1/webhook_suite_test.go | 14 +++++++++--
.../project/internal/controller/suite_test.go | 10 ++++++++
.../cronjob-tutorial/generate_cronjob.go | 7 +-----
pkg/plugins/golang/v4/scaffolds/api.go | 2 +-
pkg/plugins/golang/v4/scaffolds/init.go | 2 ++
.../templates/api/webhook_suitetest.go | 23 ++++++++++++++++---
.../controllers/controller_suitetest.go | 14 +++++++++++
pkg/plugins/golang/v4/scaffolds/webhook.go | 2 +-
.../internal/controller/suite_test.go | 10 ++++++++
.../api/crew/v1/webhook_suite_test.go | 14 +++++++++--
.../api/ship/v1/webhook_suite_test.go | 14 +++++++++--
.../api/ship/v2alpha1/webhook_suite_test.go | 14 +++++++++--
.../api/v1/webhook_suite_test.go | 14 +++++++++--
.../internal/controller/apps/suite_test.go | 10 ++++++++
.../internal/controller/crew/suite_test.go | 10 ++++++++
.../internal/controller/fiz/suite_test.go | 10 ++++++++
.../controller/foo.policy/suite_test.go | 10 ++++++++
.../internal/controller/foo/suite_test.go | 10 ++++++++
.../controller/sea-creatures/suite_test.go | 10 ++++++++
.../internal/controller/ship/suite_test.go | 10 ++++++++
.../internal/controller/suite_test.go | 10 ++++++++
.../api/v1alpha1/webhook_suite_test.go | 14 +++++++++--
.../internal/controller/suite_test.go | 10 ++++++++
.../project-v4/api/v1/webhook_suite_test.go | 14 +++++++++--
.../internal/controller/suite_test.go | 10 ++++++++
25 files changed, 243 insertions(+), 25 deletions(-)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
index 9abf343fbdb..c9e327b5c17 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
index 2eb2582ea36..a9267ddd5ef 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
@@ -27,7 +27,9 @@ package controller
import (
"context"
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
ctrl "sigs.k8s.io/controller-runtime"
@@ -81,6 +83,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
/*
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 9a404a6fc2a..23dc123660f 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -477,7 +477,6 @@ func updateSuiteTest(sp *Sample) {
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`
- "path/filepath"
"testing"
`, `
ctrl "sigs.k8s.io/controller-runtime"
@@ -502,11 +501,7 @@ var testEnv *envtest.Environment
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
- `
- By("bootstrapping test environment")
- testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
- ErrorIfCRDPathMissing: true,
+ `, runtime.GOOS, runtime.GOARCH)),
}
`, `
/*
diff --git a/pkg/plugins/golang/v4/scaffolds/api.go b/pkg/plugins/golang/v4/scaffolds/api.go
index 6184e81419e..5f1e9d67b57 100755
--- a/pkg/plugins/golang/v4/scaffolds/api.go
+++ b/pkg/plugins/golang/v4/scaffolds/api.go
@@ -101,7 +101,7 @@ func (s *apiScaffolder) Scaffold() error {
if doController {
if err := scaffold.Execute(
- &controllers.SuiteTest{Force: s.force},
+ &controllers.SuiteTest{Force: s.force, K8SVersion: EnvtestK8SVersion},
&controllers.Controller{ControllerRuntimeVersion: ControllerRuntimeVersion, Force: s.force},
); err != nil {
return fmt.Errorf("error scaffolding controller: %v", err)
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index 0af667b17cf..f4348f6d2ac 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -37,6 +37,8 @@ const (
ControllerRuntimeVersion = "v0.15.0"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.12.0"
+ // EnvtestK8SVersion is the k8s version used to do the scaffold
+ EnvtestK8SVersion = "1.27.1"
imageName = "controller:latest"
)
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 22fd41479ad..45ecb9011a2 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
@@ -36,6 +36,10 @@ type WebhookSuite struct { //nolint:maligned
// todo: currently is not possible to know if an API was or not scaffolded. We can fix it when #1826 be addressed
WireResource bool
+ // K8SVersion define the k8s version used to do the scaffold
+ // so that is possible retrieve the binaries
+ K8SVersion string
+
// BaseDirectoryRelativePath define the Path for the base directory when it is multigroup
BaseDirectoryRelativePath string
}
@@ -133,16 +137,20 @@ package {{ .Resource.Version }}
import (
"context"
+ "crypto/tls"
+ "fmt"
+ "net"
"path/filepath"
"testing"
- "fmt"
+ "time"
+ "runtime"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
%s
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
@@ -174,6 +182,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join({{ .BaseDirectoryRelativePath }}, "config", "crd", "bases")},
ErrorIfCRDPathMissing: {{ .WireResource }},
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join({{ .BaseDirectoryRelativePath }}, "bin", "k8s",
+ fmt.Sprintf("{{ .K8SVersion }}-%%s-%%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join({{ .BaseDirectoryRelativePath }}, "config", "webhook")},
},
@@ -185,7 +202,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
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 e5f77b2115e..9315ff334c8 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
@@ -34,6 +34,10 @@ type SuiteTest struct {
machinery.BoilerplateMixin
machinery.ResourceMixin
+ // K8SVersion define the k8s version used to do the scaffold
+ // so that is possible retrieve the binaries
+ K8SVersion string
+
// CRDDirectoryRelativePath define the Path for the CRD
CRDDirectoryRelativePath string
@@ -130,7 +134,9 @@ package controller
{{end}}
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -165,6 +171,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join({{ .CRDDirectoryRelativePath }}, "config", "crd", "bases")},
ErrorIfCRDPathMissing: {{ .Resource.HasAPI }},
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join({{ .CRDDirectoryRelativePath }}, "bin", "k8s",
+ fmt.Sprintf("{{ .K8SVersion }}-%%s-%%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/pkg/plugins/golang/v4/scaffolds/webhook.go b/pkg/plugins/golang/v4/scaffolds/webhook.go
index 029f75ee5e5..512ebef8174 100644
--- a/pkg/plugins/golang/v4/scaffolds/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/webhook.go
@@ -98,7 +98,7 @@ You need to implement the conversion.Hub and conversion.Convertible interfaces f
// TODO: Add test suite for conversion webhook after #1664 has been merged & conversion tests supported in envtest.
if doDefaulting || doValidation {
if err := scaffold.Execute(
- &api.WebhookSuite{},
+ &api.WebhookSuite{K8SVersion: EnvtestK8SVersion},
); err != nil {
return err
}
diff --git a/testdata/project-v4-declarative-v1/internal/controller/suite_test.go b/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
index 5f78d9e139a..de5e58a7d4b 100644
--- a/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
+++ b/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package controller
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
index 49c94418569..4bbe3abf482 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
index 2edd77dacfc..7a1496e6328 100644
--- a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
index d32e5ed78b1..a65af13f4d1 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
index f1511968296..238ac4a0914 100644
--- a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
index 6c787298e76..7d08b83f134 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package apps
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -53,6 +55,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
index 1730be12146..f239c268c8a 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package crew
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
index df20963acb7..28d49a493b5 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package fiz
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
index c697f9b6dec..e4a53660816 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package foopolicy
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
index d0639b57a44..cc260c2db70 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package foo
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
index 942be884eec..e7fc9251fbf 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package seacreatures
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -55,6 +57,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
index 201fd106400..ed595ca9203 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package ship
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -56,6 +58,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/suite_test.go b/testdata/project-v4-multigroup/internal/controller/suite_test.go
index 2b2393f00ac..1ca47074bf5 100644
--- a/testdata/project-v4-multigroup/internal/controller/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package controller
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
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 e2ffbb63fef..54b11b7f338 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
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
index 58137e675ec..58fb1aee5f0 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package controller
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4/api/v1/webhook_suite_test.go b/testdata/project-v4/api/v1/webhook_suite_test.go
index 674dbd75261..5f7eb7381f0 100644
--- a/testdata/project-v4/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4/api/v1/webhook_suite_test.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net"
"path/filepath"
+ "runtime"
"testing"
"time"
@@ -30,7 +31,7 @@ import (
admissionv1 "k8s.io/api/admission/v1"
//+kubebuilder:scaffold:imports
- "k8s.io/apimachinery/pkg/runtime"
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
@@ -63,6 +64,15 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
},
@@ -74,7 +84,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- scheme := runtime.NewScheme()
+ scheme := apimachineryruntime.NewScheme()
err = AddToScheme(scheme)
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4/internal/controller/suite_test.go b/testdata/project-v4/internal/controller/suite_test.go
index 3b4dfa3bd37..b1526b3684c 100644
--- a/testdata/project-v4/internal/controller/suite_test.go
+++ b/testdata/project-v4/internal/controller/suite_test.go
@@ -17,7 +17,9 @@ limitations under the License.
package controller
import (
+ "fmt"
"path/filepath"
+ "runtime"
"testing"
. "github.com/onsi/ginkgo/v2"
@@ -54,6 +56,14 @@ var _ = BeforeSuite(func() {
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
From 0f3db0067df41222e415eab91a1417fa412ba621 Mon Sep 17 00:00:00 2001
From: Joel Pepper
Date: Wed, 21 Jun 2023 12:44:42 +0200
Subject: [PATCH 0222/1245] fix(completion): Fix completion in deprecated
projects
Currently, when initializing in a project with deprecated plugins
the kubebuilder cli will immediately output a deprecation notice to
stdout before even parsing the command. While this is acceptable and
even desirable for interactive usage of the cli, it will "randomly"
(i.e. dependent on $PWD and not on the command) break automated usage of
the kubebuilder output. This, again is fine if kubebuilder makes no
guarantees of stable machine readable output, but this does not hold for
the completion sub commands which are only ever parsed by machines: The
output of "kubebuilder completion " must always only output the
exact script generated by cobra and the cobra internal commands
__complete and __completeNoDesc must only only return an exact list of
completion options.
In deprecated projects this will break shell completion if the shell is
started in the directory and if the completion script is correctly
initialized, all completion options will be polluted by the massive
deprecation notice.
This commit instead changes the deprecation notice to output to stderr
(while maintaining the return code of the actual command). This fixes
the completion usecase which only reads in stdout, and should not break
existing integrations, unless there exist scripts which use the length
of stderr to check for errors rather than the return code of the call.
Signed-off-by: Joel Pepper
---
pkg/cli/cli.go | 2 +-
pkg/cli/cli_test.go | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go
index 7b74436db7d..af50425603b 100644
--- a/pkg/cli/cli.go
+++ b/pkg/cli/cli.go
@@ -444,7 +444,7 @@ func (c *CLI) addExtraCommands() error {
func (c CLI) printDeprecationWarnings() {
for _, p := range c.resolvedPlugins {
if p != nil && p.(plugin.Deprecated) != nil && len(p.(plugin.Deprecated).DeprecationWarning()) > 0 {
- fmt.Printf(noticeColor, fmt.Sprintf(deprecationFmt, p.(plugin.Deprecated).DeprecationWarning()))
+ fmt.Fprintf(os.Stderr, noticeColor, fmt.Sprintf(deprecationFmt, p.(plugin.Deprecated).DeprecationWarning()))
}
}
}
diff --git a/pkg/cli/cli_test.go b/pkg/cli/cli_test.go
index 7503e2cf18b..ae5f8c7023f 100644
--- a/pkg/cli/cli_test.go
+++ b/pkg/cli/cli_test.go
@@ -592,13 +592,13 @@ plugins:
)
deprecatedPlugin := newMockDeprecatedPlugin("deprecated", "v1", deprecationWarning, projectVersion)
- // Overwrite stdout to read the output and reset it afterwards
+ // Overwrite stderr to read the deprecation output and reset it afterwards
r, w, _ := os.Pipe()
- temp := os.Stdout
+ temp := os.Stderr
defer func() {
- os.Stdout = temp
+ os.Stderr = temp
}()
- os.Stdout = w
+ os.Stderr = w
c, err = New(
WithPlugins(deprecatedPlugin),
From 9444a67cbccbbe66be369f46f8d2ec46f1c61f56 Mon Sep 17 00:00:00 2001
From: Michael Shen
Date: Tue, 13 Jun 2023 22:15:25 -0400
Subject: [PATCH 0223/1245] Fix kustomize syntax during conversion to patches
This commit fixes the syntax error introduced in #3374 where
pathcesStrategicMerge was replaced with patches, which now requires that
every patch additionally have a "path" key when multiple patches are
specified in a file.
Signed-off-by: Michael Shen
---
.../project/config/crd/kustomization.yaml | 4 +--
.../project/config/crd/kustomization.yaml | 4 +--
.../cronjob-tutorial/generate_cronjob.go | 4 +--
.../templates/config/crd/kustomization.go | 4 +--
pkg/plugins/golang/declarative/v1/api.go | 3 +-
test/e2e/v4/generate_test.go | 6 ++++
.../config/crd/kustomization.yaml | 12 +++----
.../config/crd/kustomization.yaml | 36 +++++++++----------
.../config/crd/kustomization.yaml | 8 ++---
.../project-v4/config/crd/kustomization.yaml | 12 +++----
10 files changed, 49 insertions(+), 44 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml
index 22fff65b92c..97cb6432412 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml
@@ -8,12 +8,12 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- patches/webhook_in_projectconfigs.yaml
+#- path: patches/webhook_in_projectconfigs.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-#- patches/cainjection_in_projectconfigs.yaml
+#- path: patches/cainjection_in_projectconfigs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml
index ed16f6b985b..726852ee68b 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml
@@ -8,12 +8,12 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-- patches/webhook_in_cronjobs.yaml
+- path: patches/webhook_in_cronjobs.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-- patches/cainjection_in_cronjobs.yaml
+- path: patches/cainjection_in_cronjobs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 9a404a6fc2a..3eb13ea54c3 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -581,12 +581,12 @@ func updateKustomization(sp *Sample) {
// uncomment crd/kustomization
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/crd/kustomization.yaml"),
- `#- patches/webhook_in_cronjobs.yaml`, `#`)
+ `#- path: patches/webhook_in_cronjobs.yaml`, `#`)
CheckError("fixing crd/kustomization", err)
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/crd/kustomization.yaml"),
- `#- patches/cainjection_in_cronjobs.yaml`, `#`)
+ `#- path: patches/cainjection_in_cronjobs.yaml`, `#`)
CheckError("fixing crd/kustomization", err)
}
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
index 0cdca88ad14..960ad2c5da3 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
@@ -68,9 +68,9 @@ func (f *Kustomization) GetMarkers() []machinery.Marker {
const (
resourceCodeFragment = `- bases/%s_%s.yaml
`
- webhookPatchCodeFragment = `#- patches/webhook_in_%s.yaml
+ webhookPatchCodeFragment = `#- path: patches/webhook_in_%s.yaml
`
- caInjectionPatchCodeFragment = `#- patches/cainjection_in_%s.yaml
+ caInjectionPatchCodeFragment = `#- path: patches/cainjection_in_%s.yaml
`
)
diff --git a/pkg/plugins/golang/declarative/v1/api.go b/pkg/plugins/golang/declarative/v1/api.go
index ee70095da32..998f39eebc9 100644
--- a/pkg/plugins/golang/declarative/v1/api.go
+++ b/pkg/plugins/golang/declarative/v1/api.go
@@ -20,8 +20,6 @@ import (
"errors"
"fmt"
- goPluginV3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
-
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
@@ -29,6 +27,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1/scaffolds"
goPluginV2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2"
+ goPluginV3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
)
const (
diff --git a/test/e2e/v4/generate_test.go b/test/e2e/v4/generate_test.go
index fb2deba6240..d4fc718bc25 100644
--- a/test/e2e/v4/generate_test.go
+++ b/test/e2e/v4/generate_test.go
@@ -83,6 +83,12 @@ Count int `+"`"+`json:"count,omitempty"`+"`"+`
ExpectWithOffset(1, err).NotTo(HaveOccurred())
By("uncomment kustomization.yaml to enable webhook and ca injection")
+ ExpectWithOffset(1, pluginutil.UncommentCode(
+ filepath.Join(kbc.Dir, "config", "crd", "kustomization.yaml"),
+ fmt.Sprintf("#- path: patches/webhook_in_%s.yaml", kbc.Resources), "#")).To(Succeed())
+ ExpectWithOffset(1, pluginutil.UncommentCode(
+ filepath.Join(kbc.Dir, "config", "crd", "kustomization.yaml"),
+ fmt.Sprintf("#- path: patches/cainjection_in_%s.yaml", kbc.Resources), "#")).To(Succeed())
ExpectWithOffset(1, pluginutil.UncommentCode(
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
"#- ../webhook", "#")).To(Succeed())
diff --git a/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml b/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml
index bf4c93a811c..687526d8e7c 100644
--- a/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml
+++ b/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml
@@ -10,16 +10,16 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- patches/webhook_in_captains.yaml
-#- patches/webhook_in_firstmates.yaml
-#- patches/webhook_in_admirals.yaml
+#- path: patches/webhook_in_captains.yaml
+#- path: patches/webhook_in_firstmates.yaml
+#- path: patches/webhook_in_admirals.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-#- patches/cainjection_in_captains.yaml
-#- patches/cainjection_in_firstmates.yaml
-#- patches/cainjection_in_admirals.yaml
+#- path: patches/cainjection_in_captains.yaml
+#- path: patches/cainjection_in_firstmates.yaml
+#- path: patches/cainjection_in_admirals.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index 8c2e5c49499..633e725aa1a 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -17,28 +17,28 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- patches/webhook_in_captains.yaml
-#- patches/webhook_in_frigates.yaml
-#- patches/webhook_in_destroyers.yaml
-#- patches/webhook_in_cruisers.yaml
-#- patches/webhook_in_krakens.yaml
-#- patches/webhook_in_leviathans.yaml
-#- patches/webhook_in_healthcheckpolicies.yaml
-#- patches/webhook_in_bars.yaml
-#- patches/webhook_in_lakers.yaml
+#- path: patches/webhook_in_captains.yaml
+#- path: patches/webhook_in_frigates.yaml
+#- path: patches/webhook_in_destroyers.yaml
+#- path: patches/webhook_in_cruisers.yaml
+#- path: patches/webhook_in_krakens.yaml
+#- path: patches/webhook_in_leviathans.yaml
+#- path: patches/webhook_in_healthcheckpolicies.yaml
+#- path: patches/webhook_in_bars.yaml
+#- path: patches/webhook_in_lakers.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-#- patches/cainjection_in_captains.yaml
-#- patches/cainjection_in_frigates.yaml
-#- patches/cainjection_in_destroyers.yaml
-#- patches/cainjection_in_cruisers.yaml
-#- patches/cainjection_in_krakens.yaml
-#- patches/cainjection_in_leviathans.yaml
-#- patches/cainjection_in_healthcheckpolicies.yaml
-#- patches/cainjection_in_bars.yaml
-#- patches/cainjection_in_lakers.yaml
+#- path: patches/cainjection_in_captains.yaml
+#- path: patches/cainjection_in_frigates.yaml
+#- path: patches/cainjection_in_destroyers.yaml
+#- path: patches/cainjection_in_cruisers.yaml
+#- path: patches/cainjection_in_krakens.yaml
+#- path: patches/cainjection_in_leviathans.yaml
+#- path: patches/cainjection_in_healthcheckpolicies.yaml
+#- path: patches/cainjection_in_bars.yaml
+#- path: patches/cainjection_in_lakers.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
index 4d4c5a9212d..1385006e680 100644
--- a/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
+++ b/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
@@ -9,14 +9,14 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- patches/webhook_in_memcacheds.yaml
-#- patches/webhook_in_busyboxes.yaml
+#- path: patches/webhook_in_memcacheds.yaml
+#- path: patches/webhook_in_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-#- patches/cainjection_in_memcacheds.yaml
-#- patches/cainjection_in_busyboxes.yaml
+#- path: patches/cainjection_in_memcacheds.yaml
+#- path: patches/cainjection_in_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/testdata/project-v4/config/crd/kustomization.yaml b/testdata/project-v4/config/crd/kustomization.yaml
index 75e0b8e4258..a67f99e5ea3 100644
--- a/testdata/project-v4/config/crd/kustomization.yaml
+++ b/testdata/project-v4/config/crd/kustomization.yaml
@@ -10,16 +10,16 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- patches/webhook_in_captains.yaml
-#- patches/webhook_in_firstmates.yaml
-#- patches/webhook_in_admirales.yaml
+#- path: patches/webhook_in_captains.yaml
+#- path: patches/webhook_in_firstmates.yaml
+#- path: patches/webhook_in_admirales.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-#- patches/cainjection_in_captains.yaml
-#- patches/cainjection_in_firstmates.yaml
-#- patches/cainjection_in_admirales.yaml
+#- path: patches/cainjection_in_captains.yaml
+#- path: patches/cainjection_in_firstmates.yaml
+#- path: patches/cainjection_in_admirales.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
From b8a2155ab671fc69fd4af06e8b33d72bf8c43b36 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 27 Jun 2023 00:02:28 +0000
Subject: [PATCH 0224/1245] build(deps): bump sigs.k8s.io/kubebuilder/v3
Bumps [sigs.k8s.io/kubebuilder/v3](https://github.com/kubernetes-sigs/kubebuilder) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder/compare/v3.10.0...v3.11.0)
---
updated-dependencies:
- dependency-name: sigs.k8s.io/kubebuilder/v3
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.../testdata/sampleexternalplugin/v1/go.mod | 10 +++----
.../testdata/sampleexternalplugin/v1/go.sum | 28 +++++++++----------
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
index dc2d09bae2e..d791d06eb32 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
@@ -4,14 +4,14 @@ go 1.20
require (
github.com/spf13/pflag v1.0.5
- sigs.k8s.io/kubebuilder/v3 v3.10.0
+ sigs.k8s.io/kubebuilder/v3 v3.11.0
)
require (
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/spf13/afero v1.9.5 // indirect
- golang.org/x/mod v0.10.0 // indirect
- golang.org/x/sys v0.7.0 // indirect
- golang.org/x/text v0.9.0 // indirect
- golang.org/x/tools v0.8.0 // indirect
+ golang.org/x/mod v0.11.0 // indirect
+ golang.org/x/sys v0.9.0 // indirect
+ golang.org/x/text v0.10.0 // indirect
+ golang.org/x/tools v0.10.0 // indirect
)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
index 20d24f771ed..39de897e5fd 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
@@ -58,7 +58,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
+github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
@@ -129,8 +129,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
-github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
+github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
+github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc=
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=
@@ -201,8 +201,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
-golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
+golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -235,7 +235,7 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
+golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
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=
@@ -290,8 +290,8 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
-golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
+golang.org/x/sys v0.9.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=
@@ -301,8 +301,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
-golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
+golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
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=
@@ -353,8 +353,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.8.0 h1:vSDcovVPld282ceKgDimkRSC8kpaH1dgyc9UMzlt84Y=
-golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
+golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
+golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
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=
@@ -465,6 +465,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/kubebuilder/v3 v3.10.0 h1:gLJpa7dlKYc3T/VICAyaSjLL5ECrcHMUYRZ6sPWeNdA=
-sigs.k8s.io/kubebuilder/v3 v3.10.0/go.mod h1:C65fAHNj0vVzPjMoVTjIBTHxAQal6qbg3ZA1gtMl5B4=
+sigs.k8s.io/kubebuilder/v3 v3.11.0 h1:0AoVKnPEmHj1tQ8ya1wZ3495/H0M9XTNwgC3wVukGeI=
+sigs.k8s.io/kubebuilder/v3 v3.11.0/go.mod h1:4Re8w/tE0RsqR2IN5VnwCUgsbaIPk9DcYcZlRVALA2M=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
From ad518e7bb241af070e05010b2980592535503207 Mon Sep 17 00:00:00 2001
From: Jakub Warczarek
Date: Wed, 28 Jun 2023 15:33:01 +0200
Subject: [PATCH 0225/1245] =?UTF-8?q?=E2=9C=A8=20Add=20.vscode=20to=20auto?=
=?UTF-8?q?generated=20.gitignore=20files?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/component-config-tutorial/testdata/project/.gitignore | 1 +
docs/book/src/cronjob-tutorial/testdata/project/.gitignore | 1 +
pkg/plugins/golang/v2/scaffolds/internal/templates/gitignore.go | 1 +
pkg/plugins/golang/v3/scaffolds/internal/templates/gitignore.go | 1 +
pkg/plugins/golang/v4/scaffolds/internal/templates/gitignore.go | 1 +
testdata/project-v2/.gitignore | 1 +
testdata/project-v3/.gitignore | 1 +
testdata/project-v4-declarative-v1/.gitignore | 1 +
testdata/project-v4-with-deploy-image/.gitignore | 1 +
testdata/project-v4-with-grafana/.gitignore | 1 +
10 files changed, 10 insertions(+)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/.gitignore b/docs/book/src/component-config-tutorial/testdata/project/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/.gitignore
+++ b/docs/book/src/component-config-tutorial/testdata/project/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.gitignore b/docs/book/src/cronjob-tutorial/testdata/project/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/.gitignore
+++ b/docs/book/src/cronjob-tutorial/testdata/project/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/gitignore.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/gitignore.go
index a60f46d6760..b4a5c691167 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/gitignore.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/gitignore.go
@@ -59,6 +59,7 @@ bin
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/gitignore.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/gitignore.go
index 8b194d955f6..f79f6a32d65 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/gitignore.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/gitignore.go
@@ -61,6 +61,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/gitignore.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/gitignore.go
index 0e156e463e1..b88cf76c024 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/gitignore.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/gitignore.go
@@ -60,6 +60,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v2/.gitignore b/testdata/project-v2/.gitignore
index d97ffc5159b..4f592d7553b 100644
--- a/testdata/project-v2/.gitignore
+++ b/testdata/project-v2/.gitignore
@@ -19,6 +19,7 @@ bin
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v3/.gitignore b/testdata/project-v3/.gitignore
index e917e5cefe5..c1c593e67e1 100644
--- a/testdata/project-v3/.gitignore
+++ b/testdata/project-v3/.gitignore
@@ -21,6 +21,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v4-declarative-v1/.gitignore b/testdata/project-v4-declarative-v1/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/testdata/project-v4-declarative-v1/.gitignore
+++ b/testdata/project-v4-declarative-v1/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v4-with-deploy-image/.gitignore b/testdata/project-v4-with-deploy-image/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/testdata/project-v4-with-deploy-image/.gitignore
+++ b/testdata/project-v4-with-deploy-image/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v4-with-grafana/.gitignore b/testdata/project-v4-with-grafana/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/testdata/project-v4-with-grafana/.gitignore
+++ b/testdata/project-v4-with-grafana/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
From 141f76293764eb68fa8c9fa9b92661e4816a09b5 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Mon, 19 Jun 2023 18:29:04 +0800
Subject: [PATCH 0226/1245] feat: init e2e test
feat: add test data
fix: add test in setup
fix: change the file to PROJECT
fix: test file update
fix: doc nit and test data
feat: Add By to check and project file
feat: separate fields
feat: use domain when scafflod
feat: add plugin arg when re-scaffold
fix: function name
feat: refactor plugins
fix: remove lint
fix: domain append
---
pkg/rescaffold/migrate.go | 17 ++++-
test/e2e/alphagenerate/e2e_suite_test.go | 32 ++++++++
test/e2e/alphagenerate/generate_test.go | 96 ++++++++++++++++++++++++
test/e2e/setup.sh | 1 +
test/e2e/utils/test_context.go | 9 +++
5 files changed, 154 insertions(+), 1 deletion(-)
create mode 100644 test/e2e/alphagenerate/e2e_suite_test.go
create mode 100644 test/e2e/alphagenerate/generate_test.go
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 91854c24783..caf069e93e7 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -100,8 +100,23 @@ func getOutputPath(currentWorkingDirectory, outputPath string) (string, error) {
return "", err
}
-func kubebuilderInit(_ store.Store) error {
+func kubebuilderInit(store store.Store) error {
var args []string
args = append(args, "init")
+ args = append(args, getInitArgs(store)...)
return util.RunCmd("kubebuilder init", "kubebuilder", args...)
}
+
+func getInitArgs(store store.Store) []string {
+ var args []string
+ plugins := store.Config().GetPluginChain()
+ if len(plugins) > 0 {
+ args = append(args, "--plugins")
+ args = append(args, plugins...)
+ }
+ domain := store.Config().GetDomain()
+ if domain != "" {
+ args = append(args, "--domain", domain)
+ }
+ return args
+}
diff --git a/test/e2e/alphagenerate/e2e_suite_test.go b/test/e2e/alphagenerate/e2e_suite_test.go
new file mode 100644
index 00000000000..eab37e6dac4
--- /dev/null
+++ b/test/e2e/alphagenerate/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package alphagenerate
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting kubebuilder suite test for the alpha command generate\n")
+ RunSpecs(t, "Kubebuilder alpha generate suite")
+}
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
new file mode 100644
index 00000000000..b2d455a5131
--- /dev/null
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -0,0 +1,96 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package alphagenerate
+
+import (
+ "fmt"
+ "path/filepath"
+
+ pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "sigs.k8s.io/kubebuilder/v3/test/e2e/utils"
+)
+
+var _ = Describe("kubebuilder", func() {
+ Context("alpha generate ", func() {
+ var (
+ kbc *utils.TestContext
+ )
+
+ BeforeEach(func() {
+ var err error
+ kbc, err = utils.NewTestContext(pluginutil.KubebuilderBinName, "GO111MODULE=on")
+ Expect(err).NotTo(HaveOccurred())
+ Expect(kbc.Prepare()).To(Succeed())
+ })
+
+ AfterEach(func() {
+ kbc.Destroy()
+ })
+
+ It("should regenerate the project with success", func() {
+ ReGenerateProject(kbc)
+ })
+
+ })
+})
+
+// ReGenerateProject implements a project that is regenerated by kubebuilder.
+func ReGenerateProject(kbc *utils.TestContext) {
+ var err error
+
+ By("initializing a project")
+ err = kbc.Init(
+ "--plugins", "go/v4",
+ "--project-version", "3",
+ "--domain", kbc.Domain,
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("regenerating the project")
+ err = kbc.Regenerate(
+ "--input-dir", kbc.Dir,
+ "--output-dir", filepath.Join(kbc.Dir, "testdir"),
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("checking if the project file was generated with the expected layout")
+ var layout = `layout:
+- go.kubebuilder.io/v4
+`
+ fileContainsExpr, err := pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir", "PROJECT"), layout)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected domain")
+ var domain = fmt.Sprintf("domain: %s", kbc.Domain)
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir", "PROJECT"), domain)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected version")
+ var version = `version: "3"`
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir", "PROJECT"), version)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+}
diff --git a/test/e2e/setup.sh b/test/e2e/setup.sh
index 20e7a9852fa..15210adafc3 100755
--- a/test/e2e/setup.sh
+++ b/test/e2e/setup.sh
@@ -66,6 +66,7 @@ function test_cluster {
go test $(dirname "$0")/deployimage $flags -timeout 30m
go test $(dirname "$0")/v4 $flags -timeout 30m
go test $(dirname "$0")/externalplugin $flags -timeout 30m
+ go test $(dirname "$0")/alphagenerate $flags -timeout 30m
}
function build_sample_external_plugin {
diff --git a/test/e2e/utils/test_context.go b/test/e2e/utils/test_context.go
index d9630d6c7d8..6a0f61deedb 100644
--- a/test/e2e/utils/test_context.go
+++ b/test/e2e/utils/test_context.go
@@ -214,6 +214,15 @@ func (t *TestContext) CreateWebhook(resourceOptions ...string) error {
return err
}
+// Regenerate is for running `kubebuilder alpha generate`
+func (t *TestContext) Regenerate(resourceOptions ...string) error {
+ resourceOptions = append([]string{"alpha", "generate"}, resourceOptions...)
+ //nolint:gosec
+ cmd := exec.Command(t.BinaryName, resourceOptions...)
+ _, err := t.Run(cmd)
+ return err
+}
+
// Make is for running `make` with various targets
func (t *TestContext) Make(makeOptions ...string) error {
cmd := exec.Command("make", makeOptions...)
From cc479d3eab57e31a045a7a5336740ed36836a037 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 3 Jul 2023 23:44:13 +0000
Subject: [PATCH 0227/1245] build(deps): bump sigs.k8s.io/kubebuilder/v3
Bumps [sigs.k8s.io/kubebuilder/v3](https://github.com/kubernetes-sigs/kubebuilder) from 3.11.0 to 3.11.1.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder/compare/v3.11.0...v3.11.1)
---
updated-dependencies:
- dependency-name: sigs.k8s.io/kubebuilder/v3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
.../testdata/sampleexternalplugin/v1/go.mod | 2 +-
.../testdata/sampleexternalplugin/v1/go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
index d791d06eb32..f03a56b936d 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/spf13/pflag v1.0.5
- sigs.k8s.io/kubebuilder/v3 v3.11.0
+ sigs.k8s.io/kubebuilder/v3 v3.11.1
)
require (
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
index 39de897e5fd..a9d1c75e2fe 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
@@ -465,6 +465,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/kubebuilder/v3 v3.11.0 h1:0AoVKnPEmHj1tQ8ya1wZ3495/H0M9XTNwgC3wVukGeI=
-sigs.k8s.io/kubebuilder/v3 v3.11.0/go.mod h1:4Re8w/tE0RsqR2IN5VnwCUgsbaIPk9DcYcZlRVALA2M=
+sigs.k8s.io/kubebuilder/v3 v3.11.1 h1:WbzjgZVIOYXJLRqal+j9YL4SjxjSvUuCas2j3NmzMq0=
+sigs.k8s.io/kubebuilder/v3 v3.11.1/go.mod h1:4Re8w/tE0RsqR2IN5VnwCUgsbaIPk9DcYcZlRVALA2M=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
From 659edfaf0740ba7f41c1e1584b3c28fc376db972 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Wed, 5 Jul 2023 20:26:27 +0800
Subject: [PATCH 0228/1245] feat: add multigroup flag
feat: better log when error
---
pkg/rescaffold/migrate.go | 20 ++++++++++++++++----
test/e2e/alphagenerate/generate_test.go | 20 ++++++++++++++++++++
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index caf069e93e7..9f02efac10e 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -36,20 +36,24 @@ const DefaultOutputDir = "output-dir"
func (opts *MigrateOptions) Rescaffold() error {
config := yaml.New(machinery.Filesystem{FS: afero.NewOsFs()})
if err := config.LoadFrom(opts.InputDir); err != nil {
- log.Fatal(err)
+ log.Fatalf("Failed to load PROJECT file %v", err)
}
// create output directory
// nolint: gosec
if err := os.MkdirAll(opts.OutputDir, 0755); err != nil {
- log.Fatal(err)
+ log.Fatalf("Failed to create output directory %v", err)
}
// use the new directory to set up the new project
if err := os.Chdir(opts.OutputDir); err != nil {
- log.Fatal(err)
+ log.Fatalf("Failed to change the current working directory %v", err)
}
// init project with plugins
if err := kubebuilderInit(config); err != nil {
- log.Fatal(err)
+ log.Fatalf("Failed to run init subcommand %v", err)
+ }
+ // call edit subcommands to enable or disable multigroup layout
+ if err := kubebuilderEdit(config); err != nil {
+ log.Fatalf("Failed to run edit subcommand %v", err)
}
return nil
}
@@ -107,6 +111,14 @@ func kubebuilderInit(store store.Store) error {
return util.RunCmd("kubebuilder init", "kubebuilder", args...)
}
+func kubebuilderEdit(store store.Store) error {
+ if store.Config().IsMultiGroup() {
+ args := []string{"edit", "--multigroup"}
+ return util.RunCmd("kubebuilder edit", "kubebuilder", args...)
+ }
+ return nil
+}
+
func getInitArgs(store store.Store) []string {
var args []string
plugins := store.Config().GetPluginChain()
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
index b2d455a5131..d20dfdd21fd 100644
--- a/test/e2e/alphagenerate/generate_test.go
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -93,4 +93,24 @@ func ReGenerateProject(kbc *utils.TestContext) {
filepath.Join(kbc.Dir, "testdir", "PROJECT"), version)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("editing a project with multigroup=true")
+ err = kbc.Edit(
+ "--multigroup=true",
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("regenerating the project at another output directory")
+ err = kbc.Regenerate(
+ "--input-dir", kbc.Dir,
+ "--output-dir", filepath.Join(kbc.Dir, "testdir2"),
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("checking if the project file was generated with the expected multigroup flag")
+ var multiGroup = `multigroup: true`
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), multiGroup)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
}
From 3f106fab21bf5574b5d421dd6ec07207f2253c7c Mon Sep 17 00:00:00 2001
From: Steve Sklar
Date: Sat, 8 Jul 2023 09:13:11 -0400
Subject: [PATCH 0229/1245] Updates extending kubebuilder docs to use
NewBundleWithOptions
---
docs/book/src/plugins/extending-cli.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/plugins/extending-cli.md b/docs/book/src/plugins/extending-cli.md
index 7a9f0e89b1f..69575e8b7c4 100644
--- a/docs/book/src/plugins/extending-cli.md
+++ b/docs/book/src/plugins/extending-cli.md
@@ -42,7 +42,7 @@ var (
// GetPluginsCLI returns the plugins based CLI configured to be used in your CLI binary
func GetPluginsCLI() (*cli.CLI) {
// Bundle plugin which built the golang projects scaffold by Kubebuilder go/v3
- gov3Bundle, _ := plugin.NewBundle(golang.DefaultNameQualifier, plugin.Version{Number: 3},
+ gov3Bundle, _ := plugin.NewBundleWithOptions(golang.DefaultNameQualifier, plugin.Version{Number: 3},
kustomizecommonv1.Plugin{},
golangv3.Plugin{},
)
From a5506baa755fb961c45a708e9bd9dedc5b71f47e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 10 Jul 2023 23:44:31 +0000
Subject: [PATCH 0230/1245] build(deps): bump golang.org/x/tools from 0.10.0 to
0.11.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.10.0...v0.11.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 10 +++++-----
go.sum | 20 ++++++++++----------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/go.mod b/go.mod
index 8c8194ce535..33866c029e7 100644
--- a/go.mod
+++ b/go.mod
@@ -10,8 +10,8 @@ require (
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
- golang.org/x/text v0.10.0
- golang.org/x/tools v0.10.0
+ golang.org/x/text v0.11.0
+ golang.org/x/tools v0.11.0
sigs.k8s.io/yaml v1.3.0
)
@@ -23,9 +23,9 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
- golang.org/x/mod v0.11.0 // indirect
- golang.org/x/net v0.11.0 // indirect
- golang.org/x/sys v0.9.0 // indirect
+ golang.org/x/mod v0.12.0 // indirect
+ golang.org/x/net v0.12.0 // indirect
+ golang.org/x/sys v0.10.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 4dfe90a2d63..79c5ca6cab3 100644
--- a/go.sum
+++ b/go.sum
@@ -222,8 +222,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
-golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
+golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -256,8 +256,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
-golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
+golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
+golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
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=
@@ -314,8 +314,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
-golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
+golang.org/x/sys v0.10.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=
@@ -325,8 +325,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
-golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
+golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.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=
@@ -377,8 +377,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.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
-golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
+golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8=
+golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8=
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=
From 38b2e3954241949b8db29249d598f4d05c74bda0 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Fri, 7 Jul 2023 17:02:25 +0800
Subject: [PATCH 0231/1245] feat: add support for create API
fix: golang lint
fix: uppercase for Kind
fix:nit
fix: better name
fix: add resource flag
feat: only namespaced when flag set
---
pkg/rescaffold/migrate.go | 64 +++++++++++++++++++++++++
test/e2e/alphagenerate/generate_test.go | 46 ++++++++++++++++++
2 files changed, 110 insertions(+)
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 9f02efac10e..29f975ef96e 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -23,6 +23,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/config/store"
"sigs.k8s.io/kubebuilder/v3/pkg/config/store/yaml"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+ "sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
)
@@ -55,6 +56,10 @@ func (opts *MigrateOptions) Rescaffold() error {
if err := kubebuilderEdit(config); err != nil {
log.Fatalf("Failed to run edit subcommand %v", err)
}
+ // create APIs
+ if err := kubebuilderCreate(config); err != nil {
+ log.Fatalf("Failed to run create API subcommand %v", err)
+ }
return nil
}
@@ -119,6 +124,21 @@ func kubebuilderEdit(store store.Store) error {
return nil
}
+func kubebuilderCreate(store store.Store) error {
+ resources, err := store.Config().GetResources()
+ if err != nil {
+ return err
+ }
+
+ for _, r := range resources {
+ if err = createAPI(r); err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
func getInitArgs(store store.Store) []string {
var args []string
plugins := store.Config().GetPluginChain()
@@ -132,3 +152,47 @@ func getInitArgs(store store.Store) []string {
}
return args
}
+
+func createAPI(resource resource.Resource) error {
+ var args []string
+ args = append(args, "create")
+ args = append(args, "api")
+ args = append(args, getAPIGVKFlags(resource)...)
+ args = append(args, getAPIResourceFlags(resource)...)
+ return util.RunCmd("kubebuilder create api", "kubebuilder", args...)
+}
+
+func getAPIGVKFlags(resource resource.Resource) []string {
+ var args []string
+
+ if len(resource.Group) > 0 {
+ args = append(args, "--group", resource.Group)
+ }
+ if len(resource.Version) > 0 {
+ args = append(args, "--version", resource.Version)
+ }
+ if len(resource.Kind) > 0 {
+ args = append(args, "--kind", resource.Kind)
+ }
+ return args
+}
+
+func getAPIResourceFlags(resource resource.Resource) []string {
+ var args []string
+ if resource.API == nil || resource.API.IsEmpty() {
+ // create API without creating resource
+ args = append(args, "--resource=false")
+ } else {
+ args = append(args, "--resource")
+ if resource.API.Namespaced {
+ args = append(args, "--namespaced")
+ }
+ }
+
+ if resource.Controller {
+ args = append(args, "--controller")
+ } else {
+ args = append(args, "--controller=false")
+ }
+ return args
+}
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
index d20dfdd21fd..5dff728987f 100644
--- a/test/e2e/alphagenerate/generate_test.go
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -100,6 +100,17 @@ func ReGenerateProject(kbc *utils.TestContext) {
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("create APIs with resource and controller")
+ err = kbc.CreateAPI(
+ "--group", "crew",
+ "--version", "v1",
+ "--kind", "Captain",
+ "--namespaced",
+ "--resource",
+ "--controller",
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("regenerating the project at another output directory")
err = kbc.Regenerate(
"--input-dir", kbc.Dir,
@@ -113,4 +124,39 @@ func ReGenerateProject(kbc *utils.TestContext) {
filepath.Join(kbc.Dir, "testdir2", "PROJECT"), multiGroup)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected group")
+ var APIGroup = "group: crew"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), APIGroup)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected kind")
+ var APIKind = "kind: Captain"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), APIKind)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected version")
+ var APIVersion = "version: v1"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), APIVersion)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected namespaced")
+ var namespaced = "namespaced: true"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), namespaced)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected controller")
+ var controller = "controller: true"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), controller)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
}
From 5330254ab2ba58c73dfeda6cbec3e65205d1ea94 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Fri, 14 Jul 2023 12:20:25 +0800
Subject: [PATCH 0232/1245] feat: support webhook in alpha generate
---
pkg/rescaffold/migrate.go | 52 ++++++++++++++++++++-----
test/e2e/alphagenerate/generate_test.go | 19 +++++++++
2 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 29f975ef96e..94c8a0332c1 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -134,6 +134,9 @@ func kubebuilderCreate(store store.Store) error {
if err = createAPI(r); err != nil {
return err
}
+ if err = createWebhook(r); err != nil {
+ return err
+ }
}
return nil
@@ -153,18 +156,12 @@ func getInitArgs(store store.Store) []string {
return args
}
-func createAPI(resource resource.Resource) error {
- var args []string
- args = append(args, "create")
- args = append(args, "api")
- args = append(args, getAPIGVKFlags(resource)...)
- args = append(args, getAPIResourceFlags(resource)...)
- return util.RunCmd("kubebuilder create api", "kubebuilder", args...)
-}
-
-func getAPIGVKFlags(resource resource.Resource) []string {
+func getGVKFlags(resource resource.Resource) []string {
var args []string
+ if len(resource.Plural) > 0 {
+ args = append(args, "--plural", resource.Plural)
+ }
if len(resource.Group) > 0 {
args = append(args, "--group", resource.Group)
}
@@ -177,6 +174,15 @@ func getAPIGVKFlags(resource resource.Resource) []string {
return args
}
+func createAPI(resource resource.Resource) error {
+ var args []string
+ args = append(args, "create")
+ args = append(args, "api")
+ args = append(args, getGVKFlags(resource)...)
+ args = append(args, getAPIResourceFlags(resource)...)
+ return util.RunCmd("kubebuilder create api", "kubebuilder", args...)
+}
+
func getAPIResourceFlags(resource resource.Resource) []string {
var args []string
if resource.API == nil || resource.API.IsEmpty() {
@@ -196,3 +202,29 @@ func getAPIResourceFlags(resource resource.Resource) []string {
}
return args
}
+
+func createWebhook(resource resource.Resource) error {
+ if resource.Webhooks == nil || resource.Webhooks.IsEmpty() {
+ return nil
+ }
+ var args []string
+ args = append(args, "create")
+ args = append(args, "webhook")
+ args = append(args, getGVKFlags(resource)...)
+ args = append(args, getWebhookResourceFlags(resource)...)
+ return util.RunCmd("kubebuilder create webhook", "kubebuilder", args...)
+}
+
+func getWebhookResourceFlags(resource resource.Resource) []string {
+ var args []string
+ if resource.HasConversionWebhook() {
+ args = append(args, "--conversion")
+ }
+ if resource.HasValidationWebhook() {
+ args = append(args, "--programmatic-validation")
+ }
+ if resource.HasDefaultingWebhook() {
+ args = append(args, "--defaulting")
+ }
+ return args
+}
\ No newline at end of file
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
index 5dff728987f..30d9f478f7d 100644
--- a/test/e2e/alphagenerate/generate_test.go
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -111,6 +111,16 @@ func ReGenerateProject(kbc *utils.TestContext) {
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("create Webhooks with conversion and validating webhook")
+ err = kbc.CreateWebhook(
+ "--group", "crew",
+ "--version", "v1",
+ "--kind", "Captain",
+ "--programmatic-validation",
+ "--conversion",
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("regenerating the project at another output directory")
err = kbc.Regenerate(
"--input-dir", kbc.Dir,
@@ -159,4 +169,13 @@ func ReGenerateProject(kbc *utils.TestContext) {
filepath.Join(kbc.Dir, "testdir2", "PROJECT"), controller)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected webhook")
+ var webhook = `webhooks:
+ conversion: true
+ validation: true`
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), webhook)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
}
From 38ee2c98847611a4dcd57bf12ef794dbde70f701 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Fri, 14 Jul 2023 12:29:03 +0800
Subject: [PATCH 0233/1245] fix: lint
---
pkg/rescaffold/migrate.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 94c8a0332c1..bd329aa05c4 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -227,4 +227,4 @@ func getWebhookResourceFlags(resource resource.Resource) []string {
args = append(args, "--defaulting")
}
return args
-}
\ No newline at end of file
+}
From 64ebb453907b18acce396286280564e445242048 Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Fri, 14 Jul 2023 08:16:57 +0100
Subject: [PATCH 0234/1245] Update README.md - Community Meetings
---
README.md | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index e4321e5e62f..7ec6dd5ab8a 100644
--- a/README.md
+++ b/README.md
@@ -132,9 +132,8 @@ Apple Silicon (`darwin/arm64`) support begins with the `go/v4` plugin.
## Community Meetings
The following meetings happen biweekly:
-
-- Kubebuilder, Controller Runtime, and Controller Tools
-- Kubebuilder Triage
+
+- Kubebuilder Meeting
You are more than welcome to attend. For further info join to [kubebuilder@googlegroups.com](https://groups.google.com/g/kubebuilder).
@@ -142,4 +141,4 @@ You are more than welcome to attend. For further info join to [kubebuilder@googl
[plugin-section]: https://book.kubebuilder.io/plugins/plugins.html
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
[your-own-plugins]: https://book.kubebuilder.io/plugins/creating-plugins.html
-[controller-tools]: https://github.com/kubernetes-sigs/controller-tools
\ No newline at end of file
+[controller-tools]: https://github.com/kubernetes-sigs/controller-tools
From 3749c8dba34870e1440907bcccf45cb2bdbb88f7 Mon Sep 17 00:00:00 2001
From: Carlos Santana
Date: Tue, 18 Jul 2023 13:14:38 -0400
Subject: [PATCH 0235/1245] Update quick-start.md use "kubectl -k apply"
---
docs/book/src/quick-start.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/quick-start.md b/docs/book/src/quick-start.md
index ff35aed97a0..3b01a0b032b 100644
--- a/docs/book/src/quick-start.md
+++ b/docs/book/src/quick-start.md
@@ -180,7 +180,7 @@ If you pressed `y` for Create Resource [y/n] then you created a CR for your CRD
API definition):
```bash
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
## Run It On the Cluster
From cfee7d24154abd3e754691f907c4bb8215c559d0 Mon Sep 17 00:00:00 2001
From: Micah Young
Date: Fri, 21 Jul 2023 12:19:58 -0400
Subject: [PATCH 0236/1245] Fix typo in scaffold plugins docs
Sillicom -> Silicon
---
docs/book/src/plugins/to-scaffold-project.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/plugins/to-scaffold-project.md b/docs/book/src/plugins/to-scaffold-project.md
index cb29f9cb534..c2c9235e2b5 100644
--- a/docs/book/src/plugins/to-scaffold-project.md
+++ b/docs/book/src/plugins/to-scaffold-project.md
@@ -6,4 +6,4 @@ The following plugins are useful to scaffold the whole project with the tool.
| ---------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [go.kubebuilder.io/v2 - (Deprecated)](go-v2-plugin.md) | `go/v2` | Golang plugin responsible for scaffolding the legacy layout provided with Kubebuilder CLI >= `2.0.0` and < `3.0.0`. |
| [go.kubebuilder.io/v3 - (Default scaffold with Kubebuilder init)](go-v3-plugin.md) | `go/v3` | Default scaffold used for creating a project when no plugin(s) are provided. Responsible for scaffolding Golang projects and its configurations. |
-| [go.kubebuilder.io/v4-alpha - (Add Apple Sillicom Support)](go-v4-plugin.md) | `go/v4` | Scaffold composite by `base.go.kubebuilder.io/v3` and [kustomize.common.kubebuilder.io/v2](kustomize-v2.md). Responsible for scaffolding Golang projects and its configurations. |
+| [go.kubebuilder.io/v4-alpha - (Add Apple Silicon Support)](go-v4-plugin.md) | `go/v4` | Scaffold composite by `base.go.kubebuilder.io/v3` and [kustomize.common.kubebuilder.io/v2](kustomize-v2.md). Responsible for scaffolding Golang projects and its configurations. |
From f4a9fbbb0216bb0298d8bf378346893a49e0b443 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Fri, 21 Jul 2023 20:11:03 +0800
Subject: [PATCH 0237/1245] feat: enable grafana plugin migration
fix: golang lint
refactor: error handling
---
go.mod | 1 +
go.sum | 2 ++
pkg/rescaffold/migrate.go | 40 +++++++++++++++++++++++--
test/e2e/alphagenerate/generate_test.go | 13 ++++++++
4 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 33866c029e7..79063c954c4 100644
--- a/go.mod
+++ b/go.mod
@@ -23,6 +23,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
+ golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
diff --git a/go.sum b/go.sum
index 79c5ca6cab3..b43737423f7 100644
--- a/go.sum
+++ b/go.sum
@@ -199,6 +199,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
+golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw=
+golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index bd329aa05c4..7e443865c34 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -14,12 +14,17 @@ limitations under the License.
package rescaffold
import (
+ "errors"
"fmt"
"log"
"os"
"os/exec"
+ "strings"
+
+ "golang.org/x/exp/slices"
"github.com/spf13/afero"
+ "sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/config/store"
"sigs.k8s.io/kubebuilder/v3/pkg/config/store/yaml"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -33,6 +38,7 @@ type MigrateOptions struct {
}
const DefaultOutputDir = "output-dir"
+const grafanaPluginKey = "grafana.kubebuilder.io/v1-alpha"
func (opts *MigrateOptions) Rescaffold() error {
config := yaml.New(machinery.Filesystem{FS: afero.NewOsFs()})
@@ -56,10 +62,14 @@ func (opts *MigrateOptions) Rescaffold() error {
if err := kubebuilderEdit(config); err != nil {
log.Fatalf("Failed to run edit subcommand %v", err)
}
- // create APIs
+ // create APIs and Webhooks
if err := kubebuilderCreate(config); err != nil {
log.Fatalf("Failed to run create API subcommand %v", err)
}
+ // plugin specific migration
+ if err := kubebuilderGrafanaPlugin(config); err != nil {
+ log.Fatalf("Failed to run plugin migration %v", err)
+ }
return nil
}
@@ -142,12 +152,31 @@ func kubebuilderCreate(store store.Store) error {
return nil
}
+func kubebuilderGrafanaPlugin(store store.Store) error {
+ // If the plugin is already in the plugin chain, we don't need call 'edit' method
+ // Because the plugin is already migrated in the previous step
+ plugins := store.Config().GetPluginChain()
+ if slices.Contains(plugins, grafanaPluginKey) {
+ return nil
+ }
+ // If the plugin is not in the plugin chain, we need to call 'edit' method to add the plugin
+ var grafanaPlugin struct{}
+ err := store.Config().DecodePluginConfig(grafanaPluginKey, grafanaPlugin)
+ // If the grafana plugin is not found, we don't need to migrate
+ if errors.As(err, &config.PluginKeyNotFoundError{}) {
+ return nil
+ }
+ if err != nil {
+ return fmt.Errorf("Failed to Decode Grafana Plugin: %s. %v", grafanaPluginKey, err)
+ }
+ return migrateGrafanaPlugin()
+}
+
func getInitArgs(store store.Store) []string {
var args []string
plugins := store.Config().GetPluginChain()
if len(plugins) > 0 {
- args = append(args, "--plugins")
- args = append(args, plugins...)
+ args = append(args, "--plugins", strings.Join(plugins, ","))
}
domain := store.Config().GetDomain()
if domain != "" {
@@ -228,3 +257,8 @@ func getWebhookResourceFlags(resource resource.Resource) []string {
}
return args
}
+
+func migrateGrafanaPlugin() error {
+ args := []string{"edit", "--plugins", grafanaPluginKey}
+ return util.RunCmd("kubebuilder edit", "kubebuilder", args...)
+}
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
index 30d9f478f7d..6153f41eecb 100644
--- a/test/e2e/alphagenerate/generate_test.go
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -121,6 +121,12 @@ func ReGenerateProject(kbc *utils.TestContext) {
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("Enable grafana plugin to an existing project")
+ err = kbc.Edit(
+ "--plugins", "grafana.kubebuilder.io/v1-alpha",
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("regenerating the project at another output directory")
err = kbc.Regenerate(
"--input-dir", kbc.Dir,
@@ -178,4 +184,11 @@ func ReGenerateProject(kbc *utils.TestContext) {
filepath.Join(kbc.Dir, "testdir2", "PROJECT"), webhook)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected controller")
+ var grafanaPlugin = "grafana.kubebuilder.io/v1-alpha"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), grafanaPlugin)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
}
From 5f3b5454ea0473bd78102f759852674db7da7b21 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 24 Jul 2023 23:47:18 +0000
Subject: [PATCH 0238/1245] build(deps): bump github.com/onsi/gomega from
1.27.8 to 1.27.10
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.8 to 1.27.10.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.27.8...v1.27.10)
---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 79063c954c4..5e76d173405 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.11.0
- github.com/onsi/gomega v1.27.8
+ github.com/onsi/gomega v1.27.10
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
diff --git a/go.sum b/go.sum
index b43737423f7..dc819425fcf 100644
--- a/go.sum
+++ b/go.sum
@@ -144,8 +144,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
-github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc=
-github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ=
+github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
+github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pkg/errors v0.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=
From 91424ff70021c9b814ea1762e069944719d9de3c Mon Sep 17 00:00:00 2001
From: Sajiyah-Salat
Date: Tue, 25 Jul 2023 07:12:00 +0530
Subject: [PATCH 0239/1245] Update destroy func
---
test/e2e/utils/test_context.go | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/e2e/utils/test_context.go b/test/e2e/utils/test_context.go
index d9630d6c7d8..f40bf03d29e 100644
--- a/test/e2e/utils/test_context.go
+++ b/test/e2e/utils/test_context.go
@@ -232,9 +232,12 @@ func (t *TestContext) Tidy() error {
// Destroy is for cleaning up the docker images for testing
func (t *TestContext) Destroy() {
//nolint:gosec
- cmd := exec.Command("docker", "rmi", "-f", t.ImageName)
- if _, err := t.Run(cmd); err != nil {
- warnError(err)
+ // if image name is not present or not provided skip execution of docker command
+ if t.ImageName != "" {
+ cmd := exec.Command("docker", "rmi", "-f", t.ImageName)
+ if _, err := t.Run(cmd); err != nil {
+ warnError(err)
+ }
}
if err := os.RemoveAll(t.Dir); err != nil {
warnError(err)
From 9446f3590f8530638f9397d367969c41621ad966 Mon Sep 17 00:00:00 2001
From: Tony Jin
Date: Tue, 25 Jul 2023 15:51:47 -0400
Subject: [PATCH 0240/1245] fix: apply kustomize dir with correct flags
---
.../src/component-config-tutorial/testdata/project/README.md | 2 +-
docs/book/src/cronjob-tutorial/testdata/project/README.md | 2 +-
pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go | 2 +-
pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go | 2 +-
testdata/project-v3/README.md | 2 +-
testdata/project-v4-declarative-v1/README.md | 2 +-
testdata/project-v4-multigroup/.gitignore | 1 +
testdata/project-v4-multigroup/README.md | 2 +-
testdata/project-v4-with-deploy-image/README.md | 2 +-
testdata/project-v4-with-grafana/README.md | 2 +-
testdata/project-v4/.gitignore | 1 +
testdata/project-v4/README.md | 2 +-
12 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/README.md b/docs/book/src/component-config-tutorial/testdata/project/README.md
index 3a778e70fb1..a6dd2e20a6c 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/README.md
+++ b/docs/book/src/component-config-tutorial/testdata/project/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/README.md b/docs/book/src/cronjob-tutorial/testdata/project/README.md
index 3a778e70fb1..a6dd2e20a6c 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/README.md
+++ b/docs/book/src/cronjob-tutorial/testdata/project/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go
index fa5d003eb64..577f5a62a49 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/readme.go
@@ -45,7 +45,7 @@ func (f *Readme) SetTemplateDefaults() error {
"*/", "", 1)
f.TemplateBody = fmt.Sprintf(readmeFileTemplate,
- codeFence("kubectl apply -f config/samples/"),
+ codeFence("kubectl apply -k config/samples/"),
codeFence("make docker-build docker-push IMG=/{{ .ProjectName }}:tag"),
codeFence("make deploy IMG=/{{ .ProjectName }}:tag"),
codeFence("make uninstall"),
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
index fa5d003eb64..577f5a62a49 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
@@ -45,7 +45,7 @@ func (f *Readme) SetTemplateDefaults() error {
"*/", "", 1)
f.TemplateBody = fmt.Sprintf(readmeFileTemplate,
- codeFence("kubectl apply -f config/samples/"),
+ codeFence("kubectl apply -k config/samples/"),
codeFence("make docker-build docker-push IMG=/{{ .ProjectName }}:tag"),
codeFence("make deploy IMG=/{{ .ProjectName }}:tag"),
codeFence("make uninstall"),
diff --git a/testdata/project-v3/README.md b/testdata/project-v3/README.md
index b4c9056e073..58e3bc564ee 100644
--- a/testdata/project-v3/README.md
+++ b/testdata/project-v3/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/testdata/project-v4-declarative-v1/README.md b/testdata/project-v4-declarative-v1/README.md
index c95b85c1e6c..d798867cdda 100644
--- a/testdata/project-v4-declarative-v1/README.md
+++ b/testdata/project-v4-declarative-v1/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/testdata/project-v4-multigroup/.gitignore b/testdata/project-v4-multigroup/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/testdata/project-v4-multigroup/.gitignore
+++ b/testdata/project-v4-multigroup/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v4-multigroup/README.md b/testdata/project-v4-multigroup/README.md
index f6dd72dd359..39a1873fad4 100644
--- a/testdata/project-v4-multigroup/README.md
+++ b/testdata/project-v4-multigroup/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/testdata/project-v4-with-deploy-image/README.md b/testdata/project-v4-with-deploy-image/README.md
index 73139b76a94..395ffff16bb 100644
--- a/testdata/project-v4-with-deploy-image/README.md
+++ b/testdata/project-v4-with-deploy-image/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/testdata/project-v4-with-grafana/README.md b/testdata/project-v4-with-grafana/README.md
index 1a8632ec3e6..76c83cd34b7 100644
--- a/testdata/project-v4-with-grafana/README.md
+++ b/testdata/project-v4-with-grafana/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
diff --git a/testdata/project-v4/.gitignore b/testdata/project-v4/.gitignore
index 3827d421791..7f02333db7a 100644
--- a/testdata/project-v4/.gitignore
+++ b/testdata/project-v4/.gitignore
@@ -20,6 +20,7 @@ Dockerfile.cross
# editor and IDE paraphernalia
.idea
+.vscode
*.swp
*.swo
*~
diff --git a/testdata/project-v4/README.md b/testdata/project-v4/README.md
index 51b5315e4b0..215622184f4 100644
--- a/testdata/project-v4/README.md
+++ b/testdata/project-v4/README.md
@@ -12,7 +12,7 @@ You’ll need a Kubernetes cluster to run against. You can use [KIND](https://si
1. Install Instances of Custom Resources:
```sh
-kubectl apply -f config/samples/
+kubectl apply -k config/samples/
```
2. Build and push your image to the location specified by `IMG`:
From d5ccc155589f8de5a7fccec0c31e64a0daadd8cd Mon Sep 17 00:00:00 2001
From: Eileen
Date: Thu, 6 Jul 2023 19:14:44 -0400
Subject: [PATCH 0241/1245] docs: add tutorial for external plugin
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Co-authored-by: Rashmi Gottipati
Co-authored-by: Bryce Palmer
Co-authored-by: Tony Jin
---
docs/book/src/SUMMARY.md | 1 +
docs/book/src/plugins/external-plugins.md | 156 ++++++++++++++++++++++
2 files changed, 157 insertions(+)
create mode 100644 docs/book/src/plugins/external-plugins.md
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index 40773b5e525..bf6aa49abf5 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -130,6 +130,7 @@
- [Creating your own plugins](./plugins/creating-plugins.md)
- [Testing your own plugins](./plugins/testing-plugins.md)
- [Plugins Versioning](./plugins/plugins-versioning.md)
+ - [Extending Kubebuilder with external plugins](./plugins/external-plugins.md)
---
diff --git a/docs/book/src/plugins/external-plugins.md b/docs/book/src/plugins/external-plugins.md
new file mode 100644
index 00000000000..a6548a4f297
--- /dev/null
+++ b/docs/book/src/plugins/external-plugins.md
@@ -0,0 +1,156 @@
+# Extending Kubebuilder with external plugins
+
+## Overview
+
+Kubebuilder's functionality can be extended through the use of external plugins.
+
+An external plugin is an executable (can be written in any language) that implements an execution pattern that Kubebuilder knows how to interact with.
+
+The Kubebuilder CLI loads the external plugin in the specified path and interacts with it through `stdin` & `stdout`.
+
+## When is it useful?
+
+- If you want to create helpers or addons on top of the scaffolds done by Kubebuilder's default scaffolding.
+
+- If you design customized layouts and want to take advantage of functions from Kubebuilder library.
+
+- If you are looking for implementing plugins in a language other than `Go`.
+
+## How to write it?
+
+The inter-process communication between your external plugin and Kubebuilder is through the standard I/O.
+
+Your external plugin can be written in any language, given it adheres to the [PluginRequest][PluginRequest] and [PluginResponse][PluginResponse] type structures.
+
+`PluginRequest` encompasses all the data Kubebuilder collects from the CLI and previously executed plugins in the plugin chain.
+Kubebuilder conveys the marshaled PluginRequest (a `JSON` object) to the external plugin over `stdin`.
+
+Below is a sample JSON object of the `PluginRequest` type, triggered by `kubebuilder init --plugins sampleexternalplugin/v1 --domain my.domain`:
+```json
+{
+ "apiVersion": "v1alpha1",
+ "args": ["--domain", "my.domain"],
+ "command": "init",
+ "universe": {}
+}
+```
+
+`PluginResponse` represents the updated state of the project, as modified by the plugin. This data structure is serialized into `JSON` and sent back to Kubebuilder via `stdout`.
+
+Here is a sample JSON representation of the `PluginResponse` type:
+```json
+{
+ "apiVersion": "v1alpha1",
+ "command": "init",
+ "metadata": {
+ "description": "The `init` subcommand is meant to initialize a project via Kubebuilder. It scaffolds a single file: `initFile`",
+ "examples": "kubebuilder init --plugins sampleexternalplugin/v1 --domain my.domain"
+ },
+ "universe": {
+ "initFile": "A simple file created with the `init` subcommand"
+ },
+ "error": false,
+ "errorMsgs": []
+}
+```
+
+In this example, the `init` command of the plugin has created a new file called `initFile`.
+
+The content of this file is: `A simple file created with the init subcommand`, which is recorded in the `universe` field of the response.
+
+This output is then sent back to Kubebuilder, allowing it to incorporate the changes made by the plugin into the project.
+
+
+Caution
+
+When writing your own external plugin, you **should not** directly echo or print anything to the stdout.
+
+This is because Kubebuilder and your plugin are communicating with each other via `stdin` and `stdout` using structured `JSON` data.
+Any additional information sent to stdout (such as debug messages or logs) that's not part of the expected PluginResponse JSON structure may cause parsing errors when Kubebuilder tries to read and decode the response from your plugin.
+
+If you need to include logs or debug messages while developing your plugin, consider writing these messages to a log file instead.
+
+
+
+## How to use it?
+
+### Prerequisites
+- kubebuilder CLI > 3.11.0
+- An executable for the external plugin.
+
+ This could be a plugin that you've created yourself, or one from an external source.
+- Configuration of the external plugin's path.
+
+ This can be done by setting the `${EXTERNAL_PLUGINS_PATH}` environment variable, or by placing the plugin in a path that follows a `group-like name and version` scheme:
+```sh
+# for Linux
+$HOME/.config/kubebuilder/plugins/${name}/${version}
+
+# for OSX
+~/Library/Application Support/kubebuilder/plugins/${name}/${version}
+```
+
+### Subcommands:
+
+The external plugin supports the same subcommands as kubebuilder already provides:
+- `init`: project initialization.
+- `create api`: scaffold Kubernetes API definitions.
+- `create webhook`: scaffold Kubernetes webhooks.
+- `edit`: update the project configuration.
+
+Also, there are **Optional** subcommands for a better user experience:
+- `metadata`: add customized plugin description and examples when a `--help` flag is specified.
+- `flags`: specify valid flags for Kubebuilder to pass to the external plugin.
+
+
+More about `flags` subcommand
+
+The `flags` subcommand in an external plugin allows for early error detection by informing Kubebuilder about the flags the plugin supports. If an unsupported flag is identified, Kubebuilder can issue an error before the plugin is called to execute.
+If a plugin does not implement the `flags` subcommand, Kubebuilder will pass all flags to the plugin, making it the external plugin's responsibility to handle any invalid flags.
+
+
+
+### Configuration
+
+You can configure your plugin path with a ENV VAR `$EXTERNAL_PLUGINS_PATH` to tell Kubebuilder where to search for the plugin binary, such as:
+```sh
+export EXTERNAL_PLUGINS_PATH =
+```
+
+Otherwise, Kubebuilder would search for the plugins in a default path based on your OS.
+
+Now, you can using it by calling the CLI commands:
+```sh
+# Initialize a new project with the external plugin named `sampleplugin`
+kubebuilder init --plugins sampleplugin/v1
+
+# Display help information of the `init` subcommand of the external plugin
+kubebuilder init --plugins sampleplugin/v1 --help
+
+# Create a new API with the above external plugin with a customized flag `number`
+kubebuilder create api --plugins sampleplugin/v1 --number 2
+
+# Create a webhook with the above external plugin with a customized flag `hooked`
+kubebuilder create webhook --plugins sampleplugin/v1 --hooked
+
+# Update the project configuration with the above external plugin
+kubebuilder edit --plugins sampleplugin/v1
+
+# Create new APIs with external plugins v1 and v2 by respecting the plugin chaining order
+kubebuilder create api --plugins sampleplugin/v1,sampleplugin/v2
+
+# Create new APIs with the go/v4 plugin and then pass those files to the external plugin by respecting the plugin chaining order
+kubebuilder create api --plugins go/v4,sampleplugin/v1
+```
+
+
+## Further resources
+
+- Check the [design proposal of the external plugin](https://github.com/kubernetes-sigs/kubebuilder/blob/master/designs/extensible-cli-and-scaffolding-plugins-phase-2.md)
+- Check the [plugin implementation](https://github.com/kubernetes-sigs/kubebuilder/pull/2338)
+- A [sample external plugin written in Go](https://github.com/kubernetes-sigs/kubebuilder/tree/master/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1)
+- A [sample external plugin written in Python](https://github.com/rashmigottipati/POC-Phase2-Plugins)
+- A [sample external plugin written in JavaScript](https://github.com/Eileen-Yu/kb-js-plugin)
+
+[PluginRequest]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugin/external/types.go#L23
+[PluginResponse]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugin/external/types.go#L42
From 7c1ca0df46cab0398bd385c9e14d4ab0b9279950 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Tue, 25 Jul 2023 13:26:39 +0800
Subject: [PATCH 0242/1245] feat: copy grafana config files when rescaffold
feat: reafactor code due to suggestions
feat: revert unused import in mod file
fix: add warning and fix test cases
fix: golang lint
feat: adjust work flow and revert slice dependency
---
go.mod | 1 -
go.sum | 2 -
pkg/rescaffold/migrate.go | 61 +++++++++++++++++--------
test/e2e/alphagenerate/generate_test.go | 23 ++++++++++
4 files changed, 65 insertions(+), 22 deletions(-)
diff --git a/go.mod b/go.mod
index 79063c954c4..33866c029e7 100644
--- a/go.mod
+++ b/go.mod
@@ -23,7 +23,6 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
- golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
diff --git a/go.sum b/go.sum
index b43737423f7..79c5ca6cab3 100644
--- a/go.sum
+++ b/go.sum
@@ -199,8 +199,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw=
-golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 7e443865c34..770970a87f0 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -21,8 +21,6 @@ import (
"os/exec"
"strings"
- "golang.org/x/exp/slices"
-
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/config/store"
@@ -42,7 +40,7 @@ const grafanaPluginKey = "grafana.kubebuilder.io/v1-alpha"
func (opts *MigrateOptions) Rescaffold() error {
config := yaml.New(machinery.Filesystem{FS: afero.NewOsFs()})
- if err := config.LoadFrom(opts.InputDir); err != nil {
+ if err := config.LoadFrom(fmt.Sprintf("%s/%s", opts.InputDir, yaml.DefaultPath)); err != nil {
log.Fatalf("Failed to load PROJECT file %v", err)
}
// create output directory
@@ -67,7 +65,7 @@ func (opts *MigrateOptions) Rescaffold() error {
log.Fatalf("Failed to run create API subcommand %v", err)
}
// plugin specific migration
- if err := kubebuilderGrafanaPlugin(config); err != nil {
+ if err := migrateGrafanaPlugin(config, opts.InputDir, opts.OutputDir); err != nil {
log.Fatalf("Failed to run plugin migration %v", err)
}
return nil
@@ -102,7 +100,7 @@ func getInputPath(currentWorkingDirectory string, inputPath string) (string, err
if _, err := os.Stat(projectPath); os.IsNotExist(err) {
return "", fmt.Errorf("PROJECT path: %s does not exist. %v", projectPath, err)
}
- return projectPath, nil
+ return inputPath, nil
}
func getOutputPath(currentWorkingDirectory, outputPath string) (string, error) {
@@ -152,24 +150,26 @@ func kubebuilderCreate(store store.Store) error {
return nil
}
-func kubebuilderGrafanaPlugin(store store.Store) error {
- // If the plugin is already in the plugin chain, we don't need call 'edit' method
- // Because the plugin is already migrated in the previous step
- plugins := store.Config().GetPluginChain()
- if slices.Contains(plugins, grafanaPluginKey) {
- return nil
- }
- // If the plugin is not in the plugin chain, we need to call 'edit' method to add the plugin
+func migrateGrafanaPlugin(store store.Store, src, des string) error {
var grafanaPlugin struct{}
err := store.Config().DecodePluginConfig(grafanaPluginKey, grafanaPlugin)
// If the grafana plugin is not found, we don't need to migrate
- if errors.As(err, &config.PluginKeyNotFoundError{}) {
- return nil
+ if err != nil {
+ if errors.As(err, &config.PluginKeyNotFoundError{}) {
+ log.Printf("Grafana plugin is not found, skip the migration")
+ return nil
+ }
+ return fmt.Errorf("failed to decode grafana plugin config %v", err)
}
+ err = kubebuilderGrafanaEdit()
if err != nil {
- return fmt.Errorf("Failed to Decode Grafana Plugin: %s. %v", grafanaPluginKey, err)
+ return err
+ }
+ err = grafanaConfigMigrate(src, des)
+ if err != nil {
+ return err
}
- return migrateGrafanaPlugin()
+ return kubebuilderGrafanaEdit()
}
func getInitArgs(store store.Store) []string {
@@ -258,7 +258,30 @@ func getWebhookResourceFlags(resource resource.Resource) []string {
return args
}
-func migrateGrafanaPlugin() error {
+func copyFile(src, des string) error {
+ // nolint:gosec
+ bytesRead, err := os.ReadFile(src)
+ if err != nil {
+ return fmt.Errorf("Source file path: %s does not exist. %v", src, err)
+ }
+ //Copy all the contents to the desitination file
+ // nolint:gosec
+ return os.WriteFile(des, bytesRead, 0755)
+}
+
+func grafanaConfigMigrate(src, des string) error {
+ grafanaConfig := fmt.Sprintf("%s/%s", src, "grafana/custom-metrics/config.yaml")
+ if _, err := os.Stat(grafanaConfig); os.IsNotExist(err) {
+ return fmt.Errorf("Grafana Config path: %s does not exist. %v", grafanaConfig, err)
+ }
+ return copyFile(grafanaConfig, fmt.Sprintf("%s/%s", des, "grafana/custom-metrics/config.yaml"))
+}
+
+func kubebuilderGrafanaEdit() error {
args := []string{"edit", "--plugins", grafanaPluginKey}
- return util.RunCmd("kubebuilder edit", "kubebuilder", args...)
+ err := util.RunCmd("kubebuilder edit", "kubebuilder", args...)
+ if err != nil {
+ return fmt.Errorf("Failed to run edit subcommand for Grafana Plugin %v", err)
+ }
+ return nil
}
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
index 6153f41eecb..9a9a202722e 100644
--- a/test/e2e/alphagenerate/generate_test.go
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -18,6 +18,8 @@ package alphagenerate
import (
"fmt"
+ "io"
+ "os"
"path/filepath"
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
@@ -127,6 +129,16 @@ func ReGenerateProject(kbc *utils.TestContext) {
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("Edit the grafana config file")
+ grafanaConfig, err := os.OpenFile(filepath.Join(kbc.Dir, "grafana/custom-metrics/config.yaml"),
+ os.O_APPEND|os.O_WRONLY, 0644)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ newLine := "test_new_line"
+ _, err = io.WriteString(grafanaConfig, newLine)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ err = grafanaConfig.Close()
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("regenerating the project at another output directory")
err = kbc.Regenerate(
"--input-dir", kbc.Dir,
@@ -191,4 +203,15 @@ func ReGenerateProject(kbc *utils.TestContext) {
filepath.Join(kbc.Dir, "testdir2", "PROJECT"), grafanaPlugin)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
+
+ By("checking if the generated grafana config file has the same content as the old one")
+ grafanaConfigPath := filepath.Join(kbc.Dir, "grafana/custom-metrics/config.yaml")
+ generatedGrafanaConfigPath := filepath.Join(kbc.Dir, "testdir2", "grafana/custom-metrics/config.yaml")
+ Expect(grafanaConfigPath).Should(BeARegularFile())
+ Expect(generatedGrafanaConfigPath).Should(BeARegularFile())
+ bytesBefore, err := os.ReadFile(grafanaConfigPath)
+ Expect(err).NotTo(HaveOccurred())
+ bytesAfter, err := os.ReadFile(generatedGrafanaConfigPath)
+ Expect(err).NotTo(HaveOccurred())
+ Expect(bytesBefore).Should(Equal(bytesAfter))
}
From 01681bb7fea0848d138636a8b76736531c550852 Mon Sep 17 00:00:00 2001
From: Benjamin <25504895+Benjaminvdv@users.noreply.github.com>
Date: Wed, 2 Aug 2023 13:59:07 +0200
Subject: [PATCH 0243/1245] chore(docs): change folder pkg to
internal/controller in the migration guide
---
.../book/src/migration/manually_migration_guide_gov3_to_gov4.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 8ead1c1a293..1fccbb456d0 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
@@ -66,7 +66,7 @@ Therefore, you can check the changes in the layout results into:
- 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
+ - Update the `main.go` imports to look for the new path of your controllers under the `internal/controller` directory
**Then, let's update the scaffolds paths**
From 7cdcfa34ae499c0735d60c7180c61b5a027f45d2 Mon Sep 17 00:00:00 2001
From: Eileen
Date: Thu, 3 Aug 2023 15:36:03 -0400
Subject: [PATCH 0244/1245] fix: ensure external plugin can scaffold files in
new dirs
---
pkg/plugins/external/helpers.go | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/pkg/plugins/external/helpers.go b/pkg/plugins/external/helpers.go
index 702cb1dc84c..a1bc759317e 100644
--- a/pkg/plugins/external/helpers.go
+++ b/pkg/plugins/external/helpers.go
@@ -168,7 +168,15 @@ func handlePluginResponse(fs machinery.Filesystem, req external.PluginRequest, p
}
for filename, data := range res.Universe {
- f, err := fs.FS.Create(filepath.Join(currentDir, filename))
+ path := filepath.Join(currentDir, filename)
+ dir := filepath.Dir(path)
+
+ // create the directory if it does not exist
+ if err := os.MkdirAll(dir, 0o750); err != nil {
+ return fmt.Errorf("error creating the directory: %v", err)
+ }
+
+ f, err := fs.FS.Create(path)
if err != nil {
return err
}
From b1bf8bb9d7c1fd3fbe1751d3e946a544e435ab99 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 8 Aug 2023 00:01:00 +0000
Subject: [PATCH 0245/1245] build(deps): bump golang.org/x/tools from 0.11.0 to
0.12.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.11.0...v0.12.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 8 ++++----
go.sum | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/go.mod b/go.mod
index aeb519b1c49..91c755c5f93 100644
--- a/go.mod
+++ b/go.mod
@@ -10,8 +10,8 @@ require (
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
- golang.org/x/text v0.11.0
- golang.org/x/tools v0.11.0
+ golang.org/x/text v0.12.0
+ golang.org/x/tools v0.12.0
sigs.k8s.io/yaml v1.3.0
)
@@ -24,8 +24,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.12.0 // indirect
- golang.org/x/net v0.12.0 // indirect
- golang.org/x/sys v0.10.0 // indirect
+ golang.org/x/net v0.14.0 // indirect
+ golang.org/x/sys v0.11.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 45aa4224a8c..6b1f71c7eb8 100644
--- a/go.sum
+++ b/go.sum
@@ -256,8 +256,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
-golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
+golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
+golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
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=
@@ -314,8 +314,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
-golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/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=
@@ -325,8 +325,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
-golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
+golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
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=
@@ -377,8 +377,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.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8=
-golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8=
+golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
+golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
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=
From 136aac668f3fa4b59dbe381893776a634134abc3 Mon Sep 17 00:00:00 2001
From: Sajiyah Salat <109643863+Sajiyah-Salat@users.noreply.github.com>
Date: Tue, 15 Aug 2023 18:34:45 +0530
Subject: [PATCH 0246/1245] :seedling: Image name edge cases covered (#3514)
imagename edge case cover
---
test/e2e/utils/test_context.go | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/test/e2e/utils/test_context.go b/test/e2e/utils/test_context.go
index c10b8e138b9..6ee508eb74c 100644
--- a/test/e2e/utils/test_context.go
+++ b/test/e2e/utils/test_context.go
@@ -243,10 +243,16 @@ func (t *TestContext) Destroy() {
//nolint:gosec
// if image name is not present or not provided skip execution of docker command
if t.ImageName != "" {
- cmd := exec.Command("docker", "rmi", "-f", t.ImageName)
- if _, err := t.Run(cmd); err != nil {
- warnError(err)
+ // Check white space from image name
+ if len(strings.TrimSpace(t.ImageName)) == 0 {
+ fmt.Println("Image not set, skip cleaning up of docker image")
+ } else {
+ cmd := exec.Command("docker", "rmi", "-f", t.ImageName)
+ if _, err := t.Run(cmd); err != nil {
+ warnError(err)
+ }
}
+
}
if err := os.RemoveAll(t.Dir); err != nil {
warnError(err)
From 266a038a591fbfe1419074a95ab639adab3eb1dd Mon Sep 17 00:00:00 2001
From: Sajiyah Salat <109643863+Sajiyah-Salat@users.noreply.github.com>
Date: Tue, 15 Aug 2023 18:35:13 +0530
Subject: [PATCH 0247/1245] :seedling: logs info updated (#3512)
logs info updated
---
.../generate_component_config.go | 6 ++---
.../cronjob-tutorial/generate_cronjob.go | 24 +++++++++----------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/hack/docs/internal/component-config-tutorial/generate_component_config.go b/hack/docs/internal/component-config-tutorial/generate_component_config.go
index 897f80a306e..ffd872aa813 100644
--- a/hack/docs/internal/component-config-tutorial/generate_component_config.go
+++ b/hack/docs/internal/component-config-tutorial/generate_component_config.go
@@ -56,7 +56,7 @@ func newSampleContext(binaryPath string, samplePath string, env ...string) utils
// Prepare the Context for the sample project
func (sp *Sample) Prepare() {
- log.Infof("destroying directory for sample project")
+ log.Infof("destroying directory for component_config sample project")
sp.ctx.Destroy()
log.Infof("refreshing tools and creating directory...")
@@ -66,7 +66,7 @@ func (sp *Sample) Prepare() {
}
func (sp *Sample) GenerateSampleProject() {
- log.Infof("Initializing the project")
+ log.Infof("Initializing the component config project")
err := sp.ctx.Init(
"--domain", "tutorial.kubebuilder.io",
"--repo", "tutorial.kubebuilder.io/project",
@@ -75,7 +75,7 @@ func (sp *Sample) GenerateSampleProject() {
"--plugins=go/v4",
"--component-config",
)
- CheckError("Initializing the project", err)
+ CheckError("Initializing the component config project", err)
log.Infof("Adding a new config type")
err = sp.ctx.CreateAPI(
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 70f10e7e324..e983e2e5d31 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -56,7 +56,7 @@ func newSampleContext(binaryPath string, samplePath string, env ...string) utils
// Prepare the Context for the sample project
func (sp *Sample) Prepare() {
- log.Infof("destroying directory for sample project")
+ log.Infof("destroying directory for cronjob sample project")
sp.ctx.Destroy()
log.Infof("refreshing tools and creating directory...")
@@ -66,7 +66,7 @@ func (sp *Sample) Prepare() {
}
func (sp *Sample) GenerateSampleProject() {
- log.Infof("Initializing the project")
+ log.Infof("Initializing the cronjob project")
err := sp.ctx.Init(
"--plugins", "go/v4",
@@ -75,7 +75,7 @@ func (sp *Sample) GenerateSampleProject() {
"--license", "apache2",
"--owner", "The Kubernetes authors",
)
- CheckError("Initializing the project", err)
+ CheckError("Initializing the cronjob project", err)
log.Infof("Adding a new config type")
err = sp.ctx.CreateAPI(
@@ -466,13 +466,13 @@ func updateSuiteTest(sp *Sample) {
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`limitations under the License.
*/`, SuiteTestIntro)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add license intro", err)
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`import (`, `
"context"`)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add context", err)
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
@@ -481,7 +481,7 @@ func updateSuiteTest(sp *Sample) {
`, `
ctrl "sigs.k8s.io/controller-runtime"
`)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add ctrl import", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
@@ -490,14 +490,14 @@ var cfg *rest.Config
var k8sClient client.Client
var testEnv *envtest.Environment
`, SuiteTestEnv)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add more variables", err)
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
`
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
`, SuiteTestReadCRD)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add text about CRD", err)
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
@@ -507,7 +507,7 @@ var testEnv *envtest.Environment
/*
Then, we start the envtest cluster.
*/`)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add text to show where envtest cluster start", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
@@ -517,7 +517,7 @@ var testEnv *envtest.Environment
//+kubebuilder:scaffold:scheme
`, SuiteTestAddSchema)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to add schema", err)
err = pluginutil.InsertCode(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
@@ -526,7 +526,7 @@ var testEnv *envtest.Environment
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
`, SuiteTestDescription)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go for test description", err)
err = pluginutil.ReplaceInFile(
filepath.Join(sp.ctx.Dir, "internal/controller/suite_test.go"),
@@ -537,7 +537,7 @@ var _ = AfterSuite(func() {
Expect(err).NotTo(HaveOccurred())
})
`, SuiteTestCleanup)
- CheckError("fixing suite_test.go", err)
+ CheckError("updating suite_test.go to cleanup tests", err)
}
func updateKustomization(sp *Sample) {
From c9f35442d3790f58354807dd688829215b9f46ad Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Mon, 14 Aug 2023 15:19:47 +0100
Subject: [PATCH 0248/1245] :bug: fix doc preview
---
docs/book/book.toml | 8 +++++++-
docs/book/install-and-build.sh | 12 ++++++++----
netlify.toml | 2 +-
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/docs/book/book.toml b/docs/book/book.toml
index c6244a05df3..557e903a20c 100644
--- a/docs/book/book.toml
+++ b/docs/book/book.toml
@@ -5,7 +5,6 @@ src = "src"
title = "The Kubebuilder Book"
[output.html]
-google-analytics = "UA-119864590-1"
curly-quotes = true
additional-css = ["theme/css/markers.css", "theme/css/custom.css", "theme/css/version-dropdown.css"]
git-repository-url = "https://github.com/kubernetes-sigs/kubebuilder"
@@ -16,3 +15,10 @@ command = "./litgo.sh"
[preprocessor.markerdocs]
command = "./markerdocs.sh"
+
+[context.environment]
+ environment = { GO_VERSION = "1.20" }
+
+[context.deploy-preview.environment]
+ environment = { GO_VERSION = "1.20" }
+
diff --git a/docs/book/install-and-build.sh b/docs/book/install-and-build.sh
index 1d6fc263592..81c72a7bdd8 100755
--- a/docs/book/install-and-build.sh
+++ b/docs/book/install-and-build.sh
@@ -23,7 +23,10 @@ THIS_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd "$THIS_DIR"
-[[ -n "$(command -v gimme)" ]] && eval "$(gimme stable)"
+if [[ -n "$(command -v gimme)" ]]; then
+ GO_VERSION=${GO_VERSION:-stable} # Use the provided GO_VERSION or default to 'stable'
+ eval "$(gimme $GO_VERSION)"
+fi
echo go version
GOBIN=$THIS_DIR/functions go install ./...
@@ -60,14 +63,15 @@ esac
# grab mdbook
# we hardcode linux/amd64 since rust uses a different naming scheme and it's a pain to tran
-echo "downloading mdBook-v0.4.21-${arch}-${target}.${ext}"
+echo "downloading mdBook-v0.4.34-${arch}-${target}.${ext}"
set -x
-curl -sL -o /tmp/mdbook.${ext} https://github.com/rust-lang-nursery/mdBook/releases/download/v0.4.2/mdBook-v0.4.2-${arch}-${target}.${ext}
+curl -sL -o /tmp/mdbook.${ext} https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdBook-v0.4.34-${arch}-${target}.${ext}
${cmd} /tmp/mdbook.${ext}
chmod +x /tmp/mdbook
echo "grabbing the latest released controller-gen"
-go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0
+go version
+go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.1
# make sure we add the go bin directory to our path
gobin=$(go env GOBIN)
diff --git a/netlify.toml b/netlify.toml
index 388292ee449..d3dd304a5a0 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -1,6 +1,6 @@
[build]
base = "docs/book"
- command = "./install-and-build.sh"
+ command = "GO_VERSION=1.20 ./install-and-build.sh"
publish = "docs/book/book"
functions = "docs/book/functions"
From 68abac1dfb5550f7159dec4ce600cd9b6db925bb Mon Sep 17 00:00:00 2001
From: "Tony (TianYi)"
Date: Tue, 15 Aug 2023 09:20:36 -0400
Subject: [PATCH 0249/1245] =?UTF-8?q?=F0=9F=90=9B:=20sync=20kb=20binary=20?=
=?UTF-8?q?from=20source=20code=20for=20docs=20(#3520)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
fix: sync kb binary from source code for docs
---
Makefile | 2 +-
hack/docs/check.sh | 7 ++-----
hack/docs/generate.sh | 23 +++++++++++++++++++++++
hack/docs/generate_samples.go | 8 +++++---
4 files changed, 31 insertions(+), 9 deletions(-)
create mode 100755 hack/docs/generate.sh
diff --git a/Makefile b/Makefile
index 3e49bccab68..701c0cf1892 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/ku
.PHONY: generate-docs
generate-docs: ## Update/generate the docs in $GOPATH/src/sigs.k8s.io/kubebuilder
- go run hack/docs/generate_samples.go
+ ./hack/docs/generate.sh
.PHONY: check-docs
check-docs: ## Run the script to ensure that the docs are updated
diff --git a/hack/docs/check.sh b/hack/docs/check.sh
index 85843ce52c3..b41e41bfc67 100755
--- a/hack/docs/check.sh
+++ b/hack/docs/check.sh
@@ -14,10 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-source "$(dirname "$0")/../../test/common.sh"
-
-build_kb
-
check_directory="$(dirname "$0")/../../docs/book/src/"
# Check docs directory first. If there are any uncommitted change, fail the test.
@@ -27,7 +23,8 @@ if [[ $(git status ${check_directory} --porcelain) ]]; then
exit 1
fi
-make generate-docs
+
+$(dirname "$0")/generate.sh
# Check if there are any changes to files under testdata directory.
if [[ $(git status ${check_directory} --porcelain) ]]; then
diff --git a/hack/docs/generate.sh b/hack/docs/generate.sh
new file mode 100755
index 00000000000..ac486ab5aa7
--- /dev/null
+++ b/hack/docs/generate.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+# Copyright 2023 The 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.
+
+source "$(dirname "$0")/../../test/common.sh"
+
+build_kb
+
+docs_gen_directory="$(dirname "$0")/../../hack/docs/generate_samples.go"
+go run ${docs_gen_directory}
+
diff --git a/hack/docs/generate_samples.go b/hack/docs/generate_samples.go
index f2a6171003f..facecea0e68 100644
--- a/hack/docs/generate_samples.go
+++ b/hack/docs/generate_samples.go
@@ -21,9 +21,11 @@ import (
componentconfig "sigs.k8s.io/kubebuilder/v3/hack/docs/internal/component-config-tutorial"
cronjob "sigs.k8s.io/kubebuilder/v3/hack/docs/internal/cronjob-tutorial"
- "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
)
+// Make sure executing `build_kb` to generate kb executable from the source code
+const KubebuilderBinName = "/tmp/kubebuilder/bin/kubebuilder"
+
func main() {
fmt.Println("Generating documents...")
@@ -36,7 +38,7 @@ func main() {
}
func UpdateComponentConfigTutorial() {
- binaryPath := util.KubebuilderBinName
+ binaryPath := KubebuilderBinName
samplePath := "docs/book/src/component-config-tutorial/testdata/project/"
sp := componentconfig.NewSample(binaryPath, samplePath)
@@ -51,7 +53,7 @@ func UpdateComponentConfigTutorial() {
}
func UpdateCronjobTutorial() {
- binaryPath := util.KubebuilderBinName
+ binaryPath := KubebuilderBinName
samplePath := "docs/book/src/cronjob-tutorial/testdata/project/"
sp := cronjob.NewSample(binaryPath, samplePath)
From b893c1182c1cf71676af52ab8f2f4d3f30829bde Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 22 Apr 2023 08:16:50 +0100
Subject: [PATCH 0250/1245] :bug: (go/v4) fix makefile target to build images
ensuring its single responsability
---
.../src/component-config-tutorial/testdata/project/Makefile | 4 ++--
docs/book/src/cronjob-tutorial/testdata/project/Makefile | 4 ++--
.../golang/v4/scaffolds/internal/templates/makefile.go | 4 ++--
testdata/project-v4-declarative-v1/Makefile | 4 ++--
testdata/project-v4-multigroup/Makefile | 4 ++--
testdata/project-v4-with-deploy-image/Makefile | 4 ++--
testdata/project-v4-with-grafana/Makefile | 4 ++--
testdata/project-v4/Makefile | 4 ++--
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index 60603908794..a5981c57b85 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index 60603908794..a5981c57b85 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index aad92fb4ddb..c1c543543fa 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -142,7 +142,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -157,7 +157,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile
index 60603908794..a5981c57b85 100644
--- a/testdata/project-v4-declarative-v1/Makefile
+++ b/testdata/project-v4-declarative-v1/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index 60603908794..a5981c57b85 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index 60603908794..a5981c57b85 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index 60603908794..a5981c57b85 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index 60603908794..a5981c57b85 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -78,7 +78,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
-docker-build: test ## Build docker image with the manager.
+docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
.PHONY: docker-push
@@ -93,7 +93,7 @@ docker-push: ## Push docker image with the manager.
# To properly provided solutions that supports more than one platform you should use this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
-docker-buildx: test ## Build and push docker image for the manager for cross-platform support
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
From 1d9d4777089cd8981fff0523b0ccb07026d2f925 Mon Sep 17 00:00:00 2001
From: Claudio Busse
Date: Thu, 17 Aug 2023 16:44:49 +0200
Subject: [PATCH 0251/1245] :book: fix escaped html in markdown code segments
---
docs/book/utils/markerdocs/html.go | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/docs/book/utils/markerdocs/html.go b/docs/book/utils/markerdocs/html.go
index 42f1a47e1a5..471d8a83b4f 100644
--- a/docs/book/utils/markerdocs/html.go
+++ b/docs/book/utils/markerdocs/html.go
@@ -39,10 +39,29 @@ type toHTML interface {
// Text is a chunk of text in an HTML doc.
type Text string
-// WriteHTML writes the string as HTML to the given Writer
+// WriteHTML writes the string as HTML to the given Writer while accounting for mdBook's handling
+// of backticks. Given mdBook's behavior of treating backticked content as raw text, this function
+// ensures proper rendering by preventing unnecessary HTML escaping within code snippets. Chunks
+// outside of backticks are HTML-escaped for security, while chunks inside backticks remain as raw
+// text, preserving mdBook's intended rendering of code content.
func (t Text) WriteHTML(w io.Writer) error {
- _, err := io.WriteString(w, html.EscapeString(string(t)))
- return err
+ textChunks := strings.Split(string(t), "`")
+
+ for i, chunk := range textChunks {
+ if i%2 == 0 { // Outside backticks, escape and write HTML
+ _, err := io.WriteString(w, html.EscapeString(chunk))
+ if err != nil {
+ return err
+ }
+ } else { // Inside backticks, write raw HTML
+ _, err := io.WriteString(w, "`"+chunk+"`")
+ if err != nil {
+ return err
+ }
+ }
+ }
+
+ return nil
}
// Tag is some tag with contents and attributes in an HTML doc.
From cbc7872c1ae82b321b4b02c7d53eb3a6c1463dda Mon Sep 17 00:00:00 2001
From: Claudio Busse
Date: Thu, 17 Aug 2023 21:25:54 +0200
Subject: [PATCH 0252/1245] :bug: fix typos in scaffolded makefiles
---
Makefile | 2 +-
.../testdata/project/Makefile | 16 ++++++++--------
.../cronjob-tutorial/testdata/project/Makefile | 16 ++++++++--------
.../testdata/project/Makefile | 16 ++++++++--------
.../testdata/sampleexternalplugin/v1/Makefile | 2 +-
.../v2/scaffolds/internal/templates/makefile.go | 2 +-
.../v3/scaffolds/internal/templates/makefile.go | 16 ++++++++--------
.../v4/scaffolds/internal/templates/makefile.go | 16 ++++++++--------
testdata/project-v2/Makefile | 2 +-
testdata/project-v3/Makefile | 16 ++++++++--------
testdata/project-v4-declarative-v1/Makefile | 16 ++++++++--------
testdata/project-v4-multigroup/Makefile | 16 ++++++++--------
testdata/project-v4-with-deploy-image/Makefile | 16 ++++++++--------
testdata/project-v4-with-grafana/Makefile | 16 ++++++++--------
testdata/project-v4/Makefile | 16 ++++++++--------
15 files changed, 92 insertions(+), 92 deletions(-)
diff --git a/Makefile b/Makefile
index 701c0cf1892..a2e19562d58 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ endif
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/docs/book/src/multiversion-tutorial/testdata/project/Makefile b/docs/book/src/multiversion-tutorial/testdata/project/Makefile
index 7ff4e8f8ae5..062d6b44a64 100644
--- a/docs/book/src/multiversion-tutorial/testdata/project/Makefile
+++ b/docs/book/src/multiversion-tutorial/testdata/project/Makefile
@@ -23,7 +23,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -72,8 +72,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -83,12 +83,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
docker push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/Makefile b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/Makefile
index f2da5e292db..e1ea7394d55 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/Makefile
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/Makefile
@@ -20,7 +20,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go
index 5aedcb17f0e..94ecf72fad2 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go
@@ -74,7 +74,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
index 2249c3350fb..6b5d7dfc477 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go
@@ -83,7 +83,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -128,8 +128,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
go run ./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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -139,12 +139,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
docker push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index aad92fb4ddb..6e751ad0f51 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -89,7 +89,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -138,8 +138,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -149,12 +149,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/testdata/project-v2/Makefile b/testdata/project-v2/Makefile
index 0fb3a7ac737..09b2518aa71 100644
--- a/testdata/project-v2/Makefile
+++ b/testdata/project-v2/Makefile
@@ -18,7 +18,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
diff --git a/testdata/project-v3/Makefile b/testdata/project-v3/Makefile
index 73a01c158dd..d3476d64fd9 100644
--- a/testdata/project-v3/Makefile
+++ b/testdata/project-v3/Makefile
@@ -23,7 +23,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -68,8 +68,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
go run ./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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -79,12 +79,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
docker push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/testdata/project-v4-declarative-v1/Makefile
+++ b/testdata/project-v4-declarative-v1/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index 60603908794..ca35b69cc0d 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -29,7 +29,7 @@ all: build
# The help target prints out all targets with their descriptions organized
# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk commands is responsible for reading the
+# target descriptions by '##'. The awk command is responsible for reading the
# entire set of makefiles included in this invocation, looking for lines of the
# file as xyz: ## something, and then pretty-format the target and help. Then,
# if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -74,8 +74,8 @@ build: manifests generate fmt vet ## Build manager binary.
run: manifests generate fmt vet ## Run a controller from your host.
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.
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
@@ -85,12 +85,12 @@ docker-build: test ## Build docker image with the manager.
docker-push: ## Push docker image with the manager.
$(CONTAINER_TOOL) push ${IMG}
-# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
-# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image for your registry (i.e. if you do not inform a valid value via IMG=> then the export will fail)
-# To properly provided solutions that supports more than one platform you should use this option.
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
From 1099b02fd0e3411561ab2c2dc9b8863106db9fae Mon Sep 17 00:00:00 2001
From: Eileen
Date: Thu, 24 Aug 2023 15:34:16 -0400
Subject: [PATCH 0253/1245] refactor: externalize cfg
---
pkg/config/v3/config.go | 60 ++++++++++++++++++------------------
pkg/config/v3/config_test.go | 28 ++++++++---------
2 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/pkg/config/v3/config.go b/pkg/config/v3/config.go
index 335eb348423..58f2eda3d47 100644
--- a/pkg/config/v3/config.go
+++ b/pkg/config/v3/config.go
@@ -52,7 +52,7 @@ func (ss *stringSlice) UnmarshalJSON(b []byte) error {
return nil
}
-type cfg struct {
+type Cfg struct {
// Version
Version config.Version `json:"version"`
@@ -81,7 +81,7 @@ type pluginConfig interface{}
// New returns a new config.Config
func New() config.Config {
- return &cfg{Version: Version}
+ return &Cfg{Version: Version}
}
func init() {
@@ -89,95 +89,95 @@ func init() {
}
// GetVersion implements config.Config
-func (c cfg) GetVersion() config.Version {
+func (c Cfg) GetVersion() config.Version {
return c.Version
}
// GetDomain implements config.Config
-func (c cfg) GetDomain() string {
+func (c Cfg) GetDomain() string {
return c.Domain
}
// SetDomain implements config.Config
-func (c *cfg) SetDomain(domain string) error {
+func (c *Cfg) SetDomain(domain string) error {
c.Domain = domain
return nil
}
// GetRepository implements config.Config
-func (c cfg) GetRepository() string {
+func (c Cfg) GetRepository() string {
return c.Repository
}
// SetRepository implements config.Config
-func (c *cfg) SetRepository(repository string) error {
+func (c *Cfg) SetRepository(repository string) error {
c.Repository = repository
return nil
}
// GetProjectName implements config.Config
-func (c cfg) GetProjectName() string {
+func (c Cfg) GetProjectName() string {
return c.Name
}
// SetProjectName implements config.Config
-func (c *cfg) SetProjectName(name string) error {
+func (c *Cfg) SetProjectName(name string) error {
c.Name = name
return nil
}
// GetPluginChain implements config.Config
-func (c cfg) GetPluginChain() []string {
+func (c Cfg) GetPluginChain() []string {
return c.PluginChain
}
// SetPluginChain implements config.Config
-func (c *cfg) SetPluginChain(pluginChain []string) error {
+func (c *Cfg) SetPluginChain(pluginChain []string) error {
c.PluginChain = pluginChain
return nil
}
// IsMultiGroup implements config.Config
-func (c cfg) IsMultiGroup() bool {
+func (c Cfg) IsMultiGroup() bool {
return c.MultiGroup
}
// SetMultiGroup implements config.Config
-func (c *cfg) SetMultiGroup() error {
+func (c *Cfg) SetMultiGroup() error {
c.MultiGroup = true
return nil
}
// ClearMultiGroup implements config.Config
-func (c *cfg) ClearMultiGroup() error {
+func (c *Cfg) ClearMultiGroup() error {
c.MultiGroup = false
return nil
}
// IsComponentConfig implements config.Config
-func (c cfg) IsComponentConfig() bool {
+func (c Cfg) IsComponentConfig() bool {
return c.ComponentConfig
}
// SetComponentConfig implements config.Config
-func (c *cfg) SetComponentConfig() error {
+func (c *Cfg) SetComponentConfig() error {
c.ComponentConfig = true
return nil
}
// ClearComponentConfig implements config.Config
-func (c *cfg) ClearComponentConfig() error {
+func (c *Cfg) ClearComponentConfig() error {
c.ComponentConfig = false
return nil
}
// ResourcesLength implements config.Config
-func (c cfg) ResourcesLength() int {
+func (c Cfg) ResourcesLength() int {
return len(c.Resources)
}
// HasResource implements config.Config
-func (c cfg) HasResource(gvk resource.GVK) bool {
+func (c Cfg) HasResource(gvk resource.GVK) bool {
for _, res := range c.Resources {
if gvk.IsEqualTo(res.GVK) {
return true
@@ -188,7 +188,7 @@ func (c cfg) HasResource(gvk resource.GVK) bool {
}
// GetResource implements config.Config
-func (c cfg) GetResource(gvk resource.GVK) (resource.Resource, error) {
+func (c Cfg) GetResource(gvk resource.GVK) (resource.Resource, error) {
for _, res := range c.Resources {
if gvk.IsEqualTo(res.GVK) {
r := res.Copy()
@@ -206,7 +206,7 @@ func (c cfg) GetResource(gvk resource.GVK) (resource.Resource, error) {
}
// GetResources implements config.Config
-func (c cfg) GetResources() ([]resource.Resource, error) {
+func (c Cfg) GetResources() ([]resource.Resource, error) {
resources := make([]resource.Resource, 0, len(c.Resources))
for _, res := range c.Resources {
r := res.Copy()
@@ -223,7 +223,7 @@ func (c cfg) GetResources() ([]resource.Resource, error) {
}
// AddResource implements config.Config
-func (c *cfg) AddResource(res resource.Resource) error {
+func (c *Cfg) AddResource(res resource.Resource) error {
// As res is passed by value it is already a shallow copy, but we need to make a deep copy
res = res.Copy()
@@ -239,7 +239,7 @@ func (c *cfg) AddResource(res resource.Resource) error {
}
// UpdateResource implements config.Config
-func (c *cfg) UpdateResource(res resource.Resource) error {
+func (c *Cfg) UpdateResource(res resource.Resource) error {
// As res is passed by value it is already a shallow copy, but we need to make a deep copy
res = res.Copy()
@@ -259,7 +259,7 @@ func (c *cfg) UpdateResource(res resource.Resource) error {
}
// HasGroup implements config.Config
-func (c cfg) HasGroup(group string) bool {
+func (c Cfg) HasGroup(group string) bool {
// Return true if the target group is found in the tracked resources
for _, r := range c.Resources {
if strings.EqualFold(group, r.Group) {
@@ -272,7 +272,7 @@ func (c cfg) HasGroup(group string) bool {
}
// ListCRDVersions implements config.Config
-func (c cfg) ListCRDVersions() []string {
+func (c Cfg) ListCRDVersions() []string {
// Make a map to remove duplicates
versionSet := make(map[string]struct{})
for _, r := range c.Resources {
@@ -290,7 +290,7 @@ func (c cfg) ListCRDVersions() []string {
}
// ListWebhookVersions implements config.Config
-func (c cfg) ListWebhookVersions() []string {
+func (c Cfg) ListWebhookVersions() []string {
// Make a map to remove duplicates
versionSet := make(map[string]struct{})
for _, r := range c.Resources {
@@ -308,7 +308,7 @@ func (c cfg) ListWebhookVersions() []string {
}
// DecodePluginConfig implements config.Config
-func (c cfg) DecodePluginConfig(key string, configObj interface{}) error {
+func (c Cfg) DecodePluginConfig(key string, configObj interface{}) error {
if len(c.Plugins) == 0 {
return config.PluginKeyNotFoundError{Key: key}
}
@@ -329,7 +329,7 @@ func (c cfg) DecodePluginConfig(key string, configObj interface{}) error {
}
// EncodePluginConfig will return an error if used on any project version < v3.
-func (c *cfg) EncodePluginConfig(key string, configObj interface{}) error {
+func (c *Cfg) EncodePluginConfig(key string, configObj interface{}) error {
// Get object's bytes and set them under key in extra fields.
b, err := yaml.Marshal(configObj)
if err != nil {
@@ -347,7 +347,7 @@ func (c *cfg) EncodePluginConfig(key string, configObj interface{}) error {
}
// Marshal implements config.Config
-func (c cfg) MarshalYAML() ([]byte, error) {
+func (c Cfg) MarshalYAML() ([]byte, error) {
for i, r := range c.Resources {
// If API is empty, omit it (prevents `api: {}`).
if r.API != nil && r.API.IsEmpty() {
@@ -368,7 +368,7 @@ func (c cfg) MarshalYAML() ([]byte, error) {
}
// Unmarshal implements config.Config
-func (c *cfg) UnmarshalYAML(b []byte) error {
+func (c *Cfg) UnmarshalYAML(b []byte) error {
if err := yaml.UnmarshalStrict(b, c); err != nil {
return config.UnmarshalError{Err: err}
}
diff --git a/pkg/config/v3/config_test.go b/pkg/config/v3/config_test.go
index e7ae4a1f729..fc08295597d 100644
--- a/pkg/config/v3/config_test.go
+++ b/pkg/config/v3/config_test.go
@@ -33,7 +33,7 @@ func TestConfigV3(t *testing.T) {
RunSpecs(t, "Config V3 Suite")
}
-var _ = Describe("cfg", func() {
+var _ = Describe("Cfg", func() {
const (
domain = "my.domain"
repo = "myrepo"
@@ -45,7 +45,7 @@ var _ = Describe("cfg", func() {
)
var (
- c cfg
+ c Cfg
pluginChain = []string{"go.kubebuilder.io/v2"}
@@ -53,7 +53,7 @@ var _ = Describe("cfg", func() {
)
BeforeEach(func() {
- c = cfg{
+ c = Cfg{
Version: Version,
Domain: domain,
Repository: repo,
@@ -376,14 +376,14 @@ var _ = Describe("cfg", func() {
)
var (
- c0 = cfg{
+ c0 = Cfg{
Version: Version,
Domain: domain,
Repository: repo,
Name: name,
PluginChain: pluginChain,
}
- c1 = cfg{
+ c1 = Cfg{
Version: Version,
Domain: domain,
Repository: repo,
@@ -395,7 +395,7 @@ var _ = Describe("cfg", func() {
},
},
}
- c2 = cfg{
+ c2 = Cfg{
Version: Version,
Domain: domain,
Repository: repo,
@@ -429,7 +429,7 @@ var _ = Describe("cfg", func() {
})
DescribeTable("DecodePluginConfig should retrieve the plugin data correctly",
- func(inputConfig cfg, expectedPluginConfig PluginConfig) {
+ func(inputConfig Cfg, expectedPluginConfig PluginConfig) {
var pluginConfig PluginConfig
Expect(inputConfig.DecodePluginConfig(key, &pluginConfig)).To(Succeed())
Expect(pluginConfig).To(Equal(expectedPluginConfig))
@@ -441,7 +441,7 @@ var _ = Describe("cfg", func() {
)
DescribeTable("EncodePluginConfig should encode the plugin data correctly",
- func(pluginConfig PluginConfig, expectedConfig cfg) {
+ func(pluginConfig PluginConfig, expectedConfig Cfg) {
Expect(c.EncodePluginConfig(key, pluginConfig)).To(Succeed())
Expect(c).To(Equal(expectedConfig))
},
@@ -455,14 +455,14 @@ var _ = Describe("cfg", func() {
Context("Persistence", func() {
var (
// BeforeEach is called after the entries are evaluated, and therefore, c is not available
- c1 = cfg{
+ c1 = Cfg{
Version: Version,
Domain: domain,
Repository: repo,
Name: name,
PluginChain: pluginChain,
}
- c2 = cfg{
+ c2 = Cfg{
Version: Version,
Domain: otherDomain,
Repository: otherRepo,
@@ -591,7 +591,7 @@ version: "3"
)
DescribeTable("MarshalYAML should succeed",
- func(c cfg, content string) {
+ func(c Cfg, content string) {
b, err := c.MarshalYAML()
Expect(err).NotTo(HaveOccurred())
Expect(string(b)).To(Equal(content))
@@ -601,8 +601,8 @@ version: "3"
)
DescribeTable("UnmarshalYAML should succeed",
- func(content string, c cfg) {
- var unmarshalled cfg
+ func(content string, c Cfg) {
+ var unmarshalled Cfg
Expect(unmarshalled.UnmarshalYAML([]byte(content))).To(Succeed())
Expect(unmarshalled.Version.Compare(c.Version)).To(Equal(0))
Expect(unmarshalled.Domain).To(Equal(c.Domain))
@@ -622,7 +622,7 @@ version: "3"
DescribeTable("UnmarshalYAML should fail",
func(content string) {
- var c cfg
+ var c Cfg
Expect(c.UnmarshalYAML([]byte(content))).NotTo(Succeed())
},
Entry("for unknown fields", `field: 1
From 41ce2a67f8ba380bf493d15cd2fa3af90ab981ec Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 26 Aug 2023 04:52:05 +0100
Subject: [PATCH 0254/1245] :bug: (deployimage/v1-beta1): fix scaffold with
multigroup and add optional plugins to multigroup sample to validate changes
---
.../deploy-image/v1alpha1/scaffolds/api.go | 31 +-
test/testdata/generate.sh | 12 +-
testdata/project-v4-multigroup/PROJECT | 40 +
.../api/example.com/v1alpha1/busybox_types.go | 77 ++
.../example.com/v1alpha1/groupversion_info.go | 36 +
.../example.com/v1alpha1/memcached_types.go | 80 ++
.../example.com/v1alpha1/memcached_webhook.go | 65 ++
.../v1alpha1/webhook_suite_test.go | 142 ++++
.../v1alpha1/zz_generated.deepcopy.go | 219 ++++++
testdata/project-v4-multigroup/cmd/main.go | 23 +
...example.com.testproject.org_busyboxes.yaml | 122 +++
...xample.com.testproject.org_memcacheds.yaml | 127 ++++
.../config/crd/kustomization.yaml | 6 +
.../cainjection_in_example.com_busyboxes.yaml | 7 +
...cainjection_in_example.com_memcacheds.yaml | 7 +
.../webhook_in_example.com_busyboxes.yaml | 16 +
.../webhook_in_example.com_memcacheds.yaml | 16 +
.../config/manager/manager.yaml | 5 +
.../rbac/example.com_busybox_editor_role.yaml | 31 +
.../rbac/example.com_busybox_viewer_role.yaml | 27 +
.../example.com_memcached_editor_role.yaml | 31 +
.../example.com_memcached_viewer_role.yaml | 27 +
.../config/rbac/role.yaml | 67 ++
.../samples/example.com_v1alpha1_busybox.yaml | 9 +
.../example.com_v1alpha1_memcached.yaml | 10 +
.../config/samples/kustomization.yaml | 2 +
.../config/webhook/manifests.yaml | 20 +
.../grafana/controller-resources-metrics.json | 306 ++++++++
.../grafana/controller-runtime-metrics.json | 710 ++++++++++++++++++
.../grafana/custom-metrics/config.yaml | 15 +
.../example.com/busybox_controller.go | 434 +++++++++++
.../example.com/busybox_controller_test.go | 142 ++++
.../example.com/memcached_controller.go | 440 +++++++++++
.../example.com/memcached_controller_test.go | 143 ++++
.../controller/example.com/suite_test.go | 90 +++
35 files changed, 3512 insertions(+), 23 deletions(-)
create mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go
create mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go
create mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
create mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
create mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
create mode 100644 testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
create mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml
create mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml
create mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml
create mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml
create mode 100644 testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml
create mode 100644 testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml
create mode 100644 testdata/project-v4-multigroup/grafana/controller-resources-metrics.json
create mode 100644 testdata/project-v4-multigroup/grafana/controller-runtime-metrics.json
create mode 100644 testdata/project-v4-multigroup/grafana/custom-metrics/config.yaml
create mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
index c02efe60524..6791edcb310 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
@@ -134,7 +134,7 @@ func (s *apiScaffolder) Scaffold() error {
if isGoV3 {
defaultMainPath = "main.go"
}
- if err := s.updateMainByAddingEventRecorder(isGoV3, defaultMainPath); err != nil {
+ if err := s.updateMainByAddingEventRecorder(defaultMainPath); err != nil {
return fmt.Errorf("error updating main.go: %v", err)
}
@@ -188,29 +188,16 @@ 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(isGoV3 bool, defaultMainPath string) error {
- if isGoV3 {
- if err := util.InsertCode(
- defaultMainPath,
- fmt.Sprintf(
- `if err = (&controllers.%sReconciler{
+func (s *apiScaffolder) updateMainByAddingEventRecorder(defaultMainPath string) error {
+ if err := util.InsertCode(
+ defaultMainPath,
+ fmt.Sprintf(
+ `%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)
- }
- } 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)
- }
+ fmt.Sprintf(recorderTemplate, strings.ToLower(s.resource.Kind)),
+ ); err != nil {
+ return fmt.Errorf("error scaffolding event recorder in %s: %v", defaultMainPath, err)
}
return nil
diff --git a/test/testdata/generate.sh b/test/testdata/generate.sh
index a145caece1a..1a4ba360003 100755
--- a/test/testdata/generate.sh
+++ b/test/testdata/generate.sh
@@ -102,6 +102,16 @@ function scaffold_test_project {
$kb create api --version v1 --kind Lakers --controller=true --resource=true --make=false
$kb create webhook --version v1 --kind Lakers --defaulting --programmatic-validation
fi
+
+ # Call ALL optional plugins within multigroup layout to ensure that they can work within
+ header_text 'Creating Memcached API with deploy-image plugin ...'
+ $kb create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,-o,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha" --make=false
+ $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
+
+ header_text 'Editing project with Grafana plugin ...'
+ $kb edit --plugins=grafana.kubebuilder.io/v1-alpha
elif [[ $project =~ declarative ]]; then
header_text 'Creating APIs ...'
$kb create api --group crew --version v1 --kind Captain --controller=true --resource=true --make=false
@@ -114,7 +124,7 @@ function scaffold_test_project {
header_text 'Creating Memcached webhook ...'
$kb create webhook --group example.com --version v1alpha1 --kind Memcached --programmatic-validation
elif [[ $project =~ "with-grafana" ]]; then
- header_text 'Editing project with Grafana plugin ...'
+ header_text 'Editing project with Grafana plugin ...'
$kb edit --plugins=grafana.kubebuilder.io/v1-alpha
fi
diff --git a/testdata/project-v4-multigroup/PROJECT b/testdata/project-v4-multigroup/PROJECT
index 92f8bcfd7a5..12d9db3cd58 100644
--- a/testdata/project-v4-multigroup/PROJECT
+++ b/testdata/project-v4-multigroup/PROJECT
@@ -6,6 +6,25 @@ domain: testproject.org
layout:
- go.kubebuilder.io/v4
multigroup: true
+plugins:
+ deploy-image.go.kubebuilder.io/v1-alpha:
+ resources:
+ - domain: testproject.org
+ group: example.com
+ kind: Memcached
+ options:
+ containerCommand: memcached,-m=64,-o,modern,-v
+ containerPort: "11211"
+ image: memcached:1.4.36-alpine
+ runAsUser: "1001"
+ version: v1alpha1
+ - domain: testproject.org
+ group: example.com
+ kind: Busybox
+ options:
+ image: busybox:1.28
+ version: v1alpha1
+ grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v4-multigroup
repo: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup
resources:
@@ -118,4 +137,25 @@ resources:
defaulting: true
validation: true
webhookVersion: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: example.com
+ kind: Memcached
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1
+ version: v1alpha1
+ webhooks:
+ validation: true
+ webhookVersion: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: example.com
+ kind: Busybox
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1
+ version: v1alpha1
version: "3"
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go
new file mode 100644
index 00000000000..440dd96baef
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go
@@ -0,0 +1,77 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// BusyboxSpec defines the desired state of Busybox
+type BusyboxSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Size defines the number of Busybox instances
+ // The following markers will use OpenAPI v3 schema to validate the value
+ // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
+ // +kubebuilder:validation:Minimum=1
+ // +kubebuilder:validation:Maximum=3
+ // +kubebuilder:validation:ExclusiveMaximum=false
+ Size int32 `json:"size,omitempty"`
+}
+
+// BusyboxStatus defines the observed state of Busybox
+type BusyboxStatus struct {
+ // Represents the observations of a Busybox's current state.
+ // Busybox.status.conditions.type are: "Available", "Progressing", and "Degraded"
+ // Busybox.status.conditions.status are one of True, False, Unknown.
+ // Busybox.status.conditions.reason the value should be a CamelCase string and producers of specific
+ // condition types may define expected values and meanings for this field, and whether the values
+ // are considered a guaranteed API.
+ // Busybox.status.conditions.Message is a human readable message indicating details about the transition.
+ // For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
+
+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Busybox is the Schema for the busyboxes API
+type Busybox struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec BusyboxSpec `json:"spec,omitempty"`
+ Status BusyboxStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// BusyboxList contains a list of Busybox
+type BusyboxList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Busybox `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Busybox{}, &BusyboxList{})
+}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go
new file mode 100644
index 00000000000..9541616caff
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1alpha1 contains API Schema definitions for the example.com v1alpha1 API group
+// +kubebuilder:object:generate=true
+// +groupName=example.com.testproject.org
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "example.com.testproject.org", Version: "v1alpha1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go
new file mode 100644
index 00000000000..aa82a833c00
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go
@@ -0,0 +1,80 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// MemcachedSpec defines the desired state of Memcached
+type MemcachedSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Size defines the number of Memcached instances
+ // The following markers will use OpenAPI v3 schema to validate the value
+ // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
+ // +kubebuilder:validation:Minimum=1
+ // +kubebuilder:validation:Maximum=3
+ // +kubebuilder:validation:ExclusiveMaximum=false
+ Size int32 `json:"size,omitempty"`
+
+ // Port defines the port that will be used to init the container with the image
+ ContainerPort int32 `json:"containerPort,omitempty"`
+}
+
+// MemcachedStatus defines the observed state of Memcached
+type MemcachedStatus struct {
+ // Represents the observations of a Memcached's current state.
+ // Memcached.status.conditions.type are: "Available", "Progressing", and "Degraded"
+ // Memcached.status.conditions.status are one of True, False, Unknown.
+ // Memcached.status.conditions.reason the value should be a CamelCase string and producers of specific
+ // condition types may define expected values and meanings for this field, and whether the values
+ // are considered a guaranteed API.
+ // Memcached.status.conditions.Message is a human readable message indicating details about the transition.
+ // For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
+
+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Memcached is the Schema for the memcacheds API
+type Memcached struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec MemcachedSpec `json:"spec,omitempty"`
+ Status MemcachedStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// MemcachedList contains a list of Memcached
+type MemcachedList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Memcached `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Memcached{}, &MemcachedList{})
+}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
new file mode 100644
index 00000000000..9dde8721abe
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
@@ -0,0 +1,65 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+// log is for logging in this package.
+var memcachedlog = logf.Log.WithName("memcached-resource")
+
+func (r *Memcached) SetupWebhookWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewWebhookManagedBy(mgr).
+ For(r).
+ Complete()
+}
+
+// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+
+// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
+//+kubebuilder:webhook:path=/validate-example-com-testproject-org-v1alpha1-memcached,mutating=false,failurePolicy=fail,sideEffects=None,groups=example.com.testproject.org,resources=memcacheds,verbs=create;update,versions=v1alpha1,name=vmemcached.kb.io,admissionReviewVersions=v1
+
+var _ webhook.Validator = &Memcached{}
+
+// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
+func (r *Memcached) ValidateCreate() (admission.Warnings, error) {
+ memcachedlog.Info("validate create", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object creation.
+ return nil, nil
+}
+
+// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
+func (r *Memcached) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
+ memcachedlog.Info("validate update", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object update.
+ return nil, nil
+}
+
+// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
+func (r *Memcached) ValidateDelete() (admission.Warnings, error) {
+ memcachedlog.Info("validate delete", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object deletion.
+ return nil, nil
+}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
new file mode 100644
index 00000000000..48b751c4264
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
@@ -0,0 +1,142 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1alpha1
+
+import (
+ "context"
+ "crypto/tls"
+ "fmt"
+ "net"
+ "path/filepath"
+ "runtime"
+ "testing"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ admissionv1 "k8s.io/api/admission/v1"
+ //+kubebuilder:scaffold:imports
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+var ctx context.Context
+var cancel context.CancelFunc
+
+func TestAPIs(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Webhook Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ ctx, cancel = context.WithCancel(context.TODO())
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
+ WebhookInstallOptions: envtest.WebhookInstallOptions{
+ Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
+ },
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ scheme := apimachineryruntime.NewScheme()
+ err = AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = admissionv1.AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+ // start webhook server using Manager
+ webhookInstallOptions := &testEnv.WebhookInstallOptions
+ mgr, err := ctrl.NewManager(cfg, ctrl.Options{
+ Scheme: scheme,
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ LeaderElection: false,
+ MetricsBindAddress: "0",
+ })
+ Expect(err).NotTo(HaveOccurred())
+
+ err = (&Memcached{}).SetupWebhookWithManager(mgr)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:webhook
+
+ go func() {
+ defer GinkgoRecover()
+ err = mgr.Start(ctx)
+ Expect(err).NotTo(HaveOccurred())
+ }()
+
+ // wait for the webhook server to get ready
+ dialer := &net.Dialer{Timeout: time.Second}
+ addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
+ Eventually(func() error {
+ conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
+ if err != nil {
+ return err
+ }
+ conn.Close()
+ return nil
+ }).Should(Succeed())
+
+})
+
+var _ = AfterSuite(func() {
+ cancel()
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..a1b201c4512
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
@@ -0,0 +1,219 @@
+//go:build !ignore_autogenerated
+// +build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Busybox) DeepCopyInto(out *Busybox) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ in.Status.DeepCopyInto(&out.Status)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Busybox.
+func (in *Busybox) DeepCopy() *Busybox {
+ if in == nil {
+ return nil
+ }
+ out := new(Busybox)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Busybox) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BusyboxList) DeepCopyInto(out *BusyboxList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Busybox, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusyboxList.
+func (in *BusyboxList) DeepCopy() *BusyboxList {
+ if in == nil {
+ return nil
+ }
+ out := new(BusyboxList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *BusyboxList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BusyboxSpec) DeepCopyInto(out *BusyboxSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusyboxSpec.
+func (in *BusyboxSpec) DeepCopy() *BusyboxSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(BusyboxSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BusyboxStatus) DeepCopyInto(out *BusyboxStatus) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]v1.Condition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusyboxStatus.
+func (in *BusyboxStatus) DeepCopy() *BusyboxStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(BusyboxStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Memcached) DeepCopyInto(out *Memcached) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ in.Status.DeepCopyInto(&out.Status)
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Memcached.
+func (in *Memcached) DeepCopy() *Memcached {
+ if in == nil {
+ return nil
+ }
+ out := new(Memcached)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Memcached) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MemcachedList) DeepCopyInto(out *MemcachedList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Memcached, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemcachedList.
+func (in *MemcachedList) DeepCopy() *MemcachedList {
+ if in == nil {
+ return nil
+ }
+ out := new(MemcachedList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *MemcachedList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MemcachedSpec) DeepCopyInto(out *MemcachedSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemcachedSpec.
+func (in *MemcachedSpec) DeepCopy() *MemcachedSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(MemcachedSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *MemcachedStatus) DeepCopyInto(out *MemcachedStatus) {
+ *out = *in
+ if in.Conditions != nil {
+ in, out := &in.Conditions, &out.Conditions
+ *out = make([]v1.Condition, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemcachedStatus.
+func (in *MemcachedStatus) DeepCopy() *MemcachedStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(MemcachedStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup/cmd/main.go b/testdata/project-v4-multigroup/cmd/main.go
index c773770f22e..e891c0955d8 100644
--- a/testdata/project-v4-multigroup/cmd/main.go
+++ b/testdata/project-v4-multigroup/cmd/main.go
@@ -32,6 +32,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
+ examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
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"
@@ -44,6 +45,7 @@ import (
"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"
+ examplecomcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/example.com"
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"
@@ -70,6 +72,7 @@ func init() {
utilruntime.Must(foov1.AddToScheme(scheme))
utilruntime.Must(fizv1.AddToScheme(scheme))
utilruntime.Must(testprojectorgv1.AddToScheme(scheme))
+ utilruntime.Must(examplecomv1alpha1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}
@@ -211,6 +214,26 @@ func main() {
setupLog.Error(err, "unable to create webhook", "webhook", "Lakers")
os.Exit(1)
}
+ if err = (&examplecomcontroller.MemcachedReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ Recorder: mgr.GetEventRecorderFor("memcached-controller"),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Memcached")
+ os.Exit(1)
+ }
+ if err = (&examplecomcontroller.BusyboxReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ Recorder: mgr.GetEventRecorderFor("busybox-controller"),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Busybox")
+ os.Exit(1)
+ }
+ if err = (&examplecomv1alpha1.Memcached{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Memcached")
+ os.Exit(1)
+ }
//+kubebuilder:scaffold:builder
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
diff --git a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
new file mode 100644
index 00000000000..a0e9a2c4d37
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
@@ -0,0 +1,122 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.12.0
+ name: busyboxes.example.com.testproject.org
+spec:
+ group: example.com.testproject.org
+ names:
+ kind: Busybox
+ listKind: BusyboxList
+ plural: busyboxes
+ singular: busybox
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ schema:
+ openAPIV3Schema:
+ description: Busybox is the Schema for the busyboxes API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: BusyboxSpec defines the desired state of Busybox
+ properties:
+ size:
+ description: 'Size defines the number of Busybox instances The following
+ markers will use OpenAPI v3 schema to validate the value More info:
+ https://book.kubebuilder.io/reference/markers/crd-validation.html'
+ format: int32
+ maximum: 3
+ minimum: 1
+ type: integer
+ type: object
+ status:
+ description: BusyboxStatus defines the observed state of Busybox
+ properties:
+ conditions:
+ items:
+ description: "Condition contains details for one aspect of the current
+ state of this API Resource. --- This struct is intended for direct
+ use as an array at the field path .status.conditions. For example,
+ \n type FooStatus struct{ // Represents the observations of a
+ foo's current state. // Known .status.conditions.type are: \"Available\",
+ \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
+ // +listType=map // +listMapKey=type Conditions []metav1.Condition
+ `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
+ protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
+ properties:
+ lastTransitionTime:
+ description: lastTransitionTime is the last time the condition
+ transitioned from one status to another. This should be when
+ the underlying condition changed. If that is not known, then
+ using the time when the API field changed is acceptable.
+ format: date-time
+ type: string
+ message:
+ description: message is a human readable message indicating
+ details about the transition. This may be an empty string.
+ maxLength: 32768
+ type: string
+ observedGeneration:
+ description: observedGeneration represents the .metadata.generation
+ that the condition was set based upon. For instance, if .metadata.generation
+ is currently 12, but the .status.conditions[x].observedGeneration
+ is 9, the condition is out of date with respect to the current
+ state of the instance.
+ format: int64
+ minimum: 0
+ type: integer
+ reason:
+ description: reason contains a programmatic identifier indicating
+ the reason for the condition's last transition. Producers
+ of specific condition types may define expected values and
+ meanings for this field, and whether the values are considered
+ a guaranteed API. The value should be a CamelCase string.
+ This field may not be empty.
+ maxLength: 1024
+ minLength: 1
+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
+ type: string
+ status:
+ description: status of the condition, one of True, False, Unknown.
+ enum:
+ - "True"
+ - "False"
+ - Unknown
+ type: string
+ type:
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
+ --- Many .condition.type values are consistent across resources
+ like Available, but because arbitrary conditions can be useful
+ (see .node.status.conditions), the ability to deconflict is
+ important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ maxLength: 316
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type
+ type: object
+ type: array
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
new file mode 100644
index 00000000000..d779aa1197b
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
@@ -0,0 +1,127 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.12.0
+ name: memcacheds.example.com.testproject.org
+spec:
+ group: example.com.testproject.org
+ names:
+ kind: Memcached
+ listKind: MemcachedList
+ plural: memcacheds
+ singular: memcached
+ scope: Namespaced
+ versions:
+ - name: v1alpha1
+ schema:
+ openAPIV3Schema:
+ description: Memcached is the Schema for the memcacheds API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: MemcachedSpec defines the desired state of Memcached
+ properties:
+ containerPort:
+ description: Port defines the port that will be used to init the container
+ with the image
+ format: int32
+ type: integer
+ size:
+ description: 'Size defines the number of Memcached instances The following
+ markers will use OpenAPI v3 schema to validate the value More info:
+ https://book.kubebuilder.io/reference/markers/crd-validation.html'
+ format: int32
+ maximum: 3
+ minimum: 1
+ type: integer
+ type: object
+ status:
+ description: MemcachedStatus defines the observed state of Memcached
+ properties:
+ conditions:
+ items:
+ description: "Condition contains details for one aspect of the current
+ state of this API Resource. --- This struct is intended for direct
+ use as an array at the field path .status.conditions. For example,
+ \n type FooStatus struct{ // Represents the observations of a
+ foo's current state. // Known .status.conditions.type are: \"Available\",
+ \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
+ // +listType=map // +listMapKey=type Conditions []metav1.Condition
+ `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
+ protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
+ properties:
+ lastTransitionTime:
+ description: lastTransitionTime is the last time the condition
+ transitioned from one status to another. This should be when
+ the underlying condition changed. If that is not known, then
+ using the time when the API field changed is acceptable.
+ format: date-time
+ type: string
+ message:
+ description: message is a human readable message indicating
+ details about the transition. This may be an empty string.
+ maxLength: 32768
+ type: string
+ observedGeneration:
+ description: observedGeneration represents the .metadata.generation
+ that the condition was set based upon. For instance, if .metadata.generation
+ is currently 12, but the .status.conditions[x].observedGeneration
+ is 9, the condition is out of date with respect to the current
+ state of the instance.
+ format: int64
+ minimum: 0
+ type: integer
+ reason:
+ description: reason contains a programmatic identifier indicating
+ the reason for the condition's last transition. Producers
+ of specific condition types may define expected values and
+ meanings for this field, and whether the values are considered
+ a guaranteed API. The value should be a CamelCase string.
+ This field may not be empty.
+ maxLength: 1024
+ minLength: 1
+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
+ type: string
+ status:
+ description: status of the condition, one of True, False, Unknown.
+ enum:
+ - "True"
+ - "False"
+ - Unknown
+ type: string
+ type:
+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
+ --- Many .condition.type values are consistent across resources
+ like Available, but because arbitrary conditions can be useful
+ (see .node.status.conditions), the ability to deconflict is
+ important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
+ maxLength: 316
+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
+ type: string
+ required:
+ - lastTransitionTime
+ - message
+ - reason
+ - status
+ - type
+ type: object
+ type: array
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index 633e725aa1a..c77c95dc29e 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -12,6 +12,8 @@ resources:
- bases/foo.testproject.org_bars.yaml
- bases/fiz.testproject.org_bars.yaml
- bases/testproject.org_lakers.yaml
+- bases/example.com.testproject.org_memcacheds.yaml
+- bases/example.com.testproject.org_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizeresource
patches:
@@ -26,6 +28,8 @@ patches:
#- path: patches/webhook_in_healthcheckpolicies.yaml
#- path: patches/webhook_in_bars.yaml
#- path: patches/webhook_in_lakers.yaml
+#- path: patches/webhook_in_memcacheds.yaml
+#- path: patches/webhook_in_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
@@ -39,6 +43,8 @@ patches:
#- path: patches/cainjection_in_healthcheckpolicies.yaml
#- path: patches/cainjection_in_bars.yaml
#- path: patches/cainjection_in_lakers.yaml
+#- path: patches/cainjection_in_memcacheds.yaml
+#- path: patches/cainjection_in_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml
new file mode 100644
index 00000000000..5f6b0384f48
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: busyboxes.example.com.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml
new file mode 100644
index 00000000000..5b9e839364d
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: memcacheds.example.com.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml
new file mode 100644
index 00000000000..5dbd9da7176
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: busyboxes.example.com.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml
new file mode 100644
index 00000000000..4a56b0f4c69
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: memcacheds.example.com.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup/config/manager/manager.yaml b/testdata/project-v4-multigroup/config/manager/manager.yaml
index b9d340945db..e36823baac8 100644
--- a/testdata/project-v4-multigroup/config/manager/manager.yaml
+++ b/testdata/project-v4-multigroup/config/manager/manager.yaml
@@ -72,6 +72,11 @@ spec:
- --leader-elect
image: controller:latest
name: manager
+ env:
+ - name: BUSYBOX_IMAGE
+ value: busybox:1.28
+ - name: MEMCACHED_IMAGE
+ value: memcached:1.4.36-alpine
securityContext:
allowPrivilegeEscalation: false
capabilities:
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml b/testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml
new file mode 100644
index 00000000000..ceae6910a0e
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit busyboxes.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: busybox-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup
+ app.kubernetes.io/part-of: project-v4-multigroup
+ app.kubernetes.io/managed-by: kustomize
+ name: busybox-editor-role
+rules:
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml b/testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml
new file mode 100644
index 00000000000..b3f6d566507
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view busyboxes.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: busybox-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup
+ app.kubernetes.io/part-of: project-v4-multigroup
+ app.kubernetes.io/managed-by: kustomize
+ name: busybox-viewer-role
+rules:
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml b/testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml
new file mode 100644
index 00000000000..aacaa6ffb8a
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit memcacheds.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: memcached-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup
+ app.kubernetes.io/part-of: project-v4-multigroup
+ app.kubernetes.io/managed-by: kustomize
+ name: memcached-editor-role
+rules:
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml b/testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml
new file mode 100644
index 00000000000..251117ddb78
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view memcacheds.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: memcached-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup
+ app.kubernetes.io/part-of: project-v4-multigroup
+ app.kubernetes.io/managed-by: kustomize
+ name: memcached-viewer-role
+rules:
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup/config/rbac/role.yaml b/testdata/project-v4-multigroup/config/rbac/role.yaml
index e2d30b23205..0744d29613d 100644
--- a/testdata/project-v4-multigroup/config/rbac/role.yaml
+++ b/testdata/project-v4-multigroup/config/rbac/role.yaml
@@ -30,6 +30,21 @@ rules:
- get
- patch
- update
+- apiGroups:
+ - ""
+ resources:
+ - events
+ verbs:
+ - create
+ - patch
+- apiGroups:
+ - ""
+ resources:
+ - pods
+ verbs:
+ - get
+ - list
+ - watch
- apiGroups:
- crew.testproject.org
resources:
@@ -56,6 +71,58 @@ rules:
- get
- patch
- update
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - busyboxes/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - example.com.testproject.org
+ resources:
+ - memcacheds/status
+ verbs:
+ - get
+ - patch
+ - update
- apiGroups:
- fiz.testproject.org
resources:
diff --git a/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml b/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml
new file mode 100644
index 00000000000..e5ba7642dd1
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml
@@ -0,0 +1,9 @@
+apiVersion: example.com.testproject.org/v1alpha1
+kind: Busybox
+metadata:
+ name: busybox-sample
+spec:
+ # TODO(user): edit the following value to ensure the number
+ # of Pods/Instances your Operand must have on cluster
+ size: 1
+
diff --git a/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml b/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml
new file mode 100644
index 00000000000..153d1db36c8
--- /dev/null
+++ b/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml
@@ -0,0 +1,10 @@
+apiVersion: example.com.testproject.org/v1alpha1
+kind: Memcached
+metadata:
+ name: memcached-sample
+spec:
+ # TODO(user): edit the following value to ensure the number
+ # of Pods/Instances your Operand must have on cluster
+ size: 1
+# TODO(user): edit the following value to ensure the container has the right port to be initialized
+ containerPort: 11211
diff --git a/testdata/project-v4-multigroup/config/samples/kustomization.yaml b/testdata/project-v4-multigroup/config/samples/kustomization.yaml
index a74ed904341..7018e7905d0 100644
--- a/testdata/project-v4-multigroup/config/samples/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/samples/kustomization.yaml
@@ -10,4 +10,6 @@ resources:
- foo_v1_bar.yaml
- fiz_v1_bar.yaml
- _v1_lakers.yaml
+- example.com_v1alpha1_memcached.yaml
+- example.com_v1alpha1_busybox.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
diff --git a/testdata/project-v4-multigroup/config/webhook/manifests.yaml b/testdata/project-v4-multigroup/config/webhook/manifests.yaml
index 62374002227..8537370eb6e 100644
--- a/testdata/project-v4-multigroup/config/webhook/manifests.yaml
+++ b/testdata/project-v4-multigroup/config/webhook/manifests.yaml
@@ -90,6 +90,26 @@ webhooks:
resources:
- captains
sideEffects: None
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /validate-example-com-testproject-org-v1alpha1-memcached
+ failurePolicy: Fail
+ name: vmemcached.kb.io
+ rules:
+ - apiGroups:
+ - example.com.testproject.org
+ apiVersions:
+ - v1alpha1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - memcacheds
+ sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
diff --git a/testdata/project-v4-multigroup/grafana/controller-resources-metrics.json b/testdata/project-v4-multigroup/grafana/controller-resources-metrics.json
new file mode 100644
index 00000000000..629e0d3c9b1
--- /dev/null
+++ b/testdata/project-v4-multigroup/grafana/controller-resources-metrics.json
@@ -0,0 +1,306 @@
+{
+ "__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-multigroup/grafana/controller-runtime-metrics.json b/testdata/project-v4-multigroup/grafana/controller-runtime-metrics.json
new file mode 100644
index 00000000000..70023a42d82
--- /dev/null
+++ b/testdata/project-v4-multigroup/grafana/controller-runtime-metrics.json
@@ -0,0 +1,710 @@
+{
+ "__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-multigroup/grafana/custom-metrics/config.yaml b/testdata/project-v4-multigroup/grafana/custom-metrics/config.yaml
new file mode 100644
index 00000000000..3ee1bebdf24
--- /dev/null
+++ b/testdata/project-v4-multigroup/grafana/custom-metrics/config.yaml
@@ -0,0 +1,15 @@
+---
+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-multigroup/internal/controller/example.com/busybox_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
new file mode 100644
index 00000000000..a9d30834682
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
@@ -0,0 +1,434 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package examplecom
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "strings"
+ "time"
+
+ appsv1 "k8s.io/api/apps/v1"
+ corev1 "k8s.io/api/core/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/client-go/tools/record"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
+)
+
+const busyboxFinalizer = "example.com.testproject.org/finalizer"
+
+// Definitions to manage status conditions
+const (
+ // typeAvailableBusybox represents the status of the Deployment reconciliation
+ typeAvailableBusybox = "Available"
+ // typeDegradedBusybox represents the status used when the custom resource is deleted and the finalizer operations are must to occur.
+ typeDegradedBusybox = "Degraded"
+)
+
+// BusyboxReconciler reconciles a Busybox object
+type BusyboxReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+ Recorder record.EventRecorder
+}
+
+// The following markers are used to generate the rules permissions (RBAC) on config/rbac using controller-gen
+// when the command is executed.
+// To know more about markers see: https://book.kubebuilder.io/reference/markers.html
+
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=busyboxes,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=busyboxes/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=busyboxes/finalizers,verbs=update
+//+kubebuilder:rbac:groups=core,resources=events,verbs=create;patch
+//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+
+// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
+// pattern you will create Controllers which provide a reconcile function
+// responsible for synchronizing resources until the desired state is reached on the cluster.
+// Breaking this recommendation goes against the design principles of controller-runtime.
+// and may lead to unforeseen consequences such as resources becoming stuck and requiring manual intervention.
+// 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.15.0/pkg/reconcile
+func (r *BusyboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ log := log.FromContext(ctx)
+
+ // Fetch the Busybox instance
+ // The purpose is check if the Custom Resource for the Kind Busybox
+ // is applied on the cluster if not we return nil to stop the reconciliation
+ busybox := &examplecomv1alpha1.Busybox{}
+ err := r.Get(ctx, req.NamespacedName, busybox)
+ if err != nil {
+ if apierrors.IsNotFound(err) {
+ // If the custom resource is not found then, it usually means that it was deleted or not created
+ // In this way, we will stop the reconciliation
+ log.Info("busybox resource not found. Ignoring since object must be deleted")
+ return ctrl.Result{}, nil
+ }
+ // Error reading the object - requeue the request.
+ log.Error(err, "Failed to get busybox")
+ return ctrl.Result{}, err
+ }
+
+ // Let's just set the status as Unknown when no status are available
+ if busybox.Status.Conditions == nil || len(busybox.Status.Conditions) == 0 {
+ meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
+ if err = r.Status().Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update Busybox status")
+ return ctrl.Result{}, err
+ }
+
+ // Let's re-fetch the busybox Custom Resource after update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ // if we try to update it again in the following operations
+ if err := r.Get(ctx, req.NamespacedName, busybox); err != nil {
+ log.Error(err, "Failed to re-fetch busybox")
+ return ctrl.Result{}, err
+ }
+ }
+
+ // Let's add a finalizer. Then, we can define some operations which should
+ // occurs before the custom resource to be deleted.
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
+ if !controllerutil.ContainsFinalizer(busybox, busyboxFinalizer) {
+ log.Info("Adding Finalizer for Busybox")
+ if ok := controllerutil.AddFinalizer(busybox, busyboxFinalizer); !ok {
+ log.Error(err, "Failed to add finalizer into the custom resource")
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ if err = r.Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update custom resource to add finalizer")
+ return ctrl.Result{}, err
+ }
+ }
+
+ // Check if the Busybox instance is marked to be deleted, which is
+ // indicated by the deletion timestamp being set.
+ isBusyboxMarkedToBeDeleted := busybox.GetDeletionTimestamp() != nil
+ if isBusyboxMarkedToBeDeleted {
+ if controllerutil.ContainsFinalizer(busybox, busyboxFinalizer) {
+ log.Info("Performing Finalizer Operations for Busybox before delete CR")
+
+ // Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
+ meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeDegradedBusybox,
+ Status: metav1.ConditionUnknown, Reason: "Finalizing",
+ Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", busybox.Name)})
+
+ if err := r.Status().Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update Busybox status")
+ return ctrl.Result{}, err
+ }
+
+ // Perform all operations required before remove the finalizer and allow
+ // the Kubernetes API to remove the custom resource.
+ r.doFinalizerOperationsForBusybox(busybox)
+
+ // TODO(user): If you add operations to the doFinalizerOperationsForBusybox method
+ // then you need to ensure that all worked fine before deleting and updating the Downgrade status
+ // otherwise, you should requeue here.
+
+ // Re-fetch the busybox Custom Resource before update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ if err := r.Get(ctx, req.NamespacedName, busybox); err != nil {
+ log.Error(err, "Failed to re-fetch busybox")
+ return ctrl.Result{}, err
+ }
+
+ meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeDegradedBusybox,
+ Status: metav1.ConditionTrue, Reason: "Finalizing",
+ Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", busybox.Name)})
+
+ if err := r.Status().Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update Busybox status")
+ return ctrl.Result{}, err
+ }
+
+ log.Info("Removing Finalizer for Busybox after successfully perform the operations")
+ if ok := controllerutil.RemoveFinalizer(busybox, busyboxFinalizer); !ok {
+ log.Error(err, "Failed to remove finalizer for Busybox")
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ if err := r.Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to remove finalizer for Busybox")
+ return ctrl.Result{}, err
+ }
+ }
+ return ctrl.Result{}, nil
+ }
+
+ // Check if the deployment already exists, if not create a new one
+ found := &appsv1.Deployment{}
+ err = r.Get(ctx, types.NamespacedName{Name: busybox.Name, Namespace: busybox.Namespace}, found)
+ if err != nil && apierrors.IsNotFound(err) {
+ // Define a new deployment
+ dep, err := r.deploymentForBusybox(busybox)
+ if err != nil {
+ log.Error(err, "Failed to define new Deployment resource for Busybox")
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox,
+ Status: metav1.ConditionFalse, Reason: "Reconciling",
+ Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", busybox.Name, err)})
+
+ if err := r.Status().Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update Busybox status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, err
+ }
+
+ log.Info("Creating a new Deployment",
+ "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+ if err = r.Create(ctx, dep); err != nil {
+ log.Error(err, "Failed to create new Deployment",
+ "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+ return ctrl.Result{}, err
+ }
+
+ // Deployment created successfully
+ // We will requeue the reconciliation so that we can ensure the state
+ // and move forward for the next operations
+ return ctrl.Result{RequeueAfter: time.Minute}, nil
+ } else if err != nil {
+ log.Error(err, "Failed to get Deployment")
+ // Let's return the error for the reconciliation be re-trigged again
+ return ctrl.Result{}, err
+ }
+
+ // The CRD API is defining that the Busybox type, have a BusyboxSpec.Size field
+ // to set the quantity of Deployment instances is the desired state on the cluster.
+ // Therefore, the following code will ensure the Deployment size is the same as defined
+ // via the Size spec of the Custom Resource which we are reconciling.
+ size := busybox.Spec.Size
+ if *found.Spec.Replicas != size {
+ found.Spec.Replicas = &size
+ if err = r.Update(ctx, found); err != nil {
+ log.Error(err, "Failed to update Deployment",
+ "Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
+
+ // Re-fetch the busybox Custom Resource before update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ if err := r.Get(ctx, req.NamespacedName, busybox); err != nil {
+ log.Error(err, "Failed to re-fetch busybox")
+ return ctrl.Result{}, err
+ }
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox,
+ Status: metav1.ConditionFalse, Reason: "Resizing",
+ Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", busybox.Name, err)})
+
+ if err := r.Status().Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update Busybox status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, err
+ }
+
+ // Now, that we update the size we want to requeue the reconciliation
+ // so that we can ensure that we have the latest state of the resource before
+ // update. Also, it will help ensure the desired state on the cluster
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox,
+ Status: metav1.ConditionTrue, Reason: "Reconciling",
+ Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", busybox.Name, size)})
+
+ if err := r.Status().Update(ctx, busybox); err != nil {
+ log.Error(err, "Failed to update Busybox status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, nil
+}
+
+// finalizeBusybox will perform the required operations before delete the CR.
+func (r *BusyboxReconciler) doFinalizerOperationsForBusybox(cr *examplecomv1alpha1.Busybox) {
+ // TODO(user): Add the cleanup steps that the operator
+ // needs to do before the CR can be deleted. Examples
+ // of finalizers include performing backups and deleting
+ // resources that are not owned by this CR, like a PVC.
+
+ // Note: It is not recommended to use finalizers with the purpose of delete resources which are
+ // created and managed in the reconciliation. These ones, such as the Deployment created on this reconcile,
+ // are defined as depended of the custom resource. See that we use the method ctrl.SetControllerReference.
+ // to set the ownerRef which means that the Deployment will be deleted by the Kubernetes API.
+ // More info: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/
+
+ // The following implementation will raise an event
+ r.Recorder.Event(cr, "Warning", "Deleting",
+ fmt.Sprintf("Custom Resource %s is being deleted from the namespace %s",
+ cr.Name,
+ cr.Namespace))
+}
+
+// deploymentForBusybox returns a Busybox Deployment object
+func (r *BusyboxReconciler) deploymentForBusybox(
+ busybox *examplecomv1alpha1.Busybox) (*appsv1.Deployment, error) {
+ ls := labelsForBusybox(busybox.Name)
+ replicas := busybox.Spec.Size
+
+ // Get the Operand image
+ image, err := imageForBusybox()
+ if err != nil {
+ return nil, err
+ }
+
+ dep := &appsv1.Deployment{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: busybox.Name,
+ Namespace: busybox.Namespace,
+ },
+ Spec: appsv1.DeploymentSpec{
+ Replicas: &replicas,
+ Selector: &metav1.LabelSelector{
+ MatchLabels: ls,
+ },
+ Template: corev1.PodTemplateSpec{
+ ObjectMeta: metav1.ObjectMeta{
+ Labels: ls,
+ },
+ Spec: corev1.PodSpec{
+ // TODO(user): Uncomment the following code to configure the nodeAffinity expression
+ // according to the platforms which are supported by your solution. It is considered
+ // best practice to support multiple architectures. build your manager image using the
+ // makefile target docker-buildx. Also, you can use docker manifest inspect
+ // to check what are the platforms supported.
+ // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
+ //Affinity: &corev1.Affinity{
+ // NodeAffinity: &corev1.NodeAffinity{
+ // RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
+ // NodeSelectorTerms: []corev1.NodeSelectorTerm{
+ // {
+ // MatchExpressions: []corev1.NodeSelectorRequirement{
+ // {
+ // Key: "kubernetes.io/arch",
+ // Operator: "In",
+ // Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
+ // },
+ // {
+ // Key: "kubernetes.io/os",
+ // Operator: "In",
+ // Values: []string{"linux"},
+ // },
+ // },
+ // },
+ // },
+ // },
+ // },
+ //},
+ SecurityContext: &corev1.PodSecurityContext{
+ RunAsNonRoot: &[]bool{true}[0],
+ // IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
+ // If you are looking for to produce solutions to be supported
+ // on lower versions you must remove this option.
+ SeccompProfile: &corev1.SeccompProfile{
+ Type: corev1.SeccompProfileTypeRuntimeDefault,
+ },
+ },
+ Containers: []corev1.Container{{
+ Image: image,
+ Name: "busybox",
+ ImagePullPolicy: corev1.PullIfNotPresent,
+ // Ensure restrictive context for the container
+ // More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
+ SecurityContext: &corev1.SecurityContext{
+ RunAsNonRoot: &[]bool{true}[0],
+ AllowPrivilegeEscalation: &[]bool{false}[0],
+ Capabilities: &corev1.Capabilities{
+ Drop: []corev1.Capability{
+ "ALL",
+ },
+ },
+ },
+ }},
+ },
+ },
+ },
+ }
+
+ // Set the ownerRef for the Deployment
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
+ if err := ctrl.SetControllerReference(busybox, dep, r.Scheme); err != nil {
+ return nil, err
+ }
+ return dep, nil
+}
+
+// labelsForBusybox returns the labels for selecting the resources
+// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
+func labelsForBusybox(name string) map[string]string {
+ var imageTag string
+ image, err := imageForBusybox()
+ if err == nil {
+ imageTag = strings.Split(image, ":")[1]
+ }
+ return map[string]string{"app.kubernetes.io/name": "Busybox",
+ "app.kubernetes.io/instance": name,
+ "app.kubernetes.io/version": imageTag,
+ "app.kubernetes.io/part-of": "project-v4-multigroup",
+ "app.kubernetes.io/created-by": "controller-manager",
+ }
+}
+
+// imageForBusybox gets the Operand image which is managed by this controller
+// from the BUSYBOX_IMAGE environment variable defined in the config/manager/manager.yaml
+func imageForBusybox() (string, error) {
+ var imageEnvVar = "BUSYBOX_IMAGE"
+ image, found := os.LookupEnv(imageEnvVar)
+ if !found {
+ return "", fmt.Errorf("Unable to find %s environment variable with the image", imageEnvVar)
+ }
+ return image, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+// Note that the Deployment will be also watched in order to ensure its
+// desirable state on the cluster
+func (r *BusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&examplecomv1alpha1.Busybox{}).
+ Owns(&appsv1.Deployment{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
new file mode 100644
index 00000000000..0a3496134dd
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
@@ -0,0 +1,142 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package examplecom
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ appsv1 "k8s.io/api/apps/v1"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
+)
+
+var _ = Describe("Busybox controller", func() {
+ Context("Busybox controller test", func() {
+
+ const BusyboxName = "test-busybox"
+
+ ctx := context.Background()
+
+ namespace := &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: BusyboxName,
+ Namespace: BusyboxName,
+ },
+ }
+
+ typeNamespaceName := types.NamespacedName{Name: BusyboxName, Namespace: BusyboxName}
+ busybox := &examplecomv1alpha1.Busybox{}
+
+ BeforeEach(func() {
+ By("Creating the Namespace to perform the tests")
+ err := k8sClient.Create(ctx, namespace)
+ Expect(err).To(Not(HaveOccurred()))
+
+ By("Setting the Image ENV VAR which stores the Operand image")
+ err = os.Setenv("BUSYBOX_IMAGE", "example.com/image:test")
+ Expect(err).To(Not(HaveOccurred()))
+
+ By("creating the custom resource for the Kind Busybox")
+ err = k8sClient.Get(ctx, typeNamespaceName, busybox)
+ if err != nil && errors.IsNotFound(err) {
+ // Let's mock our custom resource at the same way that we would
+ // apply on the cluster the manifest under config/samples
+ busybox := &examplecomv1alpha1.Busybox{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: BusyboxName,
+ Namespace: namespace.Name,
+ },
+ Spec: examplecomv1alpha1.BusyboxSpec{
+ Size: 1,
+ },
+ }
+
+ err = k8sClient.Create(ctx, busybox)
+ Expect(err).To(Not(HaveOccurred()))
+ }
+ })
+
+ AfterEach(func() {
+ By("removing the custom resource for the Kind Busybox")
+ found := &examplecomv1alpha1.Busybox{}
+ err := k8sClient.Get(ctx, typeNamespaceName, found)
+ Expect(err).To(Not(HaveOccurred()))
+
+ Eventually(func() error {
+ return k8sClient.Delete(context.TODO(), found)
+ }, 2*time.Minute, time.Second).Should(Succeed())
+
+ // TODO(user): Attention if you improve this code by adding other context test you MUST
+ // be aware of the current delete namespace limitations.
+ // More info: https://book.kubebuilder.io/reference/envtest.html#testing-considerations
+ By("Deleting the Namespace to perform the tests")
+ _ = k8sClient.Delete(ctx, namespace)
+
+ By("Removing the Image ENV VAR which stores the Operand image")
+ _ = os.Unsetenv("BUSYBOX_IMAGE")
+ })
+
+ It("should successfully reconcile a custom resource for Busybox", func() {
+ By("Checking if the custom resource was successfully created")
+ Eventually(func() error {
+ found := &examplecomv1alpha1.Busybox{}
+ return k8sClient.Get(ctx, typeNamespaceName, found)
+ }, time.Minute, time.Second).Should(Succeed())
+
+ By("Reconciling the custom resource created")
+ busyboxReconciler := &BusyboxReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := busyboxReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespaceName,
+ })
+ Expect(err).To(Not(HaveOccurred()))
+
+ By("Checking if Deployment was successfully created in the reconciliation")
+ Eventually(func() error {
+ found := &appsv1.Deployment{}
+ return k8sClient.Get(ctx, typeNamespaceName, found)
+ }, time.Minute, time.Second).Should(Succeed())
+
+ By("Checking the latest Status Condition added to the Busybox instance")
+ Eventually(func() error {
+ if busybox.Status.Conditions != nil && len(busybox.Status.Conditions) != 0 {
+ latestStatusCondition := busybox.Status.Conditions[len(busybox.Status.Conditions)-1]
+ expectedLatestStatusCondition := metav1.Condition{Type: typeAvailableBusybox,
+ Status: metav1.ConditionTrue, Reason: "Reconciling",
+ Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", busybox.Name, busybox.Spec.Size)}
+ if latestStatusCondition != expectedLatestStatusCondition {
+ return fmt.Errorf("The latest status condition added to the busybox instance is not as expected")
+ }
+ }
+ return nil
+ }, time.Minute, time.Second).Should(Succeed())
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
new file mode 100644
index 00000000000..a21240db732
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
@@ -0,0 +1,440 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package examplecom
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "strings"
+ "time"
+
+ appsv1 "k8s.io/api/apps/v1"
+ corev1 "k8s.io/api/core/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/api/meta"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/client-go/tools/record"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
+)
+
+const memcachedFinalizer = "example.com.testproject.org/finalizer"
+
+// Definitions to manage status conditions
+const (
+ // typeAvailableMemcached represents the status of the Deployment reconciliation
+ typeAvailableMemcached = "Available"
+ // typeDegradedMemcached represents the status used when the custom resource is deleted and the finalizer operations are must to occur.
+ typeDegradedMemcached = "Degraded"
+)
+
+// MemcachedReconciler reconciles a Memcached object
+type MemcachedReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+ Recorder record.EventRecorder
+}
+
+// The following markers are used to generate the rules permissions (RBAC) on config/rbac using controller-gen
+// when the command is executed.
+// To know more about markers see: https://book.kubebuilder.io/reference/markers.html
+
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds/finalizers,verbs=update
+//+kubebuilder:rbac:groups=core,resources=events,verbs=create;patch
+//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+
+// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
+// pattern you will create Controllers which provide a reconcile function
+// responsible for synchronizing resources until the desired state is reached on the cluster.
+// Breaking this recommendation goes against the design principles of controller-runtime.
+// and may lead to unforeseen consequences such as resources becoming stuck and requiring manual intervention.
+// 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.15.0/pkg/reconcile
+func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ log := log.FromContext(ctx)
+
+ // Fetch the Memcached instance
+ // The purpose is check if the Custom Resource for the Kind Memcached
+ // is applied on the cluster if not we return nil to stop the reconciliation
+ memcached := &examplecomv1alpha1.Memcached{}
+ err := r.Get(ctx, req.NamespacedName, memcached)
+ if err != nil {
+ if apierrors.IsNotFound(err) {
+ // If the custom resource is not found then, it usually means that it was deleted or not created
+ // In this way, we will stop the reconciliation
+ log.Info("memcached resource not found. Ignoring since object must be deleted")
+ return ctrl.Result{}, nil
+ }
+ // Error reading the object - requeue the request.
+ log.Error(err, "Failed to get memcached")
+ return ctrl.Result{}, err
+ }
+
+ // Let's just set the status as Unknown when no status are available
+ if memcached.Status.Conditions == nil || len(memcached.Status.Conditions) == 0 {
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
+ if err = r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ // Let's re-fetch the memcached Custom Resource after update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ // if we try to update it again in the following operations
+ if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+ log.Error(err, "Failed to re-fetch memcached")
+ return ctrl.Result{}, err
+ }
+ }
+
+ // Let's add a finalizer. Then, we can define some operations which should
+ // occurs before the custom resource to be deleted.
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
+ if !controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
+ log.Info("Adding Finalizer for Memcached")
+ if ok := controllerutil.AddFinalizer(memcached, memcachedFinalizer); !ok {
+ log.Error(err, "Failed to add finalizer into the custom resource")
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ if err = r.Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update custom resource to add finalizer")
+ return ctrl.Result{}, err
+ }
+ }
+
+ // Check if the Memcached instance is marked to be deleted, which is
+ // indicated by the deletion timestamp being set.
+ isMemcachedMarkedToBeDeleted := memcached.GetDeletionTimestamp() != nil
+ if isMemcachedMarkedToBeDeleted {
+ if controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
+ log.Info("Performing Finalizer Operations for Memcached before delete CR")
+
+ // Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
+ Status: metav1.ConditionUnknown, Reason: "Finalizing",
+ Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", memcached.Name)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ // Perform all operations required before remove the finalizer and allow
+ // the Kubernetes API to remove the custom resource.
+ r.doFinalizerOperationsForMemcached(memcached)
+
+ // TODO(user): If you add operations to the doFinalizerOperationsForMemcached method
+ // then you need to ensure that all worked fine before deleting and updating the Downgrade status
+ // otherwise, you should requeue here.
+
+ // Re-fetch the memcached Custom Resource before update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+ log.Error(err, "Failed to re-fetch memcached")
+ return ctrl.Result{}, err
+ }
+
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
+ Status: metav1.ConditionTrue, Reason: "Finalizing",
+ Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", memcached.Name)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ log.Info("Removing Finalizer for Memcached after successfully perform the operations")
+ if ok := controllerutil.RemoveFinalizer(memcached, memcachedFinalizer); !ok {
+ log.Error(err, "Failed to remove finalizer for Memcached")
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ if err := r.Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to remove finalizer for Memcached")
+ return ctrl.Result{}, err
+ }
+ }
+ return ctrl.Result{}, nil
+ }
+
+ // Check if the deployment already exists, if not create a new one
+ found := &appsv1.Deployment{}
+ err = r.Get(ctx, types.NamespacedName{Name: memcached.Name, Namespace: memcached.Namespace}, found)
+ if err != nil && apierrors.IsNotFound(err) {
+ // Define a new deployment
+ dep, err := r.deploymentForMemcached(memcached)
+ if err != nil {
+ log.Error(err, "Failed to define new Deployment resource for Memcached")
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionFalse, Reason: "Reconciling",
+ Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", memcached.Name, err)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, err
+ }
+
+ log.Info("Creating a new Deployment",
+ "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+ if err = r.Create(ctx, dep); err != nil {
+ log.Error(err, "Failed to create new Deployment",
+ "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+ return ctrl.Result{}, err
+ }
+
+ // Deployment created successfully
+ // We will requeue the reconciliation so that we can ensure the state
+ // and move forward for the next operations
+ return ctrl.Result{RequeueAfter: time.Minute}, nil
+ } else if err != nil {
+ log.Error(err, "Failed to get Deployment")
+ // Let's return the error for the reconciliation be re-trigged again
+ return ctrl.Result{}, err
+ }
+
+ // The CRD API is defining that the Memcached type, have a MemcachedSpec.Size field
+ // to set the quantity of Deployment instances is the desired state on the cluster.
+ // Therefore, the following code will ensure the Deployment size is the same as defined
+ // via the Size spec of the Custom Resource which we are reconciling.
+ size := memcached.Spec.Size
+ if *found.Spec.Replicas != size {
+ found.Spec.Replicas = &size
+ if err = r.Update(ctx, found); err != nil {
+ log.Error(err, "Failed to update Deployment",
+ "Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
+
+ // Re-fetch the memcached Custom Resource before update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+ log.Error(err, "Failed to re-fetch memcached")
+ return ctrl.Result{}, err
+ }
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionFalse, Reason: "Resizing",
+ Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", memcached.Name, err)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, err
+ }
+
+ // Now, that we update the size we want to requeue the reconciliation
+ // so that we can ensure that we have the latest state of the resource before
+ // update. Also, it will help ensure the desired state on the cluster
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionTrue, Reason: "Reconciling",
+ Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, size)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, nil
+}
+
+// finalizeMemcached will perform the required operations before delete the CR.
+func (r *MemcachedReconciler) doFinalizerOperationsForMemcached(cr *examplecomv1alpha1.Memcached) {
+ // TODO(user): Add the cleanup steps that the operator
+ // needs to do before the CR can be deleted. Examples
+ // of finalizers include performing backups and deleting
+ // resources that are not owned by this CR, like a PVC.
+
+ // Note: It is not recommended to use finalizers with the purpose of delete resources which are
+ // created and managed in the reconciliation. These ones, such as the Deployment created on this reconcile,
+ // are defined as depended of the custom resource. See that we use the method ctrl.SetControllerReference.
+ // to set the ownerRef which means that the Deployment will be deleted by the Kubernetes API.
+ // More info: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/
+
+ // The following implementation will raise an event
+ r.Recorder.Event(cr, "Warning", "Deleting",
+ fmt.Sprintf("Custom Resource %s is being deleted from the namespace %s",
+ cr.Name,
+ cr.Namespace))
+}
+
+// deploymentForMemcached returns a Memcached Deployment object
+func (r *MemcachedReconciler) deploymentForMemcached(
+ memcached *examplecomv1alpha1.Memcached) (*appsv1.Deployment, error) {
+ ls := labelsForMemcached(memcached.Name)
+ replicas := memcached.Spec.Size
+
+ // Get the Operand image
+ image, err := imageForMemcached()
+ if err != nil {
+ return nil, err
+ }
+
+ dep := &appsv1.Deployment{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: memcached.Name,
+ Namespace: memcached.Namespace,
+ },
+ Spec: appsv1.DeploymentSpec{
+ Replicas: &replicas,
+ Selector: &metav1.LabelSelector{
+ MatchLabels: ls,
+ },
+ Template: corev1.PodTemplateSpec{
+ ObjectMeta: metav1.ObjectMeta{
+ Labels: ls,
+ },
+ Spec: corev1.PodSpec{
+ // TODO(user): Uncomment the following code to configure the nodeAffinity expression
+ // according to the platforms which are supported by your solution. It is considered
+ // best practice to support multiple architectures. build your manager image using the
+ // makefile target docker-buildx. Also, you can use docker manifest inspect
+ // to check what are the platforms supported.
+ // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
+ //Affinity: &corev1.Affinity{
+ // NodeAffinity: &corev1.NodeAffinity{
+ // RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
+ // NodeSelectorTerms: []corev1.NodeSelectorTerm{
+ // {
+ // MatchExpressions: []corev1.NodeSelectorRequirement{
+ // {
+ // Key: "kubernetes.io/arch",
+ // Operator: "In",
+ // Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
+ // },
+ // {
+ // Key: "kubernetes.io/os",
+ // Operator: "In",
+ // Values: []string{"linux"},
+ // },
+ // },
+ // },
+ // },
+ // },
+ // },
+ //},
+ SecurityContext: &corev1.PodSecurityContext{
+ RunAsNonRoot: &[]bool{true}[0],
+ // IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
+ // If you are looking for to produce solutions to be supported
+ // on lower versions you must remove this option.
+ SeccompProfile: &corev1.SeccompProfile{
+ Type: corev1.SeccompProfileTypeRuntimeDefault,
+ },
+ },
+ Containers: []corev1.Container{{
+ Image: image,
+ Name: "memcached",
+ ImagePullPolicy: corev1.PullIfNotPresent,
+ // Ensure restrictive context for the container
+ // More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
+ SecurityContext: &corev1.SecurityContext{
+ RunAsNonRoot: &[]bool{true}[0],
+ RunAsUser: &[]int64{1001}[0],
+ AllowPrivilegeEscalation: &[]bool{false}[0],
+ Capabilities: &corev1.Capabilities{
+ Drop: []corev1.Capability{
+ "ALL",
+ },
+ },
+ },
+ Ports: []corev1.ContainerPort{{
+ ContainerPort: memcached.Spec.ContainerPort,
+ Name: "memcached",
+ }},
+ Command: []string{"memcached", "-m=64", "-o", "modern", "-v"},
+ }},
+ },
+ },
+ },
+ }
+
+ // Set the ownerRef for the Deployment
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
+ if err := ctrl.SetControllerReference(memcached, dep, r.Scheme); err != nil {
+ return nil, err
+ }
+ return dep, nil
+}
+
+// labelsForMemcached returns the labels for selecting the resources
+// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
+func labelsForMemcached(name string) map[string]string {
+ var imageTag string
+ image, err := imageForMemcached()
+ if err == nil {
+ imageTag = strings.Split(image, ":")[1]
+ }
+ return map[string]string{"app.kubernetes.io/name": "Memcached",
+ "app.kubernetes.io/instance": name,
+ "app.kubernetes.io/version": imageTag,
+ "app.kubernetes.io/part-of": "project-v4-multigroup",
+ "app.kubernetes.io/created-by": "controller-manager",
+ }
+}
+
+// imageForMemcached gets the Operand image which is managed by this controller
+// from the MEMCACHED_IMAGE environment variable defined in the config/manager/manager.yaml
+func imageForMemcached() (string, error) {
+ var imageEnvVar = "MEMCACHED_IMAGE"
+ image, found := os.LookupEnv(imageEnvVar)
+ if !found {
+ return "", fmt.Errorf("Unable to find %s environment variable with the image", imageEnvVar)
+ }
+ return image, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+// Note that the Deployment will be also watched in order to ensure its
+// desirable state on the cluster
+func (r *MemcachedReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&examplecomv1alpha1.Memcached{}).
+ Owns(&appsv1.Deployment{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
new file mode 100644
index 00000000000..f96146c9b74
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
@@ -0,0 +1,143 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package examplecom
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ appsv1 "k8s.io/api/apps/v1"
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
+)
+
+var _ = Describe("Memcached controller", func() {
+ Context("Memcached controller test", func() {
+
+ const MemcachedName = "test-memcached"
+
+ ctx := context.Background()
+
+ namespace := &corev1.Namespace{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: MemcachedName,
+ Namespace: MemcachedName,
+ },
+ }
+
+ typeNamespaceName := types.NamespacedName{Name: MemcachedName, Namespace: MemcachedName}
+ memcached := &examplecomv1alpha1.Memcached{}
+
+ BeforeEach(func() {
+ By("Creating the Namespace to perform the tests")
+ err := k8sClient.Create(ctx, namespace)
+ Expect(err).To(Not(HaveOccurred()))
+
+ By("Setting the Image ENV VAR which stores the Operand image")
+ err = os.Setenv("MEMCACHED_IMAGE", "example.com/image:test")
+ Expect(err).To(Not(HaveOccurred()))
+
+ By("creating the custom resource for the Kind Memcached")
+ err = k8sClient.Get(ctx, typeNamespaceName, memcached)
+ if err != nil && errors.IsNotFound(err) {
+ // Let's mock our custom resource at the same way that we would
+ // apply on the cluster the manifest under config/samples
+ memcached := &examplecomv1alpha1.Memcached{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: MemcachedName,
+ Namespace: namespace.Name,
+ },
+ Spec: examplecomv1alpha1.MemcachedSpec{
+ Size: 1,
+ ContainerPort: 11211,
+ },
+ }
+
+ err = k8sClient.Create(ctx, memcached)
+ Expect(err).To(Not(HaveOccurred()))
+ }
+ })
+
+ AfterEach(func() {
+ By("removing the custom resource for the Kind Memcached")
+ found := &examplecomv1alpha1.Memcached{}
+ err := k8sClient.Get(ctx, typeNamespaceName, found)
+ Expect(err).To(Not(HaveOccurred()))
+
+ Eventually(func() error {
+ return k8sClient.Delete(context.TODO(), found)
+ }, 2*time.Minute, time.Second).Should(Succeed())
+
+ // TODO(user): Attention if you improve this code by adding other context test you MUST
+ // be aware of the current delete namespace limitations.
+ // More info: https://book.kubebuilder.io/reference/envtest.html#testing-considerations
+ By("Deleting the Namespace to perform the tests")
+ _ = k8sClient.Delete(ctx, namespace)
+
+ By("Removing the Image ENV VAR which stores the Operand image")
+ _ = os.Unsetenv("MEMCACHED_IMAGE")
+ })
+
+ It("should successfully reconcile a custom resource for Memcached", func() {
+ By("Checking if the custom resource was successfully created")
+ Eventually(func() error {
+ found := &examplecomv1alpha1.Memcached{}
+ return k8sClient.Get(ctx, typeNamespaceName, found)
+ }, time.Minute, time.Second).Should(Succeed())
+
+ By("Reconciling the custom resource created")
+ memcachedReconciler := &MemcachedReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := memcachedReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespaceName,
+ })
+ Expect(err).To(Not(HaveOccurred()))
+
+ By("Checking if Deployment was successfully created in the reconciliation")
+ Eventually(func() error {
+ found := &appsv1.Deployment{}
+ return k8sClient.Get(ctx, typeNamespaceName, found)
+ }, time.Minute, time.Second).Should(Succeed())
+
+ By("Checking the latest Status Condition added to the Memcached instance")
+ Eventually(func() error {
+ if memcached.Status.Conditions != nil && len(memcached.Status.Conditions) != 0 {
+ latestStatusCondition := memcached.Status.Conditions[len(memcached.Status.Conditions)-1]
+ expectedLatestStatusCondition := metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionTrue, Reason: "Reconciling",
+ Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, memcached.Spec.Size)}
+ if latestStatusCondition != expectedLatestStatusCondition {
+ return fmt.Errorf("The latest status condition added to the memcached instance is not as expected")
+ }
+ }
+ return nil
+ }, time.Minute, time.Second).Should(Succeed())
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
new file mode 100644
index 00000000000..2d10eaa4f7f
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package examplecom
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+
+ examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = examplecomv1alpha1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
From e6dff2fbcd9c905fac0d304fe505694f1eaf1dbc Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 26 Aug 2023 06:49:28 +0100
Subject: [PATCH 0255/1245] :bug: (deployimage): fix e2e tests which are using
go/v3 which is deprecated. Ensure that we are using the go/v4
---
test/e2e/deployimage/plugin_cluster_test.go | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/e2e/deployimage/plugin_cluster_test.go b/test/e2e/deployimage/plugin_cluster_test.go
index 9ab26fffddb..66c3fac1b45 100644
--- a/test/e2e/deployimage/plugin_cluster_test.go
+++ b/test/e2e/deployimage/plugin_cluster_test.go
@@ -38,7 +38,7 @@ import (
)
var _ = Describe("kubebuilder", func() {
- Context("deploy image plugin 3", func() {
+ Context("deploy image plugin", func() {
var kbc *utils.TestContext
BeforeEach(func() {
@@ -82,7 +82,7 @@ var _ = Describe("kubebuilder", func() {
By("initializing a project with go/v3")
err = kbc.Init(
- "--plugins", "go/v3",
+ "--plugins", "go/v4",
"--project-version", "3",
"--domain", kbc.Domain,
)
@@ -117,9 +117,9 @@ var _ = Describe("kubebuilder", func() {
It("should generate a runnable project with deploy-image/v1-alpha without options ", func() {
var err error
- By("initializing a project with go/v3")
+ By("initializing a project with go/v4")
err = kbc.Init(
- "--plugins", "go/v3",
+ "--plugins", "go/v4",
"--project-version", "3",
"--domain", kbc.Domain,
)
From 2a4345da1a42204c620344f74408fde7136e344b Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 26 Aug 2023 06:34:56 +0100
Subject: [PATCH 0256/1245] ensure that we call go tidy when we generate sample
docs
---
.../src/cronjob-tutorial/testdata/project/go.mod | 2 +-
.../src/cronjob-tutorial/testdata/project/go.sum | 4 ----
.../generate_component_config.go | 12 ++++++++++--
.../internal/cronjob-tutorial/generate_cronjob.go | 12 ++++++++++--
4 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
index d1a6a71fbe1..23e8d42dbf9 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
@@ -5,6 +5,7 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.7
+ github.com/robfig/cron v1.2.0
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/client-go v0.27.2
@@ -45,7 +46,6 @@ require (
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
- github.com/robfig/cron v1.2.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
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index da86b48f019..2f447cdbd84 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -25,7 +25,6 @@ github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJ
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
-github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -80,10 +79,8 @@ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -105,7 +102,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
diff --git a/hack/docs/internal/component-config-tutorial/generate_component_config.go b/hack/docs/internal/component-config-tutorial/generate_component_config.go
index ffd872aa813..f153664c207 100644
--- a/hack/docs/internal/component-config-tutorial/generate_component_config.go
+++ b/hack/docs/internal/component-config-tutorial/generate_component_config.go
@@ -151,10 +151,18 @@ clusterName: example-test
}
func (sp *Sample) CodeGen() {
- cmd := exec.Command("make", "build")
+
+ cmd := exec.Command("make", "manifests")
_, err := sp.ctx.Run(cmd)
+ CheckError("Failed to run make manifests for componentConfig tutorial", err)
+
+ cmd = exec.Command("make", "all")
+ _, err = sp.ctx.Run(cmd)
+ CheckError("Failed to run make all for componentConfig tutorial", err)
- CheckError("Failed to generate code in componentconfig tutorial", err)
+ cmd = exec.Command("go", "mod", "tidy")
+ _, err = sp.ctx.Run(cmd)
+ CheckError("Failed to run go mod tidy all for componentConfig tutorial", err)
}
// CheckError will exit with exit code 1 when err is not nil.
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index e983e2e5d31..0149cd317a6 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -128,9 +128,17 @@ func codeGen(sp *Sample) {
_, err := sp.ctx.Run(cmd)
CheckError("Failed to get package robfig/cron", err)
- cmd = exec.Command("make", "build")
+ cmd = exec.Command("make", "manifests")
_, err = sp.ctx.Run(cmd)
- CheckError("Failed to generate code in cronjob tutorial", err)
+ CheckError("Failed to run make manifests for cronjob tutorial", err)
+
+ cmd = exec.Command("make", "all")
+ _, err = sp.ctx.Run(cmd)
+ CheckError("Failed to run make all for cronjob tutorial", err)
+
+ cmd = exec.Command("go", "mod", "tidy")
+ _, err = sp.ctx.Run(cmd)
+ CheckError("Failed to run go mod tidy for cronjob tutorial", err)
}
// insert code to fix docs
From 4fbfda4dd16b816b16665f183a59633fca79914c Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 26 Aug 2023 06:28:02 +0100
Subject: [PATCH 0257/1245] :bug: change deprecated warning to yellow
---
pkg/cli/cli.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go
index af50425603b..a5d08b42969 100644
--- a/pkg/cli/cli.go
+++ b/pkg/cli/cli.go
@@ -34,7 +34,7 @@ import (
)
const (
- noticeColor = "\033[1;36m%s\033[0m"
+ noticeColor = "\033[1;33m%s\033[0m"
deprecationFmt = "[Deprecation Notice] %s\n\n"
pluginsFlag = "plugins"
From 4d1e3c574a5e50a976cb81d723ea78adf7c628c4 Mon Sep 17 00:00:00 2001
From: "Tony (TianYi)"
Date: Sat, 26 Aug 2023 08:34:05 -0400
Subject: [PATCH 0258/1245] :sparkles: (Kustomize/v2, go/v4): upgrade
controller-tools from 0.12.0 to 0.13.0 (#3561)
(go/v4): Upgrade controller-tools from 0.12.0 to v0.13.0
---
.github/workflows/apidiff.yml | 4 ++--
Makefile | 2 +-
.../src/component-config-tutorial/testdata/project/Makefile | 2 +-
.../testdata/project/api/v2/zz_generated.deepcopy.go | 1 -
.../bases/config.tutorial.kubebuilder.io_projectconfigs.yaml | 2 +-
docs/book/src/cronjob-tutorial/testdata/project/Makefile | 2 +-
.../testdata/project/api/v1/zz_generated.deepcopy.go | 1 -
.../crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml | 2 +-
pkg/plugins/golang/v4/scaffolds/init.go | 2 +-
testdata/project-v4-declarative-v1/Makefile | 2 +-
.../project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go | 1 -
.../config/crd/bases/crew.testproject.org_admirals.yaml | 2 +-
.../config/crd/bases/crew.testproject.org_captains.yaml | 2 +-
.../config/crd/bases/crew.testproject.org_firstmates.yaml | 2 +-
testdata/project-v4-multigroup/Makefile | 2 +-
.../api/crew/v1/zz_generated.deepcopy.go | 1 -
.../project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go | 1 -
.../api/foo.policy/v1/zz_generated.deepcopy.go | 1 -
.../project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go | 1 -
.../api/sea-creatures/v1beta1/zz_generated.deepcopy.go | 1 -
.../api/sea-creatures/v1beta2/zz_generated.deepcopy.go | 1 -
.../api/ship/v1/zz_generated.deepcopy.go | 1 -
.../api/ship/v1beta1/zz_generated.deepcopy.go | 1 -
.../api/ship/v2alpha1/zz_generated.deepcopy.go | 1 -
.../project-v4-multigroup/api/v1/zz_generated.deepcopy.go | 1 -
.../config/crd/bases/crew.testproject.org_captains.yaml | 2 +-
.../config/crd/bases/fiz.testproject.org_bars.yaml | 2 +-
.../bases/foo.policy.testproject.org_healthcheckpolicies.yaml | 2 +-
.../config/crd/bases/foo.testproject.org_bars.yaml | 2 +-
.../crd/bases/sea-creatures.testproject.org_krakens.yaml | 2 +-
.../crd/bases/sea-creatures.testproject.org_leviathans.yaml | 2 +-
.../config/crd/bases/ship.testproject.org_cruisers.yaml | 2 +-
.../config/crd/bases/ship.testproject.org_destroyers.yaml | 2 +-
.../config/crd/bases/ship.testproject.org_frigates.yaml | 2 +-
.../config/crd/bases/testproject.org_lakers.yaml | 2 +-
testdata/project-v4-with-deploy-image/Makefile | 2 +-
.../api/v1alpha1/zz_generated.deepcopy.go | 1 -
.../crd/bases/example.com.testproject.org_busyboxes.yaml | 2 +-
.../crd/bases/example.com.testproject.org_memcacheds.yaml | 2 +-
testdata/project-v4-with-grafana/Makefile | 2 +-
testdata/project-v4/Makefile | 2 +-
testdata/project-v4/api/v1/zz_generated.deepcopy.go | 1 -
.../config/crd/bases/crew.testproject.org_admirales.yaml | 2 +-
.../config/crd/bases/crew.testproject.org_captains.yaml | 2 +-
.../config/crd/bases/crew.testproject.org_firstmates.yaml | 2 +-
45 files changed, 31 insertions(+), 46 deletions(-)
diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml
index bc7ab234085..88950b357ca 100644
--- a/.github/workflows/apidiff.yml
+++ b/.github/workflows/apidiff.yml
@@ -19,9 +19,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
- go-version: '~1.20'
+ go-version: "~1.20"
- name: Execute go-apidiff
- uses: joelanford/go-apidiff@v0.6.0
+ uses: joelanford/go-apidiff@v0.6.1
with:
compare-imports: true
print-compatible: true
diff --git a/Makefile b/Makefile
index a2e19562d58..e9c1e62a580 100644
--- a/Makefile
+++ b/Makefile
@@ -104,7 +104,7 @@ apidiff: go-apidiff ## Run the go-apidiff to verify any API differences compared
.PHONY: go-apidiff
go-apidiff:
- go install github.com/joelanford/go-apidiff@v0.5.0
+ go install github.com/joelanford/go-apidiff@v0.6.1
##@ Tests
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index c3ce045307b..fca59190d10 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
diff --git a/docs/book/src/component-config-tutorial/testdata/project/api/v2/zz_generated.deepcopy.go b/docs/book/src/component-config-tutorial/testdata/project/api/v2/zz_generated.deepcopy.go
index ed6397b49b3..135525ed57c 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/api/v2/zz_generated.deepcopy.go
+++ b/docs/book/src/component-config-tutorial/testdata/project/api/v2/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml
index 34ad6f3cbd0..445db7b6b0f 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/crd/bases/config.tutorial.kubebuilder.io_projectconfigs.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: projectconfigs.config.tutorial.kubebuilder.io
spec:
group: config.tutorial.kubebuilder.io
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index c3ce045307b..fca59190d10 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/zz_generated.deepcopy.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/zz_generated.deepcopy.go
index 9865f93d49b..82721dbc469 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/zz_generated.deepcopy.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
index dc2dfc5220f..dedfc49ecdc 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
- controller-gen.kubebuilder.io/version: v0.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: cronjobs.batch.tutorial.kubebuilder.io
spec:
group: batch.tutorial.kubebuilder.io
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index f4348f6d2ac..a20488034eb 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -36,7 +36,7 @@ const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
ControllerRuntimeVersion = "v0.15.0"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
- ControllerToolsVersion = "v0.12.0"
+ ControllerToolsVersion = "v0.13.0"
// EnvtestK8SVersion is the k8s version used to do the scaffold
EnvtestK8SVersion = "1.27.1"
diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile
index c3ce045307b..fca59190d10 100644
--- a/testdata/project-v4-declarative-v1/Makefile
+++ b/testdata/project-v4-declarative-v1/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
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 334a92168ca..acb0efccf9a 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
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
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 730c7e63b59..624f4a05924 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: admirals.crew.testproject.org
spec:
group: crew.testproject.org
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 d007d812776..5abd6f46979 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: captains.crew.testproject.org
spec:
group: crew.testproject.org
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 85bae3b3f1c..48b67c33c9a 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: firstmates.crew.testproject.org
spec:
group: crew.testproject.org
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index c3ce045307b..fca59190d10 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
diff --git a/testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go
index fb38edc9099..83b88d335a7 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go
index 3ed74150b13..76023cf206f 100644
--- a/testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/fiz/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go
index b6428f993a6..66bf028e3ba 100644
--- a/testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/foo.policy/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go
index 3ed74150b13..76023cf206f 100644
--- a/testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/foo/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
index 9f7feb2fdc8..64ce14510af 100644
--- a/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
index de27a7b3faa..6777d3b537d 100644
--- a/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go
index 8f4b33cd7c4..f33c86fef82 100644
--- a/testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go
index aade9e605f2..b72247060db 100644
--- a/testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go
index ce318aa131c..1a54bea8d43 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go
index 3de5e2d9f31..904f7ad869a 100644
--- a/testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
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 e62224bc2c6..fb3c3619819 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: captains.crew.testproject.org
spec:
group: crew.testproject.org
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 4e924c5060a..f82ce349aa7 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: bars.fiz.testproject.org
spec:
group: fiz.testproject.org
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 35ed5603620..fccaf45ebcf 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: healthcheckpolicies.foo.policy.testproject.org
spec:
group: foo.policy.testproject.org
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 69e1e92ad64..2ac74780e21 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: bars.foo.testproject.org
spec:
group: foo.testproject.org
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 2f9a2a14846..893171cd25c 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: krakens.sea-creatures.testproject.org
spec:
group: sea-creatures.testproject.org
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 3990744ae3e..23354ee849b 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: leviathans.sea-creatures.testproject.org
spec:
group: sea-creatures.testproject.org
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 f1aa9ff3797..822b7ddcd07 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: cruisers.ship.testproject.org
spec:
group: ship.testproject.org
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 83679b08e35..1d16092fb0e 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: destroyers.ship.testproject.org
spec:
group: ship.testproject.org
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 b5840287f3c..a39aaa5e962 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: frigates.ship.testproject.org
spec:
group: ship.testproject.org
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 538282a8e15..1677f648fab 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: lakers.testproject.org
spec:
group: testproject.org
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index c3ce045307b..fca59190d10 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
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 a1b201c4512..fa209b7c2b2 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
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
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 a0e9a2c4d37..5f6cac569ec 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: busyboxes.example.com.testproject.org
spec:
group: example.com.testproject.org
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 d779aa1197b..8d09426d3a8 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: memcacheds.example.com.testproject.org
spec:
group: example.com.testproject.org
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index c3ce045307b..fca59190d10 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index c3ce045307b..fca59190d10 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -140,7 +140,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.12.0
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
diff --git a/testdata/project-v4/api/v1/zz_generated.deepcopy.go b/testdata/project-v4/api/v1/zz_generated.deepcopy.go
index 3b442b7416a..ef5a67255b2 100644
--- a/testdata/project-v4/api/v1/zz_generated.deepcopy.go
+++ b/testdata/project-v4/api/v1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
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 873dd5f91ea..c81bd149e91 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: admirales.crew.testproject.org
spec:
group: crew.testproject.org
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 e62224bc2c6..fb3c3619819 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: captains.crew.testproject.org
spec:
group: crew.testproject.org
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 846ef6d9b77..abb67bb2920 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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: firstmates.crew.testproject.org
spec:
group: crew.testproject.org
From d225ed299d9ecfa010214a24ea75868d02327d40 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Fri, 25 Aug 2023 14:25:12 +0100
Subject: [PATCH 0259/1245] :sparkles: improve logs from alpha command generate
---
pkg/rescaffold/migrate.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 770970a87f0..8f336f752f2 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -16,11 +16,11 @@ package rescaffold
import (
"errors"
"fmt"
- "log"
"os"
"os/exec"
"strings"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/config/store"
@@ -156,7 +156,7 @@ func migrateGrafanaPlugin(store store.Store, src, des string) error {
// If the grafana plugin is not found, we don't need to migrate
if err != nil {
if errors.As(err, &config.PluginKeyNotFoundError{}) {
- log.Printf("Grafana plugin is not found, skip the migration")
+ log.Info("Grafana plugin is not found, skip the migration")
return nil
}
return fmt.Errorf("failed to decode grafana plugin config %v", err)
From 85fb8fcd85814284389dd0afbc36d8582ac50178 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 26 Aug 2023 16:42:27 +0100
Subject: [PATCH 0260/1245] :doc: changing title for external plugins
---
docs/book/src/SUMMARY.md | 2 +-
docs/book/src/plugins/external-plugins.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index bf6aa49abf5..1e797201698 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -130,7 +130,7 @@
- [Creating your own plugins](./plugins/creating-plugins.md)
- [Testing your own plugins](./plugins/testing-plugins.md)
- [Plugins Versioning](./plugins/plugins-versioning.md)
- - [Extending Kubebuilder with external plugins](./plugins/external-plugins.md)
+ - [Creating external plugins](./plugins/external-plugins.md)
---
diff --git a/docs/book/src/plugins/external-plugins.md b/docs/book/src/plugins/external-plugins.md
index a6548a4f297..0539fa1c19a 100644
--- a/docs/book/src/plugins/external-plugins.md
+++ b/docs/book/src/plugins/external-plugins.md
@@ -1,4 +1,4 @@
-# Extending Kubebuilder with external plugins
+# Creating External Plugins
## Overview
From f8f8296149e695124fa356b5ab8c0c4a9ffadf20 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 26 Aug 2023 16:47:06 +0100
Subject: [PATCH 0261/1245] :book: fix title to make clear plugins which are
deprecated
---
docs/book/src/SUMMARY.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index bf6aa49abf5..ff536664681 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -117,8 +117,8 @@
- [Available Plugins](./plugins/available-plugins.md)
- [To scaffold a project](./plugins/to-scaffold-project.md)
- [go/v2 (Deprecated)](./plugins/go-v2-plugin.md)
- - [go/v3 (Default init scaffold)](./plugins/go-v3-plugin.md)
- - [go/v4](./plugins/go-v4-plugin.md)
+ - [go/v3 (Deprecated)](./plugins/go-v3-plugin.md)
+ - [go/v4 (Default init scaffold)](./plugins/go-v4-plugin.md)
- [To add optional features](./plugins/to-add-optional-features.md)
- [declarative/v1](./plugins/declarative-v1.md)
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md)
From 8824c0a4753b57205488a260e98d24ca5e0155a2 Mon Sep 17 00:00:00 2001
From: Sajiyah Salat <109643863+Sajiyah-Salat@users.noreply.github.com>
Date: Sat, 26 Aug 2023 23:07:21 +0530
Subject: [PATCH 0262/1245] =?UTF-8?q?=F0=9F=93=96=20Add=20good=20practices?=
=?UTF-8?q?=20doc=20(#3547)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Good Practice doc page created
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
---
docs/book/src/SUMMARY.md | 1 +
docs/book/src/reference/good-practices.md | 91 +++++++++++++++++++++++
2 files changed, 92 insertions(+)
create mode 100644 docs/book/src/reference/good-practices.md
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index bf6aa49abf5..49f7332aec7 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -80,6 +80,7 @@
- [Generating CRDs](./reference/generating-crd.md)
- [Using Finalizers](./reference/using-finalizers.md)
+ - [Good Practices](./reference/good-practices.md)
- [Raising Events](./reference/raising-events.md)
- [Watching Resources](./reference/watching-resources.md)
- [Resources Managed by the Operator](./reference/watching-resources/operator-managed.md)
diff --git a/docs/book/src/reference/good-practices.md b/docs/book/src/reference/good-practices.md
new file mode 100644
index 00000000000..f027dea4972
--- /dev/null
+++ b/docs/book/src/reference/good-practices.md
@@ -0,0 +1,91 @@
+# Good Practices
+
+## What is "Reconciliation" in Operators?
+
+When you create a project using Kubebuilder, see the scaffolded code generated under `cmd/main.go`. This code initializes a [Manager][controller-runtime-manager], and the project relies on the [controller-runtime][controller-runtime] framework. The Manager manages [Controllers][controllers], which offer a reconcile function that synchronizes resources until the desired state is achieved within the cluster.
+
+Reconciliation is an ongoing loop that executes necessary operations to maintain the desired state, adhering to Kubernetes principles, such as the [control loop][k8s-control-loop]. For further information, check out the [Operator patterns][k8s-operator-pattern] documentation from Kubernetes to better understand those concepts.
+
+## Why should reconciliations be idempotent?
+
+When developing operators, the controller’s reconciliation loop needs to be idempotent. By following the [Operator pattern][operator-pattern] we create [controllers][controllers] that provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. Developing idempotent solutions will allow the reconciler to correctly respond to generic or unexpected events, easily deal with application startup or upgrade. More explanation on this is available [here][controller-runtime-topic].
+
+Writing reconciliation logic according to specific events, breaks the recommendation of operator pattern and goes against the design principles of [controller-runtime][controller-runtime]. This may lead to unforeseen consequences, such as resources becoming stuck and requiring manual intervention.
+
+## Understanding Kubernetes APIs and following API conventions
+
+Building your operator commonly involves extending the Kubernetes API itself. It is helpful to understand precisely how Custom Resource Definitions (CRDs) interact with the Kubernetes API. Also, the [Kubebuilder documentation][docs] on Groups and Versions and Kinds may be helpful to understand these concepts better as they relate to operators.
+
+Additionally, we recommend checking the documentation on [Operator patterns][operator-pattern] from Kubernetes to better understand the purpose of the standard solutions built with KubeBuilder.
+
+## Why you should adhere to the k8s API conventions and standards
+
+Embracing the [Kubernetes API conventions and standards][k8s-api-convetions] is crucial for maximizing the potential of your applications and deployments. By adhering to these established practices, you can benefit in several ways.
+
+Firstly, adherence ensures seamless interoperability within the Kubernetes ecosystem. Following conventions allows your applications to work harmoniously with other components, reducing compatibility issues and promoting a consistent user experience.
+
+Secondly, sticking to API standards enhances the maintainability and troubleshooting of your applications. Adopting familiar patterns and structures makes debugging and supporting your deployments easier, leading to more efficient operations and quicker issue resolution.
+
+Furthermore, leveraging the Kubernetes API conventions empowers you to harness the platform's full capabilities. By working within the defined framework, you can leverage the rich set of features and resources offered by Kubernetes, enabling scalability, performance optimization, and resilience.
+
+Lastly, embracing these standards future-proofs your native solutions. By aligning with the evolving Kubernetes ecosystem, you ensure compatibility with future updates, new features, and enhancements introduced by the vibrant Kubernetes community.
+
+In summary, by adhering to the Kubernetes API conventions and standards, you unlock the potential for seamless integration, simplified maintenance, optimal performance, and future-readiness, all contributing to the success of your applications and deployments.
+
+## Why should one avoid a system design where a single controller is responsible for managing multiple CRDs (Custom Resource Definitions)(for example, an _'install_all_controller.go'_)?
+
+Avoid a design solution where the same controller reconciles more than one Kind. Having many Kinds (such as CRDs), that are all managed by the same controller, usually goes against the design proposed by controller-runtime. Furthermore, this might hurt concepts such as encapsulation, the Single Responsibility Principle, and Cohesion. Damaging these concepts may cause unexpected side effects and increase the difficulty of extending, reusing, or maintaining the operator.
+Having one controller manage many Custom Resources (CRs) in an Operator can lead to several issues:
+
+- **Complexity**: A single controller managing multiple CRs can increase the complexity of the code, making it harder to understand, maintain, and debug.
+- **Scalability**: Each controller typically manages a single kind of CR for scalability. If a single controller handles multiple CRs, it could become a bottleneck, reducing the overall efficiency and responsiveness of your system.
+- **Single Responsibility Principle**: Following this principle from software engineering, each controller should ideally have only one job. This approach simplifies development and debugging, and makes the system more robust.
+- **Error Isolation**: If one controller manages multiple CRs and an error occurs, it could potentially impact all the CRs it manages. Having a single controller per CR ensures that an issue with one controller or CR does not directly affect others.
+- **Concurrency and Synchronization**: A single controller managing multiple CRs could lead to race conditions and require complex synchronization, especially if the CRs have interdependencies.
+
+In conclusion, while it might seem efficient to have a single controller manage multiple CRs, it often leads to higher complexity, lower scalability, and potential stability issues. It's generally better to adhere to the single responsibility principle, where each CR is managed by its own controller.
+
+## Why is it recommended to avoid a scenario where multiple controllers are updating the same Custom Resource (CR)?
+
+Managing a single Custom Resource (CR) with multiple controllers can lead to several challenges:
+- **Race conditions**: When multiple controllers attempt to reconcile the same CR concurrently, race conditions can emerge. These conditions can produce inconsistent or unpredictable outcomes. For example, if we try to update the CR to add a status condition, we may encounter a range of errors such as “the object has been modified; please apply your changes to the latest version and try again”, triggering a repetitive reconciliation process.
+- **Concurrency issues**: When controllers have different interpretations of the CR’s state, they may constantly overwrite each other’s changes. This conflict can create a loop, with the controllers ceaselessly disputing the CR’s state.
+- **Maintenance and support difficulties**: Coordinating the logic for multiple controllers operating on the same CR can increase system complexity, making it more challenging to understand or troubleshoot. Typically, a system’s behavior is easier to comprehend when each CR is managed by a single controller.
+- **Status tracking complications**: We may struggle to work adequately with status conditions to accurately track the state of each component managed by the Installer.
+- **Performance issues**: If multiple controllers are watching and reconciling the Installer Kind, redundant operations may occur, leading to unnecessary resource usage.
+These challenges underline the importance of assigning each controller the single responsibility of managing its own CR. This will streamline our processes and ensure a more reliable system.
+
+## Why You Should Adopt Status Conditions
+
+We recommend you manage your solutions using Status Conditionals following the [K8s Api conventions][k8s-aoi-convetions] because:
+
+- **Standardization**: Conditions provide a standardized way to represent the state of an Operator's custom resources, making it easier for users and tools to understand and interpret the resource's status.
+- **Readability**: Conditions can clearly express complex states by using a combination of multiple conditions, making it easier for users to understand the current state and progress of the resource.
+- **Extensibility**: As new features or states are added to your Operator, conditions can be easily extended to represent these new states without requiring significant changes to the existing API or structure.
+- **Observability**: Status conditions can be monitored and tracked by cluster administrators and external monitoring tools, enabling better visibility into the state of the custom resources managed by the Operator.
+- **Compatibility**: By adopting the common pattern of using conditions in Kubernetes APIs, Operator authors ensure their custom resources align with the broader ecosystem, which helps users to have a consistent experience when interacting with multiple Operators and resources in their clusters.
+
+
+ Example of Usage
+
+Check out the [Deploy Image Plugin][deploy-image-plugin]. This plugin allows users to scaffold API/Controllers to deploy and manage an Operand (image) on the cluster following the guidelines and best practices. It abstracts the
+complexities of achieving this goal while allowing users to customize the generated code.
+
+Therefore, you can check an example of Status Conditional usage by looking at its API(s) scaffolded and code implemented under the Reconciliation into its Controllers.
+
+
+
+[docs]: ./cronjob-tutorial/gvks.html
+
+[operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
+
+[controllers]: https://kubernetes.io/docs/concepts/architecture/controller/
+
+[controller-runtime-topic]: https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md#q-how-do-i-have-different-logic-in-my-reconciler-for-different-types-of-events-eg-create-update-delete
+
+[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
+
+[deploy-image]: ./plugins/deploy-image-plugin-v1-alpha.md
+
+[controller-runtime-manager]: https://github.com/kubernetes-sigs/controller-runtime/blob/304027bcbe4b3f6d582180aec5759eb4db3f17fd/pkg/manager/manager.go#L53
+
From f801a25ca45831a269c160e936fd4a9704d87d7b Mon Sep 17 00:00:00 2001
From: Eileen
Date: Sun, 27 Aug 2023 17:12:32 -0400
Subject: [PATCH 0263/1245] docs: add notes distinguish from external plugin
---
docs/book/src/plugins/creating-plugins.md | 22 +++++++++++++++++++
.../v1alpha1/zz_generated.deepcopy.go | 1 -
...example.com.testproject.org_busyboxes.yaml | 2 +-
...xample.com.testproject.org_memcacheds.yaml | 2 +-
4 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/docs/book/src/plugins/creating-plugins.md b/docs/book/src/plugins/creating-plugins.md
index b9fbcb29367..298dfb141aa 100644
--- a/docs/book/src/plugins/creating-plugins.md
+++ b/docs/book/src/plugins/creating-plugins.md
@@ -2,12 +2,34 @@
[extending-cli]: extending-cli.md
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
+[creating-external-plugins]: external-plugins.md
[operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator
[sdk-ansible]: https://sdk.operatorframework.io/docs/building-operators/ansible/
[sdk-cli-pkg]: https://pkg.go.dev/github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/cli
[sdk-helm]: https://sdk.operatorframework.io/docs/building-operators/helm/
[sdk]: https://github.com/operator-framework/operator-sdk
+
+
+Note
+
+Extending Kubebuilder can be accomplished in two primary ways:
+
+`By re-using the existing plugins`: In this approach, you use Kubebuilder as a library.
+
+This enables you to import existing Kubebuilder plugins and extend them, leveraging their features to build upon.
+
+It is particularly useful if you want to add functionalities that are closely tied with the existing Kubebuilder features.
+
+
+`By Creating an External Plugin`: This method allows you to create an independent, standalone plugin as a binary.
+
+The plugin can be written in any language and should implement an execution pattern that Kubebuilder knows how to interact with.
+
+You can see [Creating external plugins][creating-external-plugins] for more info.
+
+
+
## Overview
You can extend the Kubebuilder API to create your own plugins. If [extending the CLI][extending-cli], your plugin will be implemented in your project and registered to the CLI as has been done by the [SDK][sdk] project. See its [CLI code][sdk-cli-pkg] as an example.
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
index a1b201c4512..fa209b7c2b2 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
@@ -1,5 +1,4 @@
//go:build !ignore_autogenerated
-// +build !ignore_autogenerated
/*
Copyright 2023 The Kubernetes authors.
diff --git a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
index a0e9a2c4d37..5f6cac569ec 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
+++ b/testdata/project-v4-multigroup/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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: busyboxes.example.com.testproject.org
spec:
group: example.com.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
index d779aa1197b..8d09426d3a8 100644
--- a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
+++ b/testdata/project-v4-multigroup/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.12.0
+ controller-gen.kubebuilder.io/version: v0.13.0
name: memcacheds.example.com.testproject.org
spec:
group: example.com.testproject.org
From 8f1b1f5f69a1ee512abfeb4315efe7ba471e3bb7 Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Sat, 26 Aug 2023 22:51:51 -0500
Subject: [PATCH 0264/1245] feat: support deploy-image plugin
---
.../golang/deploy-image/v1alpha1/api.go | 4 +-
.../golang/deploy-image/v1alpha1/plugin.go | 6 +-
pkg/rescaffold/migrate.go | 67 ++++++++++++++++++-
test/e2e/alphagenerate/generate_test.go | 32 ++++++++-
4 files changed, 102 insertions(+), 7 deletions(-)
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/api.go b/pkg/plugins/golang/deploy-image/v1alpha1/api.go
index 5e256343e5c..8245d7e7906 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/api.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/api.go
@@ -219,7 +219,7 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
}
// Track the resources following a declarative approach
- cfg := pluginConfig{}
+ cfg := PluginConfig{}
if err := p.config.DecodePluginConfig(pluginKey, &cfg); errors.As(err, &config.UnsupportedFieldError{}) {
// Config doesn't support per-plugin configuration, so we can't track them
} else {
@@ -233,7 +233,7 @@ func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
ContainerPort: p.imageContainerPort,
RunAsUser: p.runAsUser,
}
- cfg.Resources = append(cfg.Resources, resourceData{
+ cfg.Resources = append(cfg.Resources, ResourceData{
Group: p.resource.GVK.Group,
Domain: p.resource.GVK.Domain,
Version: p.resource.GVK.Version,
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/plugin.go b/pkg/plugins/golang/deploy-image/v1alpha1/plugin.go
index aadf4398712..8356de8335c 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/plugin.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/plugin.go
@@ -51,11 +51,11 @@ func (Plugin) SupportedProjectVersions() []config.Version { return supportedProj
// GetCreateAPISubcommand will return the subcommand which is responsible for scaffolding apis
func (p Plugin) GetCreateAPISubcommand() plugin.CreateAPISubcommand { return &p.createAPISubcommand }
-type pluginConfig struct {
- Resources []resourceData `json:"resources,omitempty"`
+type PluginConfig struct {
+ Resources []ResourceData `json:"resources,omitempty"`
}
-type resourceData struct {
+type ResourceData struct {
Group string `json:"group,omitempty"`
Domain string `json:"domain,omitempty"`
Version string `json:"version"`
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 8f336f752f2..5765c96691f 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -28,6 +28,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1"
)
type MigrateOptions struct {
@@ -66,7 +67,10 @@ func (opts *MigrateOptions) Rescaffold() error {
}
// plugin specific migration
if err := migrateGrafanaPlugin(config, opts.InputDir, opts.OutputDir); err != nil {
- log.Fatalf("Failed to run plugin migration %v", err)
+ log.Fatalf("Failed to run grafana plugin migration %v", err)
+ }
+ if err := migrateDeployImagePlugin(config); err != nil {
+ log.Fatalf("Failed to run deploy-image plugin migration %v", err)
}
return nil
}
@@ -172,6 +176,35 @@ func migrateGrafanaPlugin(store store.Store, src, des string) error {
return kubebuilderGrafanaEdit()
}
+func migrateDeployImagePlugin(store store.Store) error {
+ deployImagePlugin := v1alpha1.PluginConfig{}
+ err := store.Config().DecodePluginConfig("deploy-image.go.kubebuilder.io/v1-alpha", &deployImagePlugin)
+ // If the deploy-image plugin is not found, we don't need to migrate
+ if err != nil {
+ if errors.As(err, &config.PluginKeyNotFoundError{}) {
+ log.Printf("deploy-image plugin is not found, skip the migration")
+ return nil
+ }
+ return fmt.Errorf("failed to decode deploy-image plugin config %v", err)
+ }
+
+ for _, r := range deployImagePlugin.Resources {
+ if err = createAPIWithDeployImage(r); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+func createAPIWithDeployImage(resource v1alpha1.ResourceData) error {
+ var args []string
+ args = append(args, "create")
+ args = append(args, "api")
+ args = append(args, getGVKFlagsFromDeployImage(resource)...)
+ args = append(args, getDeployImageOptions(resource)...)
+ return util.RunCmd("kubebuilder create api", "kubebuilder", args...)
+}
+
func getInitArgs(store store.Store) []string {
var args []string
plugins := store.Config().GetPluginChain()
@@ -203,6 +236,38 @@ func getGVKFlags(resource resource.Resource) []string {
return args
}
+func getGVKFlagsFromDeployImage(resource v1alpha1.ResourceData) []string {
+ var args []string
+ if len(resource.Group) > 0 {
+ args = append(args, "--group", resource.Group)
+ }
+ if len(resource.Version) > 0 {
+ args = append(args, "--version", resource.Version)
+ }
+ if len(resource.Kind) > 0 {
+ args = append(args, "--kind", resource.Kind)
+ }
+ return args
+}
+
+func getDeployImageOptions(resource v1alpha1.ResourceData) []string {
+ var args []string
+ if len(resource.Options.Image) > 0 {
+ args = append(args, fmt.Sprintf("--image=%s", resource.Options.Image))
+ }
+ if len(resource.Options.ContainerCommand) > 0 {
+ args = append(args, fmt.Sprintf("--image-container-command=%s", resource.Options.ContainerCommand))
+ }
+ if len(resource.Options.ContainerPort) > 0 {
+ args = append(args, fmt.Sprintf("--image-container-port=%s", resource.Options.ContainerPort))
+ }
+ if len(resource.Options.RunAsUser) > 0 {
+ args = append(args, fmt.Sprintf("--run-as-user=%s", resource.Options.RunAsUser))
+ }
+ args = append(args, fmt.Sprintf("--plugins=\"%s\"", "deploy-image/v1-alpha"))
+ return args
+}
+
func createAPI(resource resource.Resource) error {
var args []string
args = append(args, "create")
diff --git a/test/e2e/alphagenerate/generate_test.go b/test/e2e/alphagenerate/generate_test.go
index 9a9a202722e..5745cdad17b 100644
--- a/test/e2e/alphagenerate/generate_test.go
+++ b/test/e2e/alphagenerate/generate_test.go
@@ -123,6 +123,19 @@ func ReGenerateProject(kbc *utils.TestContext) {
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("create APIs with deploy-image plugin")
+ err = kbc.CreateAPI(
+ "--group", "crew",
+ "--version", "v1",
+ "--kind", "Memcached",
+ "--image=memcached:1.6.15-alpine",
+ "--image-container-command=memcached,-m=64,modern,-v",
+ "--image-container-port=11211",
+ "--run-as-user=1001",
+ "--plugins=\"deploy-image/v1-alpha\"",
+ )
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
By("Enable grafana plugin to an existing project")
err = kbc.Edit(
"--plugins", "grafana.kubebuilder.io/v1-alpha",
@@ -197,7 +210,24 @@ func ReGenerateProject(kbc *utils.TestContext) {
ExpectWithOffset(1, err).NotTo(HaveOccurred())
ExpectWithOffset(1, fileContainsExpr).To(BeTrue())
- By("checking if the project file was generated with the expected controller")
+ By("checking if the project file was generated with the expected deploy-image plugin fields")
+ var deployImagePlugin = "deploy-image.go.kubebuilder.io/v1-alpha"
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), deployImagePlugin)
+ Expect(err).NotTo(HaveOccurred())
+ Expect(fileContainsExpr).To(BeTrue())
+ var deployImagePluginFields = `kind: Memcached
+ options:
+ containerCommand: memcached,-m=64,modern,-v
+ containerPort: "11211"
+ image: memcached:1.6.15-alpine
+ runAsUser: "1001"`
+ fileContainsExpr, err = pluginutil.HasFileContentWith(
+ filepath.Join(kbc.Dir, "testdir2", "PROJECT"), deployImagePluginFields)
+ Expect(err).NotTo(HaveOccurred())
+ Expect(fileContainsExpr).To(BeTrue())
+
+ By("checking if the project file was generated with the expected grafana plugin fields")
var grafanaPlugin = "grafana.kubebuilder.io/v1-alpha"
fileContainsExpr, err = pluginutil.HasFileContentWith(
filepath.Join(kbc.Dir, "testdir2", "PROJECT"), grafanaPlugin)
From bca82df33f1571f78b25cc916c5a3e6ec4eea29a Mon Sep 17 00:00:00 2001
From: yyy1000 <992364620@qq.com>
Date: Mon, 28 Aug 2023 12:48:58 -0500
Subject: [PATCH 0265/1245] doc: when and how
---
docs/book/src/reference/rescaffold.md | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 docs/book/src/reference/rescaffold.md
diff --git a/docs/book/src/reference/rescaffold.md b/docs/book/src/reference/rescaffold.md
new file mode 100644
index 00000000000..6a9a7ab4418
--- /dev/null
+++ b/docs/book/src/reference/rescaffold.md
@@ -0,0 +1,21 @@
+# Rescaffold Command
+
+## Overview
+
+The Kubebuilder CLI provides a new experimental helper `alpha generate` command to re-scaffold an existing project from the scratch using the current version of KubeBuilder binary available based on PROJECT config file.
+
+## When to use it ?
+
+This command is useful when you want to upgrade an existing project to the latest version of the Kubebuilder project layout. It makes it easier for the users to migrate their operator projects to the new scaffolding.
+
+## How to use it ?
+
+Currently, it supports two optional params, `input-dir` and `output-dir`.
+
+`input-dir` is the path to the existing project that you want to re-scaffold. Default is the current working directory.
+
+`output-dir` is the path to the directory where you want to generate the new project. Default is a subdirectory in the current working directory.
+
+```sh
+kubebuilder alpha generate --input-dir=/path/to/existing/project --output-dir=/path/to/new/project
+```
\ No newline at end of file
From a99441f035a7d3c7c75899f23a7fb195babbd3d9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 28 Aug 2023 23:16:35 +0000
Subject: [PATCH 0266/1245] build(deps): bump github.com/onsi/ginkgo/v2 from
2.11.0 to 2.12.0
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.11.0...v2.12.0)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 91c755c5f93..a781fd2f504 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.9.5
diff --git a/go.sum b/go.sum
index 6b1f71c7eb8..44762490106 100644
--- a/go.sum
+++ b/go.sum
@@ -142,8 +142,8 @@ 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.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
-github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
+github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
+github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
From 72996dddc6dca65c926ae4888140e97cd7749e64 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 29 Aug 2023 00:00:37 +0000
Subject: [PATCH 0267/1245] :seedling: bump joelanford/go-apidiff from 0.6.1 to
0.7.0
Bumps [joelanford/go-apidiff](https://github.com/joelanford/go-apidiff) from 0.6.1 to 0.7.0.
- [Release notes](https://github.com/joelanford/go-apidiff/releases)
- [Commits](https://github.com/joelanford/go-apidiff/compare/v0.6.1...v0.7.0)
---
updated-dependencies:
- dependency-name: joelanford/go-apidiff
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.github/workflows/apidiff.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml
index 88950b357ca..29f72a046dc 100644
--- a/.github/workflows/apidiff.yml
+++ b/.github/workflows/apidiff.yml
@@ -21,7 +21,7 @@ jobs:
with:
go-version: "~1.20"
- name: Execute go-apidiff
- uses: joelanford/go-apidiff@v0.6.1
+ uses: joelanford/go-apidiff@v0.7.0
with:
compare-imports: true
print-compatible: true
From f4ffb9805dd9cfea2854e2d3867cee25c2e42c03 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Mon, 8 May 2023 09:32:00 +0100
Subject: [PATCH 0268/1245] :warning: adds deprecation of declarative plugin
---
docs/book/src/plugins/declarative-v1.md | 16 +-
.../src/plugins/to-add-optional-features.md | 10 +-
pkg/plugins/golang/declarative/v1/plugin.go | 19 +-
test/testdata/generate.sh | 7 +-
test/testdata/test.sh | 1 -
.../project-v4-declarative-v1/.dockerignore | 3 -
testdata/project-v4-declarative-v1/.gitignore | 26 --
testdata/project-v4-declarative-v1/Dockerfile | 40 ---
testdata/project-v4-declarative-v1/Makefile | 163 ----------
testdata/project-v4-declarative-v1/PROJECT | 53 ---
testdata/project-v4-declarative-v1/README.md | 94 ------
.../api/v1/admiral_types.go | 90 ------
.../api/v1/captain_types.go | 89 ------
.../api/v1/firstmate_types.go | 89 ------
.../api/v1/groupversion_info.go | 36 ---
.../api/v1/zz_generated.deepcopy.go | 301 ------------------
.../packages/admiral/0.0.1/manifest.yaml | 1 -
.../packages/captain/0.0.1/manifest.yaml | 1 -
.../packages/firstmate/0.0.1/manifest.yaml | 1 -
.../project-v4-declarative-v1/channels/stable | 3 -
.../project-v4-declarative-v1/cmd/main.go | 129 --------
.../bases/crew.testproject.org_admirals.yaml | 69 ----
.../bases/crew.testproject.org_captains.yaml | 69 ----
.../crew.testproject.org_firstmates.yaml | 69 ----
.../config/crd/kustomization.yaml | 27 --
.../config/crd/kustomizeconfig.yaml | 19 --
.../crd/patches/cainjection_in_admirals.yaml | 7 -
.../crd/patches/cainjection_in_captains.yaml | 7 -
.../patches/cainjection_in_firstmates.yaml | 7 -
.../crd/patches/webhook_in_admirals.yaml | 16 -
.../crd/patches/webhook_in_captains.yaml | 16 -
.../crd/patches/webhook_in_firstmates.yaml | 16 -
.../config/default/kustomization.yaml | 144 ---------
.../default/manager_auth_proxy_patch.yaml | 39 ---
.../config/default/manager_config_patch.yaml | 10 -
.../config/manager/kustomization.yaml | 2 -
.../config/manager/manager.yaml | 102 ------
.../config/prometheus/kustomization.yaml | 2 -
.../config/prometheus/monitor.yaml | 26 --
.../config/rbac/admiral_editor_role.yaml | 31 --
.../config/rbac/admiral_viewer_role.yaml | 27 --
.../rbac/auth_proxy_client_clusterrole.yaml | 16 -
.../config/rbac/auth_proxy_role.yaml | 24 --
.../config/rbac/auth_proxy_role_binding.yaml | 19 --
.../config/rbac/auth_proxy_service.yaml | 21 --
.../config/rbac/captain_editor_role.yaml | 31 --
.../config/rbac/captain_viewer_role.yaml | 27 --
.../config/rbac/firstmate_editor_role.yaml | 31 --
.../config/rbac/firstmate_viewer_role.yaml | 27 --
.../config/rbac/kustomization.yaml | 18 --
.../config/rbac/leader_election_role.yaml | 44 ---
.../rbac/leader_election_role_binding.yaml | 19 --
.../config/rbac/role.yaml | 66 ----
.../config/rbac/role_binding.yaml | 19 --
.../config/rbac/service_account.yaml | 12 -
.../config/samples/crew_v1_admiral.yaml | 12 -
.../config/samples/crew_v1_captain.yaml | 12 -
.../config/samples/crew_v1_firstmate.yaml | 12 -
.../config/samples/kustomization.yaml | 6 -
testdata/project-v4-declarative-v1/go.mod | 116 -------
.../hack/boilerplate.go.txt | 15 -
.../internal/controller/admiral_controller.go | 89 ------
.../internal/controller/captain_controller.go | 89 ------
.../controller/firstmate_controller.go | 89 ------
.../internal/controller/suite_test.go | 90 ------
65 files changed, 39 insertions(+), 2742 deletions(-)
delete mode 100644 testdata/project-v4-declarative-v1/.dockerignore
delete mode 100644 testdata/project-v4-declarative-v1/.gitignore
delete mode 100644 testdata/project-v4-declarative-v1/Dockerfile
delete mode 100644 testdata/project-v4-declarative-v1/Makefile
delete mode 100644 testdata/project-v4-declarative-v1/PROJECT
delete mode 100644 testdata/project-v4-declarative-v1/README.md
delete mode 100644 testdata/project-v4-declarative-v1/api/v1/admiral_types.go
delete mode 100644 testdata/project-v4-declarative-v1/api/v1/captain_types.go
delete mode 100644 testdata/project-v4-declarative-v1/api/v1/firstmate_types.go
delete mode 100644 testdata/project-v4-declarative-v1/api/v1/groupversion_info.go
delete mode 100644 testdata/project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go
delete mode 100644 testdata/project-v4-declarative-v1/channels/packages/admiral/0.0.1/manifest.yaml
delete mode 100644 testdata/project-v4-declarative-v1/channels/packages/captain/0.0.1/manifest.yaml
delete mode 100644 testdata/project-v4-declarative-v1/channels/packages/firstmate/0.0.1/manifest.yaml
delete mode 100644 testdata/project-v4-declarative-v1/channels/stable
delete mode 100644 testdata/project-v4-declarative-v1/cmd/main.go
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/kustomization.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/kustomizeconfig.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_admirals.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_captains.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_firstmates.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_admirals.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_captains.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_firstmates.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/default/kustomization.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/default/manager_auth_proxy_patch.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/default/manager_config_patch.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/manager/kustomization.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/manager/manager.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/prometheus/kustomization.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/prometheus/monitor.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/admiral_editor_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/admiral_viewer_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/auth_proxy_client_clusterrole.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role_binding.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/auth_proxy_service.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/captain_editor_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/captain_viewer_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/firstmate_editor_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/firstmate_viewer_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/kustomization.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/leader_election_role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/leader_election_role_binding.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/role.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/role_binding.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/rbac/service_account.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/samples/crew_v1_admiral.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/samples/crew_v1_captain.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/samples/crew_v1_firstmate.yaml
delete mode 100644 testdata/project-v4-declarative-v1/config/samples/kustomization.yaml
delete mode 100644 testdata/project-v4-declarative-v1/go.mod
delete mode 100644 testdata/project-v4-declarative-v1/hack/boilerplate.go.txt
delete mode 100644 testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
delete mode 100644 testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
delete mode 100644 testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
delete mode 100644 testdata/project-v4-declarative-v1/internal/controller/suite_test.go
diff --git a/docs/book/src/plugins/declarative-v1.md b/docs/book/src/plugins/declarative-v1.md
index c3513618dae..ac3eb13b691 100644
--- a/docs/book/src/plugins/declarative-v1.md
+++ b/docs/book/src/plugins/declarative-v1.md
@@ -1,4 +1,18 @@
-# Declarative Plugin
+# [Deprecated] Declarative Plugin
+
+
+Notice of Deprecation
+
+The Declarative plugin is an implementation derived from the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project.
+As the project maintainers possess the most comprehensive knowledge about its changes and Kubebuilder allows
+the creation of custom plugins using its library, it has been decided that this plugin will be better
+maintained within the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project itself,
+which falls under its domain of responsibility. This decision aims to improve the maintainability of both the
+plugin and Kubebuilder, ultimately providing an enhanced user experience. To follow up on this work, please refer
+to [Issue #293](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/issues/293) in the
+kubebuilder-declarative-pattern repository.
+
+
The declarative plugin allows you to create [controllers][controller-runtime] using the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern].
By using the declarative plugin, you can make the required changes on top of what is scaffolded by default when you create a Go project with Kubebuilder and the Golang plugins (i.e. go/v2, go/v3).
diff --git a/docs/book/src/plugins/to-add-optional-features.md b/docs/book/src/plugins/to-add-optional-features.md
index 085b11fda94..f62da55d2a2 100644
--- a/docs/book/src/plugins/to-add-optional-features.md
+++ b/docs/book/src/plugins/to-add-optional-features.md
@@ -2,8 +2,8 @@
The following plugins are useful to generate code and take advantage of optional features
-| Plugin | Key | Description |
-| ---------------------------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [declarative.go.kubebuilder.io/v1](declarative-v1.md) | `declarative/v1` | Optional plugin used to scaffold APIs/controllers using the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project. |
-| [grafana.kubebuilder.io/v1-alpha](grafana-v1-alpha.md) | `grafana/v1-alpha` | Optional helper plugin which can be used to scaffold Grafana Manifests Dashboards for the default metrics which are exported by controller-runtime. |
-| [deploy-image.go.kubebuilder.io/v1-alpha](deploy-image-plugin-v1-alpha) | `deploy-image/v1-alpha` | Optional helper plugin which can be used to scaffold APIs and controller with code implementation to Deploy and Manage an Operand(image). |
+| Plugin | Key | Description |
+|-------------------------------------------------------------------------| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [declarative.go.kubebuilder.io/v1 - (Deprecated) ](declarative-v1.md) | `declarative/v1` | Optional plugin used to scaffold APIs/controllers using the [kubebuilder-declarative-pattern][kubebuilder-declarative-pattern] project. |
+| [grafana.kubebuilder.io/v1-alpha](grafana-v1-alpha.md) | `grafana/v1-alpha` | Optional helper plugin which can be used to scaffold Grafana Manifests Dashboards for the default metrics which are exported by controller-runtime. |
+| [deploy-image.go.kubebuilder.io/v1-alpha](deploy-image-plugin-v1-alpha) | `deploy-image/v1-alpha` | Optional helper plugin which can be used to scaffold APIs and controller with code implementation to Deploy and Manage an Operand(image). |
diff --git a/pkg/plugins/golang/declarative/v1/plugin.go b/pkg/plugins/golang/declarative/v1/plugin.go
index 76cf07c7c31..bb553a3aaaa 100644
--- a/pkg/plugins/golang/declarative/v1/plugin.go
+++ b/pkg/plugins/golang/declarative/v1/plugin.go
@@ -14,6 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Deprecated: The declarative plugin has been deprecated.
+// The Declarative plugin is an implementation derived from the kubebuilder-declarative-pattern project.
+// As the project maintainers possess the most comprehensive knowledge about its changes and Kubebuilder
+// allows the creation of custom plugins using its library, it has been decided that this plugin will be
+// better maintained within the kubebuilder-declarative-pattern project
+// itself, which falls under its domain of responsibility. This decision aims to improve the maintainability
+// of both the plugin and Kubebuilder, ultimately providing an enhanced user experience.
+// To follow up on this work, please refer to the Issue #293:
+// https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/issues/293.
package v1
import (
@@ -61,5 +70,13 @@ type pluginConfig struct {
}
func (p Plugin) DeprecationWarning() string {
- return ""
+ return "The declarative plugin has been deprecated. \n" +
+ "The Declarative plugin is an implementation derived from the kubebuilder-declarative-pattern project. " +
+ "As the project maintainers possess the most comprehensive knowledge about its changes and Kubebuilder " +
+ "allows the creation of custom plugins using its library, it has been decided that this plugin will be " +
+ "better maintained within the kubebuilder-declarative-pattern project " +
+ "itself, which falls under its domain of responsibility. This decision aims to improve the maintainability " +
+ "of both the plugin and Kubebuilder, ultimately providing an enhanced user experience." +
+ "To follow up on this work, please refer to the Issue #293: " +
+ "https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/issues/293."
}
diff --git a/test/testdata/generate.sh b/test/testdata/generate.sh
index 1a4ba360003..a6f7a8f2d8c 100755
--- a/test/testdata/generate.sh
+++ b/test/testdata/generate.sh
@@ -112,11 +112,7 @@ function scaffold_test_project {
header_text 'Editing project with Grafana plugin ...'
$kb edit --plugins=grafana.kubebuilder.io/v1-alpha
- elif [[ $project =~ declarative ]]; then
- header_text 'Creating APIs ...'
- $kb create api --group crew --version v1 --kind Captain --controller=true --resource=true --make=false
- $kb create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false
- $kb create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false
+
elif [[ $project =~ deploy-image ]]; then
header_text 'Creating Memcached API with deploy-image plugin ...'
$kb create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,-o,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha" --make=false
@@ -145,6 +141,5 @@ scaffold_test_project project-v3 --plugins="go/v3"
# [Currently, default CLI plugin] - [Next version, alpha] Project version v4-alpha
scaffold_test_project project-v4 --plugins="go/v4"
scaffold_test_project project-v4-multigroup --plugins="go/v4"
-scaffold_test_project project-v4-declarative-v1 --plugins="go/v4,declarative"
scaffold_test_project project-v4-with-deploy-image --plugins="go/v4"
scaffold_test_project project-v4-with-grafana --plugins="go/v4"
diff --git a/test/testdata/test.sh b/test/testdata/test.sh
index e4a534693f5..162a66419a1 100755
--- a/test/testdata/test.sh
+++ b/test/testdata/test.sh
@@ -33,6 +33,5 @@ build_kb
# Project version v4-alpha
test_project project-v4
test_project project-v4-multigroup
-test_project project-v4-declarative-v1
test_project project-v4-with-deploy-image
test_project project-v4-with-grafana
diff --git a/testdata/project-v4-declarative-v1/.dockerignore b/testdata/project-v4-declarative-v1/.dockerignore
deleted file mode 100644
index a3aab7af70c..00000000000
--- a/testdata/project-v4-declarative-v1/.dockerignore
+++ /dev/null
@@ -1,3 +0,0 @@
-# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
-# Ignore build and test binaries.
-bin/
diff --git a/testdata/project-v4-declarative-v1/.gitignore b/testdata/project-v4-declarative-v1/.gitignore
deleted file mode 100644
index 7f02333db7a..00000000000
--- a/testdata/project-v4-declarative-v1/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-bin/*
-Dockerfile.cross
-
-# Test binary, build with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
-# Kubernetes Generated files - skip generated files, except for vendored files
-
-!vendor/**/zz_generated.*
-
-# editor and IDE paraphernalia
-.idea
-.vscode
-*.swp
-*.swo
-*~
diff --git a/testdata/project-v4-declarative-v1/Dockerfile b/testdata/project-v4-declarative-v1/Dockerfile
deleted file mode 100644
index fee7871fdc6..00000000000
--- a/testdata/project-v4-declarative-v1/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Build the manager binary
-FROM golang:1.20 as builder
-ARG TARGETOS
-ARG TARGETARCH
-
-WORKDIR /workspace
-# Copy the Go Modules manifests
-COPY go.mod go.mod
-COPY go.sum go.sum
-# cache deps before building and copying source so that we don't need to re-download as much
-# and so that source changes don't invalidate our downloaded layer
-RUN go mod download
-
-# Copy the go source
-COPY cmd/main.go cmd/main.go
-COPY api/ api/
-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/
-RUN chmod -R a+rx /channels/
-
-# 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 cmd/main.go
-
-# Use distroless as minimal base image to package the manager binary
-# Refer to https://github.com/GoogleContainerTools/distroless for more details
-FROM gcr.io/distroless/static:nonroot
-WORKDIR /
-COPY --from=builder /workspace/manager .
-# copy channels
-COPY --from=builder /channels /channels
-
-USER 65532:65532
-
-ENTRYPOINT ["/manager"]
diff --git a/testdata/project-v4-declarative-v1/Makefile b/testdata/project-v4-declarative-v1/Makefile
deleted file mode 100644
index fca59190d10..00000000000
--- a/testdata/project-v4-declarative-v1/Makefile
+++ /dev/null
@@ -1,163 +0,0 @@
-
-# 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.27.1
-
-# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
-ifeq (,$(shell go env GOBIN))
-GOBIN=$(shell go env GOPATH)/bin
-else
-GOBIN=$(shell go env GOBIN)
-endif
-
-# CONTAINER_TOOL defines the container tool to be used for building images.
-# Be aware that the target commands are only tested with Docker which is
-# scaffolded by default. However, you might want to replace it to use other
-# tools. (i.e. podman)
-CONTAINER_TOOL ?= docker
-
-# Setting SHELL to bash allows bash commands to be executed by recipes.
-# Options are set to exit when a recipe line exits non-zero or a piped command fails.
-SHELL = /usr/bin/env bash -o pipefail
-.SHELLFLAGS = -ec
-
-.PHONY: all
-all: build
-
-##@ General
-
-# The help target prints out all targets with their descriptions organized
-# beneath their categories. The categories are represented by '##@' and the
-# target descriptions by '##'. The awk command is responsible for reading the
-# entire set of makefiles included in this invocation, looking for lines of the
-# file as xyz: ## something, and then pretty-format the target and help. Then,
-# if there's a line with ##@ something, that gets pretty-printed as a category.
-# More info on the usage of ANSI control characters for terminal formatting:
-# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
-# More info on the awk command:
-# http://linuxcommand.org/lc3_adv_awk.php
-
-.PHONY: help
-help: ## Display this help.
- @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
-
-##@ Development
-
-.PHONY: manifests
-manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
- $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
-
-.PHONY: generate
-generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
- $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
-
-.PHONY: fmt
-fmt: ## Run go fmt against code.
- go fmt ./...
-
-.PHONY: vet
-vet: ## Run go vet against code.
- go vet ./...
-
-.PHONY: test
-test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
-
-##@ Build
-
-.PHONY: build
-build: manifests generate fmt vet ## Build manager binary.
- go 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
-
-# If you wish to build the manager image targeting other platforms you can use the --platform flag.
-# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
-# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-.PHONY: docker-build
-docker-build: ## Build docker image with the manager.
- $(CONTAINER_TOOL) build -t ${IMG} .
-
-.PHONY: docker-push
-docker-push: ## Push docker image with the manager.
- $(CONTAINER_TOOL) push ${IMG}
-
-# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
-# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
-# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
-# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
-# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
-# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
-PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
-.PHONY: docker-buildx
-docker-buildx: ## Build and push docker image for the manager for cross-platform support
- # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
- sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
- - $(CONTAINER_TOOL) buildx create --name project-v3-builder
- $(CONTAINER_TOOL) buildx use project-v3-builder
- - $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
- - $(CONTAINER_TOOL) buildx rm project-v3-builder
- rm Dockerfile.cross
-
-##@ Deployment
-
-ifndef ignore-not-found
- ignore-not-found = false
-endif
-
-.PHONY: install
-install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
- $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
-
-.PHONY: uninstall
-uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
-
-.PHONY: deploy
-deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
- cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
- $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
-
-.PHONY: undeploy
-undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
- $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
-
-##@ Build Dependencies
-
-## Location to install dependencies to
-LOCALBIN ?= $(shell pwd)/bin
-$(LOCALBIN):
- mkdir -p $(LOCALBIN)
-
-## Tool Binaries
-KUBECTL ?= kubectl
-KUSTOMIZE ?= $(LOCALBIN)/kustomize
-CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
-ENVTEST ?= $(LOCALBIN)/setup-envtest
-
-## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
-CONTROLLER_TOOLS_VERSION ?= v0.13.0
-
-.PHONY: kustomize
-kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
-$(KUSTOMIZE): $(LOCALBIN)
- @if test -x $(LOCALBIN)/kustomize && ! $(LOCALBIN)/kustomize version | grep -q $(KUSTOMIZE_VERSION); then \
- echo "$(LOCALBIN)/kustomize version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \
- rm -rf $(LOCALBIN)/kustomize; \
- fi
- test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION)
-
-.PHONY: controller-gen
-controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
-$(CONTROLLER_GEN): $(LOCALBIN)
- test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
- GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
-
-.PHONY: envtest
-envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
-$(ENVTEST): $(LOCALBIN)
- test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
diff --git a/testdata/project-v4-declarative-v1/PROJECT b/testdata/project-v4-declarative-v1/PROJECT
deleted file mode 100644
index 9753638b394..00000000000
--- a/testdata/project-v4-declarative-v1/PROJECT
+++ /dev/null
@@ -1,53 +0,0 @@
-# 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
-- declarative.go.kubebuilder.io/v1
-plugins:
- declarative.go.kubebuilder.io/v1:
- resources:
- - domain: testproject.org
- group: crew
- kind: Captain
- version: v1
- - domain: testproject.org
- group: crew
- kind: FirstMate
- version: v1
- - domain: testproject.org
- group: crew
- kind: Admiral
- version: v1
-projectName: project-v4-declarative-v1
-repo: sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1
-resources:
-- api:
- crdVersion: v1
- namespaced: true
- controller: true
- domain: testproject.org
- group: crew
- kind: Captain
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1
- version: v1
-- api:
- crdVersion: v1
- namespaced: true
- controller: true
- domain: testproject.org
- group: crew
- kind: FirstMate
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1
- version: v1
-- api:
- crdVersion: v1
- controller: true
- domain: testproject.org
- group: crew
- kind: Admiral
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1
- version: v1
-version: "3"
diff --git a/testdata/project-v4-declarative-v1/README.md b/testdata/project-v4-declarative-v1/README.md
deleted file mode 100644
index d798867cdda..00000000000
--- a/testdata/project-v4-declarative-v1/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-# project-v4-declarative-v1
-// TODO(user): Add simple overview of use/purpose
-
-## Description
-// TODO(user): An in-depth paragraph about your project and overview of use
-
-## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-
-### Running on the cluster
-1. Install Instances of Custom Resources:
-
-```sh
-kubectl apply -k 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
-make deploy IMG=/project-v4-declarative-v1:tag
-```
-
-### Uninstall CRDs
-To delete the CRDs from the cluster:
-
-```sh
-make uninstall
-```
-
-### Undeploy controller
-UnDeploy the controller from the cluster:
-
-```sh
-make undeploy
-```
-
-## Contributing
-// 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/).
-
-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:
-
-```sh
-make install
-```
-
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
-
-```sh
-make run
-```
-
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
-
-```sh
-make manifests
-```
-
-**NOTE:** Run `make --help` for more information on all potential `make` targets
-
-More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
-
-## License
-
-Copyright 2023 The 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.
-
diff --git a/testdata/project-v4-declarative-v1/api/v1/admiral_types.go b/testdata/project-v4-declarative-v1/api/v1/admiral_types.go
deleted file mode 100644
index 83f507b1913..00000000000
--- a/testdata/project-v4-declarative-v1/api/v1/admiral_types.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package v1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1"
-)
-
-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-
-// AdmiralSpec defines the desired state of Admiral
-type AdmiralSpec struct {
- addonv1alpha1.CommonSpec `json:",inline"`
- addonv1alpha1.PatchSpec `json:",inline"`
-
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-}
-
-// AdmiralStatus defines the observed state of Admiral
-type AdmiralStatus struct {
- addonv1alpha1.CommonStatus `json:",inline"`
-
- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-}
-
-//+kubebuilder:object:root=true
-//+kubebuilder:subresource:status
-//+kubebuilder:resource:scope=Cluster
-
-// Admiral is the Schema for the admirals API
-type Admiral struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- Spec AdmiralSpec `json:"spec,omitempty"`
- Status AdmiralStatus `json:"status,omitempty"`
-}
-
-var _ addonv1alpha1.CommonObject = &Admiral{}
-
-func (o *Admiral) ComponentName() string {
- return "admiral"
-}
-
-func (o *Admiral) CommonSpec() addonv1alpha1.CommonSpec {
- return o.Spec.CommonSpec
-}
-
-func (o *Admiral) PatchSpec() addonv1alpha1.PatchSpec {
- return o.Spec.PatchSpec
-}
-
-func (o *Admiral) GetCommonStatus() addonv1alpha1.CommonStatus {
- return o.Status.CommonStatus
-}
-
-func (o *Admiral) SetCommonStatus(s addonv1alpha1.CommonStatus) {
- o.Status.CommonStatus = s
-}
-
-//+kubebuilder:object:root=true
-
-// AdmiralList contains a list of Admiral
-type AdmiralList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []Admiral `json:"items"`
-}
-
-func init() {
- SchemeBuilder.Register(&Admiral{}, &AdmiralList{})
-}
diff --git a/testdata/project-v4-declarative-v1/api/v1/captain_types.go b/testdata/project-v4-declarative-v1/api/v1/captain_types.go
deleted file mode 100644
index b82e24ec320..00000000000
--- a/testdata/project-v4-declarative-v1/api/v1/captain_types.go
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package v1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1"
-)
-
-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-
-// CaptainSpec defines the desired state of Captain
-type CaptainSpec struct {
- addonv1alpha1.CommonSpec `json:",inline"`
- addonv1alpha1.PatchSpec `json:",inline"`
-
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-}
-
-// CaptainStatus defines the observed state of Captain
-type CaptainStatus struct {
- addonv1alpha1.CommonStatus `json:",inline"`
-
- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-}
-
-//+kubebuilder:object:root=true
-//+kubebuilder:subresource:status
-
-// Captain is the Schema for the captains API
-type Captain struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- Spec CaptainSpec `json:"spec,omitempty"`
- Status CaptainStatus `json:"status,omitempty"`
-}
-
-var _ addonv1alpha1.CommonObject = &Captain{}
-
-func (o *Captain) ComponentName() string {
- return "captain"
-}
-
-func (o *Captain) CommonSpec() addonv1alpha1.CommonSpec {
- return o.Spec.CommonSpec
-}
-
-func (o *Captain) PatchSpec() addonv1alpha1.PatchSpec {
- return o.Spec.PatchSpec
-}
-
-func (o *Captain) GetCommonStatus() addonv1alpha1.CommonStatus {
- return o.Status.CommonStatus
-}
-
-func (o *Captain) SetCommonStatus(s addonv1alpha1.CommonStatus) {
- o.Status.CommonStatus = s
-}
-
-//+kubebuilder:object:root=true
-
-// CaptainList contains a list of Captain
-type CaptainList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []Captain `json:"items"`
-}
-
-func init() {
- SchemeBuilder.Register(&Captain{}, &CaptainList{})
-}
diff --git a/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go b/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go
deleted file mode 100644
index a410f27f483..00000000000
--- a/testdata/project-v4-declarative-v1/api/v1/firstmate_types.go
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package v1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1"
-)
-
-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-
-// FirstMateSpec defines the desired state of FirstMate
-type FirstMateSpec struct {
- addonv1alpha1.CommonSpec `json:",inline"`
- addonv1alpha1.PatchSpec `json:",inline"`
-
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-}
-
-// FirstMateStatus defines the observed state of FirstMate
-type FirstMateStatus struct {
- addonv1alpha1.CommonStatus `json:",inline"`
-
- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-}
-
-//+kubebuilder:object:root=true
-//+kubebuilder:subresource:status
-
-// FirstMate is the Schema for the firstmates API
-type FirstMate struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- Spec FirstMateSpec `json:"spec,omitempty"`
- Status FirstMateStatus `json:"status,omitempty"`
-}
-
-var _ addonv1alpha1.CommonObject = &FirstMate{}
-
-func (o *FirstMate) ComponentName() string {
- return "firstmate"
-}
-
-func (o *FirstMate) CommonSpec() addonv1alpha1.CommonSpec {
- return o.Spec.CommonSpec
-}
-
-func (o *FirstMate) PatchSpec() addonv1alpha1.PatchSpec {
- return o.Spec.PatchSpec
-}
-
-func (o *FirstMate) GetCommonStatus() addonv1alpha1.CommonStatus {
- return o.Status.CommonStatus
-}
-
-func (o *FirstMate) SetCommonStatus(s addonv1alpha1.CommonStatus) {
- o.Status.CommonStatus = s
-}
-
-//+kubebuilder:object:root=true
-
-// FirstMateList contains a list of FirstMate
-type FirstMateList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []FirstMate `json:"items"`
-}
-
-func init() {
- SchemeBuilder.Register(&FirstMate{}, &FirstMateList{})
-}
diff --git a/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go b/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go
deleted file mode 100644
index fe267f232c5..00000000000
--- a/testdata/project-v4-declarative-v1/api/v1/groupversion_info.go
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-// Package v1 contains API Schema definitions for the crew v1 API group
-// +kubebuilder:object:generate=true
-// +groupName=crew.testproject.org
-package v1
-
-import (
- "k8s.io/apimachinery/pkg/runtime/schema"
- "sigs.k8s.io/controller-runtime/pkg/scheme"
-)
-
-var (
- // GroupVersion is group version used to register these objects
- GroupVersion = schema.GroupVersion{Group: "crew.testproject.org", Version: "v1"}
-
- // SchemeBuilder is used to add go types to the GroupVersionKind scheme
- SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
-
- // AddToScheme adds the types in this group-version to the given scheme.
- AddToScheme = SchemeBuilder.AddToScheme
-)
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
deleted file mode 100644
index acb0efccf9a..00000000000
--- a/testdata/project-v4-declarative-v1/api/v1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,301 +0,0 @@
-//go:build !ignore_autogenerated
-
-/*
-Copyright 2023 The 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.
-*/
-
-// Code generated by controller-gen. DO NOT EDIT.
-
-package v1
-
-import (
- runtime "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Admiral) DeepCopyInto(out *Admiral) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- in.Spec.DeepCopyInto(&out.Spec)
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Admiral.
-func (in *Admiral) DeepCopy() *Admiral {
- if in == nil {
- return nil
- }
- out := new(Admiral)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *Admiral) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AdmiralList) DeepCopyInto(out *AdmiralList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]Admiral, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralList.
-func (in *AdmiralList) DeepCopy() *AdmiralList {
- if in == nil {
- return nil
- }
- out := new(AdmiralList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *AdmiralList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AdmiralSpec) DeepCopyInto(out *AdmiralSpec) {
- *out = *in
- out.CommonSpec = in.CommonSpec
- in.PatchSpec.DeepCopyInto(&out.PatchSpec)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralSpec.
-func (in *AdmiralSpec) DeepCopy() *AdmiralSpec {
- if in == nil {
- return nil
- }
- out := new(AdmiralSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *AdmiralStatus) DeepCopyInto(out *AdmiralStatus) {
- *out = *in
- in.CommonStatus.DeepCopyInto(&out.CommonStatus)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmiralStatus.
-func (in *AdmiralStatus) DeepCopy() *AdmiralStatus {
- if in == nil {
- return nil
- }
- out := new(AdmiralStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Captain) DeepCopyInto(out *Captain) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- in.Spec.DeepCopyInto(&out.Spec)
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Captain.
-func (in *Captain) DeepCopy() *Captain {
- if in == nil {
- return nil
- }
- out := new(Captain)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *Captain) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CaptainList) DeepCopyInto(out *CaptainList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]Captain, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainList.
-func (in *CaptainList) DeepCopy() *CaptainList {
- if in == nil {
- return nil
- }
- out := new(CaptainList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *CaptainList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CaptainSpec) DeepCopyInto(out *CaptainSpec) {
- *out = *in
- out.CommonSpec = in.CommonSpec
- in.PatchSpec.DeepCopyInto(&out.PatchSpec)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainSpec.
-func (in *CaptainSpec) DeepCopy() *CaptainSpec {
- if in == nil {
- return nil
- }
- out := new(CaptainSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CaptainStatus) DeepCopyInto(out *CaptainStatus) {
- *out = *in
- in.CommonStatus.DeepCopyInto(&out.CommonStatus)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainStatus.
-func (in *CaptainStatus) DeepCopy() *CaptainStatus {
- if in == nil {
- return nil
- }
- out := new(CaptainStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *FirstMate) DeepCopyInto(out *FirstMate) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- in.Spec.DeepCopyInto(&out.Spec)
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMate.
-func (in *FirstMate) DeepCopy() *FirstMate {
- if in == nil {
- return nil
- }
- out := new(FirstMate)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *FirstMate) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *FirstMateList) DeepCopyInto(out *FirstMateList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]FirstMate, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateList.
-func (in *FirstMateList) DeepCopy() *FirstMateList {
- if in == nil {
- return nil
- }
- out := new(FirstMateList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *FirstMateList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *FirstMateSpec) DeepCopyInto(out *FirstMateSpec) {
- *out = *in
- out.CommonSpec = in.CommonSpec
- in.PatchSpec.DeepCopyInto(&out.PatchSpec)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateSpec.
-func (in *FirstMateSpec) DeepCopy() *FirstMateSpec {
- if in == nil {
- return nil
- }
- out := new(FirstMateSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *FirstMateStatus) DeepCopyInto(out *FirstMateStatus) {
- *out = *in
- in.CommonStatus.DeepCopyInto(&out.CommonStatus)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirstMateStatus.
-func (in *FirstMateStatus) DeepCopy() *FirstMateStatus {
- if in == nil {
- return nil
- }
- out := new(FirstMateStatus)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/testdata/project-v4-declarative-v1/channels/packages/admiral/0.0.1/manifest.yaml b/testdata/project-v4-declarative-v1/channels/packages/admiral/0.0.1/manifest.yaml
deleted file mode 100644
index af9a253c582..00000000000
--- a/testdata/project-v4-declarative-v1/channels/packages/admiral/0.0.1/manifest.yaml
+++ /dev/null
@@ -1 +0,0 @@
-# Placeholder manifest - replace with the manifest for your addon
diff --git a/testdata/project-v4-declarative-v1/channels/packages/captain/0.0.1/manifest.yaml b/testdata/project-v4-declarative-v1/channels/packages/captain/0.0.1/manifest.yaml
deleted file mode 100644
index af9a253c582..00000000000
--- a/testdata/project-v4-declarative-v1/channels/packages/captain/0.0.1/manifest.yaml
+++ /dev/null
@@ -1 +0,0 @@
-# Placeholder manifest - replace with the manifest for your addon
diff --git a/testdata/project-v4-declarative-v1/channels/packages/firstmate/0.0.1/manifest.yaml b/testdata/project-v4-declarative-v1/channels/packages/firstmate/0.0.1/manifest.yaml
deleted file mode 100644
index af9a253c582..00000000000
--- a/testdata/project-v4-declarative-v1/channels/packages/firstmate/0.0.1/manifest.yaml
+++ /dev/null
@@ -1 +0,0 @@
-# Placeholder manifest - replace with the manifest for your addon
diff --git a/testdata/project-v4-declarative-v1/channels/stable b/testdata/project-v4-declarative-v1/channels/stable
deleted file mode 100644
index 31216a4aca9..00000000000
--- a/testdata/project-v4-declarative-v1/channels/stable
+++ /dev/null
@@ -1,3 +0,0 @@
-# Versions for the stable channel
-manifests:
-- version: 0.0.1
diff --git a/testdata/project-v4-declarative-v1/cmd/main.go b/testdata/project-v4-declarative-v1/cmd/main.go
deleted file mode 100644
index 4f90472a040..00000000000
--- a/testdata/project-v4-declarative-v1/cmd/main.go
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package main
-
-import (
- "flag"
- "os"
-
- // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
- // to ensure that exec-entrypoint and run can make use of them.
- _ "k8s.io/client-go/plugin/pkg/client/auth"
-
- "k8s.io/apimachinery/pkg/runtime"
- utilruntime "k8s.io/apimachinery/pkg/util/runtime"
- clientgoscheme "k8s.io/client-go/kubernetes/scheme"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/healthz"
- "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/internal/controller"
- //+kubebuilder:scaffold:imports
-)
-
-var (
- scheme = runtime.NewScheme()
- setupLog = ctrl.Log.WithName("setup")
-)
-
-func init() {
- utilruntime.Must(clientgoscheme.AddToScheme(scheme))
-
- utilruntime.Must(crewv1.AddToScheme(scheme))
- //+kubebuilder:scaffold:scheme
-}
-
-func main() {
- var metricsAddr string
- var enableLeaderElection bool
- var probeAddr string
- flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
- flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
- flag.BoolVar(&enableLeaderElection, "leader-elect", false,
- "Enable leader election for controller manager. "+
- "Enabling this will ensure there is only one active controller manager.")
- opts := zap.Options{
- Development: true,
- }
- opts.BindFlags(flag.CommandLine)
- flag.Parse()
-
- ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
-
- mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
- Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
- HealthProbeBindAddress: probeAddr,
- LeaderElection: enableLeaderElection,
- LeaderElectionID: "661f9a6b.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
- // speeds up voluntary leader transitions as the new leader don't have to wait
- // LeaseDuration time first.
- //
- // In the default scaffold provided, the program ends immediately after
- // the manager stops, so would be fine to enable this option. However,
- // if you are doing or is intended to do any operation such as perform cleanups
- // after the manager stops then its usage might be unsafe.
- // LeaderElectionReleaseOnCancel: true,
- })
- if err != nil {
- setupLog.Error(err, "unable to start manager")
- os.Exit(1)
- }
-
- 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 = (&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 = (&controller.AdmiralReconciler{
- Client: mgr.GetClient(),
- Scheme: mgr.GetScheme(),
- }).SetupWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create controller", "controller", "Admiral")
- os.Exit(1)
- }
- //+kubebuilder:scaffold:builder
-
- if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
- setupLog.Error(err, "unable to set up health check")
- os.Exit(1)
- }
- if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
- setupLog.Error(err, "unable to set up ready check")
- os.Exit(1)
- }
-
- setupLog.Info("starting manager")
- if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
- setupLog.Error(err, "problem running manager")
- os.Exit(1)
- }
-}
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
deleted file mode 100644
index 624f4a05924..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_admirals.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- controller-gen.kubebuilder.io/version: v0.13.0
- name: admirals.crew.testproject.org
-spec:
- group: crew.testproject.org
- names:
- kind: Admiral
- listKind: AdmiralList
- plural: admirals
- singular: admiral
- scope: Cluster
- versions:
- - name: v1
- schema:
- openAPIV3Schema:
- description: Admiral is the Schema for the admirals API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: AdmiralSpec defines the desired state of Admiral
- properties:
- channel:
- description: 'Channel specifies a channel that can be used to resolve
- a specific addon, eg: stable It will be ignored if Version is specified'
- type: string
- patches:
- items:
- type: object
- x-kubernetes-preserve-unknown-fields: true
- type: array
- version:
- description: Version specifies the exact addon version to be deployed,
- eg 1.2.3 It should not be specified if Channel is specified
- type: string
- type: object
- status:
- description: AdmiralStatus defines the observed state of Admiral
- properties:
- errors:
- items:
- type: string
- type: array
- healthy:
- type: boolean
- phase:
- type: string
- required:
- - healthy
- type: object
- type: object
- served: true
- storage: true
- subresources:
- status: {}
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
deleted file mode 100644
index 5abd6f46979..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_captains.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- controller-gen.kubebuilder.io/version: v0.13.0
- name: captains.crew.testproject.org
-spec:
- group: crew.testproject.org
- names:
- kind: Captain
- listKind: CaptainList
- plural: captains
- singular: captain
- scope: Namespaced
- versions:
- - name: v1
- schema:
- openAPIV3Schema:
- description: Captain is the Schema for the captains API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: CaptainSpec defines the desired state of Captain
- properties:
- channel:
- description: 'Channel specifies a channel that can be used to resolve
- a specific addon, eg: stable It will be ignored if Version is specified'
- type: string
- patches:
- items:
- type: object
- x-kubernetes-preserve-unknown-fields: true
- type: array
- version:
- description: Version specifies the exact addon version to be deployed,
- eg 1.2.3 It should not be specified if Channel is specified
- type: string
- type: object
- status:
- description: CaptainStatus defines the observed state of Captain
- properties:
- errors:
- items:
- type: string
- type: array
- healthy:
- type: boolean
- phase:
- type: string
- required:
- - healthy
- type: object
- type: object
- served: true
- storage: true
- subresources:
- status: {}
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
deleted file mode 100644
index 48b67c33c9a..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/bases/crew.testproject.org_firstmates.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- controller-gen.kubebuilder.io/version: v0.13.0
- name: firstmates.crew.testproject.org
-spec:
- group: crew.testproject.org
- names:
- kind: FirstMate
- listKind: FirstMateList
- plural: firstmates
- singular: firstmate
- scope: Namespaced
- versions:
- - name: v1
- schema:
- openAPIV3Schema:
- description: FirstMate is the Schema for the firstmates API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: FirstMateSpec defines the desired state of FirstMate
- properties:
- channel:
- description: 'Channel specifies a channel that can be used to resolve
- a specific addon, eg: stable It will be ignored if Version is specified'
- type: string
- patches:
- items:
- type: object
- x-kubernetes-preserve-unknown-fields: true
- type: array
- version:
- description: Version specifies the exact addon version to be deployed,
- eg 1.2.3 It should not be specified if Channel is specified
- type: string
- type: object
- status:
- description: FirstMateStatus defines the observed state of FirstMate
- properties:
- errors:
- items:
- type: string
- type: array
- healthy:
- type: boolean
- phase:
- type: string
- required:
- - healthy
- type: object
- type: object
- served: true
- storage: true
- subresources:
- status: {}
diff --git a/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml b/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml
deleted file mode 100644
index 687526d8e7c..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/kustomization.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# This kustomization.yaml is not intended to be run by itself,
-# since it depends on service name and namespace that are out of this kustomize package.
-# It should be run by config/default
-resources:
-- bases/crew.testproject.org_captains.yaml
-- bases/crew.testproject.org_firstmates.yaml
-- bases/crew.testproject.org_admirals.yaml
-#+kubebuilder:scaffold:crdkustomizeresource
-
-patches:
-# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
-# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_captains.yaml
-#- path: patches/webhook_in_firstmates.yaml
-#- path: patches/webhook_in_admirals.yaml
-#+kubebuilder:scaffold:crdkustomizewebhookpatch
-
-# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
-# patches here are for enabling the CA injection for each CRD
-#- path: patches/cainjection_in_captains.yaml
-#- path: patches/cainjection_in_firstmates.yaml
-#- path: patches/cainjection_in_admirals.yaml
-#+kubebuilder:scaffold:crdkustomizecainjectionpatch
-
-# the following config is for teaching kustomize how to do kustomization for CRDs.
-configurations:
-- kustomizeconfig.yaml
diff --git a/testdata/project-v4-declarative-v1/config/crd/kustomizeconfig.yaml b/testdata/project-v4-declarative-v1/config/crd/kustomizeconfig.yaml
deleted file mode 100644
index ec5c150a9df..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/kustomizeconfig.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is for teaching kustomize how to substitute name and namespace reference in CRD
-nameReference:
-- kind: Service
- version: v1
- fieldSpecs:
- - kind: CustomResourceDefinition
- version: v1
- group: apiextensions.k8s.io
- path: spec/conversion/webhook/clientConfig/service/name
-
-namespace:
-- kind: CustomResourceDefinition
- version: v1
- group: apiextensions.k8s.io
- path: spec/conversion/webhook/clientConfig/service/namespace
- create: false
-
-varReference:
-- path: metadata/annotations
diff --git a/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_admirals.yaml b/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_admirals.yaml
deleted file mode 100644
index 49bfa257d37..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_admirals.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: admirals.crew.testproject.org
diff --git a/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_captains.yaml b/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_captains.yaml
deleted file mode 100644
index fba0c3ed6fd..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_captains.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: captains.crew.testproject.org
diff --git a/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_firstmates.yaml b/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_firstmates.yaml
deleted file mode 100644
index 69292458eb5..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/patches/cainjection_in_firstmates.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: firstmates.crew.testproject.org
diff --git a/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_admirals.yaml b/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_admirals.yaml
deleted file mode 100644
index 0ce2808578a..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_admirals.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: admirals.crew.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_captains.yaml b/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_captains.yaml
deleted file mode 100644
index f73ae2e8abc..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_captains.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: captains.crew.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_firstmates.yaml b/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_firstmates.yaml
deleted file mode 100644
index 76ee5acedbd..00000000000
--- a/testdata/project-v4-declarative-v1/config/crd/patches/webhook_in_firstmates.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: firstmates.crew.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-declarative-v1/config/default/kustomization.yaml b/testdata/project-v4-declarative-v1/config/default/kustomization.yaml
deleted file mode 100644
index f1e0ad92725..00000000000
--- a/testdata/project-v4-declarative-v1/config/default/kustomization.yaml
+++ /dev/null
@@ -1,144 +0,0 @@
-# Adds namespace to all resources.
-namespace: project-v4-declarative-v1-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-declarative-v1-
-
-# Labels to add to all resources and selectors.
-#labels:
-#- includeSelectors: true
-# pairs:
-# someName: someValue
-
-resources:
-- ../crd
-- ../rbac
-- ../manager
-# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
-# crd/kustomization.yaml
-#- ../webhook
-# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
-#- ../certmanager
-# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
-#- ../prometheus
-
-patchesStrategicMerge:
-# Protect the /metrics endpoint by putting it behind auth.
-# If you want your controller-manager to expose the /metrics
-# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
-
-
-
-# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
-# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
-
-# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
-# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
-# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
-
-# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
-# Uncomment the following replacements to add the cert-manager CA injection annotations
-#replacements:
-# - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
-# kind: Certificate
-# group: cert-manager.io
-# version: v1
-# name: serving-cert # this name should match the one in certificate.yaml
-# fieldPath: .metadata.namespace # namespace of the certificate CR
-# targets:
-# - select:
-# kind: ValidatingWebhookConfiguration
-# fieldPaths:
-# - .metadata.annotations.[cert-manager.io/inject-ca-from]
-# options:
-# delimiter: '/'
-# index: 0
-# create: true
-# - select:
-# kind: MutatingWebhookConfiguration
-# fieldPaths:
-# - .metadata.annotations.[cert-manager.io/inject-ca-from]
-# options:
-# delimiter: '/'
-# index: 0
-# create: true
-# - select:
-# kind: CustomResourceDefinition
-# fieldPaths:
-# - .metadata.annotations.[cert-manager.io/inject-ca-from]
-# options:
-# delimiter: '/'
-# index: 0
-# create: true
-# - source:
-# kind: Certificate
-# group: cert-manager.io
-# version: v1
-# name: serving-cert # this name should match the one in certificate.yaml
-# fieldPath: .metadata.name
-# targets:
-# - select:
-# kind: ValidatingWebhookConfiguration
-# fieldPaths:
-# - .metadata.annotations.[cert-manager.io/inject-ca-from]
-# options:
-# delimiter: '/'
-# index: 1
-# create: true
-# - select:
-# kind: MutatingWebhookConfiguration
-# fieldPaths:
-# - .metadata.annotations.[cert-manager.io/inject-ca-from]
-# options:
-# delimiter: '/'
-# index: 1
-# create: true
-# - select:
-# kind: CustomResourceDefinition
-# fieldPaths:
-# - .metadata.annotations.[cert-manager.io/inject-ca-from]
-# options:
-# delimiter: '/'
-# index: 1
-# create: true
-# - source: # Add cert-manager annotation to the webhook Service
-# kind: Service
-# version: v1
-# name: webhook-service
-# fieldPath: .metadata.name # namespace of the service
-# targets:
-# - select:
-# kind: Certificate
-# group: cert-manager.io
-# version: v1
-# fieldPaths:
-# - .spec.dnsNames.0
-# - .spec.dnsNames.1
-# options:
-# delimiter: '.'
-# index: 0
-# create: true
-# - source:
-# kind: Service
-# version: v1
-# name: webhook-service
-# fieldPath: .metadata.namespace # namespace of the service
-# targets:
-# - select:
-# kind: Certificate
-# group: cert-manager.io
-# version: v1
-# fieldPaths:
-# - .spec.dnsNames.0
-# - .spec.dnsNames.1
-# options:
-# delimiter: '.'
-# index: 1
-# create: true
diff --git a/testdata/project-v4-declarative-v1/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-declarative-v1/config/default/manager_auth_proxy_patch.yaml
deleted file mode 100644
index 73fad2a6754..00000000000
--- a/testdata/project-v4-declarative-v1/config/default/manager_auth_proxy_patch.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-# This patch inject a sidecar container which is a HTTP proxy for the
-# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: controller-manager
- namespace: system
-spec:
- template:
- spec:
- containers:
- - name: kube-rbac-proxy
- securityContext:
- allowPrivilegeEscalation: false
- capabilities:
- drop:
- - "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
- args:
- - "--secure-listen-address=0.0.0.0:8443"
- - "--upstream=http://127.0.0.1:8080/"
- - "--logtostderr=true"
- - "--v=0"
- ports:
- - containerPort: 8443
- protocol: TCP
- name: https
- resources:
- limits:
- cpu: 500m
- memory: 128Mi
- requests:
- cpu: 5m
- memory: 64Mi
- - name: manager
- args:
- - "--health-probe-bind-address=:8081"
- - "--metrics-bind-address=127.0.0.1:8080"
- - "--leader-elect"
diff --git a/testdata/project-v4-declarative-v1/config/default/manager_config_patch.yaml b/testdata/project-v4-declarative-v1/config/default/manager_config_patch.yaml
deleted file mode 100644
index f6f58916922..00000000000
--- a/testdata/project-v4-declarative-v1/config/default/manager_config_patch.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: controller-manager
- namespace: system
-spec:
- template:
- spec:
- containers:
- - name: manager
diff --git a/testdata/project-v4-declarative-v1/config/manager/kustomization.yaml b/testdata/project-v4-declarative-v1/config/manager/kustomization.yaml
deleted file mode 100644
index 5c5f0b84cba..00000000000
--- a/testdata/project-v4-declarative-v1/config/manager/kustomization.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-resources:
-- manager.yaml
diff --git a/testdata/project-v4-declarative-v1/config/manager/manager.yaml b/testdata/project-v4-declarative-v1/config/manager/manager.yaml
deleted file mode 100644
index 3c451f10116..00000000000
--- a/testdata/project-v4-declarative-v1/config/manager/manager.yaml
+++ /dev/null
@@ -1,102 +0,0 @@
-apiVersion: v1
-kind: Namespace
-metadata:
- labels:
- control-plane: controller-manager
- app.kubernetes.io/name: namespace
- app.kubernetes.io/instance: system
- app.kubernetes.io/component: manager
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: system
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: controller-manager
- namespace: system
- labels:
- control-plane: controller-manager
- app.kubernetes.io/name: deployment
- app.kubernetes.io/instance: controller-manager
- app.kubernetes.io/component: manager
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
-spec:
- selector:
- matchLabels:
- control-plane: controller-manager
- replicas: 1
- template:
- metadata:
- annotations:
- kubectl.kubernetes.io/default-container: manager
- labels:
- control-plane: controller-manager
- spec:
- # TODO(user): Uncomment the following code to configure the nodeAffinity expression
- # according to the platforms which are supported by your solution.
- # It is considered best practice to support multiple architectures. You can
- # build your manager image using the makefile target docker-buildx.
- # affinity:
- # nodeAffinity:
- # requiredDuringSchedulingIgnoredDuringExecution:
- # nodeSelectorTerms:
- # - matchExpressions:
- # - key: kubernetes.io/arch
- # operator: In
- # values:
- # - amd64
- # - arm64
- # - ppc64le
- # - s390x
- # - key: kubernetes.io/os
- # operator: In
- # values:
- # - linux
- securityContext:
- runAsNonRoot: true
- # TODO(user): For common cases that do not require escalating privileges
- # it is recommended to ensure that all your Pods/Containers are restrictive.
- # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
- # Please uncomment the following code if your project does NOT have to work on old Kubernetes
- # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
- # seccompProfile:
- # type: RuntimeDefault
- containers:
- - command:
- - /manager
- args:
- - --leader-elect
- image: controller:latest
- name: manager
- securityContext:
- allowPrivilegeEscalation: false
- capabilities:
- drop:
- - "ALL"
- livenessProbe:
- httpGet:
- path: /healthz
- port: 8081
- initialDelaySeconds: 15
- periodSeconds: 20
- readinessProbe:
- httpGet:
- path: /readyz
- port: 8081
- initialDelaySeconds: 5
- periodSeconds: 10
- # TODO(user): Configure the resources accordingly based on the project requirements.
- # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
- resources:
- limits:
- cpu: 500m
- memory: 128Mi
- requests:
- cpu: 10m
- memory: 64Mi
- serviceAccountName: controller-manager
- terminationGracePeriodSeconds: 10
diff --git a/testdata/project-v4-declarative-v1/config/prometheus/kustomization.yaml b/testdata/project-v4-declarative-v1/config/prometheus/kustomization.yaml
deleted file mode 100644
index ed137168a1d..00000000000
--- a/testdata/project-v4-declarative-v1/config/prometheus/kustomization.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-resources:
-- monitor.yaml
diff --git a/testdata/project-v4-declarative-v1/config/prometheus/monitor.yaml b/testdata/project-v4-declarative-v1/config/prometheus/monitor.yaml
deleted file mode 100644
index 61fc67b22f4..00000000000
--- a/testdata/project-v4-declarative-v1/config/prometheus/monitor.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-# Prometheus Monitor Service (Metrics)
-apiVersion: monitoring.coreos.com/v1
-kind: ServiceMonitor
-metadata:
- labels:
- control-plane: controller-manager
- app.kubernetes.io/name: servicemonitor
- app.kubernetes.io/instance: controller-manager-metrics-monitor
- app.kubernetes.io/component: metrics
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: controller-manager-metrics-monitor
- namespace: system
-spec:
- endpoints:
- - path: /metrics
- port: https
- scheme: https
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
- tlsConfig:
- insecureSkipVerify: true
- selector:
- matchLabels:
- control-plane: controller-manager
diff --git a/testdata/project-v4-declarative-v1/config/rbac/admiral_editor_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/admiral_editor_role.yaml
deleted file mode 100644
index 1576cae6978..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/admiral_editor_role.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# permissions for end users to edit admirals.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: admiral-editor-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: admiral-editor-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - admirals
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - admirals/status
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/admiral_viewer_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/admiral_viewer_role.yaml
deleted file mode 100644
index c99224d4ef1..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/admiral_viewer_role.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# permissions for end users to view admirals.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: admiral-viewer-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: admiral-viewer-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - admirals
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - admirals/status
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_client_clusterrole.yaml
deleted file mode 100644
index 919613c489c..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_client_clusterrole.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: metrics-reader
- app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: metrics-reader
-rules:
-- nonResourceURLs:
- - "/metrics"
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role.yaml
deleted file mode 100644
index 357383f9f7c..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: proxy-role
- app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: proxy-role
-rules:
-- apiGroups:
- - authentication.k8s.io
- resources:
- - tokenreviews
- verbs:
- - create
-- apiGroups:
- - authorization.k8s.io
- resources:
- - subjectaccessreviews
- verbs:
- - create
diff --git a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role_binding.yaml
deleted file mode 100644
index 1d36447d718..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_role_binding.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- labels:
- app.kubernetes.io/name: clusterrolebinding
- app.kubernetes.io/instance: proxy-rolebinding
- app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: proxy-rolebinding
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: proxy-role
-subjects:
-- kind: ServiceAccount
- name: controller-manager
- namespace: system
diff --git a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_service.yaml b/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_service.yaml
deleted file mode 100644
index 30eca5566f5..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/auth_proxy_service.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
- labels:
- control-plane: controller-manager
- app.kubernetes.io/name: service
- app.kubernetes.io/instance: controller-manager-metrics-service
- app.kubernetes.io/component: kube-rbac-proxy
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: controller-manager-metrics-service
- namespace: system
-spec:
- ports:
- - name: https
- port: 8443
- protocol: TCP
- targetPort: https
- selector:
- control-plane: controller-manager
diff --git a/testdata/project-v4-declarative-v1/config/rbac/captain_editor_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/captain_editor_role.yaml
deleted file mode 100644
index 915caa67478..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/captain_editor_role.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# permissions for end users to edit captains.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: captain-editor-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: captain-editor-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - captains
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - captains/status
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/captain_viewer_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/captain_viewer_role.yaml
deleted file mode 100644
index 64f1902b105..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/captain_viewer_role.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# permissions for end users to view captains.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: captain-viewer-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: captain-viewer-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - captains
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - captains/status
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/firstmate_editor_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/firstmate_editor_role.yaml
deleted file mode 100644
index d0060228686..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/firstmate_editor_role.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# permissions for end users to edit firstmates.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: firstmate-editor-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: firstmate-editor-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - firstmates
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - firstmates/status
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/firstmate_viewer_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/firstmate_viewer_role.yaml
deleted file mode 100644
index f73a37dc0da..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/firstmate_viewer_role.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# permissions for end users to view firstmates.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: firstmate-viewer-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: firstmate-viewer-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - firstmates
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - firstmates/status
- verbs:
- - get
diff --git a/testdata/project-v4-declarative-v1/config/rbac/kustomization.yaml b/testdata/project-v4-declarative-v1/config/rbac/kustomization.yaml
deleted file mode 100644
index 731832a6ac3..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/kustomization.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-resources:
-# All RBAC will be applied under this service account in
-# the deployment namespace. You may comment out this resource
-# if your manager will use a service account that exists at
-# runtime. Be sure to update RoleBinding and ClusterRoleBinding
-# subjects if changing service account names.
-- service_account.yaml
-- role.yaml
-- role_binding.yaml
-- leader_election_role.yaml
-- leader_election_role_binding.yaml
-# Comment the following 4 lines if you want to disable
-# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
-# which protects your /metrics endpoint.
-- auth_proxy_service.yaml
-- auth_proxy_role.yaml
-- auth_proxy_role_binding.yaml
-- auth_proxy_client_clusterrole.yaml
diff --git a/testdata/project-v4-declarative-v1/config/rbac/leader_election_role.yaml b/testdata/project-v4-declarative-v1/config/rbac/leader_election_role.yaml
deleted file mode 100644
index d3daae8ea04..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/leader_election_role.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
-# permissions to do leader election.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: Role
-metadata:
- labels:
- app.kubernetes.io/name: role
- app.kubernetes.io/instance: leader-election-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: leader-election-role
-rules:
-- apiGroups:
- - ""
- resources:
- - configmaps
- verbs:
- - get
- - list
- - watch
- - create
- - update
- - patch
- - delete
-- apiGroups:
- - coordination.k8s.io
- resources:
- - leases
- verbs:
- - get
- - list
- - watch
- - create
- - update
- - patch
- - delete
-- apiGroups:
- - ""
- resources:
- - events
- verbs:
- - create
- - patch
diff --git a/testdata/project-v4-declarative-v1/config/rbac/leader_election_role_binding.yaml b/testdata/project-v4-declarative-v1/config/rbac/leader_election_role_binding.yaml
deleted file mode 100644
index e8888473947..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/leader_election_role_binding.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-apiVersion: rbac.authorization.k8s.io/v1
-kind: RoleBinding
-metadata:
- labels:
- app.kubernetes.io/name: rolebinding
- app.kubernetes.io/instance: leader-election-rolebinding
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: leader-election-rolebinding
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: Role
- name: leader-election-role
-subjects:
-- kind: ServiceAccount
- name: controller-manager
- namespace: system
diff --git a/testdata/project-v4-declarative-v1/config/rbac/role.yaml b/testdata/project-v4-declarative-v1/config/rbac/role.yaml
deleted file mode 100644
index 6565ab53363..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/role.yaml
+++ /dev/null
@@ -1,66 +0,0 @@
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- name: manager-role
-rules:
-- apiGroups:
- - crew.testproject.org
- resources:
- - admirals
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - admirals/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - crew.testproject.org
- resources:
- - captains
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - captains/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - crew.testproject.org
- resources:
- - firstmates
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - crew.testproject.org
- resources:
- - firstmates/status
- verbs:
- - get
- - patch
- - update
diff --git a/testdata/project-v4-declarative-v1/config/rbac/role_binding.yaml b/testdata/project-v4-declarative-v1/config/rbac/role_binding.yaml
deleted file mode 100644
index 89468ce7324..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/role_binding.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
- labels:
- app.kubernetes.io/name: clusterrolebinding
- app.kubernetes.io/instance: manager-rolebinding
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: manager-rolebinding
-roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: manager-role
-subjects:
-- kind: ServiceAccount
- name: controller-manager
- namespace: system
diff --git a/testdata/project-v4-declarative-v1/config/rbac/service_account.yaml b/testdata/project-v4-declarative-v1/config/rbac/service_account.yaml
deleted file mode 100644
index 304dead7057..00000000000
--- a/testdata/project-v4-declarative-v1/config/rbac/service_account.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- labels:
- app.kubernetes.io/name: serviceaccount
- app.kubernetes.io/instance: controller-manager-sa
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-declarative-v1
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- name: controller-manager
- namespace: system
diff --git a/testdata/project-v4-declarative-v1/config/samples/crew_v1_admiral.yaml b/testdata/project-v4-declarative-v1/config/samples/crew_v1_admiral.yaml
deleted file mode 100644
index ebe264df032..00000000000
--- a/testdata/project-v4-declarative-v1/config/samples/crew_v1_admiral.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: crew.testproject.org/v1
-kind: Admiral
-metadata:
- labels:
- app.kubernetes.io/name: admiral
- app.kubernetes.io/instance: admiral-sample
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- app.kubernetes.io/created-by: project-v4-declarative-v1
- name: admiral-sample
-spec:
- # TODO(user): Add fields here
diff --git a/testdata/project-v4-declarative-v1/config/samples/crew_v1_captain.yaml b/testdata/project-v4-declarative-v1/config/samples/crew_v1_captain.yaml
deleted file mode 100644
index fa873e62545..00000000000
--- a/testdata/project-v4-declarative-v1/config/samples/crew_v1_captain.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: crew.testproject.org/v1
-kind: Captain
-metadata:
- labels:
- app.kubernetes.io/name: captain
- app.kubernetes.io/instance: captain-sample
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- app.kubernetes.io/created-by: project-v4-declarative-v1
- name: captain-sample
-spec:
- # TODO(user): Add fields here
diff --git a/testdata/project-v4-declarative-v1/config/samples/crew_v1_firstmate.yaml b/testdata/project-v4-declarative-v1/config/samples/crew_v1_firstmate.yaml
deleted file mode 100644
index c025672bde4..00000000000
--- a/testdata/project-v4-declarative-v1/config/samples/crew_v1_firstmate.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-apiVersion: crew.testproject.org/v1
-kind: FirstMate
-metadata:
- labels:
- app.kubernetes.io/name: firstmate
- app.kubernetes.io/instance: firstmate-sample
- app.kubernetes.io/part-of: project-v4-declarative-v1
- app.kubernetes.io/managed-by: kustomize
- app.kubernetes.io/created-by: project-v4-declarative-v1
- name: firstmate-sample
-spec:
- # TODO(user): Add fields here
diff --git a/testdata/project-v4-declarative-v1/config/samples/kustomization.yaml b/testdata/project-v4-declarative-v1/config/samples/kustomization.yaml
deleted file mode 100644
index b5cf9e60f5c..00000000000
--- a/testdata/project-v4-declarative-v1/config/samples/kustomization.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-## Append samples of your project ##
-resources:
-- crew_v1_captain.yaml
-- crew_v1_firstmate.yaml
-- crew_v1_admiral.yaml
-#+kubebuilder:scaffold:manifestskustomizesamples
diff --git a/testdata/project-v4-declarative-v1/go.mod b/testdata/project-v4-declarative-v1/go.mod
deleted file mode 100644
index b93d3bb786a..00000000000
--- a/testdata/project-v4-declarative-v1/go.mod
+++ /dev/null
@@ -1,116 +0,0 @@
-module sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1
-
-go 1.20
-
-require (
- github.com/go-logr/logr v1.2.4
- github.com/onsi/ginkgo/v2 v2.9.5
- github.com/onsi/gomega v1.27.7
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
- sigs.k8s.io/kubebuilder-declarative-pattern v0.13.0-beta.1.0.20230604223042-9a410556b95d
-)
-
-require (
- github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
- github.com/MakeNowJust/heredoc v1.0.0 // indirect
- github.com/beorn7/perks v1.0.1 // indirect
- github.com/blang/semver/v4 v4.0.0 // indirect
- github.com/cespare/xxhash/v2 v2.2.0 // 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.10.2 // 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.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
- github.com/go-git/go-billy/v5 v5.0.0 // indirect
- github.com/go-git/go-git/v5 v5.1.0 // indirect
- github.com/go-logr/zapr v1.2.4 // indirect
- github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.2 // indirect
- github.com/go-openapi/swag v0.22.3 // indirect
- github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
- github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.3 // indirect
- github.com/google/btree v1.0.1 // indirect
- github.com/google/gnostic v0.6.9 // indirect
- github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.2.0 // indirect
- github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
- github.com/google/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.15 // 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
- github.com/json-iterator/go v1.1.12 // indirect
- 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.7 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.4 // 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-20221205130635-1aeaba878587 // 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.15.1 // indirect
- github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.43.0 // indirect
- github.com/prometheus/procfs v0.9.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.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.24.0 // indirect
- golang.org/x/crypto v0.1.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
- golang.org/x/time v0.3.0 // indirect
- golang.org/x/tools v0.9.1 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
- google.golang.org/appengine v1.6.7 // indirect
- google.golang.org/protobuf v1.30.0 // 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.27.2 // indirect
- k8s.io/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/cli-runtime v0.26.3 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.100.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/kubectl v0.26.3 // indirect
- k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
- sigs.k8s.io/cli-utils v0.33.0 // indirect
- sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
- sigs.k8s.io/kubebuilder-declarative-pattern/applylib v0.0.0-20230420203711-4abaa68e1923 // indirect
- sigs.k8s.io/kustomize/api v0.12.1 // indirect
- sigs.k8s.io/kustomize/kstatus v0.0.2-0.20200509233124-065f70705d4d // indirect
- sigs.k8s.io/kustomize/kyaml v0.13.9 // 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-declarative-v1/hack/boilerplate.go.txt b/testdata/project-v4-declarative-v1/hack/boilerplate.go.txt
deleted file mode 100644
index 8c36d12450d..00000000000
--- a/testdata/project-v4-declarative-v1/hack/boilerplate.go.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
\ No newline at end of file
diff --git a/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go b/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
deleted file mode 100644
index 126171a2a18..00000000000
--- a/testdata/project-v4-declarative-v1/internal/controller/admiral_controller.go
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package controller
-
-import (
- "github.com/go-logr/logr"
- "k8s.io/apimachinery/pkg/runtime"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/controller"
- "sigs.k8s.io/controller-runtime/pkg/handler"
- "sigs.k8s.io/controller-runtime/pkg/reconcile"
- "sigs.k8s.io/controller-runtime/pkg/source"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative"
-
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1"
-)
-
-var _ reconcile.Reconciler = &AdmiralReconciler{}
-
-// AdmiralReconciler reconciles a Admiral object
-type AdmiralReconciler struct {
- client.Client
- Log logr.Logger
- Scheme *runtime.Scheme
-
- declarative.Reconciler
-}
-
-//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=crew.testproject.org,resources=admirals/status,verbs=get;update;patch
-
-// SetupWithManager sets up the controller with the Manager.
-func (r *AdmiralReconciler) SetupWithManager(mgr ctrl.Manager) error {
- addon.Init()
-
- labels := map[string]string{
- "k8s-app": "admiral",
- }
-
- watchLabels := declarative.SourceLabel(mgr.GetScheme())
-
- if err := r.Reconciler.Init(mgr, &crewv1.Admiral{},
- declarative.WithObjectTransform(declarative.AddLabels(labels)),
- declarative.WithOwner(declarative.SourceAsOwner),
- declarative.WithLabels(watchLabels),
- declarative.WithStatus(status.NewBasic(mgr.GetClient())),
- // TODO: add an application to your manifest: declarative.WithObjectTransform(addon.TransformApplicationFromStatus),
- // TODO: add an application to your manifest: declarative.WithManagedApplication(watchLabels),
- declarative.WithObjectTransform(addon.ApplyPatches),
- ); err != nil {
- return err
- }
-
- c, err := controller.New("admiral-controller", mgr, controller.Options{Reconciler: r})
- if err != nil {
- return err
- }
-
- // Watch for changes to Admiral
- err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.Admiral{}), &handler.EnqueueRequestForObject{})
- if err != nil {
- return err
- }
-
- // Watch for changes to deployed objects
- err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
- if err != nil {
- return err
- }
-
- return nil
-}
diff --git a/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go b/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
deleted file mode 100644
index 5de7552186b..00000000000
--- a/testdata/project-v4-declarative-v1/internal/controller/captain_controller.go
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package controller
-
-import (
- "github.com/go-logr/logr"
- "k8s.io/apimachinery/pkg/runtime"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/controller"
- "sigs.k8s.io/controller-runtime/pkg/handler"
- "sigs.k8s.io/controller-runtime/pkg/reconcile"
- "sigs.k8s.io/controller-runtime/pkg/source"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative"
-
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1"
-)
-
-var _ reconcile.Reconciler = &CaptainReconciler{}
-
-// CaptainReconciler reconciles a Captain object
-type CaptainReconciler struct {
- client.Client
- Log logr.Logger
- Scheme *runtime.Scheme
-
- declarative.Reconciler
-}
-
-//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains/status,verbs=get;update;patch
-
-// SetupWithManager sets up the controller with the Manager.
-func (r *CaptainReconciler) SetupWithManager(mgr ctrl.Manager) error {
- addon.Init()
-
- labels := map[string]string{
- "k8s-app": "captain",
- }
-
- watchLabels := declarative.SourceLabel(mgr.GetScheme())
-
- if err := r.Reconciler.Init(mgr, &crewv1.Captain{},
- declarative.WithObjectTransform(declarative.AddLabels(labels)),
- declarative.WithOwner(declarative.SourceAsOwner),
- declarative.WithLabels(watchLabels),
- declarative.WithStatus(status.NewBasic(mgr.GetClient())),
- // TODO: add an application to your manifest: declarative.WithObjectTransform(addon.TransformApplicationFromStatus),
- // TODO: add an application to your manifest: declarative.WithManagedApplication(watchLabels),
- declarative.WithObjectTransform(addon.ApplyPatches),
- ); err != nil {
- return err
- }
-
- c, err := controller.New("captain-controller", mgr, controller.Options{Reconciler: r})
- if err != nil {
- return err
- }
-
- // Watch for changes to Captain
- err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.Captain{}), &handler.EnqueueRequestForObject{})
- if err != nil {
- return err
- }
-
- // Watch for changes to deployed objects
- err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
- if err != nil {
- return err
- }
-
- return nil
-}
diff --git a/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go b/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
deleted file mode 100644
index 28d592cad9a..00000000000
--- a/testdata/project-v4-declarative-v1/internal/controller/firstmate_controller.go
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package controller
-
-import (
- "github.com/go-logr/logr"
- "k8s.io/apimachinery/pkg/runtime"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/controller"
- "sigs.k8s.io/controller-runtime/pkg/handler"
- "sigs.k8s.io/controller-runtime/pkg/reconcile"
- "sigs.k8s.io/controller-runtime/pkg/source"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/status"
- "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/declarative"
-
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1"
-)
-
-var _ reconcile.Reconciler = &FirstMateReconciler{}
-
-// FirstMateReconciler reconciles a FirstMate object
-type FirstMateReconciler struct {
- client.Client
- Log logr.Logger
- Scheme *runtime.Scheme
-
- declarative.Reconciler
-}
-
-//+kubebuilder:rbac:groups=crew.testproject.org,resources=firstmates,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=crew.testproject.org,resources=firstmates/status,verbs=get;update;patch
-
-// SetupWithManager sets up the controller with the Manager.
-func (r *FirstMateReconciler) SetupWithManager(mgr ctrl.Manager) error {
- addon.Init()
-
- labels := map[string]string{
- "k8s-app": "firstmate",
- }
-
- watchLabels := declarative.SourceLabel(mgr.GetScheme())
-
- if err := r.Reconciler.Init(mgr, &crewv1.FirstMate{},
- declarative.WithObjectTransform(declarative.AddLabels(labels)),
- declarative.WithOwner(declarative.SourceAsOwner),
- declarative.WithLabels(watchLabels),
- declarative.WithStatus(status.NewBasic(mgr.GetClient())),
- // TODO: add an application to your manifest: declarative.WithObjectTransform(addon.TransformApplicationFromStatus),
- // TODO: add an application to your manifest: declarative.WithManagedApplication(watchLabels),
- declarative.WithObjectTransform(addon.ApplyPatches),
- ); err != nil {
- return err
- }
-
- c, err := controller.New("firstmate-controller", mgr, controller.Options{Reconciler: r})
- if err != nil {
- return err
- }
-
- // Watch for changes to FirstMate
- err = c.Watch(source.Kind(mgr.GetCache(), &crewv1.FirstMate{}), &handler.EnqueueRequestForObject{})
- if err != nil {
- return err
- }
-
- // Watch for changes to deployed objects
- err = declarative.WatchAll(mgr.GetConfig(), c, r, watchLabels)
- if err != nil {
- return err
- }
-
- return nil
-}
diff --git a/testdata/project-v4-declarative-v1/internal/controller/suite_test.go b/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
deleted file mode 100644
index de5e58a7d4b..00000000000
--- a/testdata/project-v4-declarative-v1/internal/controller/suite_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package controller
-
-import (
- "fmt"
- "path/filepath"
- "runtime"
- "testing"
-
- . "github.com/onsi/ginkgo/v2"
- . "github.com/onsi/gomega"
-
- "k8s.io/client-go/kubernetes/scheme"
- "k8s.io/client-go/rest"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/envtest"
- logf "sigs.k8s.io/controller-runtime/pkg/log"
- "sigs.k8s.io/controller-runtime/pkg/log/zap"
-
- crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-declarative-v1/api/v1"
- //+kubebuilder:scaffold:imports
-)
-
-// These tests use Ginkgo (BDD-style Go testing framework). Refer to
-// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
-
-var cfg *rest.Config
-var k8sClient client.Client
-var testEnv *envtest.Environment
-
-func TestControllers(t *testing.T) {
- RegisterFailHandler(Fail)
-
- RunSpecs(t, "Controller Suite")
-}
-
-var _ = BeforeSuite(func() {
- logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
-
- By("bootstrapping test environment")
- testEnv = &envtest.Environment{
- CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
- ErrorIfCRDPathMissing: true,
-
- // The BinaryAssetsDirectory is only required if you want to run the tests directly
- // without call the makefile target test. If not informed it will look for the
- // default path defined in controller-runtime which is /usr/local/kubebuilder/.
- // Note that you must have the required binaries setup under the bin directory to perform
- // the tests directly. When we run make test it will be setup and used automatically.
- BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
- }
-
- var err error
- // cfg is defined in this file globally.
- cfg, err = testEnv.Start()
- Expect(err).NotTo(HaveOccurred())
- Expect(cfg).NotTo(BeNil())
-
- err = crewv1.AddToScheme(scheme.Scheme)
- Expect(err).NotTo(HaveOccurred())
-
- //+kubebuilder:scaffold:scheme
-
- k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
- Expect(err).NotTo(HaveOccurred())
- Expect(k8sClient).NotTo(BeNil())
-
-})
-
-var _ = AfterSuite(func() {
- By("tearing down the test environment")
- err := testEnv.Stop()
- Expect(err).NotTo(HaveOccurred())
-})
From 9ba019e66dc11d282ea92b55f1f63dbf6f25568e Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Sun, 27 Aug 2023 11:38:44 +0800
Subject: [PATCH 0269/1245] use logrus to replace fmt.Print
Signed-off-by: lowang-bh
---
cmd/main.go | 6 ++----
hack/docs/generate_samples.go | 8 ++++----
hack/docs/internal/cronjob-tutorial/generate_cronjob.go | 4 ++--
pkg/cli/alpha/generate.go | 2 +-
pkg/plugin/util/exec.go | 5 +++--
pkg/plugins/common/kustomize/v1/scaffolds/api.go | 4 +++-
pkg/plugins/common/kustomize/v1/scaffolds/init.go | 4 ++--
pkg/plugins/common/kustomize/v1/scaffolds/webhook.go | 4 +++-
pkg/plugins/common/kustomize/v2/scaffolds/api.go | 4 +++-
pkg/plugins/common/kustomize/v2/scaffolds/init.go | 4 ++--
pkg/plugins/common/kustomize/v2/scaffolds/webhook.go | 4 +++-
pkg/plugins/golang/declarative/v1/api.go | 4 +++-
pkg/plugins/golang/declarative/v1/init.go | 4 +++-
.../v1/scaffolds/internal/templates/channel.go | 5 +++--
.../v1/scaffolds/internal/templates/controller.go | 5 +++--
.../v1/scaffolds/internal/templates/manifest.go | 5 +++--
.../declarative/v1/scaffolds/internal/templates/types.go | 4 +++-
pkg/plugins/golang/deploy-image/v1alpha1/api.go | 7 ++++---
pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go | 6 +++---
.../v1alpha1/scaffolds/internal/templates/api/types.go | 5 +++--
.../internal/templates/config/samples/crd_sample.go | 5 +++--
.../internal/templates/controllers/controller-test.go | 7 ++++---
.../internal/templates/controllers/controller.go | 7 ++++---
pkg/plugins/golang/v2/init.go | 3 ++-
pkg/plugins/golang/v2/scaffolds/api.go | 3 ++-
pkg/plugins/golang/v2/scaffolds/init.go | 5 ++---
.../golang/v2/scaffolds/internal/templates/api/types.go | 5 +++--
.../golang/v2/scaffolds/internal/templates/api/webhook.go | 5 +++--
.../internal/templates/controllers/controller.go | 5 +++--
pkg/plugins/golang/v2/scaffolds/webhook.go | 3 ++-
pkg/plugins/golang/v3/init.go | 3 ++-
pkg/plugins/golang/v3/scaffolds/api.go | 3 ++-
pkg/plugins/golang/v3/scaffolds/init.go | 8 +++-----
.../golang/v3/scaffolds/internal/templates/api/types.go | 5 +++--
.../golang/v3/scaffolds/internal/templates/api/webhook.go | 5 +++--
.../internal/templates/controllers/controller.go | 5 +++--
pkg/plugins/golang/v3/scaffolds/webhook.go | 3 ++-
pkg/plugins/golang/v4/api.go | 5 +++--
pkg/plugins/golang/v4/init.go | 3 ++-
pkg/plugins/golang/v4/scaffolds/api.go | 3 ++-
pkg/plugins/golang/v4/scaffolds/init.go | 8 +++-----
.../golang/v4/scaffolds/internal/templates/api/group.go | 5 +++--
.../golang/v4/scaffolds/internal/templates/api/types.go | 5 +++--
.../golang/v4/scaffolds/internal/templates/api/webhook.go | 5 +++--
.../scaffolds/internal/templates/api/webhook_suitetest.go | 4 +++-
.../internal/templates/controllers/controller.go | 5 +++--
.../templates/controllers/controller_suitetest.go | 4 +++-
pkg/plugins/golang/v4/scaffolds/webhook.go | 5 +++--
pkg/plugins/optional/grafana/v1alpha/scaffolds/edit.go | 4 +++-
pkg/plugins/optional/grafana/v1alpha/scaffolds/init.go | 4 ++--
pkg/rescaffold/migrate.go | 1 +
test/e2e/utils/test_context.go | 3 ++-
52 files changed, 141 insertions(+), 97 deletions(-)
diff --git a/cmd/main.go b/cmd/main.go
index 7f59bb26161..55621a857a7 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -17,8 +17,6 @@ limitations under the License.
package main
import (
- "log"
-
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/cli"
@@ -88,9 +86,9 @@ func main() {
cli.WithCompletion(),
)
if err != nil {
- log.Fatal(err)
+ logrus.Fatal(err)
}
if err := c.Run(); err != nil {
- log.Fatal(err)
+ logrus.Fatal(err)
}
}
diff --git a/hack/docs/generate_samples.go b/hack/docs/generate_samples.go
index facecea0e68..1f9544120e3 100644
--- a/hack/docs/generate_samples.go
+++ b/hack/docs/generate_samples.go
@@ -17,7 +17,7 @@ limitations under the License.
package main
import (
- "fmt"
+ log "github.com/sirupsen/logrus"
componentconfig "sigs.k8s.io/kubebuilder/v3/hack/docs/internal/component-config-tutorial"
cronjob "sigs.k8s.io/kubebuilder/v3/hack/docs/internal/cronjob-tutorial"
@@ -27,12 +27,12 @@ import (
const KubebuilderBinName = "/tmp/kubebuilder/bin/kubebuilder"
func main() {
- fmt.Println("Generating documents...")
+ log.Println("Generating documents...")
- fmt.Println("Generating component-config tutorial...")
+ log.Println("Generating component-config tutorial...")
UpdateComponentConfigTutorial()
- fmt.Println("Generating cronjob tutorial...")
+ log.Println("Generating cronjob tutorial...")
UpdateCronjobTutorial()
// TODO: Generate multiversion-tutorial
}
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 0149cd317a6..3f38b88e68d 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -17,13 +17,13 @@ limitations under the License.
package cronjob
import (
- "fmt"
"os"
"os/exec"
"path/filepath"
log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
+
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
"sigs.k8s.io/kubebuilder/v3/test/e2e/utils"
)
@@ -97,7 +97,7 @@ func (sp *Sample) GenerateSampleProject() {
}
func (sp *Sample) UpdateTutorial() {
- fmt.Println("TODO: update tutorial")
+ log.Println("TODO: update tutorial")
// 1. update specs
updateSpec(sp)
// 2. update webhook
diff --git a/pkg/cli/alpha/generate.go b/pkg/cli/alpha/generate.go
index 23c346f3216..4f4f292e1dc 100644
--- a/pkg/cli/alpha/generate.go
+++ b/pkg/cli/alpha/generate.go
@@ -14,7 +14,7 @@ limitations under the License.
package alpha
import (
- "log"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"sigs.k8s.io/kubebuilder/v3/pkg/rescaffold"
diff --git a/pkg/plugin/util/exec.go b/pkg/plugin/util/exec.go
index 6e9d7085cfc..806b17faf83 100644
--- a/pkg/plugin/util/exec.go
+++ b/pkg/plugin/util/exec.go
@@ -17,10 +17,11 @@ limitations under the License.
package util
import (
- "fmt"
"os"
"os/exec"
"strings"
+
+ log "github.com/sirupsen/logrus"
)
// RunCmd prints the provided message and command and then executes it binding stdout and stderr
@@ -28,6 +29,6 @@ func RunCmd(msg, cmd string, args ...string) error {
c := exec.Command(cmd, args...) //nolint:gosec
c.Stdout = os.Stdout
c.Stderr = os.Stderr
- fmt.Println(msg + ":\n$ " + strings.Join(c.Args, " "))
+ log.Println(msg + ":\n$ " + strings.Join(c.Args, " "))
return c.Run()
}
diff --git a/pkg/plugins/common/kustomize/v1/scaffolds/api.go b/pkg/plugins/common/kustomize/v1/scaffolds/api.go
index e59d2c92e5a..c3fefbd5c31 100644
--- a/pkg/plugins/common/kustomize/v1/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v1/scaffolds/api.go
@@ -19,6 +19,8 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
@@ -60,7 +62,7 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *apiScaffolder) Scaffold() error {
- fmt.Println("Writing kustomize manifests for you to edit...")
+ log.Println("Writing kustomize manifests for you to edit...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs,
diff --git a/pkg/plugins/common/kustomize/v1/scaffolds/init.go b/pkg/plugins/common/kustomize/v1/scaffolds/init.go
index bfb5e32c6c4..c4c0227fcc5 100644
--- a/pkg/plugins/common/kustomize/v1/scaffolds/init.go
+++ b/pkg/plugins/common/kustomize/v1/scaffolds/init.go
@@ -17,7 +17,7 @@ limitations under the License.
package scaffolds
import (
- "fmt"
+ log "github.com/sirupsen/logrus"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -55,7 +55,7 @@ func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *initScaffolder) Scaffold() error {
- fmt.Println("Writing kustomize manifests for you to edit...")
+ log.Println("Writing kustomize manifests for you to edit...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs,
diff --git a/pkg/plugins/common/kustomize/v1/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v1/scaffolds/webhook.go
index cfe17403518..6e494f194a8 100644
--- a/pkg/plugins/common/kustomize/v1/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v1/scaffolds/webhook.go
@@ -19,6 +19,8 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
@@ -55,7 +57,7 @@ func (s *webhookScaffolder) InjectFS(fs machinery.Filesystem) { s.fs = fs }
// Scaffold implements cmdutil.Scaffolder
func (s *webhookScaffolder) Scaffold() error {
- fmt.Println("Writing kustomize manifests for you to edit...")
+ log.Println("Writing kustomize manifests for you to edit...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs,
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/api.go b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
index 402d9d4b65d..8bafbf9f9d1 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
@@ -19,6 +19,8 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
@@ -60,7 +62,7 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *apiScaffolder) Scaffold() error {
- fmt.Println("Writing kustomize manifests for you to edit...")
+ log.Println("Writing kustomize manifests for you to edit...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs,
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/init.go b/pkg/plugins/common/kustomize/v2/scaffolds/init.go
index d669963c9df..3d5785255a0 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/init.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/init.go
@@ -17,7 +17,7 @@ limitations under the License.
package scaffolds
import (
- "fmt"
+ log "github.com/sirupsen/logrus"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -55,7 +55,7 @@ func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *initScaffolder) Scaffold() error {
- fmt.Println("Writing kustomize manifests for you to edit...")
+ log.Println("Writing kustomize manifests for you to edit...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs,
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
index 422e198fc8d..2dedaa52e22 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
@@ -19,6 +19,8 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
@@ -55,7 +57,7 @@ func (s *webhookScaffolder) InjectFS(fs machinery.Filesystem) { s.fs = fs }
// Scaffold implements cmdutil.Scaffolder
func (s *webhookScaffolder) Scaffold() error {
- fmt.Println("Writing kustomize manifests for you to edit...")
+ log.Println("Writing kustomize manifests for you to edit...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs,
diff --git a/pkg/plugins/golang/declarative/v1/api.go b/pkg/plugins/golang/declarative/v1/api.go
index 998f39eebc9..c3c99eade4d 100644
--- a/pkg/plugins/golang/declarative/v1/api.go
+++ b/pkg/plugins/golang/declarative/v1/api.go
@@ -20,6 +20,8 @@ import (
"errors"
"fmt"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/model/resource"
@@ -92,7 +94,7 @@ func (p *createAPISubcommand) InjectResource(res *resource.Resource) error {
}
func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
- fmt.Println("updating scaffold with declarative pattern...")
+ log.Println("updating scaffold with declarative pattern...")
scaffolder := scaffolds.NewAPIScaffolder(p.config, *p.resource)
scaffolder.InjectFS(fs)
diff --git a/pkg/plugins/golang/declarative/v1/init.go b/pkg/plugins/golang/declarative/v1/init.go
index db15aa1bbac..0dd7e05f6cc 100644
--- a/pkg/plugins/golang/declarative/v1/init.go
+++ b/pkg/plugins/golang/declarative/v1/init.go
@@ -22,6 +22,8 @@ import (
"path/filepath"
"strings"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
@@ -51,7 +53,7 @@ func (p *initSubcommand) Scaffold(_ machinery.Filesystem) error {
// updateDockerfile will add channels staging required for declarative plugin
func updateDockerfile(isLegacyLayout bool) error {
- fmt.Println("updating Dockerfile to add channels/ directory in the image")
+ log.Println("updating Dockerfile to add channels/ directory in the image")
dockerfile := filepath.Join("Dockerfile")
controllerPath := "internal/controller/"
diff --git a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/channel.go b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/channel.go
index 02ff67b6faf..4d5431d8357 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/channel.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/channel.go
@@ -17,9 +17,10 @@ limitations under the License.
package templates
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -37,7 +38,7 @@ func (f *Channel) SetTemplateDefaults() error {
if f.Path == "" {
f.Path = filepath.Join("channels", "stable")
}
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = channelTemplate
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 8687cf7c420..12c60f42984 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/controller.go
@@ -17,9 +17,10 @@ limitations under the License.
package templates
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -56,7 +57,7 @@ func (f *Controller) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.PackageName = "controller"
if f.IsLegacyLayout {
diff --git a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/manifest.go b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/manifest.go
index 6548bd4c77c..d91f779aee5 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/manifest.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/manifest.go
@@ -17,9 +17,10 @@ limitations under the License.
package templates
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -39,7 +40,7 @@ func (f *Manifest) SetTemplateDefaults() error {
f.Path = filepath.Join("channels", "packages", "%[kind]", f.ManifestVersion, "manifest.yaml")
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = manifestTemplate
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 359c3bb0d34..9187c886c4a 100644
--- a/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/types.go
+++ b/pkg/plugins/golang/declarative/v1/scaffolds/internal/templates/types.go
@@ -21,6 +21,8 @@ import (
"path/filepath"
"text/template"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -56,7 +58,7 @@ func (f *Types) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.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 8245d7e7906..923a6813e53 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/api.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/api.go
@@ -22,14 +22,15 @@ import (
"os"
"strings"
- "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
- goPlugin "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"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/plugin/util"
+ goPlugin "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds"
)
@@ -204,7 +205,7 @@ func (p *createAPISubcommand) PreScaffold(machinery.Filesystem) error {
}
func (p *createAPISubcommand) Scaffold(fs machinery.Filesystem) error {
- fmt.Println("updating scaffold with deploy-image/v1alpha1 plugin...")
+ log.Println("updating scaffold with deploy-image/v1alpha1 plugin...")
scaffolder := scaffolds.NewDeployImageScaffolder(p.config,
*p.resource,
diff --git a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
index 6791edcb310..16dbe43f366 100644
--- a/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
+++ b/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go
@@ -21,13 +21,13 @@ import (
"path/filepath"
"strings"
- "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
-
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"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/plugin/util"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
kustomizev1scaffolds "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v1/scaffolds"
@@ -77,7 +77,7 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *apiScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
//nolint: staticcheck
isGoV3 := plugin.IsLegacyLayout(s.config)
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 30779753ebd..e7b73cf7d9f 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
@@ -17,9 +17,10 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -63,7 +64,7 @@ func (f *Types) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = typesTemplate
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 a4344fd2e56..43b324aa8dc 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,9 +14,10 @@ limitations under the License.
package samples
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -37,7 +38,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)
+ log.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 5cd027bd5fe..8ed8601ffd6 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
@@ -17,9 +17,10 @@ limitations under the License.
package controllers
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -56,14 +57,14 @@ func (f *ControllerTest) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.PackageName = "controller"
if f.IsLegacyLayout {
f.PackageName = "controllers"
}
- fmt.Println("creating import for %", f.Resource.Path)
+ log.Println("creating import for %", f.Resource.Path)
f.TemplateBody = controllerTestTemplate
return nil
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 1caaab444ac..5284478c2ba 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
@@ -17,9 +17,10 @@ limitations under the License.
package controllers
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -60,14 +61,14 @@ func (f *Controller) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.PackageName = "controller"
if f.IsLegacyLayout {
f.PackageName = "controllers"
}
- fmt.Println("creating import for %", f.Resource.Path)
+ log.Println("creating import for %", f.Resource.Path)
f.TemplateBody = controllerTemplate
// This one is to overwrite the controller if it exist
diff --git a/pkg/plugins/golang/v2/init.go b/pkg/plugins/golang/v2/init.go
index bafe378c359..7d5f0077113 100644
--- a/pkg/plugins/golang/v2/init.go
+++ b/pkg/plugins/golang/v2/init.go
@@ -23,6 +23,7 @@ import (
"path/filepath"
"strings"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -160,7 +161,7 @@ func (p *initSubcommand) Scaffold(fs machinery.Filesystem) error {
}
if !p.fetchDeps {
- fmt.Println("Skipping fetching dependencies.")
+ log.Println("Skipping fetching dependencies.")
return nil
}
diff --git a/pkg/plugins/golang/v2/scaffolds/api.go b/pkg/plugins/golang/v2/scaffolds/api.go
index 46d7f20fc42..0b190c62791 100644
--- a/pkg/plugins/golang/v2/scaffolds/api.go
+++ b/pkg/plugins/golang/v2/scaffolds/api.go
@@ -19,6 +19,7 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -67,7 +68,7 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *apiScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Load the boilerplate
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
diff --git a/pkg/plugins/golang/v2/scaffolds/init.go b/pkg/plugins/golang/v2/scaffolds/init.go
index e730f9e51a4..eb883d9c79f 100644
--- a/pkg/plugins/golang/v2/scaffolds/init.go
+++ b/pkg/plugins/golang/v2/scaffolds/init.go
@@ -17,8 +17,7 @@ limitations under the License.
package scaffolds
import (
- "fmt"
-
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -80,7 +79,7 @@ func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *initScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Initialize the machinery.Scaffold that will write the boilerplate file to disk
// The boilerplate file needs to be scaffolded as a separate step as it is going to
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/api/types.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/api/types.go
index d80e5f33b93..688751e1f8f 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/api/types.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/api/types.go
@@ -17,9 +17,10 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -46,7 +47,7 @@ func (f *Types) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = typesTemplate
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/api/webhook.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/api/webhook.go
index 5def3986d32..1d653617227 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/api/webhook.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/api/webhook.go
@@ -17,10 +17,11 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
"strings"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -47,7 +48,7 @@ func (f *Webhook) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
webhookTemplate := webhookTemplate
if f.Resource.HasDefaultingWebhook() {
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/controllers/controller.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/controllers/controller.go
index 23569f72593..7c800b50e54 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/controllers/controller.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/controllers/controller.go
@@ -17,9 +17,10 @@ limitations under the License.
package controllers
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -48,7 +49,7 @@ func (f *Controller) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = controllerTemplate
diff --git a/pkg/plugins/golang/v2/scaffolds/webhook.go b/pkg/plugins/golang/v2/scaffolds/webhook.go
index d3cef711cad..3e34cbf0ac0 100644
--- a/pkg/plugins/golang/v2/scaffolds/webhook.go
+++ b/pkg/plugins/golang/v2/scaffolds/webhook.go
@@ -19,6 +19,7 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -55,7 +56,7 @@ func (s *webhookScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *webhookScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Load the boilerplate
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
diff --git a/pkg/plugins/golang/v3/init.go b/pkg/plugins/golang/v3/init.go
index 6216b11bae0..6264118f744 100644
--- a/pkg/plugins/golang/v3/init.go
+++ b/pkg/plugins/golang/v3/init.go
@@ -24,6 +24,7 @@ import (
"strings"
"unicode"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -130,7 +131,7 @@ func (p *initSubcommand) Scaffold(fs machinery.Filesystem) error {
}
if !p.fetchDeps {
- fmt.Println("Skipping fetching dependencies.")
+ log.Println("Skipping fetching dependencies.")
return nil
}
diff --git a/pkg/plugins/golang/v3/scaffolds/api.go b/pkg/plugins/golang/v3/scaffolds/api.go
index fe9ad41da08..bccb6e84350 100644
--- a/pkg/plugins/golang/v3/scaffolds/api.go
+++ b/pkg/plugins/golang/v3/scaffolds/api.go
@@ -19,6 +19,7 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -62,7 +63,7 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *apiScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Load the boilerplate
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
diff --git a/pkg/plugins/golang/v3/scaffolds/init.go b/pkg/plugins/golang/v3/scaffolds/init.go
index 5e798149752..ffba15e9216 100644
--- a/pkg/plugins/golang/v3/scaffolds/init.go
+++ b/pkg/plugins/golang/v3/scaffolds/init.go
@@ -17,14 +17,12 @@ limitations under the License.
package scaffolds
import (
- "fmt"
-
- "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
-
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
kustomizecommonv1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v1"
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
@@ -72,7 +70,7 @@ func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *initScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Initialize the machinery.Scaffold that will write the boilerplate file to disk
// The boilerplate file needs to be scaffolded as a separate step as it is going to
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/api/types.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/api/types.go
index a76e3cb1391..03241a6610e 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/api/types.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/api/types.go
@@ -17,9 +17,10 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -50,7 +51,7 @@ func (f *Types) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = typesTemplate
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/api/webhook.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/api/webhook.go
index b441e908085..a019844c25c 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/api/webhook.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/api/webhook.go
@@ -17,10 +17,11 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
"strings"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -56,7 +57,7 @@ func (f *Webhook) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
webhookTemplate := webhookTemplate
if f.Resource.HasDefaultingWebhook() {
diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/controllers/controller.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/controllers/controller.go
index f575c03fea2..e2dd50ddc34 100644
--- a/pkg/plugins/golang/v3/scaffolds/internal/templates/controllers/controller.go
+++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/controllers/controller.go
@@ -17,9 +17,10 @@ limitations under the License.
package controllers
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -48,7 +49,7 @@ func (f *Controller) SetTemplateDefaults() error {
}
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = controllerTemplate
diff --git a/pkg/plugins/golang/v3/scaffolds/webhook.go b/pkg/plugins/golang/v3/scaffolds/webhook.go
index 5ca51c39844..b77aefadbcc 100644
--- a/pkg/plugins/golang/v3/scaffolds/webhook.go
+++ b/pkg/plugins/golang/v3/scaffolds/webhook.go
@@ -19,6 +19,7 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -59,7 +60,7 @@ func (s *webhookScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *webhookScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Load the boilerplate
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
diff --git a/pkg/plugins/golang/v4/api.go b/pkg/plugins/golang/v4/api.go
index 6e07ff7390f..6b54f060532 100644
--- a/pkg/plugins/golang/v4/api.go
+++ b/pkg/plugins/golang/v4/api.go
@@ -22,6 +22,7 @@ import (
"fmt"
"os"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -129,11 +130,11 @@ func (p *createAPISubcommand) InjectResource(res *resource.Resource) error {
// Ask for API and Controller if not specified
reader := bufio.NewReader(os.Stdin)
if !p.resourceFlag.Changed {
- fmt.Println("Create Resource [y/n]")
+ log.Println("Create Resource [y/n]")
p.options.DoAPI = util.YesNo(reader)
}
if !p.controllerFlag.Changed {
- fmt.Println("Create Controller [y/n]")
+ log.Println("Create Controller [y/n]")
p.options.DoController = util.YesNo(reader)
}
diff --git a/pkg/plugins/golang/v4/init.go b/pkg/plugins/golang/v4/init.go
index fb94b18e07b..564ffdc5288 100644
--- a/pkg/plugins/golang/v4/init.go
+++ b/pkg/plugins/golang/v4/init.go
@@ -23,6 +23,7 @@ import (
"strings"
"unicode"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -129,7 +130,7 @@ func (p *initSubcommand) Scaffold(fs machinery.Filesystem) error {
}
if !p.fetchDeps {
- fmt.Println("Skipping fetching dependencies.")
+ log.Println("Skipping fetching dependencies.")
return nil
}
diff --git a/pkg/plugins/golang/v4/scaffolds/api.go b/pkg/plugins/golang/v4/scaffolds/api.go
index 5f1e9d67b57..a2de5f578b1 100755
--- a/pkg/plugins/golang/v4/scaffolds/api.go
+++ b/pkg/plugins/golang/v4/scaffolds/api.go
@@ -20,6 +20,7 @@ import (
"errors"
"fmt"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -63,7 +64,7 @@ func (s *apiScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *apiScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Load the boilerplate
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index a20488034eb..9a2d46a2f1d 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -17,14 +17,12 @@ limitations under the License.
package scaffolds
import (
- "fmt"
-
- "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
-
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugin"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
kustomizecommonv1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v1"
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
@@ -74,7 +72,7 @@ func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *initScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Initialize the machinery.Scaffold that will write the boilerplate file to disk
// The boilerplate file needs to be scaffolded as a separate step as it is going to
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 15c8a67a7c6..4e692b70551 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/group.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/group.go
@@ -17,9 +17,10 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -44,7 +45,7 @@ func (f *Group) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = groupTemplate
return nil
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 3a27bf88d00..55961e2b53c 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go
@@ -17,9 +17,10 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -47,7 +48,7 @@ func (f *Types) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = typesTemplate
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 f55f039fa82..bde82f8f5c6 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
@@ -17,10 +17,11 @@ limitations under the License.
package api
import (
- "fmt"
"path/filepath"
"strings"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -53,7 +54,7 @@ func (f *Webhook) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
webhookTemplate := webhookTemplate
if f.Resource.HasDefaultingWebhook() {
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 45ecb9011a2..607adf487b8 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
@@ -20,6 +20,8 @@ import (
"fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -55,7 +57,7 @@ func (f *WebhookSuite) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = fmt.Sprintf(webhookTestSuiteTemplate,
machinery.NewMarkerFor(f.Path, importMarker),
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 fb4388f372b..3842da93b6d 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller.go
@@ -17,9 +17,10 @@ limitations under the License.
package controllers
import (
- "fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -49,7 +50,7 @@ func (f *Controller) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = controllerTemplate
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 9315ff334c8..bffe718186f 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
@@ -20,6 +20,8 @@ import (
"fmt"
"path/filepath"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
)
@@ -55,7 +57,7 @@ func (f *SuiteTest) SetTemplateDefaults() error {
}
f.Path = f.Resource.Replacer().Replace(f.Path)
- fmt.Println(f.Path)
+ log.Println(f.Path)
f.TemplateBody = fmt.Sprintf(controllerSuiteTestTemplate,
machinery.NewMarkerFor(f.Path, importMarker),
diff --git a/pkg/plugins/golang/v4/scaffolds/webhook.go b/pkg/plugins/golang/v4/scaffolds/webhook.go
index 512ebef8174..40c66e54440 100644
--- a/pkg/plugins/golang/v4/scaffolds/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/webhook.go
@@ -19,6 +19,7 @@ package scaffolds
import (
"fmt"
+ log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
@@ -59,7 +60,7 @@ func (s *webhookScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *webhookScaffolder) Scaffold() error {
- fmt.Println("Writing scaffold for you to edit...")
+ log.Println("Writing scaffold for you to edit...")
// Load the boilerplate
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
@@ -91,7 +92,7 @@ func (s *webhookScaffolder) Scaffold() error {
}
if doConversion {
- fmt.Println(`Webhook server has been set up for you.
+ log.Println(`Webhook server has been set up for you.
You need to implement the conversion.Hub and conversion.Convertible interfaces for your CRD types.`)
}
diff --git a/pkg/plugins/optional/grafana/v1alpha/scaffolds/edit.go b/pkg/plugins/optional/grafana/v1alpha/scaffolds/edit.go
index 6cf8edf7d8b..0773fa1e037 100644
--- a/pkg/plugins/optional/grafana/v1alpha/scaffolds/edit.go
+++ b/pkg/plugins/optional/grafana/v1alpha/scaffolds/edit.go
@@ -22,6 +22,8 @@ import (
"os"
"strings"
+ log "github.com/sirupsen/logrus"
+
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates"
@@ -160,7 +162,7 @@ func fillMissingUnit(item templates.CustomMetricItem) templates.CustomMetricItem
// Scaffold implements cmdutil.Scaffolder
func (s *editScaffolder) Scaffold() error {
- fmt.Println("Generating Grafana manifests to visualize controller status...")
+ log.Println("Generating Grafana manifests to visualize controller status...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs)
diff --git a/pkg/plugins/optional/grafana/v1alpha/scaffolds/init.go b/pkg/plugins/optional/grafana/v1alpha/scaffolds/init.go
index 74eb15c1c9b..07eeacea949 100644
--- a/pkg/plugins/optional/grafana/v1alpha/scaffolds/init.go
+++ b/pkg/plugins/optional/grafana/v1alpha/scaffolds/init.go
@@ -17,7 +17,7 @@ limitations under the License.
package scaffolds
import (
- "fmt"
+ log "github.com/sirupsen/logrus"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins"
@@ -43,7 +43,7 @@ func (s *initScaffolder) InjectFS(fs machinery.Filesystem) {
// Scaffold implements cmdutil.Scaffolder
func (s *initScaffolder) Scaffold() error {
- fmt.Println("Generating Grafana manifests to visualize controller status...")
+ log.Println("Generating Grafana manifests to visualize controller status...")
// Initialize the machinery.Scaffold that will write the files to disk
scaffold := machinery.NewScaffold(s.fs)
diff --git a/pkg/rescaffold/migrate.go b/pkg/rescaffold/migrate.go
index 5765c96691f..af2c4eaa673 100644
--- a/pkg/rescaffold/migrate.go
+++ b/pkg/rescaffold/migrate.go
@@ -21,6 +21,7 @@ import (
"strings"
log "github.com/sirupsen/logrus"
+
"github.com/spf13/afero"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/config/store"
diff --git a/test/e2e/utils/test_context.go b/test/e2e/utils/test_context.go
index 6ee508eb74c..1ae91489783 100644
--- a/test/e2e/utils/test_context.go
+++ b/test/e2e/utils/test_context.go
@@ -24,6 +24,7 @@ import (
"path/filepath"
"strings"
+ log "github.com/sirupsen/logrus"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
@@ -245,7 +246,7 @@ func (t *TestContext) Destroy() {
if t.ImageName != "" {
// Check white space from image name
if len(strings.TrimSpace(t.ImageName)) == 0 {
- fmt.Println("Image not set, skip cleaning up of docker image")
+ log.Println("Image not set, skip cleaning up of docker image")
} else {
cmd := exec.Command("docker", "rmi", "-f", t.ImageName)
if _, err := t.Run(cmd); err != nil {
From 30be71cc76013e2a55cd694d0c0639d286d6432d Mon Sep 17 00:00:00 2001
From: Ashutosh Jha
Date: Thu, 31 Aug 2023 23:02:28 +0530
Subject: [PATCH 0270/1245] feat: fix docs
---
docs/book/src/component-config-tutorial/tutorial.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/book/src/component-config-tutorial/tutorial.md b/docs/book/src/component-config-tutorial/tutorial.md
index 16ab2749675..4482f686bb2 100644
--- a/docs/book/src/component-config-tutorial/tutorial.md
+++ b/docs/book/src/component-config-tutorial/tutorial.md
@@ -10,6 +10,8 @@ no longer guaranteeing its functionality from version 3.11.0 onwards. You can fi
Please, be aware that it will force Kubebuilder remove this option soon in future release.
+Instead of relying on ComponentConfig, you can now directly utilize `manager.Options` to achieve similar configuration capabilities.
+
Nearly every project that is built for Kubernetes will eventually need to
From c399f0c383a764d0cb10e96e9264db9ab788b301 Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Fri, 1 Sep 2023 12:08:20 +0100
Subject: [PATCH 0271/1245] =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20:=20upgrade=20k8?=
=?UTF-8?q?s=201.27.1=20to=201.28.0=20and=20controller-runtime=20from=200.?=
=?UTF-8?q?15.0=20to=200.16.0=20(#3570)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
:warning: upgrade k8s 1.27 to 1.28 and controller-runtime from 0.15 to 0.16
---
.../testdata/project/Makefile | 2 +-
.../testdata/project/go.mod | 48 ++--
.../testdata/project/go.sum | 205 ++++++++---------
.../testdata/project/Makefile | 2 +-
.../project/api/v1/webhook_suite_test.go | 18 +-
.../testdata/project/cmd/main.go | 4 +-
...atch.tutorial.kubebuilder.io_cronjobs.yaml | 210 +++++++++++------
.../cronjob-tutorial/testdata/project/go.mod | 54 ++---
.../cronjob-tutorial/testdata/project/go.sum | 211 ++++++++----------
.../internal/controller/cronjob_controller.go | 2 +-
.../project/internal/controller/suite_test.go | 2 +-
pkg/plugins/golang/v4/scaffolds/init.go | 4 +-
.../templates/api/webhook_suitetest.go | 12 +-
.../v4/scaffolds/internal/templates/main.go | 4 +-
.../scaffolds/internal/templates/makefile.go | 2 +-
test/common.sh | 3 +-
testdata/project-v4-multigroup/Makefile | 2 +-
.../api/crew/v1/webhook_suite_test.go | 18 +-
.../v1alpha1/webhook_suite_test.go | 18 +-
.../api/ship/v1/webhook_suite_test.go | 18 +-
.../api/ship/v2alpha1/webhook_suite_test.go | 18 +-
.../api/v1/webhook_suite_test.go | 18 +-
testdata/project-v4-multigroup/cmd/main.go | 4 +-
testdata/project-v4-multigroup/go.mod | 54 ++---
.../controller/apps/deployment_controller.go | 2 +-
.../internal/controller/apps/suite_test.go | 2 +-
.../controller/crew/captain_controller.go | 2 +-
.../internal/controller/crew/suite_test.go | 2 +-
.../example.com/busybox_controller.go | 2 +-
.../example.com/memcached_controller.go | 2 +-
.../controller/example.com/suite_test.go | 2 +-
.../internal/controller/fiz/bar_controller.go | 2 +-
.../internal/controller/fiz/suite_test.go | 2 +-
.../healthcheckpolicy_controller.go | 2 +-
.../controller/foo.policy/suite_test.go | 2 +-
.../internal/controller/foo/bar_controller.go | 2 +-
.../internal/controller/foo/suite_test.go | 2 +-
.../internal/controller/lakers_controller.go | 2 +-
.../sea-creatures/kraken_controller.go | 2 +-
.../sea-creatures/leviathan_controller.go | 2 +-
.../controller/sea-creatures/suite_test.go | 2 +-
.../controller/ship/cruiser_controller.go | 2 +-
.../controller/ship/destroyer_controller.go | 2 +-
.../controller/ship/frigate_controller.go | 2 +-
.../internal/controller/ship/suite_test.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
.../project-v4-with-deploy-image/Makefile | 2 +-
.../api/v1alpha1/webhook_suite_test.go | 18 +-
.../project-v4-with-deploy-image/cmd/main.go | 4 +-
testdata/project-v4-with-deploy-image/go.mod | 54 ++---
.../internal/controller/busybox_controller.go | 2 +-
.../controller/memcached_controller.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
testdata/project-v4-with-grafana/Makefile | 2 +-
testdata/project-v4-with-grafana/cmd/main.go | 4 +-
testdata/project-v4-with-grafana/go.mod | 48 ++--
testdata/project-v4/Makefile | 2 +-
.../project-v4/api/v1/webhook_suite_test.go | 18 +-
testdata/project-v4/cmd/main.go | 4 +-
testdata/project-v4/go.mod | 54 ++---
.../internal/controller/admiral_controller.go | 2 +-
.../internal/controller/captain_controller.go | 2 +-
.../controller/firstmate_controller.go | 2 +-
.../internal/controller/laker_controller.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
65 files changed, 641 insertions(+), 562 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index fca59190d10..fa6be8303dc 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.27.1
+ENVTEST_K8S_VERSION = 1.28.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/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod
index f7378473622..c0adde9aa99 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.mod
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod
@@ -3,9 +3,9 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
+ k8s.io/apimachinery v0.28.0
+ k8s.io/client-go v0.28.0
+ sigs.k8s.io/controller-runtime v0.16.0
)
require (
@@ -18,14 +18,14 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // 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.3 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -36,32 +36,32 @@ require (
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.15.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.42.0 // indirect
- github.com/prometheus/procfs v0.9.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.24.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.5.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.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.27.2 // indirect
- k8s.io/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.90.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ k8s.io/api v0.28.0 // indirect
+ k8s.io/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum
index 47fc076f513..a3295731972 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.sum
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum
@@ -1,75 +1,68 @@
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
+github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
+github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18=
+github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
+github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
+github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
+github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
+github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
+github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
-github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8=
-github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
+github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
+github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
-github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/cel-go v0.16.0 h1:DG9YQ8nFCFXAs/FDDwBxmL1tpKNrdlGUM9U3537bX/Y=
+github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
+github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
-github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
+github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
+github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
@@ -78,7 +71,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -96,61 +88,70 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
-github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
+github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
+github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
-github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
+github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
-github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
-github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
-github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
-github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
+github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
+github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
+github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
+github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
+github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.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/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/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
+go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
+go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
+go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 h1:sxoY9kG1s1WpSYNyzm24rlwH4lnRYFXUVVBmKMBfRgw=
+go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
+go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
+go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
+go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
+go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
-go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
-go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
+go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
+go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
+golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
+golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
@@ -158,19 +159,16 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
-golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
-golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY=
+golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
+golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
+golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -178,92 +176,75 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
-golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
-golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
+golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.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.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
-golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
+golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
+golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
-gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
+gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M=
+google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM=
+google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo=
-k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4=
-k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo=
-k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ=
-k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg=
-k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
-k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE=
-k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ=
-k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo=
-k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo=
-k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
-k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
-k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
-k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
-k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
-sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
+k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM=
+k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY=
+k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E=
+k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE=
+k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA=
+k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
+k8s.io/apiserver v0.28.0 h1:wVh7bK6Xj7hq+5ntInysTeQRAOqqFoKGUOW2yj8DXrY=
+k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM=
+k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc=
+k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI=
+k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk=
+k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
+k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/kms v0.28.0 h1:BwJhU9qPcJhHLUcQjtelOSjYti+1/caJLr+4jHbKzTA=
+k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
+k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
+k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
+k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA=
+sigs.k8s.io/controller-runtime v0.16.0 h1:5koYaaRVBHDr0LZAJjO5dWzUjMsh6cwa7q1Mmusrdvk=
+sigs.k8s.io/controller-runtime v0.16.0/go.mod h1:77DnuwA8+J7AO0njzv3wbNlMOnGuLrwFr8JPNwx3J7g=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index fca59190d10..fa6be8303dc 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-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.27.1
+ENVTEST_K8S_VERSION = 1.28.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/project/api/v1/webhook_suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
index c9e327b5c17..eba3577726c 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go b/docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go
index f0b8bdb00bd..8f5d1efbdb9 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/cmd/main.go
@@ -31,6 +31,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
batchv1 "tutorial.kubebuilder.io/project/api/v1"
"tutorial.kubebuilder.io/project/internal/controller"
@@ -86,8 +87,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "80807133.tutorial.kubebuilder.io",
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
index dedfc49ecdc..ce6bc308fc7 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
@@ -77,6 +77,17 @@ spec:
this job failed. Defaults to 6
format: int32
type: integer
+ backoffLimitPerIndex:
+ description: Specifies the limit for the number of retries
+ within an index before marking this index as failed. When
+ enabled the number of failures per index is kept in the
+ pod's batch.kubernetes.io/job-index-failure-count annotation.
+ It can only be set when Job's completionMode=Indexed, and
+ the Pod's restart policy is Never. The field is immutable.
+ This field is alpha-level. It can be used when the `JobBackoffLimitPerIndex`
+ feature gate is enabled (disabled by default).
+ format: int32
+ type: integer
completionMode:
description: "completionMode specifies how Pod completions
are tracked. It can be `NonIndexed` (default) or `Indexed`.
@@ -118,6 +129,21 @@ spec:
in jobs that were created with the old `extensions/v1beta1`
API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector'
type: boolean
+ maxFailedIndexes:
+ description: Specifies the maximal number of failed indexes
+ before marking the Job as failed, when backoffLimitPerIndex
+ is set. Once the number of failed indexes exceeds this number
+ the entire Job is marked as Failed and its execution is
+ terminated. When left as null the job continues execution
+ of all of its indexes and is marked with the `Complete`
+ Job condition. It can only be specified when backoffLimitPerIndex
+ is set. It can be null or up to completions. It is required
+ and must be less than or equal to 10^4 when is completions
+ greater than 10^5. This field is alpha-level. It can be
+ used when the `JobBackoffLimitPerIndex` feature gate is
+ enabled (disabled by default).
+ format: int32
+ type: integer
parallelism:
description: 'Specifies the maximum desired number of pods
the job should run at any given time. The actual number
@@ -157,14 +183,18 @@ spec:
failure when the requirements are satisfied. Possible
values are: \n - FailJob: indicates that the pod's
job is marked as Failed and all running pods are
- terminated. - Ignore: indicates that the counter
- towards the .backoffLimit is not incremented and
- a replacement pod is created. - Count: indicates
- that the pod is handled in the default way - the
- counter towards the .backoffLimit is incremented.
- Additional values are considered to be added in
- the future. Clients should react to an unknown
- action by skipping the rule."
+ terminated. - FailIndex: indicates that the pod's
+ index is marked as Failed and will not be restarted.
+ This value is alpha-level. It can be used when
+ the `JobBackoffLimitPerIndex` feature gate is
+ enabled (disabled by default). - Ignore: indicates
+ that the counter towards the .backoffLimit is
+ not incremented and a replacement pod is created.
+ - Count: indicates that the pod is handled in
+ the default way - the counter towards the .backoffLimit
+ is incremented. Additional values are considered
+ to be added in the future. Clients should react
+ to an unknown action by skipping the rule."
type: string
onExitCodes:
description: Represents the requirement on the container
@@ -254,6 +284,19 @@ spec:
required:
- rules
type: object
+ podReplacementPolicy:
+ description: "podReplacementPolicy specifies when to create
+ replacement Pods. Possible values are: - TerminatingOrFailed
+ means that we recreate pods when they are terminating (has
+ a metadata.deletionTimestamp) or failed. - Failed means
+ to wait until a previously created Pod is fully terminated
+ (has phase Failed or Succeeded) before creating a replacement
+ Pod. \n When using podFailurePolicy, Failed is the the only
+ allowed value. TerminatingOrFailed and Failed are allowed
+ values when podFailurePolicy is not in use. This is an alpha
+ field. Enable JobPodReplacementPolicy to be able to use
+ this field."
+ type: string
selector:
description: 'A label query over pods that should match the
pod count. Normally, the system sets this field for you.
@@ -2345,6 +2388,31 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
+ restartPolicy:
+ description: 'RestartPolicy defines the restart
+ behavior of individual containers in a pod.
+ This field may only be set for init containers,
+ and the only allowed value is "Always". For
+ non-init containers or when this field is
+ not specified, the restart behavior is defined
+ by the Pod''s restart policy and the container
+ type. Setting the RestartPolicy as "Always"
+ for the init container will have the following
+ effect: this init container will be continually
+ restarted on exit until all regular containers
+ have terminated. Once all regular containers
+ have completed, all init containers with restartPolicy
+ "Always" will be shut down. This lifecycle
+ differs from normal init containers and is
+ often referred to as a "sidecar" container.
+ Although this init container still starts
+ in the init container sequence, it does not
+ wait for the container to complete before
+ proceeding to the next init container. Instead,
+ the next init container starts immediately
+ after this init container is started, or after
+ any startupProbe has successfully completed.'
+ type: string
securityContext:
description: 'SecurityContext defines the security
options the container should be run with.
@@ -2487,8 +2555,9 @@ spec:
be preconfigured on the node to work.
Must be a descending path, relative
to the kubelet's configured seccomp
- profile location. Must only be set
- if type is "Localhost".
+ profile location. Must be set if type
+ is "Localhost". Must NOT be set for
+ any other type.
type: string
type:
description: "type indicates which kind
@@ -2528,18 +2597,14 @@ spec:
hostProcess:
description: HostProcess determines
if a container should be run as a
- 'Host Process' container. This field
- is alpha-level and will only be honored
- by components that enable the WindowsHostProcessContainers
- feature flag. Setting this field without
- the feature flag will result in errors
- when validating the Pod. All of a
+ 'Host Process' container. All of a
Pod's containers must have the same
effective HostProcess value (it is
not allowed to have a mix of HostProcess
- containers and non-HostProcess containers). In
- addition, if HostProcess is true then
- HostNetwork must also be set to true.
+ containers and non-HostProcess containers).
+ In addition, if HostProcess is true
+ then HostNetwork must also be set
+ to true.
type: boolean
runAsUserName:
description: The UserName in Windows
@@ -3888,6 +3953,13 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
+ restartPolicy:
+ description: Restart policy for the container
+ to manage the restart behavior of each container
+ within a pod. This may only be set for init
+ containers. You cannot set this field on ephemeral
+ containers.
+ type: string
securityContext:
description: 'Optional: SecurityContext defines
the security options the ephemeral container
@@ -4030,8 +4102,9 @@ spec:
be preconfigured on the node to work.
Must be a descending path, relative
to the kubelet's configured seccomp
- profile location. Must only be set
- if type is "Localhost".
+ profile location. Must be set if type
+ is "Localhost". Must NOT be set for
+ any other type.
type: string
type:
description: "type indicates which kind
@@ -4071,18 +4144,14 @@ spec:
hostProcess:
description: HostProcess determines
if a container should be run as a
- 'Host Process' container. This field
- is alpha-level and will only be honored
- by components that enable the WindowsHostProcessContainers
- feature flag. Setting this field without
- the feature flag will result in errors
- when validating the Pod. All of a
+ 'Host Process' container. All of a
Pod's containers must have the same
effective HostProcess value (it is
not allowed to have a mix of HostProcess
- containers and non-HostProcess containers). In
- addition, if HostProcess is true then
- HostNetwork must also be set to true.
+ containers and non-HostProcess containers).
+ In addition, if HostProcess is true
+ then HostNetwork must also be set
+ to true.
type: boolean
runAsUserName:
description: The UserName in Windows
@@ -5472,6 +5541,31 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
type: object
type: object
+ restartPolicy:
+ description: 'RestartPolicy defines the restart
+ behavior of individual containers in a pod.
+ This field may only be set for init containers,
+ and the only allowed value is "Always". For
+ non-init containers or when this field is
+ not specified, the restart behavior is defined
+ by the Pod''s restart policy and the container
+ type. Setting the RestartPolicy as "Always"
+ for the init container will have the following
+ effect: this init container will be continually
+ restarted on exit until all regular containers
+ have terminated. Once all regular containers
+ have completed, all init containers with restartPolicy
+ "Always" will be shut down. This lifecycle
+ differs from normal init containers and is
+ often referred to as a "sidecar" container.
+ Although this init container still starts
+ in the init container sequence, it does not
+ wait for the container to complete before
+ proceeding to the next init container. Instead,
+ the next init container starts immediately
+ after this init container is started, or after
+ any startupProbe has successfully completed.'
+ type: string
securityContext:
description: 'SecurityContext defines the security
options the container should be run with.
@@ -5614,8 +5708,9 @@ spec:
be preconfigured on the node to work.
Must be a descending path, relative
to the kubelet's configured seccomp
- profile location. Must only be set
- if type is "Localhost".
+ profile location. Must be set if type
+ is "Localhost". Must NOT be set for
+ any other type.
type: string
type:
description: "type indicates which kind
@@ -5655,18 +5750,14 @@ spec:
hostProcess:
description: HostProcess determines
if a container should be run as a
- 'Host Process' container. This field
- is alpha-level and will only be honored
- by components that enable the WindowsHostProcessContainers
- feature flag. Setting this field without
- the feature flag will result in errors
- when validating the Pod. All of a
+ 'Host Process' container. All of a
Pod's containers must have the same
effective HostProcess value (it is
not allowed to have a mix of HostProcess
- containers and non-HostProcess containers). In
- addition, if HostProcess is true then
- HostNetwork must also be set to true.
+ containers and non-HostProcess containers).
+ In addition, if HostProcess is true
+ then HostNetwork must also be set
+ to true.
type: boolean
runAsUserName:
description: The UserName in Windows
@@ -6142,17 +6233,10 @@ spec:
a new ResourceClaim, which will be bound
to this pod. When this pod is deleted,
the ResourceClaim will also be deleted.
- The name of the ResourceClaim will be
- -, where is the PodResourceClaim.Name. Pod
- validation will reject the pod if the
- concatenated name is not valid for a ResourceClaim
- (e.g. too long). \n An existing ResourceClaim
- with that name that is not owned by the
- pod will not be used for the pod to avoid
- using an unrelated resource by mistake.
- Scheduling and pod startup are then blocked
- until the unrelated ResourceClaim is removed.
+ The pod name and resource name, along
+ with a generated component, will be used
+ to form a unique name for the ResourceClaim,
+ which will be recorded in pod.status.resourceClaimStatuses.
\n This field is immutable and no changes
will be made to the corresponding ResourceClaim
by the control plane after creating the
@@ -6314,8 +6398,9 @@ spec:
be used. The profile must be preconfigured
on the node to work. Must be a descending
path, relative to the kubelet's configured
- seccomp profile location. Must only be set
- if type is "Localhost".
+ seccomp profile location. Must be set if
+ type is "Localhost". Must NOT be set for
+ any other type.
type: string
type:
description: "type indicates which kind of
@@ -6390,17 +6475,12 @@ spec:
hostProcess:
description: HostProcess determines if a container
should be run as a 'Host Process' container.
- This field is alpha-level and will only
- be honored by components that enable the
- WindowsHostProcessContainers feature flag.
- Setting this field without the feature flag
- will result in errors when validating the
- Pod. All of a Pod's containers must have
- the same effective HostProcess value (it
- is not allowed to have a mix of HostProcess
- containers and non-HostProcess containers). In
- addition, if HostProcess is true then HostNetwork
- must also be set to true.
+ All of a Pod's containers must have the
+ same effective HostProcess value (it is
+ not allowed to have a mix of HostProcess
+ containers and non-HostProcess containers).
+ In addition, if HostProcess is true then
+ HostNetwork must also be set to true.
type: boolean
runAsUserName:
description: The UserName in Windows to run
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
index 23e8d42dbf9..a774b8871dc 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
@@ -3,13 +3,13 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.9.5
- github.com/onsi/gomega v1.27.7
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
github.com/robfig/cron v1.2.0
- k8s.io/api v0.27.2
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
+ k8s.io/api v0.28.0
+ k8s.io/apimachinery v0.28.0
+ k8s.io/client-go v0.28.0
+ sigs.k8s.io/controller-runtime v0.16.0
)
require (
@@ -22,15 +22,15 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
@@ -42,32 +42,32 @@ require (
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.15.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.42.0 // indirect
- github.com/prometheus/procfs v0.9.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.24.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.5.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
- golang.org/x/tools v0.9.1 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.90.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ k8s.io/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index 2f447cdbd84..18c71f39989 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -1,81 +1,74 @@
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
+github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
+github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18=
+github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
+github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
+github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
+github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
-github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
+github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
+github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
-github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8=
-github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
+github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
+github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
-github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/cel-go v0.16.0 h1:DG9YQ8nFCFXAs/FDDwBxmL1tpKNrdlGUM9U3537bX/Y=
+github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
+github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
-github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
+github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
+github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
@@ -84,7 +77,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -102,67 +94,76 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
-github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
-github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
-github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU=
-github.com/onsi/gomega v1.27.7/go.mod h1:1p8OOlwo2iUUDsHnOrjE5UKYJ+e3W8eQ3qSlRahPmr4=
+github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
+github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
+github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
+github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI=
-github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
+github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY=
github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
-github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
-github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
-github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
-github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
+github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
+github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
+github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
+github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
+github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.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/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
+go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
+go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
+go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 h1:sxoY9kG1s1WpSYNyzm24rlwH4lnRYFXUVVBmKMBfRgw=
+go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
+go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
+go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
+go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
+go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
-go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
-go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
+go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c=
+go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
+golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
+golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
@@ -170,19 +171,16 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
-golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
-golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY=
+golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
+golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
+golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -191,93 +189,76 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
-golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
-golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
+golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
+golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.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.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
-golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
+golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
-golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
+golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
+golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc=
-gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
+gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M=
+google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM=
+google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-k8s.io/api v0.27.2 h1:+H17AJpUMvl+clT+BPnKf0E3ksMAzoBBg7CntpSuADo=
-k8s.io/api v0.27.2/go.mod h1:ENmbocXfBT2ADujUXcBhHV55RIT31IIEvkntP6vZKS4=
-k8s.io/apiextensions-apiserver v0.27.2 h1:iwhyoeS4xj9Y7v8YExhUwbVuBhMr3Q4bd/laClBV6Bo=
-k8s.io/apiextensions-apiserver v0.27.2/go.mod h1:Oz9UdvGguL3ULgRdY9QMUzL2RZImotgxvGjdWRq6ZXQ=
-k8s.io/apimachinery v0.27.2 h1:vBjGaKKieaIreI+oQwELalVG4d8f3YAMNpWLzDXkxeg=
-k8s.io/apimachinery v0.27.2/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E=
-k8s.io/client-go v0.27.2 h1:vDLSeuYvCHKeoQRhCXjxXO45nHVv2Ip4Fe0MfioMrhE=
-k8s.io/client-go v0.27.2/go.mod h1:tY0gVmUsHrAmjzHX9zs7eCjxcBsf8IiNe7KQ52biTcQ=
-k8s.io/component-base v0.27.2 h1:neju+7s/r5O4x4/txeUONNTS9r1HsPbyoPBAtHsDCpo=
-k8s.io/component-base v0.27.2/go.mod h1:5UPk7EjfgrfgRIuDBFtsEFAe4DAvP3U+M8RTzoSJkpo=
-k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
-k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
-k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
-k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
-k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU=
-sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
+k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM=
+k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY=
+k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E=
+k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE=
+k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA=
+k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
+k8s.io/apiserver v0.28.0 h1:wVh7bK6Xj7hq+5ntInysTeQRAOqqFoKGUOW2yj8DXrY=
+k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM=
+k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc=
+k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI=
+k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk=
+k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
+k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/kms v0.28.0 h1:BwJhU9qPcJhHLUcQjtelOSjYti+1/caJLr+4jHbKzTA=
+k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
+k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
+k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
+k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA=
+sigs.k8s.io/controller-runtime v0.16.0 h1:5koYaaRVBHDr0LZAJjO5dWzUjMsh6cwa7q1Mmusrdvk=
+sigs.k8s.io/controller-runtime v0.16.0/go.mod h1:77DnuwA8+J7AO0njzv3wbNlMOnGuLrwFr8JPNwx3J7g=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
index 05c436784d0..6b9b776453f 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
@@ -95,7 +95,7 @@ var (
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
index a9267ddd5ef..b12efd124d0 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
@@ -90,7 +90,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
/*
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index 9a2d46a2f1d..fbd8032dff5 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -32,11 +32,11 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.15.0"
+ ControllerRuntimeVersion = "v0.16.0"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.13.0"
// EnvtestK8SVersion is the k8s version used to do the scaffold
- EnvtestK8SVersion = "1.27.1"
+ EnvtestK8SVersion = "1.28.0"
imageName = "controller:latest"
)
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 607adf487b8..ea9af73c683 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
@@ -158,6 +158,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -221,11 +222,14 @@ var _ = BeforeSuite(func() {
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
LeaderElection: false,
- MetricsBindAddress: "0",
+ Metrics: metricsserver.Options{BindAddress: "0"},
+
})
Expect(err).NotTo(HaveOccurred())
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
index f95541d69de..61d49d76c58 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
@@ -198,6 +198,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/healthz"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
%s
)
@@ -240,8 +241,7 @@ func main() {
{{ if not .ComponentConfig }}
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "{{ hashFNV .Repo }}.{{ .Domain }}",
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 5ec5654ced4..9ad9268c5e7 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.27.1
+ENVTEST_K8S_VERSION = 1.28.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/test/common.sh b/test/common.sh
index e6a93059bd8..053c8a12f6e 100644
--- a/test/common.sh
+++ b/test/common.sh
@@ -30,6 +30,7 @@ function convert_to_tools_ver {
"1.25") echo "1.25.0";;
"1.26") echo "1.26.0";;
"1.27") echo "1.27.1";;
+ "1.28") echo "1.28.0";;
*)
echo "k8s version $k8s_ver not supported"
exit 1
@@ -49,7 +50,7 @@ if [ -n "$TRACE" ]; then
set -x
fi
-export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.27.1"}"
+export KIND_K8S_VERSION="${KIND_K8S_VERSION:-"v1.28.0"}"
tools_k8s_version=$(convert_to_tools_ver "${KIND_K8S_VERSION#v*}")
kind_version=0.15.0
goarch=amd64
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index fca59190d10..fa6be8303dc 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.27.1
+ENVTEST_K8S_VERSION = 1.28.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
index 4bbe3abf482..fb0518a6657 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
index 48b751c4264..3fbb781f9f7 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
index 7a1496e6328..fd04fa63923 100644
--- a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
index a65af13f4d1..8f37bf1ee3d 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
index 238ac4a0914..5a88f849efe 100644
--- a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-multigroup/cmd/main.go b/testdata/project-v4-multigroup/cmd/main.go
index e891c0955d8..2e1ebae672e 100644
--- a/testdata/project-v4-multigroup/cmd/main.go
+++ b/testdata/project-v4-multigroup/cmd/main.go
@@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
@@ -95,8 +96,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "3e9f67a9.testproject.org",
diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod
index 214e2ac4fd2..54878971c4b 100644
--- a/testdata/project-v4-multigroup/go.mod
+++ b/testdata/project-v4-multigroup/go.mod
@@ -3,12 +3,12 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.9.5
- github.com/onsi/gomega v1.27.7
- k8s.io/api v0.27.2
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
+ k8s.io/api v0.28.0
+ k8s.io/apimachinery v0.28.0
+ k8s.io/client-go v0.28.0
+ sigs.k8s.io/controller-runtime v0.16.0
)
require (
@@ -21,15 +21,15 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
@@ -41,32 +41,32 @@ require (
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.15.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.42.0 // indirect
- github.com/prometheus/procfs v0.9.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.24.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.5.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
- golang.org/x/tools v0.9.1 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.90.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ k8s.io/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
index 87e7ecea478..58109370e15 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/apps/suite_test.go b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
index 7d08b83f134..78f8abdf282 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
@@ -62,7 +62,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
index c598df71e0f..b46dedb7fd8 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
index f239c268c8a..21d0db41af5 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
index a9d30834682..ce289946129 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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-multigroup/internal/controller/example.com/memcached_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
index a21240db732..9dd0faa9c7a 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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-multigroup/internal/controller/example.com/suite_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
index 2d10eaa4f7f..b298e0a96d8 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
index aa1a9b99674..712fd53e0c2 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/fiz/suite_test.go b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
index 28d49a493b5..d00d49233ce 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
index b8956d2cd8c..03c46db27b5 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/foo.policy/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
index e4a53660816..c2c9a90dfe1 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
index ac6c10fe6dd..05509b671c0 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/foo/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
index cc260c2db70..f916fad82ff 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
index bfdeb6c10c7..4729bf31a32 100644
--- a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
index f3b9462818f..41ddce9d804 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
index 3f63e3532c4..1745fa7f47c 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/sea-creatures/suite_test.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
index e7fc9251fbf..d078ffdcb26 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
@@ -64,7 +64,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
index 50ea249caf8..ad5e8b49225 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
index 6541a721136..f4447bf2125 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
index 9b051c99e3a..e9bbb817358 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/ship/suite_test.go b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
index ed595ca9203..91cebc694ae 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
@@ -65,7 +65,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/suite_test.go b/testdata/project-v4-multigroup/internal/controller/suite_test.go
index 1ca47074bf5..d1f730181a0 100644
--- a/testdata/project-v4-multigroup/internal/controller/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index fca59190d10..fa6be8303dc 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.27.1
+ENVTEST_K8S_VERSION = 1.28.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
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 54b11b7f338..ad362da3011 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
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4-with-deploy-image/cmd/main.go b/testdata/project-v4-with-deploy-image/cmd/main.go
index c441f024dfe..973a8f30205 100644
--- a/testdata/project-v4-with-deploy-image/cmd/main.go
+++ b/testdata/project-v4-with-deploy-image/cmd/main.go
@@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/api/v1alpha1"
"sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/internal/controller"
@@ -67,8 +68,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "1836d577.testproject.org",
diff --git a/testdata/project-v4-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod
index 2b6851dc820..fc8d0b02ee0 100644
--- a/testdata/project-v4-with-deploy-image/go.mod
+++ b/testdata/project-v4-with-deploy-image/go.mod
@@ -3,12 +3,12 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.9.5
- github.com/onsi/gomega v1.27.7
- k8s.io/api v0.27.2
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
+ k8s.io/api v0.28.0
+ k8s.io/apimachinery v0.28.0
+ k8s.io/client-go v0.28.0
+ sigs.k8s.io/controller-runtime v0.16.0
)
require (
@@ -21,15 +21,15 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
@@ -41,32 +41,32 @@ require (
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.15.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.42.0 // indirect
- github.com/prometheus/procfs v0.9.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.24.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.5.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
- golang.org/x/tools v0.9.1 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.90.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ k8s.io/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index 1299edd04b6..ca6cce659e2 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index 18a1f9d43f5..d602cc86194 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/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/internal/controller/suite_test.go b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
index 58fb1aee5f0..174d44531f9 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index fca59190d10..fa6be8303dc 100644
--- a/testdata/project-v4-with-grafana/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.27.1
+ENVTEST_K8S_VERSION = 1.28.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4-with-grafana/cmd/main.go b/testdata/project-v4-with-grafana/cmd/main.go
index 9989e5b1a29..63a312ad855 100644
--- a/testdata/project-v4-with-grafana/cmd/main.go
+++ b/testdata/project-v4-with-grafana/cmd/main.go
@@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
//+kubebuilder:scaffold:imports
)
@@ -63,8 +64,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "bc2db930.testproject.org",
diff --git a/testdata/project-v4-with-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
index 9e92684bf83..a44e547fb71 100644
--- a/testdata/project-v4-with-grafana/go.mod
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -3,9 +3,9 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
go 1.20
require (
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
+ k8s.io/apimachinery v0.28.0
+ k8s.io/client-go v0.28.0
+ sigs.k8s.io/controller-runtime v0.16.0
)
require (
@@ -18,14 +18,14 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // 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.3 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -36,32 +36,32 @@ require (
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.15.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.42.0 // indirect
- github.com/prometheus/procfs v0.9.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.24.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.5.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.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.27.2 // indirect
- k8s.io/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.90.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ k8s.io/api v0.28.0 // indirect
+ k8s.io/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index fca59190d10..fa6be8303dc 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.27.1
+ENVTEST_K8S_VERSION = 1.28.0
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4/api/v1/webhook_suite_test.go b/testdata/project-v4/api/v1/webhook_suite_test.go
index 5f7eb7381f0..bd1f7f75811 100644
--- a/testdata/project-v4/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4/api/v1/webhook_suite_test.go
@@ -38,6 +38,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
)
// These tests use Ginkgo (BDD-style Go testing framework). Refer to
@@ -71,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
@@ -100,12 +102,14 @@ var _ = BeforeSuite(func() {
// start webhook server using Manager
webhookInstallOptions := &testEnv.WebhookInstallOptions
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
- Scheme: scheme,
- Host: webhookInstallOptions.LocalServingHost,
- Port: webhookInstallOptions.LocalServingPort,
- CertDir: webhookInstallOptions.LocalServingCertDir,
- LeaderElection: false,
- MetricsBindAddress: "0",
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
})
Expect(err).NotTo(HaveOccurred())
diff --git a/testdata/project-v4/cmd/main.go b/testdata/project-v4/cmd/main.go
index 297be2c2df6..72c3aa70315 100644
--- a/testdata/project-v4/cmd/main.go
+++ b/testdata/project-v4/cmd/main.go
@@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4/api/v1"
"sigs.k8s.io/kubebuilder/testdata/project-v4/internal/controller"
@@ -67,8 +68,7 @@ func main() {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "da1d9c86.testproject.org",
diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod
index af7d863a445..99dfb34d896 100644
--- a/testdata/project-v4/go.mod
+++ b/testdata/project-v4/go.mod
@@ -3,12 +3,12 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4
go 1.20
require (
- github.com/onsi/ginkgo/v2 v2.9.5
- github.com/onsi/gomega v1.27.7
- k8s.io/api v0.27.2
- k8s.io/apimachinery v0.27.2
- k8s.io/client-go v0.27.2
- sigs.k8s.io/controller-runtime v0.15.0
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
+ k8s.io/api v0.28.0
+ k8s.io/apimachinery v0.28.0
+ k8s.io/client-go v0.28.0
+ sigs.k8s.io/controller-runtime v0.16.0
)
require (
@@ -21,15 +21,15 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
- github.com/go-openapi/jsonreference v0.20.1 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
- github.com/google/gnostic v0.5.7-v3refs // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/gofuzz v1.1.0 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
@@ -41,32 +41,32 @@ require (
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.15.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
- github.com/prometheus/common v0.42.0 // indirect
- github.com/prometheus/procfs v0.9.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
- go.uber.org/atomic v1.7.0 // indirect
- go.uber.org/multierr v1.6.0 // indirect
- go.uber.org/zap v1.24.0 // indirect
- golang.org/x/net v0.10.0 // indirect
- golang.org/x/oauth2 v0.5.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
- golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
- golang.org/x/tools v0.9.1 // indirect
- gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.27.2 // indirect
- k8s.io/component-base v0.27.2 // indirect
- k8s.io/klog/v2 v2.90.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
- k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+ k8s.io/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
diff --git a/testdata/project-v4/internal/controller/admiral_controller.go b/testdata/project-v4/internal/controller/admiral_controller.go
index 5aecf4aa66d..69127fe1687 100644
--- a/testdata/project-v4/internal/controller/admiral_controller.go
+++ b/testdata/project-v4/internal/controller/admiral_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/captain_controller.go b/testdata/project-v4/internal/controller/captain_controller.go
index 8d568e9127f..47fec25b223 100644
--- a/testdata/project-v4/internal/controller/captain_controller.go
+++ b/testdata/project-v4/internal/controller/captain_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/firstmate_controller.go b/testdata/project-v4/internal/controller/firstmate_controller.go
index e5c602eb6d5..36f2ba2a0e7 100644
--- a/testdata/project-v4/internal/controller/firstmate_controller.go
+++ b/testdata/project-v4/internal/controller/firstmate_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/laker_controller.go b/testdata/project-v4/internal/controller/laker_controller.go
index ff4d74dd2fb..ff0f0fc1c6f 100644
--- a/testdata/project-v4/internal/controller/laker_controller.go
+++ b/testdata/project-v4/internal/controller/laker_controller.go
@@ -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.15.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/suite_test.go b/testdata/project-v4/internal/controller/suite_test.go
index b1526b3684c..8d250be6ee4 100644
--- a/testdata/project-v4/internal/controller/suite_test.go
+++ b/testdata/project-v4/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.27.1-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
From 805136d099e11d1f4b6a51fee9427d2f189f43fd Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Sun, 3 Sep 2023 18:07:43 +0800
Subject: [PATCH 0272/1245] fix error of 'Permission denied' about binary file
if no write permission to those binary file, error occurs 'etcd: Permission
denied'
Signed-off-by: lowang-bh
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index e9c1e62a580..f67cd5724fd 100644
--- a/Makefile
+++ b/Makefile
@@ -68,6 +68,7 @@ generate: generate-testdata generate-docs ## Update/generate all mock data. You
.PHONY: generate-testdata
generate-testdata: ## Update/generate the testdata in $GOPATH/src/sigs.k8s.io/kubebuilder
+ chmod -R +w testdata/
rm -rf testdata/
./test/testdata/generate.sh
From 0be93201520923fd5a830ca874af15d49d2258d8 Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Sun, 3 Sep 2023 19:29:41 +0800
Subject: [PATCH 0273/1245] make generate error: target directory is not empty
Signed-off-by: lowang-bh
---
hack/docs/generate.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hack/docs/generate.sh b/hack/docs/generate.sh
index ac486ab5aa7..b51b7811cbb 100755
--- a/hack/docs/generate.sh
+++ b/hack/docs/generate.sh
@@ -18,6 +18,10 @@ source "$(dirname "$0")/../../test/common.sh"
build_kb
+# ensure that destroy succeed
+chmod -R +w docs/book/src/component-config-tutorial/testdata/project/
+chmod -R +w docs/book/src/cronjob-tutorial/testdata/project/
+
docs_gen_directory="$(dirname "$0")/../../hack/docs/generate_samples.go"
go run ${docs_gen_directory}
From 038406433bab83290c0c564967b1b5daa56cfa57 Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Sun, 3 Sep 2023 17:13:05 +0800
Subject: [PATCH 0274/1245] fix kustomization comments about patches file names
Signed-off-by: lowang-bh
---
.../templates/config/crd/kustomization.go | 9 +++-
.../crd/patches/enablecainjection_patch.go | 7 ++-
.../config/crd/kustomization.yaml | 46 ++++++++++---------
3 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
index 960ad2c5da3..352d0b15bb6 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
@@ -31,6 +31,7 @@ var (
// Kustomization scaffolds a file that defines the kustomization scheme for the crd folder
type Kustomization struct {
machinery.TemplateMixin
+ machinery.MultiGroupMixin
machinery.ResourceMixin
}
@@ -82,13 +83,17 @@ func (f *Kustomization) GetCodeFragments() machinery.CodeFragmentsMap {
res := make([]string, 0)
res = append(res, fmt.Sprintf(resourceCodeFragment, f.Resource.QualifiedGroup(), f.Resource.Plural))
+ suffix := f.Resource.Plural
+ if f.MultiGroup {
+ suffix = f.Resource.Group + "_" + f.Resource.Plural
+ }
// Generate resource code fragments
webhookPatch := make([]string, 0)
- webhookPatch = append(webhookPatch, fmt.Sprintf(webhookPatchCodeFragment, f.Resource.Plural))
+ webhookPatch = append(webhookPatch, fmt.Sprintf(webhookPatchCodeFragment, suffix))
// Generate resource code fragments
caInjectionPatch := make([]string, 0)
- caInjectionPatch = append(caInjectionPatch, fmt.Sprintf(caInjectionPatchCodeFragment, f.Resource.Plural))
+ caInjectionPatch = append(caInjectionPatch, fmt.Sprintf(caInjectionPatchCodeFragment, suffix))
// Only store code fragments in the map if the slices are non-empty
if len(res) != 0 {
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go
index 376a058a01c..60debd5dc92 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go
@@ -27,13 +27,18 @@ var _ machinery.Template = &EnableCAInjectionPatch{}
// EnableCAInjectionPatch scaffolds a file that defines the patch that injects CA into the CRD
type EnableCAInjectionPatch struct {
machinery.TemplateMixin
+ machinery.MultiGroupMixin
machinery.ResourceMixin
}
// SetTemplateDefaults implements file.Template
func (f *EnableCAInjectionPatch) SetTemplateDefaults() error {
if f.Path == "" {
- f.Path = filepath.Join("config", "crd", "patches", "cainjection_in_%[plural].yaml")
+ if f.MultiGroup {
+ f.Path = filepath.Join("config", "crd", "patches", "cainjection_in_%[group]_%[plural].yaml")
+ } else {
+ f.Path = filepath.Join("config", "crd", "patches", "cainjection_in_%[plural].yaml")
+ }
}
f.Path = f.Resource.Replacer().Replace(f.Path)
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index c77c95dc29e..e3729c3f731 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -19,32 +19,34 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_captains.yaml
-#- path: patches/webhook_in_frigates.yaml
-#- path: patches/webhook_in_destroyers.yaml
-#- path: patches/webhook_in_cruisers.yaml
-#- path: patches/webhook_in_krakens.yaml
-#- path: patches/webhook_in_leviathans.yaml
-#- path: patches/webhook_in_healthcheckpolicies.yaml
-#- path: patches/webhook_in_bars.yaml
-#- path: patches/webhook_in_lakers.yaml
-#- path: patches/webhook_in_memcacheds.yaml
-#- path: patches/webhook_in_busyboxes.yaml
+#- path: patches/webhook_in_crew_captains.yaml
+#- path: patches/webhook_in_ship_frigates.yaml
+#- path: patches/webhook_in_ship_destroyers.yaml
+#- path: patches/webhook_in_ship_cruisers.yaml
+#- path: patches/webhook_in_sea-creatures_krakens.yaml
+#- path: patches/webhook_in_sea-creatures_leviathans.yaml
+#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
+#- path: patches/webhook_in_foo_bars.yaml
+#- path: patches/webhook_in_fiz_bars.yaml
+#- path: patches/webhook_in__lakers.yaml
+#- path: patches/webhook_in_example.com_memcacheds.yaml
+#- path: patches/webhook_in_example.com_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
-#- path: patches/cainjection_in_captains.yaml
-#- path: patches/cainjection_in_frigates.yaml
-#- path: patches/cainjection_in_destroyers.yaml
-#- path: patches/cainjection_in_cruisers.yaml
-#- path: patches/cainjection_in_krakens.yaml
-#- path: patches/cainjection_in_leviathans.yaml
-#- path: patches/cainjection_in_healthcheckpolicies.yaml
-#- path: patches/cainjection_in_bars.yaml
-#- path: patches/cainjection_in_lakers.yaml
-#- path: patches/cainjection_in_memcacheds.yaml
-#- path: patches/cainjection_in_busyboxes.yaml
+#- path: patches/cainjection_in_crew_captains.yaml
+#- path: patches/cainjection_in_ship_frigates.yaml
+#- path: patches/cainjection_in_ship_destroyers.yaml
+#- path: patches/cainjection_in_ship_cruisers.yaml
+#- path: patches/cainjection_in_sea-creatures_krakens.yaml
+#- path: patches/cainjection_in_sea-creatures_leviathans.yaml
+#- path: patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
+#- path: patches/cainjection_in_foo_bars.yaml
+#- path: patches/cainjection_in_fiz_bars.yaml
+#- path: patches/cainjection_in__lakers.yaml
+#- path: patches/cainjection_in_example.com_memcacheds.yaml
+#- path: patches/cainjection_in_example.com_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
From a8ad43f34efd0bbbf359d4dab6e397f12c2d1e8f Mon Sep 17 00:00:00 2001
From: dragon-fly
Date: Mon, 4 Sep 2023 15:17:04 +0800
Subject: [PATCH 0275/1245] =?UTF-8?q?=F0=9F=90=9B=20(go/v4):=20Start=20to?=
=?UTF-8?q?=20check=20ENABLE=5FWEBHOOKS=20envvar=20into=20main.go=20to=20f?=
=?UTF-8?q?ix=20issue=20when=20webhooks=20are=20used=20(#3578)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
🐛 (go/v4): Start to check ENABLE_WEBHOOKS envvar into main.go to fix issue when webhooks are used (#3578)
---
.../cronjob-tutorial/generate_cronjob.go | 8 ----
.../cronjob-tutorial/main_revisited.go | 7 +--
.../v4/scaffolds/internal/templates/main.go | 8 ++--
testdata/project-v4-multigroup/cmd/main.go | 48 ++++++++++++-------
.../project-v4-with-deploy-image/cmd/main.go | 8 ++--
testdata/project-v4/cmd/main.go | 24 ++++++----
6 files changed, 56 insertions(+), 47 deletions(-)
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index 3f38b88e68d..f64a28ea3d5 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -362,14 +362,6 @@ CronJob controller's`+" `"+`SetupWithManager`+"`"+` method.
}`, `
// +kubebuilder:docs-gen:collapse=old stuff`)
CheckError("fixing main.go", err)
-
- err = pluginutil.ReplaceInFile(
- filepath.Join(sp.ctx.Dir, "cmd/main.go"),
- ` if err = (&batchv1.CronJob{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "CronJob")
- os.Exit(1)
- }`, `}`)
- CheckError("fixing main.go", err)
}
func updateWebhook(sp *Sample) {
diff --git a/hack/docs/internal/cronjob-tutorial/main_revisited.go b/hack/docs/internal/cronjob-tutorial/main_revisited.go
index 914a201461a..e0e52467c7b 100644
--- a/hack/docs/internal/cronjob-tutorial/main_revisited.go
+++ b/hack/docs/internal/cronjob-tutorial/main_revisited.go
@@ -37,9 +37,4 @@ const MainEnableWebhook = `
locally, we'll put them behind an environment variable.
We'll just make sure to set` + " `" + `ENABLE_WEBHOOKS=false` + "`" + ` when we run locally.
- */
- if os.Getenv("ENABLE_WEBHOOKS") != "false" {
- if err = (&batchv1.CronJob{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "CronJob")
- os.Exit(1)
- }`
+ */`
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
index 61d49d76c58..2ad545a3349 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/main.go
@@ -113,9 +113,11 @@ const (
os.Exit(1)
}
`
- webhookSetupCodeFragment = `if err = (&%s.%s{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "%s")
- os.Exit(1)
+ webhookSetupCodeFragment = `if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&%s.%s{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "%s")
+ os.Exit(1)
+ }
}
`
)
diff --git a/testdata/project-v4-multigroup/cmd/main.go b/testdata/project-v4-multigroup/cmd/main.go
index 2e1ebae672e..c9bebd9afbc 100644
--- a/testdata/project-v4-multigroup/cmd/main.go
+++ b/testdata/project-v4-multigroup/cmd/main.go
@@ -124,9 +124,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Captain")
os.Exit(1)
}
- if err = (&crewv1.Captain{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&crewv1.Captain{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
+ os.Exit(1)
+ }
}
if err = (&shipcontroller.FrigateReconciler{
Client: mgr.GetClient(),
@@ -135,9 +137,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Frigate")
os.Exit(1)
}
- if err = (&shipv1beta1.Frigate{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Frigate")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&shipv1beta1.Frigate{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Frigate")
+ os.Exit(1)
+ }
}
if err = (&shipcontroller.DestroyerReconciler{
Client: mgr.GetClient(),
@@ -146,9 +150,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Destroyer")
os.Exit(1)
}
- if err = (&shipv1.Destroyer{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Destroyer")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&shipv1.Destroyer{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Destroyer")
+ os.Exit(1)
+ }
}
if err = (&shipcontroller.CruiserReconciler{
Client: mgr.GetClient(),
@@ -157,9 +163,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Cruiser")
os.Exit(1)
}
- if err = (&shipv2alpha1.Cruiser{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Cruiser")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&shipv2alpha1.Cruiser{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Cruiser")
+ os.Exit(1)
+ }
}
if err = (&seacreaturescontroller.KrakenReconciler{
Client: mgr.GetClient(),
@@ -210,9 +218,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Lakers")
os.Exit(1)
}
- if err = (&testprojectorgv1.Lakers{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Lakers")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&testprojectorgv1.Lakers{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Lakers")
+ os.Exit(1)
+ }
}
if err = (&examplecomcontroller.MemcachedReconciler{
Client: mgr.GetClient(),
@@ -230,9 +240,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Busybox")
os.Exit(1)
}
- if err = (&examplecomv1alpha1.Memcached{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Memcached")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&examplecomv1alpha1.Memcached{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Memcached")
+ os.Exit(1)
+ }
}
//+kubebuilder:scaffold:builder
diff --git a/testdata/project-v4-with-deploy-image/cmd/main.go b/testdata/project-v4-with-deploy-image/cmd/main.go
index 973a8f30205..8bb8383467d 100644
--- a/testdata/project-v4-with-deploy-image/cmd/main.go
+++ b/testdata/project-v4-with-deploy-image/cmd/main.go
@@ -105,9 +105,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Busybox")
os.Exit(1)
}
- if err = (&examplecomv1alpha1.Memcached{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Memcached")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&examplecomv1alpha1.Memcached{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Memcached")
+ os.Exit(1)
+ }
}
//+kubebuilder:scaffold:builder
diff --git a/testdata/project-v4/cmd/main.go b/testdata/project-v4/cmd/main.go
index 72c3aa70315..593dc4ef7a2 100644
--- a/testdata/project-v4/cmd/main.go
+++ b/testdata/project-v4/cmd/main.go
@@ -96,9 +96,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Captain")
os.Exit(1)
}
- if err = (&crewv1.Captain{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&crewv1.Captain{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
+ os.Exit(1)
+ }
}
if err = (&controller.FirstMateReconciler{
Client: mgr.GetClient(),
@@ -107,9 +109,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "FirstMate")
os.Exit(1)
}
- if err = (&crewv1.FirstMate{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "FirstMate")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&crewv1.FirstMate{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "FirstMate")
+ os.Exit(1)
+ }
}
if err = (&controller.AdmiralReconciler{
Client: mgr.GetClient(),
@@ -118,9 +122,11 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Admiral")
os.Exit(1)
}
- if err = (&crewv1.Admiral{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Admiral")
- os.Exit(1)
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&crewv1.Admiral{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Admiral")
+ os.Exit(1)
+ }
}
if err = (&controller.LakerReconciler{
Client: mgr.GetClient(),
From 4c20e7ea1f5b463207884427757850aec12f9ed3 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Mon, 4 Sep 2023 18:13:27 +0100
Subject: [PATCH 0276/1245] :seedling: fix lint ci issue and update
golangci-lint version
---
.github/workflows/lint.yml | 2 +-
Makefile | 2 +-
cmd/main.go | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index b4276d63d91..e242e427bf8 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -21,7 +21,7 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
- version: v1.51
+ version: v1.54
only-new-issues: true # Show only new issues if it's a pull request
yamllint:
diff --git a/Makefile b/Makefile
index f67cd5724fd..c3db5404eaf 100644
--- a/Makefile
+++ b/Makefile
@@ -96,7 +96,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.51.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
}
.PHONY: apidiff
diff --git a/cmd/main.go b/cmd/main.go
index 55621a857a7..6dd4fc8d23a 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -27,6 +27,8 @@ import (
kustomizecommonv1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v1"
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang"
+
+ //nolint:staticcheck
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/declarative/v1"
deployimagev1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/deploy-image/v1alpha1"
golangv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2"
From 742ab8bb71360d019781013ac18ed9bdb8020fb3 Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Tue, 5 Sep 2023 07:32:09 +0100
Subject: [PATCH 0277/1245] :sparkles: (kustomize/v2, go/v4) upgrade kustomize
version from 5.0.1 to 5.1.1 (#3587)
---
.../src/component-config-tutorial/testdata/project/Makefile | 2 +-
docs/book/src/cronjob-tutorial/testdata/project/Makefile | 2 +-
pkg/plugins/common/kustomize/v2/plugin.go | 2 +-
testdata/project-v4-multigroup/Makefile | 2 +-
testdata/project-v4-with-deploy-image/Makefile | 2 +-
testdata/project-v4-with-grafana/Makefile | 2 +-
testdata/project-v4/Makefile | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index fa6be8303dc..751cdd77165 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -139,7 +139,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
+KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index fa6be8303dc..751cdd77165 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -139,7 +139,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
+KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/pkg/plugins/common/kustomize/v2/plugin.go b/pkg/plugins/common/kustomize/v2/plugin.go
index 31873e86e75..da61ac59fd8 100644
--- a/pkg/plugins/common/kustomize/v2/plugin.go
+++ b/pkg/plugins/common/kustomize/v2/plugin.go
@@ -25,7 +25,7 @@ import (
)
// KustomizeVersion is the kubernetes-sigs/kustomize version to be used in the project
-const KustomizeVersion = "v5.0.1"
+const KustomizeVersion = "v5.1.1"
const pluginName = "kustomize.common." + plugins.DefaultNameQualifier
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index fa6be8303dc..751cdd77165 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -139,7 +139,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
+KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index fa6be8303dc..751cdd77165 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -139,7 +139,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
+KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index fa6be8303dc..751cdd77165 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -139,7 +139,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
+KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index fa6be8303dc..751cdd77165 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -139,7 +139,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.0.1
+KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
From 919b7a60f74c6628676c5cbaa355327f1b8cbbd9 Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Tue, 5 Sep 2023 08:52:11 +0100
Subject: [PATCH 0278/1245] =?UTF-8?q?=F0=9F=8C=B1=20fix=20lint=20gosec=20f?=
=?UTF-8?q?alse=20complain=20(#3590)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
fix lint gosec false complain
---
.../v1/scaffolds/internal/templates/config/crd/kustomization.go | 1 +
.../v2/scaffolds/internal/templates/config/crd/kustomization.go | 1 +
.../v2/scaffolds/internal/templates/config/crd/kustomization.go | 1 +
3 files changed, 3 insertions(+)
diff --git a/pkg/plugins/common/kustomize/v1/scaffolds/internal/templates/config/crd/kustomization.go b/pkg/plugins/common/kustomize/v1/scaffolds/internal/templates/config/crd/kustomization.go
index 25fbc18af85..0dd55f5204c 100644
--- a/pkg/plugins/common/kustomize/v1/scaffolds/internal/templates/config/crd/kustomization.go
+++ b/pkg/plugins/common/kustomize/v1/scaffolds/internal/templates/config/crd/kustomization.go
@@ -50,6 +50,7 @@ func (f *Kustomization) SetTemplateDefaults() error {
return nil
}
+//nolint:gosec to ignore false complain G101: Potential hardcoded credentials (gosec)
const (
resourceMarker = "crdkustomizeresource"
webhookPatchMarker = "crdkustomizewebhookpatch"
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
index 352d0b15bb6..87137778bf8 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
@@ -51,6 +51,7 @@ func (f *Kustomization) SetTemplateDefaults() error {
return nil
}
+//nolint:gosec to ignore false complain G101: Potential hardcoded credentials (gosec)
const (
resourceMarker = "crdkustomizeresource"
webhookPatchMarker = "crdkustomizewebhookpatch"
diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/kustomization.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/kustomization.go
index c0e20efdf8e..7f23dbb5d5b 100644
--- a/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/kustomization.go
+++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/config/crd/kustomization.go
@@ -50,6 +50,7 @@ func (f *Kustomization) SetTemplateDefaults() error {
return nil
}
+//nolint:gosec to ignore false complain G101: Potential hardcoded credentials (gosec)
const (
resourceMarker = "crdkustomizeresource"
webhookPatchMarker = "crdkustomizewebhookpatch"
From 4b518220b02bf2ba8f3f4b20efa62968266eba20 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Tue, 5 Sep 2023 18:19:04 +0100
Subject: [PATCH 0279/1245] :seedleng: remove gosec lint due false claims
---
.golangci.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.golangci.yml b/.golangci.yml
index 8ca78c49c23..dba9e9f4d69 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -67,7 +67,6 @@ linters:
- gocyclo
- gofmt
- goimports
- - gosec
- gosimple
- govet
- ineffassign
From 96151516a32daea07c9b53e09528766762ec12b1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 5 Sep 2023 20:08:52 +0100
Subject: [PATCH 0280/1245] =?UTF-8?q?=F0=9F=8C=B1=20chore(deps):=20bump=20?=
=?UTF-8?q?golang.org/x/text=20from=200.12.0=20to=200.13.0=20(#3589)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
chore(deps): bump golang.org/x/text from 0.12.0 to 0.13.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.12.0...v0.13.0)
---
updated-dependencies:
- dependency-name: golang.org/x/text
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index a781fd2f504..c11638d5c09 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
- golang.org/x/text v0.12.0
+ golang.org/x/text v0.13.0
golang.org/x/tools v0.12.0
sigs.k8s.io/yaml v1.3.0
)
diff --git a/go.sum b/go.sum
index 44762490106..c01916bdd5f 100644
--- a/go.sum
+++ b/go.sum
@@ -325,8 +325,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
-golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
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=
From ba4d579cd30c7cbb4e659d32ada003f5b9980b31 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 5 Sep 2023 19:09:39 +0000
Subject: [PATCH 0281/1245] :seedling: bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/apidiff.yml | 2 +-
.github/workflows/lint.yml | 4 ++--
.github/workflows/release.yml | 2 +-
.github/workflows/testdata.yml | 2 +-
.github/workflows/unit-tests-legacy.yml | 2 +-
.github/workflows/unit-tests.yml | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/apidiff.yml b/.github/workflows/apidiff.yml
index 29f72a046dc..69806358293 100644
--- a/.github/workflows/apidiff.yml
+++ b/.github/workflows/apidiff.yml
@@ -13,7 +13,7 @@ jobs:
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index e242e427bf8..6c8d0ddd8bb 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -17,7 +17,7 @@ jobs:
with:
go-version: '~1.20'
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
@@ -27,6 +27,6 @@ jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Run yamllint make target
run: make yamllint
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4f5f4328436..126cd2074a1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all tags
diff --git a/.github/workflows/testdata.yml b/.github/workflows/testdata.yml
index a9873c867a2..8864528c315 100644
--- a/.github/workflows/testdata.yml
+++ b/.github/workflows/testdata.yml
@@ -14,7 +14,7 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
diff --git a/.github/workflows/unit-tests-legacy.yml b/.github/workflows/unit-tests-legacy.yml
index ca2a4751174..2cc0b3e1099 100644
--- a/.github/workflows/unit-tests-legacy.yml
+++ b/.github/workflows/unit-tests-legacy.yml
@@ -19,7 +19,7 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index a6b88c4f1dc..e198126a68c 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -18,7 +18,7 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
@@ -48,7 +48,7 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
From f1f90951f98932ef8b6c96bb26f8fbdfe69958d1 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Wed, 6 Sep 2023 07:38:00 +0100
Subject: [PATCH 0282/1245] update summary index to show that declarative is
deprecated
---
docs/book/src/SUMMARY.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index 2038a5869fa..74cbdb15029 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -121,7 +121,7 @@
- [go/v3 (Deprecated)](./plugins/go-v3-plugin.md)
- [go/v4 (Default init scaffold)](./plugins/go-v4-plugin.md)
- [To add optional features](./plugins/to-add-optional-features.md)
- - [declarative/v1](./plugins/declarative-v1.md)
+ - [declarative/v1 (Deprecated)](./plugins/declarative-v1.md)
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md)
- [deploy-image/v1-alpha](./plugins/deploy-image-plugin-v1-alpha.md)
- [To be extended for others tools](./plugins/to-be-extended.md)
From aa6aee82449aadb41077c62789b29811b9ff74e2 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Wed, 6 Sep 2023 07:41:05 +0100
Subject: [PATCH 0283/1245] add tip for release notes
---
RELEASE.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/RELEASE.md b/RELEASE.md
index 25912d01afb..f1329419e9d 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -25,6 +25,9 @@ process was done to ensure that we have an aligned process under the org (simila
> **Note**
> - You will need to have checkout locally from the remote repository the previous branch
> - Also, ensure that you fetch all tags from the remote `git fetch --all --tags`
+> - Also, if you face issues to generate the release notes you might want to able to sort it out by running i.e.:
+> `go run sigs.k8s.io/kubebuilder-release-tools/notes --use-upstream=false --from=v3.11.0 --branch=release-X`
+
### Draft a new release from GitHub
From c7ede900cc28e411aaab5cfd92d418fa6775a913 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Wed, 6 Sep 2023 07:45:06 +0100
Subject: [PATCH 0284/1245] fix link best practices
---
docs/book/src/reference/good-practices.md | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/docs/book/src/reference/good-practices.md b/docs/book/src/reference/good-practices.md
index f027dea4972..eb7cedd802c 100644
--- a/docs/book/src/reference/good-practices.md
+++ b/docs/book/src/reference/good-practices.md
@@ -68,7 +68,7 @@ We recommend you manage your solutions using Status Conditionals following the [
Example of Usage
-Check out the [Deploy Image Plugin][deploy-image-plugin]. This plugin allows users to scaffold API/Controllers to deploy and manage an Operand (image) on the cluster following the guidelines and best practices. It abstracts the
+Check out the [Deploy Image Plugin][deploy-image]. This plugin allows users to scaffold API/Controllers to deploy and manage an Operand (image) on the cluster following the guidelines and best practices. It abstracts the
complexities of achieving this goal while allowing users to customize the generated code.
Therefore, you can check an example of Status Conditional usage by looking at its API(s) scaffolded and code implemented under the Reconciliation into its Controllers.
@@ -76,16 +76,9 @@ Therefore, you can check an example of Status Conditional usage by looking at it
[docs]: ./cronjob-tutorial/gvks.html
-
-[operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
-
+[operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
[controllers]: https://kubernetes.io/docs/concepts/architecture/controller/
-
[controller-runtime-topic]: https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md#q-how-do-i-have-different-logic-in-my-reconciler-for-different-types-of-events-eg-create-update-delete
-
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
-
[deploy-image]: ./plugins/deploy-image-plugin-v1-alpha.md
-
-[controller-runtime-manager]: https://github.com/kubernetes-sigs/controller-runtime/blob/304027bcbe4b3f6d582180aec5759eb4db3f17fd/pkg/manager/manager.go#L53
-
+[controller-runtime-manager]: https://github.com/kubernetes-sigs/controller-runtime/blob/304027bcbe4b3f6d582180aec5759eb4db3f17fd/pkg/manager/manager.go#L53
From 1bb430b29172d20d0e18ecde3e5d1a5bcfd921ef Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Wed, 6 Sep 2023 16:35:05 +0100
Subject: [PATCH 0285/1245] =?UTF-8?q?=E2=9C=A8=20upgrade=20controller-runt?=
=?UTF-8?q?ime=20from=200.16.0=20to=200.16.1=20(#3597)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
upgrade controller-runtime from 0.16.0 to 0.16.1
---
.../testdata/project/go.mod | 10 ++--
.../testdata/project/go.sum | 59 ++++---------------
.../cronjob-tutorial/testdata/project/go.mod | 10 ++--
.../cronjob-tutorial/testdata/project/go.sum | 59 ++++---------------
.../internal/controller/cronjob_controller.go | 2 +-
pkg/plugins/golang/v4/scaffolds/init.go | 2 +-
testdata/project-v4-multigroup/go.mod | 10 ++--
.../controller/apps/deployment_controller.go | 2 +-
.../controller/crew/captain_controller.go | 2 +-
.../example.com/busybox_controller.go | 2 +-
.../example.com/memcached_controller.go | 2 +-
.../internal/controller/fiz/bar_controller.go | 2 +-
.../healthcheckpolicy_controller.go | 2 +-
.../internal/controller/foo/bar_controller.go | 2 +-
.../internal/controller/lakers_controller.go | 2 +-
.../sea-creatures/kraken_controller.go | 2 +-
.../sea-creatures/leviathan_controller.go | 2 +-
.../controller/ship/cruiser_controller.go | 2 +-
.../controller/ship/destroyer_controller.go | 2 +-
.../controller/ship/frigate_controller.go | 2 +-
testdata/project-v4-with-deploy-image/go.mod | 10 ++--
.../internal/controller/busybox_controller.go | 2 +-
.../controller/memcached_controller.go | 2 +-
testdata/project-v4-with-grafana/go.mod | 10 ++--
testdata/project-v4/go.mod | 10 ++--
.../internal/controller/admiral_controller.go | 2 +-
.../internal/controller/captain_controller.go | 2 +-
.../controller/firstmate_controller.go | 2 +-
.../internal/controller/laker_controller.go | 2 +-
29 files changed, 71 insertions(+), 149 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod
index c0adde9aa99..2ffa49421b2 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.mod
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod
@@ -3,9 +3,9 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
- k8s.io/apimachinery v0.28.0
- k8s.io/client-go v0.28.0
- sigs.k8s.io/controller-runtime v0.16.0
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.1
)
require (
@@ -56,9 +56,9 @@ require (
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.28.0 // indirect
+ k8s.io/api v0.28.1 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum
index a3295731972..de2d668e659 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.sum
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum
@@ -1,16 +1,9 @@
-github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18=
-github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
-github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
-github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -20,13 +13,11 @@ github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
-github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
@@ -45,7 +36,6 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/cel-go v0.16.0 h1:DG9YQ8nFCFXAs/FDDwBxmL1tpKNrdlGUM9U3537bX/Y=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@@ -57,12 +47,8 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
-github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
@@ -104,10 +90,8 @@ github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -120,19 +104,6 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
-go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
-go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 h1:sxoY9kG1s1WpSYNyzm24rlwH4lnRYFXUVVBmKMBfRgw=
-go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
-go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
-go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
-go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
-go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
@@ -145,7 +116,6 @@ go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -168,7 +138,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -203,10 +172,6 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M=
-google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM=
-google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
@@ -217,34 +182,30 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM=
-k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY=
+k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108=
+k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg=
k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E=
k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE=
-k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA=
-k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
-k8s.io/apiserver v0.28.0 h1:wVh7bK6Xj7hq+5ntInysTeQRAOqqFoKGUOW2yj8DXrY=
-k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM=
-k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc=
-k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI=
-k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk=
+k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY=
+k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
+k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8=
+k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE=
+k8s.io/component-base v0.28.1 h1:LA4AujMlK2mr0tZbQDZkjWbdhTV5bRyEyAFe0TJxlWg=
+k8s.io/component-base v0.28.1/go.mod h1:jI11OyhbX21Qtbav7JkhehyBsIRfnO8oEgoAR12ArIU=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kms v0.28.0 h1:BwJhU9qPcJhHLUcQjtelOSjYti+1/caJLr+4jHbKzTA=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA=
-sigs.k8s.io/controller-runtime v0.16.0 h1:5koYaaRVBHDr0LZAJjO5dWzUjMsh6cwa7q1Mmusrdvk=
-sigs.k8s.io/controller-runtime v0.16.0/go.mod h1:77DnuwA8+J7AO0njzv3wbNlMOnGuLrwFr8JPNwx3J7g=
+sigs.k8s.io/controller-runtime v0.16.1 h1:+15lzrmHsE0s2kNl0Dl8cTchI5Cs8qofo5PGcPrV9z0=
+sigs.k8s.io/controller-runtime v0.16.1/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
index a774b8871dc..187bd8a19ca 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
@@ -6,10 +6,10 @@ require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/robfig/cron v1.2.0
- k8s.io/api v0.28.0
- k8s.io/apimachinery v0.28.0
- k8s.io/client-go v0.28.0
- sigs.k8s.io/controller-runtime v0.16.0
+ k8s.io/api v0.28.1
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.1
)
require (
@@ -64,7 +64,7 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index 18c71f39989..31ee90eefb9 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -1,19 +1,12 @@
-github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
-github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18=
-github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
-github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
-github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -23,13 +16,11 @@ github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
-github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo=
github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
@@ -49,7 +40,6 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/cel-go v0.16.0 h1:DG9YQ8nFCFXAs/FDDwBxmL1tpKNrdlGUM9U3537bX/Y=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@@ -62,13 +52,9 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
-github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
-github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
@@ -114,10 +100,8 @@ github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPH
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -131,19 +115,6 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs=
-go.etcd.io/etcd/client/pkg/v3 v3.5.9 h1:oidDC4+YEuSIQbsR94rY9gur91UPL6DnxDCIYd2IGsE=
-go.etcd.io/etcd/client/v3 v3.5.9 h1:r5xghnU7CwbUxD/fbUtRyJGaYNfDun8sp/gTr1hew6E=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.1 h1:sxoY9kG1s1WpSYNyzm24rlwH4lnRYFXUVVBmKMBfRgw=
-go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
-go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
-go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
-go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
-go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
@@ -156,7 +127,6 @@ go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -180,7 +150,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -217,10 +186,6 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M=
-google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM=
-google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
@@ -231,34 +196,30 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
-gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM=
-k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY=
+k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108=
+k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg=
k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E=
k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE=
-k8s.io/apimachinery v0.28.0 h1:ScHS2AG16UlYWk63r46oU3D5y54T53cVI5mMJwwqFNA=
-k8s.io/apimachinery v0.28.0/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
-k8s.io/apiserver v0.28.0 h1:wVh7bK6Xj7hq+5ntInysTeQRAOqqFoKGUOW2yj8DXrY=
-k8s.io/client-go v0.28.0 h1:ebcPRDZsCjpj62+cMk1eGNX1QkMdRmQ6lmz5BLoFWeM=
-k8s.io/client-go v0.28.0/go.mod h1:0Asy9Xt3U98RypWJmU1ZrRAGKhP6NqDPmptlAzK2kMc=
-k8s.io/component-base v0.28.0 h1:HQKy1enJrOeJlTlN4a6dU09wtmXaUvThC0irImfqyxI=
-k8s.io/component-base v0.28.0/go.mod h1:Yyf3+ZypLfMydVzuLBqJ5V7Kx6WwDr/5cN+dFjw1FNk=
+k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY=
+k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
+k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8=
+k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE=
+k8s.io/component-base v0.28.1 h1:LA4AujMlK2mr0tZbQDZkjWbdhTV5bRyEyAFe0TJxlWg=
+k8s.io/component-base v0.28.1/go.mod h1:jI11OyhbX21Qtbav7JkhehyBsIRfnO8oEgoAR12ArIU=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kms v0.28.0 h1:BwJhU9qPcJhHLUcQjtelOSjYti+1/caJLr+4jHbKzTA=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA=
-sigs.k8s.io/controller-runtime v0.16.0 h1:5koYaaRVBHDr0LZAJjO5dWzUjMsh6cwa7q1Mmusrdvk=
-sigs.k8s.io/controller-runtime v0.16.0/go.mod h1:77DnuwA8+J7AO0njzv3wbNlMOnGuLrwFr8JPNwx3J7g=
+sigs.k8s.io/controller-runtime v0.16.1 h1:+15lzrmHsE0s2kNl0Dl8cTchI5Cs8qofo5PGcPrV9z0=
+sigs.k8s.io/controller-runtime v0.16.1/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
index 6b9b776453f..ad5b7247319 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
@@ -95,7 +95,7 @@ var (
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.1/pkg/reconcile
func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index fbd8032dff5..7e1f3e72c8c 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -32,7 +32,7 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.16.0"
+ ControllerRuntimeVersion = "v0.16.1"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.13.0"
// EnvtestK8SVersion is the k8s version used to do the scaffold
diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod
index 54878971c4b..58a6ed04231 100644
--- a/testdata/project-v4-multigroup/go.mod
+++ b/testdata/project-v4-multigroup/go.mod
@@ -5,10 +5,10 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.0
- k8s.io/apimachinery v0.28.0
- k8s.io/client-go v0.28.0
- sigs.k8s.io/controller-runtime v0.16.0
+ k8s.io/api v0.28.1
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.1
)
require (
@@ -63,7 +63,7 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
index 58109370e15..24f8f5c4ef1 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
index b46dedb7fd8..b69ce80b664 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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-multigroup/internal/controller/example.com/busybox_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
index ce289946129..0fd739b009c 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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-multigroup/internal/controller/example.com/memcached_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
index 9dd0faa9c7a..21a601bfea4 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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-multigroup/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
index 712fd53e0c2..56974bcf2af 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
index 03c46db27b5..6dafb8ef6d0 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
index 05509b671c0..24d289393a4 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
index 4729bf31a32..06d1f90f27e 100644
--- a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
index 41ddce9d804..ed978a94498 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
index 1745fa7f47c..f4f36401021 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
index ad5e8b49225..553a643c830 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
index f4447bf2125..197f60cafe2 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
index e9bbb817358..aec94378542 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod
index fc8d0b02ee0..f771cdfd71a 100644
--- a/testdata/project-v4-with-deploy-image/go.mod
+++ b/testdata/project-v4-with-deploy-image/go.mod
@@ -5,10 +5,10 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.0
- k8s.io/apimachinery v0.28.0
- k8s.io/client-go v0.28.0
- sigs.k8s.io/controller-runtime v0.16.0
+ k8s.io/api v0.28.1
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.1
)
require (
@@ -63,7 +63,7 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index ca6cce659e2..1e20a56e034 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index d602cc86194..60713637aba 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
index a44e547fb71..2988dd2b414 100644
--- a/testdata/project-v4-with-grafana/go.mod
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -3,9 +3,9 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
go 1.20
require (
- k8s.io/apimachinery v0.28.0
- k8s.io/client-go v0.28.0
- sigs.k8s.io/controller-runtime v0.16.0
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.1
)
require (
@@ -56,9 +56,9 @@ require (
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.28.0 // indirect
+ k8s.io/api v0.28.1 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod
index 99dfb34d896..69298c5fef2 100644
--- a/testdata/project-v4/go.mod
+++ b/testdata/project-v4/go.mod
@@ -5,10 +5,10 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.0
- k8s.io/apimachinery v0.28.0
- k8s.io/client-go v0.28.0
- sigs.k8s.io/controller-runtime v0.16.0
+ k8s.io/api v0.28.1
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.1
)
require (
@@ -63,7 +63,7 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4/internal/controller/admiral_controller.go b/testdata/project-v4/internal/controller/admiral_controller.go
index 69127fe1687..b300a601984 100644
--- a/testdata/project-v4/internal/controller/admiral_controller.go
+++ b/testdata/project-v4/internal/controller/admiral_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/captain_controller.go b/testdata/project-v4/internal/controller/captain_controller.go
index 47fec25b223..b03f4e85925 100644
--- a/testdata/project-v4/internal/controller/captain_controller.go
+++ b/testdata/project-v4/internal/controller/captain_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/firstmate_controller.go b/testdata/project-v4/internal/controller/firstmate_controller.go
index 36f2ba2a0e7..a6a3c0344cf 100644
--- a/testdata/project-v4/internal/controller/firstmate_controller.go
+++ b/testdata/project-v4/internal/controller/firstmate_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.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/internal/controller/laker_controller.go b/testdata/project-v4/internal/controller/laker_controller.go
index ff0f0fc1c6f..690b6c172e5 100644
--- a/testdata/project-v4/internal/controller/laker_controller.go
+++ b/testdata/project-v4/internal/controller/laker_controller.go
@@ -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.16.0/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.1/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
From 803ae01be4fdc7178c0359f8924aa7ccc8007fae Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Thu, 7 Sep 2023 10:48:54 +0100
Subject: [PATCH 0286/1245] suplement doc over alpha generate command
---
docs/book/src/SUMMARY.md | 2 +
.../migration/migration_guide_gov3_to_gov4.md | 11 +++++
docs/book/src/reference/rescaffold.md | 40 +++++++++++++++++--
3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index 74cbdb15029..90a385589f7 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -74,6 +74,8 @@
- [Migration by updating the files](migration/manually_migration_guide_gov3_to_gov4.md)
- [Single Group to Multi-Group](./migration/multi-group.md)
+- [Project Upgrade Assistant](./reference/rescaffold.md)
+
---
- [Reference](./reference/reference.md)
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 d7053ce1f43..4d714d84c09 100644
--- a/docs/book/src/migration/migration_guide_gov3_to_gov4.md
+++ b/docs/book/src/migration/migration_guide_gov3_to_gov4.md
@@ -10,6 +10,16 @@ The recommended way to migrate a `go/v3` project is to create a new `go/v4` proj
copy over the API and the reconciliation code. The conversion will end up with a
project that looks like a native go/v4 project layout (latest version).
+
+Your Upgrade Assistant: The `alpha generate` command
+
+To upgrade your project you might want to use the command `kubebuilder alpha generate [OPTIONS]`.
+This command will re-scaffold the project using the current Kubebuilder version.
+You can run `kubebuilder alpha generate --plugins=go/v4` to regenerate your project using `go/v4`
+based in your [PROJECT][project-file] file config.
+
+
+
However, in some cases, it's possible to do an in-place upgrade (i.e. reuse the go/v3 project layout, upgrading
the PROJECT file, and scaffolds manually). For further information see [Migration from go/v3 to go/v4 by updating the files manually][manually-upgrade]
@@ -148,3 +158,4 @@ fine.
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime/releases
[multi-group]: multi-group.md
[manually-upgrade]: manually_migration_guide_gov3_to_gov4.md
+[project-file]: ../reference/project-config.md
\ No newline at end of file
diff --git a/docs/book/src/reference/rescaffold.md b/docs/book/src/reference/rescaffold.md
index 6a9a7ab4418..2b075cefa5c 100644
--- a/docs/book/src/reference/rescaffold.md
+++ b/docs/book/src/reference/rescaffold.md
@@ -1,15 +1,30 @@
-# Rescaffold Command
+# Project Upgrade Assistant
## Overview
-The Kubebuilder CLI provides a new experimental helper `alpha generate` command to re-scaffold an existing project from the scratch using the current version of KubeBuilder binary available based on PROJECT config file.
+Please note that all input utilized via the Kubebuilder tool is tracked in the PROJECT file ([example][example]).
+This file is responsible for storing essential information, representing various facets of the Project such as its layout,
+plugins, APIs, and more. ([More info][more-info]).
+
+With the release of new plugin versions/layouts or even a new Kubebuilder CLI version with scaffold changes,
+an easy way to upgrade your project is by re-scaffolding. This process allows users to employ tools like IDEs to compare
+changes, enabling them to overlay their code implementation on the new scaffold or integrate these changes into their existing projects.
## When to use it ?
-This command is useful when you want to upgrade an existing project to the latest version of the Kubebuilder project layout. It makes it easier for the users to migrate their operator projects to the new scaffolding.
+This command is useful when you want to upgrade an existing project to the latest version of the Kubebuilder project layout.
+It makes it easier for the users to migrate their operator projects to the new scaffolding.
## How to use it ?
+**To upgrade the scaffold of your project to use a new plugin version:**
+
+```sh
+kubebuilder alpha generate --plugins="pluginkey/version"
+```
+
+**To upgrade the scaffold of your project to get the latest changes:**
+
Currently, it supports two optional params, `input-dir` and `output-dir`.
`input-dir` is the path to the existing project that you want to re-scaffold. Default is the current working directory.
@@ -18,4 +33,21 @@ Currently, it supports two optional params, `input-dir` and `output-dir`.
```sh
kubebuilder alpha generate --input-dir=/path/to/existing/project --output-dir=/path/to/new/project
-```
\ No newline at end of file
+```
+
+
+Regarding `input-dir` and `output-dir`:
+
+If neither `input-dir` nor `output-dir` are specified, the project will be regenerated in the current directory.
+This approach facilitates comparison between your current local branch and the version stored upstream (e.g., GitHub main branch).
+This way, you can easily overlay your project's code changes atop the new scaffold.
+
+
+
+## Further Resources:
+
+- Check out [video to show how it works](https://youtu.be/7997RIbx8kw?si=ODYMud5lLycz7osp)
+- See the [desing proposal documentation](../../../../designs/helper_to_upgrade_projects_by_rescaffolding.md)
+
+[example]: ./../../../../testdata/project-v4-with-deploy-image/PROJECT
+[more-info]: ./../reference/project-config.md
\ No newline at end of file
From 46ea676fc75e7a8844bbf237cf8e1c4b66b24dd4 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Wed, 6 Sep 2023 12:08:10 +0100
Subject: [PATCH 0287/1245] add golangci integration to the default scaffold
---
.../testdata/project/.golangci.yml | 40 +++++++++
.../testdata/project/Makefile | 15 ++++
.../testdata/project/.golangci.yml | 40 +++++++++
.../testdata/project/Makefile | 15 ++++
.../project/api/v1/cronjob_webhook.go | 1 +
.../project/api/v1/webhook_suite_test.go | 3 +-
.../templates/controllers/controller-test.go | 23 +++--
.../templates/controllers/controller.go | 1 -
pkg/plugins/golang/v4/scaffolds/init.go | 2 +-
.../internal/templates/api/webhook.go | 1 +
.../templates/api/webhook_suitetest.go | 3 +-
.../scaffolds/internal/templates/golangci.go | 85 +++++++++++++++++++
.../scaffolds/internal/templates/makefile.go | 15 ++++
test/e2e/externalplugin/generate_test.go | 3 -
test/testdata/generate.sh | 2 +-
testdata/project-v4-multigroup/.golangci.yml | 40 +++++++++
testdata/project-v4-multigroup/Makefile | 15 ++++
.../api/crew/v1/captain_webhook.go | 1 +
.../api/crew/v1/webhook_suite_test.go | 3 +-
.../example.com/v1alpha1/memcached_webhook.go | 1 +
.../v1alpha1/webhook_suite_test.go | 3 +-
.../api/ship/v1/destroyer_webhook.go | 1 +
.../api/ship/v1/webhook_suite_test.go | 3 +-
.../api/ship/v1beta1/frigate_webhook.go | 1 +
.../api/ship/v2alpha1/cruiser_webhook.go | 1 +
.../api/ship/v2alpha1/webhook_suite_test.go | 3 +-
.../api/v1/lakers_webhook.go | 1 +
.../api/v1/webhook_suite_test.go | 3 +-
.../example.com/busybox_controller.go | 1 -
.../example.com/busybox_controller_test.go | 23 +++--
.../example.com/memcached_controller.go | 1 -
.../example.com/memcached_controller_test.go | 23 +++--
.../.golangci.yml | 40 +++++++++
.../project-v4-with-deploy-image/Makefile | 15 ++++
.../api/v1alpha1/memcached_webhook.go | 1 +
.../api/v1alpha1/webhook_suite_test.go | 3 +-
.../internal/controller/busybox_controller.go | 1 -
.../controller/busybox_controller_test.go | 23 +++--
.../controller/memcached_controller.go | 1 -
.../controller/memcached_controller_test.go | 23 +++--
.../project-v4-with-grafana/.golangci.yml | 40 +++++++++
testdata/project-v4-with-grafana/Makefile | 15 ++++
testdata/project-v4/.golangci.yml | 40 +++++++++
testdata/project-v4/Makefile | 15 ++++
testdata/project-v4/api/v1/admiral_webhook.go | 1 +
testdata/project-v4/api/v1/captain_webhook.go | 1 +
.../project-v4/api/v1/firstmate_webhook.go | 1 +
.../project-v4/api/v1/webhook_suite_test.go | 3 +-
48 files changed, 538 insertions(+), 58 deletions(-)
create mode 100644 docs/book/src/component-config-tutorial/testdata/project/.golangci.yml
create mode 100644 docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
create mode 100644 pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go
create mode 100644 testdata/project-v4-multigroup/.golangci.yml
create mode 100644 testdata/project-v4-with-deploy-image/.golangci.yml
create mode 100644 testdata/project-v4-with-grafana/.golangci.yml
create mode 100644 testdata/project-v4/.golangci.yml
diff --git a/docs/book/src/component-config-tutorial/testdata/project/.golangci.yml b/docs/book/src/component-config-tutorial/testdata/project/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/docs/book/src/component-config-tutorial/testdata/project/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index 751cdd77165..fc949b7f470 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -64,6 +64,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index 751cdd77165..fc949b7f470 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -64,6 +64,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go
index 909469c09c7..e75120e120a 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook.go
@@ -42,6 +42,7 @@ var cronjoblog = logf.Log.WithName("cronjob-resource")
Then, we set up the webhook with the manager.
*/
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *CronJob) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
index eba3577726c..e82b72c2607 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
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 8ed8601ffd6..4ecfb708032 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
@@ -81,6 +81,7 @@ import (
"time"
"fmt"
+ //nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
@@ -109,7 +110,10 @@ var _ = Describe("{{ .Resource.Kind }} controller", func() {
},
}
- typeNamespaceName := types.NamespacedName{Name: {{ .Resource.Kind }}Name, Namespace: {{ .Resource.Kind }}Name}
+ typeNamespaceName := types.NamespacedName{
+ Name: {{ .Resource.Kind }}Name,
+ Namespace: {{ .Resource.Kind }}Name,
+ }
{{ lower .Resource.Kind }} := &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{}
BeforeEach(func() {
@@ -190,13 +194,20 @@ var _ = Describe("{{ .Resource.Kind }} controller", func() {
By("Checking the latest Status Condition added to the {{ .Resource.Kind }} instance")
Eventually(func() error {
- if {{ lower .Resource.Kind }}.Status.Conditions != nil && len({{ lower .Resource.Kind }}.Status.Conditions) != 0 {
+ if {{ lower .Resource.Kind }}.Status.Conditions != nil &&
+ len({{ lower .Resource.Kind }}.Status.Conditions) != 0 {
latestStatusCondition := {{ lower .Resource.Kind }}.Status.Conditions[len({{ lower .Resource.Kind }}.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{Type: typeAvailable{{ .Resource.Kind }},
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", {{ lower .Resource.Kind }}.Name, {{ lower .Resource.Kind }}.Spec.Size)}
+ expectedLatestStatusCondition := metav1.Condition{
+ Type: typeAvailable{{ .Resource.Kind }},
+ Status: metav1.ConditionTrue,
+ Reason: "Reconciling",
+ Message: fmt.Sprintf(
+ "Deployment for custom resource (%s) with %d replicas created successfully",
+ {{ lower .Resource.Kind }}.Name,
+ {{ lower .Resource.Kind }}.Spec.Size),
+ }
if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the {{ lower .Resource.Kind }} instance is not as expected")
+ return fmt.Errorf("The latest status condition added to the {{ .Resource.Kind }} instance is not as expected")
}
}
return nil
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 5284478c2ba..d7e6f9262af 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
@@ -137,7 +137,6 @@ type {{ .Resource.Kind }}Reconciler struct {
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
-
// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
// pattern you will create Controllers which provide a reconcile function
// responsible for synchronizing resources until the desired state is reached on the cluster.
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index fbd8032dff5..637d036171d 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -19,7 +19,6 @@ package scaffolds
import (
log "github.com/sirupsen/logrus"
"github.com/spf13/afero"
-
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
"sigs.k8s.io/kubebuilder/v3/pkg/plugin"
@@ -139,5 +138,6 @@ func (s *initScaffolder) Scaffold() error {
&templates.Dockerfile{},
&templates.DockerIgnore{},
&templates.Readme{},
+ &templates.Golangci{},
)
}
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 bde82f8f5c6..60ff9051a27 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook.go
@@ -98,6 +98,7 @@ import (
// log is for logging in this package.
var {{ lower .Resource.Kind }}log = logf.Log.WithName("{{ lower .Resource.Kind }}-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *{{ .Resource.Kind }}) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
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 ea9af73c683..e8e396deb16 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
@@ -249,8 +249,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close();
}).Should(Succeed())
})
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go
new file mode 100644
index 00000000000..f6b263dc674
--- /dev/null
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go
@@ -0,0 +1,85 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package templates
+
+import (
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &Golangci{}
+
+// Golangci scaffolds a file which define Golangci rules
+type Golangci struct {
+ machinery.TemplateMixin
+ machinery.ProjectNameMixin
+}
+
+// SetTemplateDefaults implements file.Template
+func (f *Golangci) SetTemplateDefaults() error {
+ if f.Path == "" {
+ f.Path = ".golangci.yml"
+ }
+
+ f.TemplateBody = golangciTemplate
+
+ f.IfExistsAction = machinery.SkipFile
+
+ return nil
+}
+
+//nolint:lll
+const golangciTemplate = `run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
+`
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 9ad9268c5e7..28ffa442cb7 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -128,6 +128,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
diff --git a/test/e2e/externalplugin/generate_test.go b/test/e2e/externalplugin/generate_test.go
index fa495485682..cdd39333638 100644
--- a/test/e2e/externalplugin/generate_test.go
+++ b/test/e2e/externalplugin/generate_test.go
@@ -24,9 +24,6 @@ import (
//nolint:golint
//nolint:revive
. "github.com/onsi/ginkgo/v2"
-
- //nolint:golint
- //nolint:revive
. "github.com/onsi/gomega"
//nolint:golint
diff --git a/test/testdata/generate.sh b/test/testdata/generate.sh
index a6f7a8f2d8c..f37c007b63a 100755
--- a/test/testdata/generate.sh
+++ b/test/testdata/generate.sh
@@ -126,7 +126,7 @@ function scaffold_test_project {
make generate manifests
rm -f go.sum
-
+ go mod tidy
popd
}
diff --git a/testdata/project-v4-multigroup/.golangci.yml b/testdata/project-v4-multigroup/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/testdata/project-v4-multigroup/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index 751cdd77165..fc949b7f470 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -64,6 +64,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
diff --git a/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
index 7948f0387a6..ed99f7f0e55 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook.go
@@ -27,6 +27,7 @@ import (
// log is for logging in this package.
var captainlog = logf.Log.WithName("captain-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Captain) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
index fb0518a6657..d58a13812d1 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
index 9dde8721abe..77993bc8d50 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
@@ -27,6 +27,7 @@ import (
// log is for logging in this package.
var memcachedlog = logf.Log.WithName("memcached-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Memcached) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
index 3fbb781f9f7..17d019e74f8 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
diff --git a/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go b/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go
index 67798c6e1f0..4b0fb739d55 100644
--- a/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook.go
@@ -25,6 +25,7 @@ import (
// log is for logging in this package.
var destroyerlog = logf.Log.WithName("destroyer-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Destroyer) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
index fd04fa63923..1c6bb164c54 100644
--- a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
diff --git a/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go
index 028189c9eab..e03bafd22b2 100644
--- a/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook.go
@@ -24,6 +24,7 @@ import (
// log is for logging in this package.
var frigatelog = logf.Log.WithName("frigate-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Frigate) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
index 030b6937640..14d5710a831 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook.go
@@ -27,6 +27,7 @@ import (
// log is for logging in this package.
var cruiserlog = logf.Log.WithName("cruiser-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Cruiser) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
index 8f37bf1ee3d..38482d55ee7 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
diff --git a/testdata/project-v4-multigroup/api/v1/lakers_webhook.go b/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
index f1b3ac61a91..26041fdfc75 100644
--- a/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
+++ b/testdata/project-v4-multigroup/api/v1/lakers_webhook.go
@@ -27,6 +27,7 @@ import (
// log is for logging in this package.
var lakerslog = logf.Log.WithName("lakers-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Lakers) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
index 5a88f849efe..250b42b87b3 100644
--- a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
index ce289946129..65756ff8f53 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
@@ -69,7 +69,6 @@ type BusyboxReconciler struct {
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
-
// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
// pattern you will create Controllers which provide a reconcile function
// responsible for synchronizing resources until the desired state is reached on the cluster.
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
index 0a3496134dd..1d06b715f88 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
@@ -22,6 +22,7 @@ import (
"os"
"time"
+ //nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
@@ -48,7 +49,10 @@ var _ = Describe("Busybox controller", func() {
},
}
- typeNamespaceName := types.NamespacedName{Name: BusyboxName, Namespace: BusyboxName}
+ typeNamespaceName := types.NamespacedName{
+ Name: BusyboxName,
+ Namespace: BusyboxName,
+ }
busybox := &examplecomv1alpha1.Busybox{}
BeforeEach(func() {
@@ -126,13 +130,20 @@ var _ = Describe("Busybox controller", func() {
By("Checking the latest Status Condition added to the Busybox instance")
Eventually(func() error {
- if busybox.Status.Conditions != nil && len(busybox.Status.Conditions) != 0 {
+ if busybox.Status.Conditions != nil &&
+ len(busybox.Status.Conditions) != 0 {
latestStatusCondition := busybox.Status.Conditions[len(busybox.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{Type: typeAvailableBusybox,
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", busybox.Name, busybox.Spec.Size)}
+ expectedLatestStatusCondition := metav1.Condition{
+ Type: typeAvailableBusybox,
+ Status: metav1.ConditionTrue,
+ Reason: "Reconciling",
+ Message: fmt.Sprintf(
+ "Deployment for custom resource (%s) with %d replicas created successfully",
+ busybox.Name,
+ busybox.Spec.Size),
+ }
if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the busybox instance is not as expected")
+ return fmt.Errorf("The latest status condition added to the Busybox instance is not as expected")
}
}
return nil
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
index 9dd0faa9c7a..b17cbe01477 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
@@ -69,7 +69,6 @@ type MemcachedReconciler struct {
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
-
// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
// pattern you will create Controllers which provide a reconcile function
// responsible for synchronizing resources until the desired state is reached on the cluster.
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
index f96146c9b74..920db20dd05 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
@@ -22,6 +22,7 @@ import (
"os"
"time"
+ //nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
@@ -48,7 +49,10 @@ var _ = Describe("Memcached controller", func() {
},
}
- typeNamespaceName := types.NamespacedName{Name: MemcachedName, Namespace: MemcachedName}
+ typeNamespaceName := types.NamespacedName{
+ Name: MemcachedName,
+ Namespace: MemcachedName,
+ }
memcached := &examplecomv1alpha1.Memcached{}
BeforeEach(func() {
@@ -127,13 +131,20 @@ var _ = Describe("Memcached controller", func() {
By("Checking the latest Status Condition added to the Memcached instance")
Eventually(func() error {
- if memcached.Status.Conditions != nil && len(memcached.Status.Conditions) != 0 {
+ if memcached.Status.Conditions != nil &&
+ len(memcached.Status.Conditions) != 0 {
latestStatusCondition := memcached.Status.Conditions[len(memcached.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{Type: typeAvailableMemcached,
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, memcached.Spec.Size)}
+ expectedLatestStatusCondition := metav1.Condition{
+ Type: typeAvailableMemcached,
+ Status: metav1.ConditionTrue,
+ Reason: "Reconciling",
+ Message: fmt.Sprintf(
+ "Deployment for custom resource (%s) with %d replicas created successfully",
+ memcached.Name,
+ memcached.Spec.Size),
+ }
if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the memcached instance is not as expected")
+ return fmt.Errorf("The latest status condition added to the Memcached instance is not as expected")
}
}
return nil
diff --git a/testdata/project-v4-with-deploy-image/.golangci.yml b/testdata/project-v4-with-deploy-image/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/testdata/project-v4-with-deploy-image/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index 751cdd77165..fc949b7f470 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -64,6 +64,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
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 9dde8721abe..77993bc8d50 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
@@ -27,6 +27,7 @@ import (
// log is for logging in this package.
var memcachedlog = logf.Log.WithName("memcached-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Memcached) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
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 ad362da3011..d1abc45a294 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
@@ -132,8 +132,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index ca6cce659e2..12f6de5afc0 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -69,7 +69,6 @@ type BusyboxReconciler struct {
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
-
// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
// pattern you will create Controllers which provide a reconcile function
// responsible for synchronizing resources until the desired state is reached on the cluster.
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go
index 146c380873b..e3aeacd7191 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller_test.go
@@ -22,6 +22,7 @@ import (
"os"
"time"
+ //nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
@@ -48,7 +49,10 @@ var _ = Describe("Busybox controller", func() {
},
}
- typeNamespaceName := types.NamespacedName{Name: BusyboxName, Namespace: BusyboxName}
+ typeNamespaceName := types.NamespacedName{
+ Name: BusyboxName,
+ Namespace: BusyboxName,
+ }
busybox := &examplecomv1alpha1.Busybox{}
BeforeEach(func() {
@@ -126,13 +130,20 @@ var _ = Describe("Busybox controller", func() {
By("Checking the latest Status Condition added to the Busybox instance")
Eventually(func() error {
- if busybox.Status.Conditions != nil && len(busybox.Status.Conditions) != 0 {
+ if busybox.Status.Conditions != nil &&
+ len(busybox.Status.Conditions) != 0 {
latestStatusCondition := busybox.Status.Conditions[len(busybox.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{Type: typeAvailableBusybox,
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", busybox.Name, busybox.Spec.Size)}
+ expectedLatestStatusCondition := metav1.Condition{
+ Type: typeAvailableBusybox,
+ Status: metav1.ConditionTrue,
+ Reason: "Reconciling",
+ Message: fmt.Sprintf(
+ "Deployment for custom resource (%s) with %d replicas created successfully",
+ busybox.Name,
+ busybox.Spec.Size),
+ }
if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the busybox instance is not as expected")
+ return fmt.Errorf("The latest status condition added to the Busybox instance is not as expected")
}
}
return nil
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index d602cc86194..fb09c3095ff 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -69,7 +69,6 @@ type MemcachedReconciler struct {
// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
-
// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
// pattern you will create Controllers which provide a reconcile function
// responsible for synchronizing resources until the desired state is reached on the cluster.
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go
index 38e270374a4..00f8e7828d4 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller_test.go
@@ -22,6 +22,7 @@ import (
"os"
"time"
+ //nolint:golint
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
@@ -48,7 +49,10 @@ var _ = Describe("Memcached controller", func() {
},
}
- typeNamespaceName := types.NamespacedName{Name: MemcachedName, Namespace: MemcachedName}
+ typeNamespaceName := types.NamespacedName{
+ Name: MemcachedName,
+ Namespace: MemcachedName,
+ }
memcached := &examplecomv1alpha1.Memcached{}
BeforeEach(func() {
@@ -127,13 +131,20 @@ var _ = Describe("Memcached controller", func() {
By("Checking the latest Status Condition added to the Memcached instance")
Eventually(func() error {
- if memcached.Status.Conditions != nil && len(memcached.Status.Conditions) != 0 {
+ if memcached.Status.Conditions != nil &&
+ len(memcached.Status.Conditions) != 0 {
latestStatusCondition := memcached.Status.Conditions[len(memcached.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{Type: typeAvailableMemcached,
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, memcached.Spec.Size)}
+ expectedLatestStatusCondition := metav1.Condition{
+ Type: typeAvailableMemcached,
+ Status: metav1.ConditionTrue,
+ Reason: "Reconciling",
+ Message: fmt.Sprintf(
+ "Deployment for custom resource (%s) with %d replicas created successfully",
+ memcached.Name,
+ memcached.Spec.Size),
+ }
if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the memcached instance is not as expected")
+ return fmt.Errorf("The latest status condition added to the Memcached instance is not as expected")
}
}
return nil
diff --git a/testdata/project-v4-with-grafana/.golangci.yml b/testdata/project-v4-with-grafana/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/testdata/project-v4-with-grafana/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index 751cdd77165..fc949b7f470 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -64,6 +64,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
diff --git a/testdata/project-v4/.golangci.yml b/testdata/project-v4/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/testdata/project-v4/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index 751cdd77165..fc949b7f470 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -64,6 +64,21 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
##@ Build
.PHONY: build
diff --git a/testdata/project-v4/api/v1/admiral_webhook.go b/testdata/project-v4/api/v1/admiral_webhook.go
index b809f0feb0e..26b2c9f44c6 100644
--- a/testdata/project-v4/api/v1/admiral_webhook.go
+++ b/testdata/project-v4/api/v1/admiral_webhook.go
@@ -25,6 +25,7 @@ import (
// log is for logging in this package.
var admirallog = logf.Log.WithName("admiral-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Admiral) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4/api/v1/captain_webhook.go b/testdata/project-v4/api/v1/captain_webhook.go
index 7948f0387a6..ed99f7f0e55 100644
--- a/testdata/project-v4/api/v1/captain_webhook.go
+++ b/testdata/project-v4/api/v1/captain_webhook.go
@@ -27,6 +27,7 @@ import (
// log is for logging in this package.
var captainlog = logf.Log.WithName("captain-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *Captain) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4/api/v1/firstmate_webhook.go b/testdata/project-v4/api/v1/firstmate_webhook.go
index 941a86ed458..fda29007398 100644
--- a/testdata/project-v4/api/v1/firstmate_webhook.go
+++ b/testdata/project-v4/api/v1/firstmate_webhook.go
@@ -24,6 +24,7 @@ import (
// log is for logging in this package.
var firstmatelog = logf.Log.WithName("firstmate-resource")
+// SetupWebhookWithManager will setup the manager to manage the webhooks
func (r *FirstMate) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
diff --git a/testdata/project-v4/api/v1/webhook_suite_test.go b/testdata/project-v4/api/v1/webhook_suite_test.go
index bd1f7f75811..f15fd5f894a 100644
--- a/testdata/project-v4/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4/api/v1/webhook_suite_test.go
@@ -135,8 +135,7 @@ var _ = BeforeSuite(func() {
if err != nil {
return err
}
- conn.Close()
- return nil
+ return conn.Close()
}).Should(Succeed())
})
From 522614dbdd262c886a5bf7e51448d22c8ba98c1f Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Mon, 11 Sep 2023 13:39:10 +0100
Subject: [PATCH 0288/1245] Updating go deps
---
go.mod | 11 ++++-------
go.sum | 26 +++++++++++---------------
2 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/go.mod b/go.mod
index c11638d5c09..6ba49262914 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.13.0
- golang.org/x/tools v0.12.0
+ golang.org/x/tools v0.13.0
sigs.k8s.io/yaml v1.3.0
)
@@ -19,14 +19,11 @@ require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
+ github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
- github.com/kr/text v0.2.0 // indirect
- github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
golang.org/x/mod v0.12.0 // indirect
- golang.org/x/net v0.14.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
+ golang.org/x/net v0.15.0 // indirect
+ golang.org/x/sys v0.12.0 // 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 c01916bdd5f..8ee4a7b93f3 100644
--- a/go.sum
+++ b/go.sum
@@ -47,7 +47,6 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
-github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -118,8 +117,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
-github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb h1:LCMfzVg3sflxTs4UvuP4D8CkoZnfHLe2qzqgDn/4OHs=
+github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
@@ -135,13 +134,11 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/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.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
@@ -256,8 +253,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
-golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
+golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
+golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
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=
@@ -314,8 +311,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
-golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
+golang.org/x/sys v0.12.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=
@@ -377,8 +374,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.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
-golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
+golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
+golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
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=
@@ -473,9 +470,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
-gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
From ea82a4349ae391254afed87e18996c9be07dac7f Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Mon, 11 Sep 2023 14:00:21 +0100
Subject: [PATCH 0289/1245] doc: add info about status and webhooks
---
docs/book/src/reference/admission-webhook.md | 78 ++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/docs/book/src/reference/admission-webhook.md b/docs/book/src/reference/admission-webhook.md
index bc32756ea58..75ca8d1dd9f 100644
--- a/docs/book/src/reference/admission-webhook.md
+++ b/docs/book/src/reference/admission-webhook.md
@@ -21,3 +21,81 @@ if you want to authenticate the clients, you can configure the apiserver to use
basic auth, bearer token, or a cert to authenticate itself to the webhooks.
You can find detailed steps
[here](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#authenticate-apiservers).
+
+
+Execution Order
+
+**Validating webhooks run after all mutating webhooks**, so you don't need to worry about another webhook changing an
+object after your validation has accepted it.
+
+
+
+## Handling Resource Status in Admission Webhooks
+
+
+Execution Order
+
+**You cannot modify or default the status of a resource using a mutating admission webhook**.
+Set initial status in your controller when you first see a new object.
+
+
+
+### Understanding Why:
+
+#### Mutating Admission Webhooks
+
+Mutating Admission Webhooks are primarily designed to intercept and modify requests concerning the creation,
+modification, or deletion of objects. Though they possess the capability to modify an object's specification,
+directly altering its status isn't deemed a standard practice,
+often leading to unintended results.
+
+```go
+// MutatingWebhookConfiguration allows for modification of objects.
+// However, direct modification of the status might result in unexpected behavior.
+type MutatingWebhookConfiguration struct {
+ ...
+}
+```
+
+#### Setting Initial Status
+
+For those diving into custom controllers for custom resources, it's imperative to grasp the concept of setting an
+initial status. This initialization typically takes place within the controller itself. The moment the controller
+identifies a new instance of its managed resource, primarily through a watch mechanism, it holds the authority
+to assign an initial status to that resource.
+
+```go
+// Custom controller's reconcile function might look something like this:
+func (r *ReconcileMyResource) Reconcile(request reconcile.Request) (reconcile.Result, error) {
+ // ...
+ // Upon discovering a new instance, set the initial status
+ instance.Status = SomeInitialStatus
+ // ...
+}
+```
+
+#### Status Subresource
+
+Delving into Kubernetes custom resources, a clear demarcation exists between the spec (depicting the desired state)
+and the status (illustrating the observed state). Activating the /status subresource for a custom resource definition
+(CRD) bifurcates the `status` and `spec`, each assigned to its respective API endpoint.
+This separation ensures that changes introduced by users, such as modifying the spec, and system-driven updates,
+like status alterations, remain distinct. Leveraging a mutating webhook to tweak the status during a spec-modifying
+operation might not pan out as expected, courtesy of this isolation.
+
+```yaml
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: myresources.mygroup.mydomain
+spec:
+ ...
+ subresources:
+ status: {} # Enables the /status subresource
+```
+
+#### Conclusion
+
+While certain edge scenarios might allow a mutating webhook to seamlessly modify the status, treading this path isn't a
+universally acclaimed or recommended strategy. Entrusting the controller logic with status updates remains the
+most advocated approach.
\ No newline at end of file
From 1756efefaedc4302661e6b48f909a1211ec16925 Mon Sep 17 00:00:00 2001
From: Joe Searcy
Date: Mon, 11 Sep 2023 15:41:39 -0400
Subject: [PATCH 0290/1245] Update docs for using decoder with core type
webhook
Signed-off-by: Joe Searcy
---
.../src/reference/webhook-for-core-types.md | 25 ++++++++++---------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/docs/book/src/reference/webhook-for-core-types.md b/docs/book/src/reference/webhook-for-core-types.md
index 692ef22fc35..5e487c2d5ae 100644
--- a/docs/book/src/reference/webhook-for-core-types.md
+++ b/docs/book/src/reference/webhook-for-core-types.md
@@ -38,18 +38,6 @@ func (a *podAnnotator) Handle(ctx context.Context, req admission.Request) admiss
}
```
-If you need a client, just pass in the client at struct construction time.
-
-If you add the `InjectDecoder` method for your handler, a decoder will be
-injected for you.
-
-```go
-func (a *podAnnotator) InjectDecoder(d *admission.Decoder) error {
- a.decoder = d
- return nil
-}
-```
-
**Note**: in order to have controller-gen generate the webhook configuration for
you, you need to add markers. For example,
`// +kubebuilder:webhook:path=/mutate-v1-pod,mutating=true,failurePolicy=fail,groups="",resources=pods,verbs=create;update,versions=v1,name=mpod.kb.io`
@@ -64,6 +52,19 @@ mgr.GetWebhookServer().Register("/mutate-v1-pod", &webhook.Admission{Handler: &p
You need to ensure the path here match the path in the marker.
+### Client/Decoder
+
+If you need a client and/or decoder, just pass them in at struct construction time.
+
+```go
+mgr.GetWebhookServer().Register("/mutate-v1-pod", &webhook.Admission{
+ Handler: &podAnnotator{
+ Client: mgr.GetClient(),
+ Decoder: admission.NewDecoder(mgr.GetScheme()),
+ },
+})
+```
+
## Deploy
Deploying it is just like deploying a webhook server for CRD. You need to
From 382c2d02b5aacbcd257187adbda0fe3830fca330 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 11 Sep 2023 23:44:48 +0000
Subject: [PATCH 0291/1245] :seedling: Bump goreleaser/goreleaser-action from 4
to 5
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4 to 5.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/v4...v5)
---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/release.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 126cd2074a1..61ec007795b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,7 +19,7 @@ jobs:
with:
go-version: '~1.20'
- name: Run GoReleaser
- uses: goreleaser/goreleaser-action@v4
+ uses: goreleaser/goreleaser-action@v5
with:
version: v1.11.2
args: release -f ./build/.goreleaser.yml --rm-dist
From f7c05e9f38a0fecdcb0a649b3684283928a24bd8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 11 Sep 2023 23:46:30 +0000
Subject: [PATCH 0292/1245] Bump sigs.k8s.io/kubebuilder/v3
Bumps [sigs.k8s.io/kubebuilder/v3](https://github.com/kubernetes-sigs/kubebuilder) from 3.11.1 to 3.12.0.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder/compare/v3.11.1...v3.12.0)
---
updated-dependencies:
- dependency-name: sigs.k8s.io/kubebuilder/v3
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.../testdata/sampleexternalplugin/v1/go.mod | 10 +++----
.../testdata/sampleexternalplugin/v1/go.sum | 26 +++++++++----------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
index f03a56b936d..14f2dc50aff 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
@@ -4,14 +4,14 @@ go 1.20
require (
github.com/spf13/pflag v1.0.5
- sigs.k8s.io/kubebuilder/v3 v3.11.1
+ sigs.k8s.io/kubebuilder/v3 v3.12.0
)
require (
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/spf13/afero v1.9.5 // indirect
- golang.org/x/mod v0.11.0 // indirect
- golang.org/x/sys v0.9.0 // indirect
- golang.org/x/text v0.10.0 // indirect
- golang.org/x/tools v0.10.0 // indirect
+ golang.org/x/mod v0.12.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
+ golang.org/x/tools v0.12.0 // indirect
)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
index a9d1c75e2fe..d13d78f9029 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
@@ -129,8 +129,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
-github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc=
+github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
+github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
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=
@@ -201,8 +201,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
-golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
+golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -235,7 +235,7 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
+golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
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=
@@ -290,8 +290,8 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
-golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/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=
@@ -301,8 +301,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
-golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
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=
@@ -353,8 +353,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.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=
-golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
+golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
+golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
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=
@@ -465,6 +465,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/kubebuilder/v3 v3.11.1 h1:WbzjgZVIOYXJLRqal+j9YL4SjxjSvUuCas2j3NmzMq0=
-sigs.k8s.io/kubebuilder/v3 v3.11.1/go.mod h1:4Re8w/tE0RsqR2IN5VnwCUgsbaIPk9DcYcZlRVALA2M=
+sigs.k8s.io/kubebuilder/v3 v3.12.0 h1:POh46v+T2wPGzAzcIE/eKlwZr17nn+R49elJg2Wz2qU=
+sigs.k8s.io/kubebuilder/v3 v3.12.0/go.mod h1:ZJZ6jpjhh0skfehrYl7b8X/SCozhfLAU7IYV8ZN/f3s=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
From 67c798a0d66fafabc4c92c8d491d6b9647c8fbf1 Mon Sep 17 00:00:00 2001
From: Jesse Claven
Date: Tue, 12 Sep 2023 09:09:33 +0100
Subject: [PATCH 0293/1245] =?UTF-8?q?=F0=9F=93=96=20docs(cert-manager):=20?=
=?UTF-8?q?Change=20ownership=20links=20(#3610)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
📖 docs(cert-manager): Change ownership links (#3610)
---
.../book/src/cronjob-tutorial/cert-manager.md | 2 +-
docs/book/src/migration/legacy/v1vsv2.md | 2 +-
.../src/multiversion-tutorial/deployment.md | 2 +-
docs/book/src/reference/envtest.md | 54 +++++++++----------
test/e2e/utils/test_context.go | 2 +-
5 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/docs/book/src/cronjob-tutorial/cert-manager.md b/docs/book/src/cronjob-tutorial/cert-manager.md
index 594cfd1eebb..c2596deb8f8 100644
--- a/docs/book/src/cronjob-tutorial/cert-manager.md
+++ b/docs/book/src/cronjob-tutorial/cert-manager.md
@@ -1,6 +1,6 @@
# Deploying cert-manager
-We suggest using [cert-manager](https://github.com/jetstack/cert-manager) for
+We suggest using [cert-manager](https://github.com/cert-manager/cert-manager) for
provisioning the certificates for the webhook server. Other solutions should
also work as long as they put the certificates in the desired location.
diff --git a/docs/book/src/migration/legacy/v1vsv2.md b/docs/book/src/migration/legacy/v1vsv2.md
index 20ee9a3c287..993a29845a3 100644
--- a/docs/book/src/migration/legacy/v1vsv2.md
+++ b/docs/book/src/migration/legacy/v1vsv2.md
@@ -31,7 +31,7 @@ information.
- Automatic certificate generation for webhooks has been removed, and webhooks
will no longer self-register. Use controller-tools to generate a webhook
configuration. If you need certificate generation, we recommend using
-[cert-manager](https://github.com/jetstack/cert-manager). Kubebuilder v2 will
+[cert-manager](https://github.com/cert-manager/cert-manager). Kubebuilder v2 will
scaffold out cert manager configs for you to use -- see the
[Webhook Tutorial](/cronjob-tutorial/webhook-implementation.md) for more details.
diff --git a/docs/book/src/multiversion-tutorial/deployment.md b/docs/book/src/multiversion-tutorial/deployment.md
index d3fd45cec29..71a7840051a 100644
--- a/docs/book/src/multiversion-tutorial/deployment.md
+++ b/docs/book/src/multiversion-tutorial/deployment.md
@@ -34,7 +34,7 @@ You'll need [cert-manager](../cronjob-tutorial/cert-manager.md) installed
(version `0.9.0+`) unless you've got some other certificate management
solution. The Kubebuilder team has tested the instructions in this tutorial
with
-[0.9.0-alpha.0](https://github.com/jetstack/cert-manager/releases/tag/v0.9.0-alpha.0)
+[0.9.0-alpha.0](https://github.com/cert-manager/cert-manager/releases/tag/v0.9.0-alpha.0)
release.
Once all our ducks are in a row with certificates, we can run `make
diff --git a/docs/book/src/reference/envtest.md b/docs/book/src/reference/envtest.md
index 7154f93108d..38f17bdfb89 100644
--- a/docs/book/src/reference/envtest.md
+++ b/docs/book/src/reference/envtest.md
@@ -1,28 +1,28 @@
# Configuring envtest for integration tests
-The [`controller-runtime/pkg/envtest`][envtest] Go library helps write integration tests for your controllers by setting up and starting an instance of etcd and the
+The [`controller-runtime/pkg/envtest`][envtest] Go library helps write integration tests for your controllers by setting up and starting an instance of etcd and the
Kubernetes API server, without kubelet, controller-manager or other components.
## Installation
Installing the binaries is as a simple as running `make envtest`. `envtest` will download the Kubernetes API server binaries to the `bin/` folder in your project
-by default. `make test` is the one-stop shop for downloading the binaries, setting up the test environment, and running the tests.
+by default. `make test` is the one-stop shop for downloading the binaries, setting up the test environment, and running the tests.
-The make targets require `bash` to run.
+The make targets require `bash` to run.
## 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).
-The examples below will show how to install the Kubernetes API binaries using mostly defaults set by `setup-envtest`.
+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).
+The examples below will show how to install the Kubernetes API binaries using mostly defaults set by `setup-envtest`.
### Download the binaries
-`make envtest` will download the `setup-envtest` binary to `./bin/`.
+`make envtest` will download the `setup-envtest` binary to `./bin/`.
```shell
make envtest
```
-Installing the binaries using `setup-envtest` stores the binary in OS specific locations, you can read more about them
+Installing the binaries using `setup-envtest` stores the binary in OS specific locations, you can read more about them
[here](https://github.com/kubernetes-sigs/controller-runtime/tree/master/tools/setup-envtest#where-does-it-put-all-those-binaries)
```sh
./bin/setup-envtest use 1.21.2
@@ -30,7 +30,7 @@ Installing the binaries using `setup-envtest` stores the binary in OS specific l
### Update the test make target
Once these binaries are installed, change the `test` make target to include a `-i` like below. `-i` will only check for locally installed
-binaries and not reach out to remote resources. You could also set the `ENVTEST_INSTALLED_ONLY` env variable.
+binaries and not reach out to remote resources. You could also set the `ENVTEST_INSTALLED_ONLY` env variable.
```makefile
test: manifests generate fmt vet
@@ -91,7 +91,7 @@ Controller-runtime’s [envtest][envtest] framework requires `kubectl`, `kube-ap
The `make test` command will install these binaries to the `bin/` directory and use them when running tests that use `envtest`.
Ie,
-```shell
+```shell
./bin/k8s/
└── 1.25.0-darwin-amd64
├── etcd
@@ -125,7 +125,7 @@ var _ = BeforeSuite(func(done Done) {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
testenv = &envtest.Environment{}
-
+
_, err := testenv.Start()
Expect(err).NotTo(HaveOccurred())
@@ -213,25 +213,25 @@ For further information see the issue raised in the controller-runtime [controll
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.
-Therefore, to test a reconciliation in common cases you do not need to care about these options. However, if you would like to do tests with the Prometheus and the Cert-manager installed you can add the required steps to install them before running the tests.
+Therefore, to test a reconciliation in common cases you do not need to care about these options. However, if you would like to do tests with the Prometheus and the Cert-manager installed you can add the required steps to install them before running the tests.
Following an example.
```go
- // Add the operations to install the Prometheus operator and the cert-manager
- // before the tests.
+ // Add the operations to install the Prometheus operator and the cert-manager
+ // before the tests.
BeforeEach(func() {
By("installing prometheus operator")
Expect(utils.InstallPrometheusOperator()).To(Succeed())
-
+
By("installing the cert-manager")
Expect(utils.InstallCertManager()).To(Succeed())
}
-
+
// You can also remove them after the tests::
AfterEach(func() {
By("uninstalling the Prometheus manager bundle")
utils.UninstallPrometheusOperManager()
-
+
By("uninstalling the cert-manager bundle")
utils.UninstallCertManager()
})
@@ -244,7 +244,7 @@ const (
prometheusOperatorVersion = "0.51"
prometheusOperatorURL = "https://raw.githubusercontent.com/prometheus-operator/" + "prometheus-operator/release-%s/bundle.yaml"
certmanagerVersion = "v1.5.3"
- certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+ certmanagerURLTmpl = "https://github.com/cert-manager/cert-manager/releases/download/%s/cert-manager.yaml"
)
func warnError(err error) {
@@ -284,14 +284,14 @@ func InstallCertManager() error {
if _, err := Run(cmd); err != nil {
return err
}
- // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
- //was re-installed after uninstalling on a cluster.
- cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
- "--for", "condition=Available",
- "--namespace", "cert-manager",
- "--timeout", "5m",
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ //was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
)
-
+
_, err := Run(cmd)
return err
}
@@ -302,7 +302,7 @@ func LoadImageToKindClusterWithName(name string) error {
if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
cluster = v
}
-
+
kindOptions := []string{"load", "docker-image", name, "--name", cluster}
cmd := exec.Command("kind", kindOptions...)
_, err := Run(cmd)
diff --git a/test/e2e/utils/test_context.go b/test/e2e/utils/test_context.go
index 1ae91489783..0f0a2be9aba 100644
--- a/test/e2e/utils/test_context.go
+++ b/test/e2e/utils/test_context.go
@@ -32,7 +32,7 @@ import (
const (
certmanagerVersion = "v1.5.3"
- certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+ certmanagerURLTmpl = "https://github.com/cert-manager/cert-manager/releases/download/%s/cert-manager.yaml"
prometheusOperatorVersion = "0.51"
prometheusOperatorURL = "https://raw.githubusercontent.com/prometheus-operator/" +
"prometheus-operator/release-%s/bundle.yaml"
From d8c8f4d2aa28ed13da1e252741e3e86cec48fa01 Mon Sep 17 00:00:00 2001
From: semihbkgr
Date: Tue, 12 Sep 2023 15:44:50 +0300
Subject: [PATCH 0294/1245] improvements and fixes in the documentation
---
docs/README.md | 2 +-
docs/book/src/faq.md | 2 +-
docs/book/src/introduction.md | 4 ++--
docs/book/src/quick-start.md | 4 ++--
docs/book/src/reference/good-practices.md | 13 ++++++++-----
docs/book/src/reference/raising-events.md | 7 +++++++
.../watching-resources/operator-managed.md | 3 ++-
7 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/docs/README.md b/docs/README.md
index 63c3996b1a5..ec9980fda5a 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -4,7 +4,7 @@ The kubebuilder book is served using [mdBook](https://github.com/rust-lang-nurse
1. Follow the instructions at [https://github.com/rust-lang-nursery/mdBook#installation](https://github.com/rust-lang-nursery/mdBook#installation) to
install mdBook.
-2. Make sure [controller-gen](https://pkg.go.dev/sigs.k8s.io/controller-tools/cmd/controller-gen) is install in `$GOPATH`.
+2. Make sure [controller-gen](https://pkg.go.dev/sigs.k8s.io/controller-tools/cmd/controller-gen) is installed in `$GOPATH`.
3. cd into the `docs/book` directory
4. Run `mdbook serve`
5. Visit [http://localhost:3000](http://localhost:3000)
diff --git a/docs/book/src/faq.md b/docs/book/src/faq.md
index 0e8aa54c296..517a5a0d69b 100644
--- a/docs/book/src/faq.md
+++ b/docs/book/src/faq.md
@@ -55,7 +55,7 @@ environment variables to only add this option for development purposes, such as:
```go
leaderElectionNS := ""
- if os.Getenv("ENABLE_LEADER_ELECATION_NAMESPACE") != "false" {
+ if os.Getenv("ENABLE_LEADER_ELECTION_NAMESPACE") != "false" {
leaderElectionNS = "-system"
}
diff --git a/docs/book/src/introduction.md b/docs/book/src/introduction.md
index 4db659d5f42..b245e8fa1f1 100644
--- a/docs/book/src/introduction.md
+++ b/docs/book/src/introduction.md
@@ -51,8 +51,8 @@ common tooling to manage the objects.
Building services as Kubernetes APIs provides many advantages to plain old REST, including:
* Hosted API endpoints, storage, and validation.
-* Rich tooling and clis such as `kubectl` and `kustomize`.
-* Support for Authn and granular Authz.
+* Rich tooling and CLIs such as `kubectl` and `kustomize`.
+* Support for AuthN and granular AuthZ.
* Support for API evolution through API versioning and conversion.
* Facilitation of adaptive / self-healing APIs that continuously respond to changes
in the system state without user intervention.
diff --git a/docs/book/src/quick-start.md b/docs/book/src/quick-start.md
index 3b01a0b032b..e1cc22c8dbe 100644
--- a/docs/book/src/quick-start.md
+++ b/docs/book/src/quick-start.md
@@ -21,7 +21,7 @@ Projects created by Kubebuilder contain a Makefile that will install tools at ve
- [kustomize](https://github.com/kubernetes-sigs/kustomize)
- [controller-gen](https://github.com/kubernetes-sigs/controller-tools)
-The versions which are defined in the `Makefile` and `go.mod` files are the versions tested and therefore is recommend to use the specified versions.
+The versions which are defined in the `Makefile` and `go.mod` files are the versions tested and therefore is recommended to use the specified versions.
@@ -91,7 +91,7 @@ and the `internal/controllers/guestbook_controller.go` where the reconciliation
logic. For more info see [Designing an API](/cronjob-tutorial/api-design.md) and [What's in
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
+If you are editing the API definitions, generate the manifests such as Custom Resources (CRs) or Custom Resource Definitions (CRDs) using
```bash
make manifests
```
diff --git a/docs/book/src/reference/good-practices.md b/docs/book/src/reference/good-practices.md
index eb7cedd802c..08def0b8128 100644
--- a/docs/book/src/reference/good-practices.md
+++ b/docs/book/src/reference/good-practices.md
@@ -18,9 +18,9 @@ Building your operator commonly involves extending the Kubernetes API itself. It
Additionally, we recommend checking the documentation on [Operator patterns][operator-pattern] from Kubernetes to better understand the purpose of the standard solutions built with KubeBuilder.
-## Why you should adhere to the k8s API conventions and standards
+## Why you should adhere to the Kubernetes API conventions and standards
-Embracing the [Kubernetes API conventions and standards][k8s-api-convetions] is crucial for maximizing the potential of your applications and deployments. By adhering to these established practices, you can benefit in several ways.
+Embracing the [Kubernetes API conventions and standards][k8s-api-conventions] is crucial for maximizing the potential of your applications and deployments. By adhering to these established practices, you can benefit in several ways.
Firstly, adherence ensures seamless interoperability within the Kubernetes ecosystem. Following conventions allows your applications to work harmoniously with other components, reducing compatibility issues and promoting a consistent user experience.
@@ -57,7 +57,7 @@ These challenges underline the importance of assigning each controller the singl
## Why You Should Adopt Status Conditions
-We recommend you manage your solutions using Status Conditionals following the [K8s Api conventions][k8s-aoi-convetions] because:
+We recommend you manage your solutions using Status Conditionals following the [K8s Api conventions][k8s-api-conventions] because:
- **Standardization**: Conditions provide a standardized way to represent the state of an Operator's custom resources, making it easier for users and tools to understand and interpret the resource's status.
- **Readability**: Conditions can clearly express complex states by using a combination of multiple conditions, making it easier for users to understand the current state and progress of the resource.
@@ -75,10 +75,13 @@ Therefore, you can check an example of Status Conditional usage by looking at it
-[docs]: ./cronjob-tutorial/gvks.html
+[docs]: /cronjob-tutorial/gvks.html
[operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
[controllers]: https://kubernetes.io/docs/concepts/architecture/controller/
[controller-runtime-topic]: https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md#q-how-do-i-have-different-logic-in-my-reconciler-for-different-types-of-events-eg-create-update-delete
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
-[deploy-image]: ./plugins/deploy-image-plugin-v1-alpha.md
+[deploy-image]: /plugins/deploy-image-plugin-v1-alpha.md
[controller-runtime-manager]: https://github.com/kubernetes-sigs/controller-runtime/blob/304027bcbe4b3f6d582180aec5759eb4db3f17fd/pkg/manager/manager.go#L53
+[k8s-api-conventions]: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
+[k8s-control-loop]: https://kubernetes.io/docs/concepts/architecture/controller/
+[k8s-operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
diff --git a/docs/book/src/reference/raising-events.md b/docs/book/src/reference/raising-events.md
index 5633d43352a..7e22c5d4862 100644
--- a/docs/book/src/reference/raising-events.md
+++ b/docs/book/src/reference/raising-events.md
@@ -75,9 +75,13 @@ type MyKindReconciler struct {
// See that we added the following code to allow us to pass the record.EventRecorder
Recorder record.EventRecorder
}
+```
+
### Passing the EventRecorder to the Controller
+
Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`,
which can be created for a Controller by calling `GetRecorder(name string)` on a Manager. See that we will change the implementation scaffolded in `cmd/main.go`:
+
```go
if err = (&controller.MyKindReconciler{
Client: mgr.GetClient(),
@@ -89,15 +93,18 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a
os.Exit(1)
}
```
+
### Granting the required permissions
You must also grant the RBAC rules permissions to allow your project to create Events. Therefore, ensure that you add the [RBAC][rbac-markers] into your controller:
+
```go
...
//+kubebuilder:rbac:groups=core,resources=events,verbs=create;patch
...
func (r *MyKindReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
```
+
And then, run `$ make manifests` to update the rules under `config/rbac/rule.yaml`.
[Events]: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#events
diff --git a/docs/book/src/reference/watching-resources/operator-managed.md b/docs/book/src/reference/watching-resources/operator-managed.md
index 3c4c69a86b2..6853ade2dba 100644
--- a/docs/book/src/reference/watching-resources/operator-managed.md
+++ b/docs/book/src/reference/watching-resources/operator-managed.md
@@ -10,10 +10,11 @@ Managing dependency resources is fundamental to a controller, and it's not possi
- ReplicaSets must know when their Pods are deleted, or change from healthy to unhealthy.
Through the `Owns()` functionality, Controller Runtime provides an easy way to watch dependency resources for changes.
+A resource can be defined as dependent on another resource through the 'ownerReferences' field.
As an example, we are going to create a `SimpleDeployment` resource.
The `SimpleDeployment`'s purpose is to manage a `Deployment` that users can change certain aspects of, through the `SimpleDeployment` Spec.
-The `SimpleDeployment` controller's purpose is to make sure that it's owned `Deployment` always uses the settings provided by the user.
+The `SimpleDeployment` controller's purpose is to make sure that it's owned `Deployment` (has an ownerReference which points to `SimpleDeployment` resource) always uses the settings provided by the user.
### Provide basic templating in the `Spec`
From e43663bf9990e28fde465a3ec210a38a2f64b43c Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Wed, 13 Sep 2023 21:51:39 +0800
Subject: [PATCH 0295/1245] runtime error on darwin arm64 machine: killed
Signed-off-by: lowang-bh
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index c3db5404eaf..b7103457b32 100644
--- a/Makefile
+++ b/Makefile
@@ -58,6 +58,7 @@ build: ## Build the project locally
.PHONY: install
install: build ## Build and install the binary with the current source code. Use it to test your changes locally.
+ rm -f $(GOBIN)/kubebuilder
cp ./bin/kubebuilder $(GOBIN)/kubebuilder
##@ Development
From b1b77a80ab1717e2fbfdd33b5b3b567676727a37 Mon Sep 17 00:00:00 2001
From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Date: Wed, 13 Sep 2023 22:35:01 +0100
Subject: [PATCH 0296/1245] Update docs/book/src/reference/admission-webhook.md
---
docs/book/src/reference/admission-webhook.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/reference/admission-webhook.md b/docs/book/src/reference/admission-webhook.md
index 75ca8d1dd9f..e1ec2256fea 100644
--- a/docs/book/src/reference/admission-webhook.md
+++ b/docs/book/src/reference/admission-webhook.md
@@ -33,7 +33,7 @@ object after your validation has accepted it.
## Handling Resource Status in Admission Webhooks
-Execution Order
+Modify status
**You cannot modify or default the status of a resource using a mutating admission webhook**.
Set initial status in your controller when you first see a new object.
From a1c6eb502aa5c626d8ce7d676f07211521cc61d8 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Wed, 6 Sep 2023 09:23:55 +0100
Subject: [PATCH 0297/1245] Add getting started doc
Co-authored-by: Varsha
---
docs/book/src/SUMMARY.md | 4 +-
docs/book/src/getting-started.md | 540 +++++++++++++++++++++++++++++++
2 files changed, 543 insertions(+), 1 deletion(-)
create mode 100644 docs/book/src/getting-started.md
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index 90a385589f7..6ddbcdbab51 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -2,9 +2,11 @@
[Introduction](./introduction.md)
+[Architecture](./architecture.md)
+
[Quick Start](./quick-start.md)
-[Architecture](./architecture.md)
+[Getting Started](./getting-started.md)
---
diff --git a/docs/book/src/getting-started.md b/docs/book/src/getting-started.md
new file mode 100644
index 00000000000..ab11b7aa77c
--- /dev/null
+++ b/docs/book/src/getting-started.md
@@ -0,0 +1,540 @@
+# Getting Started
+
+## Overview
+
+By following the [Operator Pattern][k8s-operator-pattern], it’s possible not only to provide all expected resources
+but also to manage them dynamically, programmatically, and at execution time. To illustrate this idea, imagine if
+someone accidentally changed a configuration or removed a resource by mistake; in this case, the operator could fix it
+without any human intervention.
+
+## Sample Project
+
+We will create a sample project to let you know how it works. This sample will:
+
+- Reconcile a Memcached CR - which represents an instance of a Memcached deployed/managed on cluster
+- Create a Deployment with the Memcached image
+- Not allow more instances than the size defined in the CR which will be applied
+- Update the Memcached CR status
+
+Following the steps.
+
+## Create a project
+
+First, create and navigate into a directory for your project. Then, initialize it using `kubebuilder`:
+
+```shell
+mkdir $GOPATH/memcached-operator
+cd $GOPATH/memcached-operator
+kubebuilder init --domain=example.com
+```
+
+## Create the Memcached API (CRD):
+
+Next, we'll create a new API responsible for deploying and managing our Memcached solution. In this instance, we will utilize the [Deploy Image Plugin][deploy-image] to get a comprehensive code implementation for our solution.
+
+```
+kubebuilder create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,-o,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha" --make=false
+```
+
+### Understanding APIs
+
+This command's primary aim is to produce the Custom Resource (CR) and Custom Resource Definition (CRD) for the Memcached Kind. It creates the API with the group `cache.example.com` and version `v1alpha1`, uniquely identifying the new CRD of the Memcached Kind. By leveraging the Kubebuilder tool, we can define our APIs and objects representing our solutions for these platforms. While we've added only one Kind of resource in this example, you can have as many `Groups` and `Kinds` as necessary. Simply put, think of CRDs as the definition of our custom Objects, while CRs are instances of them.
+
+
+Getting a better idea
+
+Consider a typical scenario where the objective is to run an application and its database on a Kubernetes platform. In this context, one object might represent the Frontend App, while another denotes the backend Data Base. If we define one CRD for the App and another for the DB, we uphold essential concepts like encapsulation, the single responsibility principle, and cohesion. Breaching these principles might lead to complications, making extension, reuse, or maintenance challenging.
+
+In essence, the App CRD and the DB CRD will have their controller. Let's say, for instance, that the application requires a Deployment and Service to run. In this example, the App’s Controller will cater to these needs. Similarly, the DB’s controller will manage the business logic of its items.
+
+Therefore, for each CRD, there should be one distinct controller, adhering to the design outlined by the [controller-runtime][controller-runtime]. For further information see [Groups and Versions and Kinds, oh my!][group-kind-oh-my].
+
+
+
+### Define your API
+
+In this example, observe that the Memcached Kind (CRD) possesses certain specifications. These were scaffolded by the Deploy Image plugin, building upon the default scaffold for management purposes:
+
+#### Status and Specs
+
+The `MemcachedSpec` section is where we encapsulate all the available specifications and configurations for our Custom Resource (CR). Furthermore, it's worth noting that we employ Status Conditions. This ensures proficient management of the Memcached CR. When any change transpires, these conditions equip us with the necessary data to discern the current status of this resource within the Kubernetes cluster. This is akin to the status insights we obtain for a Deployment resource.
+
+From: `api/v1alpha1/memcached_types.go`
+
+```go
+// MemcachedSpec defines the desired state of Memcached
+type MemcachedSpec struct {
+// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+// Important: Run "make" to regenerate code after modifying this file
+
+// Size defines the number of Memcached instances
+// The following markers will use OpenAPI v3 schema to validate the value
+// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
+// +kubebuilder:validation:Minimum=1
+// +kubebuilder:validation:Maximum=3
+// +kubebuilder:validation:ExclusiveMaximum=false
+Size int32 `json:"size,omitempty"`
+
+// Port defines the port that will be used to init the container with the image
+ContainerPort int32 `json:"containerPort,omitempty"`
+}
+
+// MemcachedStatus defines the observed state of Memcached
+type MemcachedStatus struct {
+// Represents the observations of a Memcached's current state.
+// Memcached.status.conditions.type are: "Available", "Progressing", and "Degraded"
+// Memcached.status.conditions.status are one of True, False, Unknown.
+// Memcached.status.conditions.reason the value should be a CamelCase string and producers of specific
+// condition types may define expected values and meanings for this field, and whether the values
+// are considered a guaranteed API.
+// Memcached.status.conditions.Message is a human readable message indicating details about the transition.
+// For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
+
+Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
+}
+```
+
+Thus, when we introduce new specifications to this file and execute the `make generate` command, we utilize [controller-gen][controller-gen] to generate the CRD manifest, which is located under the `config/crds` directory.
+
+#### Markers and validations
+
+Moreover, it's important to note that we're employing `markers`, such as `+kubebuilder:validation:Minimum=1`. These markers help in defining validations and criteria, ensuring that data provided by users—when they create or edit a Custom Resource for the Memcached Kind—is properly validated. For a comprehensive list and details of available markers, refer [here][markers].
+Observe the validation schema within the CRD; this schema ensures that the Kubernetes API properly validates the Custom Resources (CRs) that are applied:
+
+From: `config/crd/bases/example.com.testproject.org_memcacheds.yaml`
+```yaml
+ description: MemcachedSpec defines the desired state of Memcached
+ properties:
+ containerPort:
+ description: Port defines the port that will be used to init the container
+ with the image
+ format: int32
+ type: integer
+ size:
+ description: 'Size defines the number of Memcached instances The following
+ markers will use OpenAPI v3 schema to validate the value More info:
+ https://book.kubebuilder.io/reference/markers/crd-validation.html'
+ format: int32
+ maximum: 3 ## See here from the marker +kubebuilder:validation:Maximum=3
+ minimum: 1 ## See here from the marker +kubebuilder:validation:Minimum=1
+ type: integer
+ type: object
+
+```
+
+#### Sample of Custom Resources
+
+The manifests located under the "config/samples" directory serve as examples of Custom Resources that can be applied to the cluster.
+In this particular example, by applying the given resource to the cluster, we would generate a Deployment with a single instance size (see `size: 1`).
+
+From: `config/samples/example.com_v1alpha1_memcached.yaml`
+
+```shell
+apiVersion: example.com.testproject.org/v1alpha1
+kind: Memcached
+metadata:
+ name: memcached-sample
+spec:
+ # TODO(user): edit the following value to ensure the number
+ # of Pods/Instances your Operand must have on cluster
+ size: 1
+# TODO(user): edit the following value to ensure the container has the right port to be initialized
+ containerPort: 11211
+```
+
+### Reconciliation Process
+
+The reconciliation function plays a pivotal role in ensuring synchronization between resources and their specifications based on the business logic embedded within them. Essentially, it operates like a loop, continuously checking conditions and performing actions until all conditions align with its implementation. Here's a pseudo-code to illustrate this:
+
+```go
+reconcile App {
+
+// Check if a Deployment for the app exists, if not, create one
+// If there's an error, then restart from the beginning of the reconcile
+if err != nil {
+return reconcile.Result{}, err
+}
+
+// Check if a Service for the app exists, if not, create one
+// If there's an error, then restart from the beginning of the reconcile
+if err != nil {
+return reconcile.Result{}, err
+}
+
+// Look for Database CR/CRD
+// Check the Database Deployment's replicas size
+// If deployment.replicas size doesn't match cr.size, then update it
+// Then, restart from the beginning of the reconcile. For example, by returning `reconcile.Result{Requeue: true}, nil`.
+if err != nil {
+return reconcile.Result{Requeue: true}, nil
+}
+...
+
+// If at the end of the loop:
+// Everything was executed successfully, and the reconcile can stop
+return reconcile.Result{}, nil
+
+}
+```
+
+#### Return Options
+
+The following are a few possible return options to restart the Reconcile:
+
+- With the error:
+
+```go
+return ctrl.Result{}, err
+```
+- Without an error:
+
+```go
+return ctrl.Result{Requeue: true}, nil
+```
+
+- Therefore, to stop the Reconcile, use:
+
+```go
+return ctrl.Result{}, nil
+```
+
+- Reconcile again after X time:
+
+```go
+return ctrl.Result{RequeueAfter: nextRun.Sub(r.Now())}, nil
+```
+
+#### In the context of our example
+
+When a Custom Resource is applied to the cluster, there's a designated controller to manage the Memcached Kind. You can check its reconciliation implemented:
+
+From `testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go`:
+
+```go
+func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+log := log.FromContext(ctx)
+
+// Fetch the Memcached instance
+// The purpose is to check if the Custom Resource for the Kind Memcached
+// is applied on the cluster if not we return nil to stop the reconciliation
+memcached := &examplecomv1alpha1.Memcached{}
+err := r.Get(ctx, req.NamespacedName, memcached)
+if err != nil {
+if apierrors.IsNotFound(err) {
+// If the custom resource is not found then, it usually means that it was deleted or not created
+// In this way, we will stop the reconciliation
+log.Info("memcached resource not found. Ignoring since object must be deleted")
+return ctrl.Result{}, nil
+}
+// Error reading the object - requeue the request.
+log.Error(err, "Failed to get memcached")
+return ctrl.Result{}, err
+}
+
+// Let's just set the status as Unknown when no status are available
+if memcached.Status.Conditions == nil || len(memcached.Status.Conditions) == 0 {
+meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
+if err = r.Status().Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update Memcached status")
+return ctrl.Result{}, err
+}
+
+// Let's re-fetch the memcached Custom Resource after update the status
+// so that we have the latest state of the resource on the cluster and we will avoid
+// raise the issue "the object has been modified, please apply
+// your changes to the latest version and try again" which would re-trigger the reconciliation
+// if we try to update it again in the following operations
+if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+log.Error(err, "Failed to re-fetch memcached")
+return ctrl.Result{}, err
+}
+}
+
+// Let's add a finalizer. Then, we can define some operations which should
+// occurs before the custom resource to be deleted.
+// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
+if !controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
+log.Info("Adding Finalizer for Memcached")
+if ok := controllerutil.AddFinalizer(memcached, memcachedFinalizer); !ok {
+log.Error(err, "Failed to add finalizer into the custom resource")
+return ctrl.Result{Requeue: true}, nil
+}
+
+if err = r.Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update custom resource to add finalizer")
+return ctrl.Result{}, err
+}
+}
+
+// Check if the Memcached instance is marked to be deleted, which is
+// indicated by the deletion timestamp being set.
+isMemcachedMarkedToBeDeleted := memcached.GetDeletionTimestamp() != nil
+if isMemcachedMarkedToBeDeleted {
+if controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
+log.Info("Performing Finalizer Operations for Memcached before delete CR")
+
+// Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
+meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
+Status: metav1.ConditionUnknown, Reason: "Finalizing",
+Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", memcached.Name)})
+
+if err := r.Status().Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update Memcached status")
+return ctrl.Result{}, err
+}
+
+// Perform all operations required before remove the finalizer and allow
+// the Kubernetes API to remove the custom resource.
+r.doFinalizerOperationsForMemcached(memcached)
+
+// TODO(user): If you add operations to the doFinalizerOperationsForMemcached method
+// then you need to ensure that all worked fine before deleting and updating the Downgrade status
+// otherwise, you should requeue here.
+
+// Re-fetch the memcached Custom Resource before update the status
+// so that we have the latest state of the resource on the cluster and we will avoid
+// raise the issue "the object has been modified, please apply
+// your changes to the latest version and try again" which would re-trigger the reconciliation
+if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+log.Error(err, "Failed to re-fetch memcached")
+return ctrl.Result{}, err
+}
+
+meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
+Status: metav1.ConditionTrue, Reason: "Finalizing",
+Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", memcached.Name)})
+
+if err := r.Status().Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update Memcached status")
+return ctrl.Result{}, err
+}
+
+log.Info("Removing Finalizer for Memcached after successfully perform the operations")
+if ok := controllerutil.RemoveFinalizer(memcached, memcachedFinalizer); !ok {
+log.Error(err, "Failed to remove finalizer for Memcached")
+return ctrl.Result{Requeue: true}, nil
+}
+
+if err := r.Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to remove finalizer for Memcached")
+return ctrl.Result{}, err
+}
+}
+return ctrl.Result{}, nil
+}
+
+// Check if the deployment already exists, if not create a new one
+found := &appsv1.Deployment{}
+err = r.Get(ctx, types.NamespacedName{Name: memcached.Name, Namespace: memcached.Namespace}, found)
+if err != nil && apierrors.IsNotFound(err) {
+// Define a new deployment
+dep, err := r.deploymentForMemcached(memcached)
+if err != nil {
+log.Error(err, "Failed to define new Deployment resource for Memcached")
+
+// The following implementation will update the status
+meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+Status: metav1.ConditionFalse, Reason: "Reconciling",
+Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", memcached.Name, err)})
+
+if err := r.Status().Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update Memcached status")
+return ctrl.Result{}, err
+}
+
+return ctrl.Result{}, err
+}
+
+log.Info("Creating a new Deployment",
+"Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+if err = r.Create(ctx, dep); err != nil {
+log.Error(err, "Failed to create new Deployment",
+"Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+return ctrl.Result{}, err
+}
+
+// Deployment created successfully
+// We will requeue the reconciliation so that we can ensure the state
+// and move forward for the next operations
+return ctrl.Result{RequeueAfter: time.Minute}, nil
+} else if err != nil {
+log.Error(err, "Failed to get Deployment")
+// Let's return the error for the reconciliation be re-trigged again
+return ctrl.Result{}, err
+}
+
+// The CRD API is defining that the Memcached type, have a MemcachedSpec.Size field
+// to set the quantity of Deployment instances is the desired state on the cluster.
+// Therefore, the following code will ensure the Deployment size is the same as defined
+// via the Size spec of the Custom Resource which we are reconciling.
+size := memcached.Spec.Size
+if *found.Spec.Replicas != size {
+found.Spec.Replicas = &size
+if err = r.Update(ctx, found); err != nil {
+log.Error(err, "Failed to update Deployment",
+"Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
+
+// Re-fetch the memcached Custom Resource before update the status
+// so that we have the latest state of the resource on the cluster and we will avoid
+// raise the issue "the object has been modified, please apply
+// your changes to the latest version and try again" which would re-trigger the reconciliation
+if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+log.Error(err, "Failed to re-fetch memcached")
+return ctrl.Result{}, err
+}
+
+// The following implementation will update the status
+meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+Status: metav1.ConditionFalse, Reason: "Resizing",
+Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", memcached.Name, err)})
+
+if err := r.Status().Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update Memcached status")
+return ctrl.Result{}, err
+}
+
+return ctrl.Result{}, err
+}
+
+// Now, that we update the size we want to requeue the reconciliation
+// so that we can ensure that we have the latest state of the resource before
+// update. Also, it will help ensure the desired state on the cluster
+return ctrl.Result{Requeue: true}, nil
+}
+
+// The following implementation will update the status
+meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+Status: metav1.ConditionTrue, Reason: "Reconciling",
+Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, size)})
+
+if err := r.Status().Update(ctx, memcached); err != nil {
+log.Error(err, "Failed to update Memcached status")
+return ctrl.Result{}, err
+}
+
+return ctrl.Result{}, nil
+}
+```
+
+#### Observing changes on cluster
+
+This controller is persistently observant, monitoring any events associated with this Kind. As a result, pertinent changes
+instantly set off the controller's reconciliation process. It's worth noting that we have implemented the `watches` feature. [(More info)][watches].
+This allows us to monitor events related to creating, updating, or deleting a Custom Resource of the Memcached kind, as well as the Deployment
+which is orchestrated and owned by its respective controller. Observe:
+
+```go
+// SetupWithManager sets up the controller with the Manager.
+// Note that the Deployment will be also watched in order to ensure its
+// desirable state on the cluster
+func (r *MemcachedReconciler) SetupWithManager(mgr ctrl.Manager) error {
+return ctrl.NewControllerManagedBy(mgr).
+For(&examplecomv1alpha1.Memcached{}). ## Create watches for the Memcached Kind
+Owns(&appsv1.Deployment{}). ## Create watches for the Deployment which has its controller owned reference
+Complete(r)
+}
+```
+
+
+Set the ownerRef for the Deployment
+
+See that when we create the Deployment to run the Memcached image we are setting the reference:
+
+```go
+// Set the ownerRef for the Deployment
+// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
+if err := ctrl.SetControllerReference(memcached, dep, r.Scheme); err != nil {
+return nil, err
+}
+
+```
+
+
+
+### Setting the RBAC permissions
+
+The [RBAC permissions][k8s-rbac] are now configured via [RBAC markers][rbac-markers], which are used to generate and update the
+manifest files present in `config/rbac/`. These markers can be found (and should be defined) on the `Reconcile()` method of each controller, see
+how it is implemented in our example:
+
+```go
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds/finalizers,verbs=update
+//+kubebuilder:rbac:groups=core,resources=events,verbs=create;patch
+//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch
+
+```
+
+It's important to highlight that if you wish to add or modify RBAC rules, you can do so by updating or adding the respective markers in the controller.
+After making the necessary changes, run the `make generate` command. This will prompt [controller-gen][controller-gen] to refresh the files located under `config/rbac`.
+
+
+RBAC generate under config/rbac
+
+For each Kind generate Kubebuilder will either scaffold rules with view and edit permissions. (i.e. `memcached_editor_role.yaml` and `memcached_viewer_role.yaml`)
+Those rules are not applied on the cluster when you deploy your solution with `make deploy IMG=myregistery/example:1.0.0`.
+Those rules are aimed to help our system admins to allow them grant permissions to group of users.
+
+
+
+### Manager (main.go)
+
+The [Manager][manager] plays a crucial role in overseeing Controllers, which in turn enable operations on the cluster side.
+If you inspect the `cmd/main.go` file, you'll come across the following:
+
+```go
+...
+mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
+Scheme: scheme,
+Metrics: metricsserver.Options{BindAddress: metricsAddr},
+HealthProbeBindAddress: probeAddr,
+LeaderElection: enableLeaderElection,
+LeaderElectionID: "1836d577.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
+// speeds up voluntary leader transitions as the new leader don't have to wait
+// LeaseDuration time first.
+//
+// In the default scaffold provided, the program ends immediately after
+// the manager stops, so would be fine to enable this option. However,
+// if you are doing or is intended to do any operation such as perform cleanups
+// after the manager stops then its usage might be unsafe.
+// LeaderElectionReleaseOnCancel: true,
+})
+if err != nil {
+setupLog.Error(err, "unable to start manager")
+os.Exit(1)
+}
+```
+
+The code snippet above outlines the configuration [options][options-manager] for the Manager. While we won't be altering this in our current example,
+it's crucial to understand its location and the initialization process of your operator-based image. The Manager is responsible for overseeing the controllers
+that are produced for your operator's APIs.
+
+### Checking the Project running in the cluster
+
+At this point, you can primarily execute the commands highlighted in the [quick-start][quick-start].
+By executing `make build IMG=myregistry/example:1.0.0`, you'll build the image for your project. For testing purposes, it's recommended to publish this image to a
+public registry. This ensures easy accessibility, eliminating the need for additional configurations. Once that's done, you can deploy the image
+to the cluster using the `make deploy IMG=myregistry/example:1.0.0` command.
+
+## Next Steps
+
+- To delve deeper into developing your solution, consider going through the provided tutorials.
+- For insights on optimizing your approach, refer to the [Best Practices][best-practices] documentation.
+
+[k8s-operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
+[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
+[group-kind-oh-my]: ./cronjob-tutorial/gvks.md
+[controller-gen]: ./reference/controller-gen.md
+[markers]: ./reference/markers.md
+[watches]: ./reference/watching-resources.md
+[rbac-markers]: ./reference/markers/rbac.md
+[k8s-rbac]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
+[manager]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager
+[options-manager]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Options
+[quick-start]: ./quick-start.md
+[best-practices]: ./reference/good-practices.md
\ No newline at end of file
From 24c169c284d5c68d1bbbfcacf89dcc8a4c65e059 Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Wed, 13 Sep 2023 23:31:29 +0800
Subject: [PATCH 0298/1245] unify promethuse-operator url
Signed-off-by: lowang-bh
---
test/e2e/utils/test_context.go | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/test/e2e/utils/test_context.go b/test/e2e/utils/test_context.go
index 0f0a2be9aba..15c31eaa6e3 100644
--- a/test/e2e/utils/test_context.go
+++ b/test/e2e/utils/test_context.go
@@ -122,6 +122,10 @@ func (t *TestContext) makeCertManagerURL() string {
return fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
}
+func (t *TestContext) makePrometheusOperatorURL() string {
+ return fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+}
+
// InstallCertManager installs the cert manager bundle. If hasv1beta1CRs is true,
// the legacy version (which uses v1alpha2 CRs) is installed.
func (t *TestContext) InstallCertManager() error {
@@ -149,14 +153,14 @@ func (t *TestContext) UninstallCertManager() {
// InstallPrometheusOperManager installs the prometheus manager bundle.
func (t *TestContext) InstallPrometheusOperManager() error {
- url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ url := t.makePrometheusOperatorURL()
_, err := t.Kubectl.Apply(false, "-f", url)
return err
}
// UninstallPrometheusOperManager uninstalls the prometheus manager bundle.
func (t *TestContext) UninstallPrometheusOperManager() {
- url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ url := t.makePrometheusOperatorURL()
if _, err := t.Kubectl.Delete(false, "-f", url); err != nil {
warnError(err)
}
From 2addf1df487d36a9579bd017f130e12830baf793 Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Wed, 13 Sep 2023 21:41:42 +0800
Subject: [PATCH 0299/1245] fix: disable log timestamp
Signed-off-by: lowang-bh
---
cmd/main.go | 5 +++++
hack/docs/generate_samples.go | 1 +
2 files changed, 6 insertions(+)
diff --git a/cmd/main.go b/cmd/main.go
index 6dd4fc8d23a..617f06b08b4 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -37,6 +37,11 @@ import (
grafanav1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha"
)
+func init() {
+ // Disable timestamps on the default TextFormatter
+ logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true})
+}
+
func main() {
const deprecateMessageGoV3Bundle = "This version is deprecated." +
diff --git a/hack/docs/generate_samples.go b/hack/docs/generate_samples.go
index 1f9544120e3..aa25b687dd1 100644
--- a/hack/docs/generate_samples.go
+++ b/hack/docs/generate_samples.go
@@ -27,6 +27,7 @@ import (
const KubebuilderBinName = "/tmp/kubebuilder/bin/kubebuilder"
func main() {
+ log.SetFormatter(&log.TextFormatter{DisableTimestamp: true})
log.Println("Generating documents...")
log.Println("Generating component-config tutorial...")
From b728f774586da8c22a2e4b8b6c29687bf7d9dbb5 Mon Sep 17 00:00:00 2001
From: Sajiyah-Salat
Date: Sat, 19 Aug 2023 21:10:49 +0530
Subject: [PATCH 0300/1245] Error and solution added in faq section succesfully
---
docs/book/src/faq.md | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/docs/book/src/faq.md b/docs/book/src/faq.md
index 0e8aa54c296..fb37bcf07ae 100644
--- a/docs/book/src/faq.md
+++ b/docs/book/src/faq.md
@@ -92,9 +92,41 @@ securityContext:
```
However, note that this problem is fixed and will not occur if you deploy the project in high versions (maybe >= 1.22).
+## The error `Too long: must have at most 262144 bytes` is faced when I run `make install` to apply the CRD manifests. How to solve it? Why this error is faced?
+
+When attempting to run `make install` to apply the CRD manifests, the error `Too long: must have at most 262144 bytes may be encountered.` This error arises due to a size limit enforced by the Kubernetes API. Note that the `make install` target will apply the CRD manifest under `config/crd` using `kubectl apply -f -`. Therefore, when the apply command is used, the API annotates the object with the `last-applied-configuration` which contains the entire previous configuration. If this configuration is too large, it will exceed the allowed byte size. ([More info][k8s-obj-creation])
+
+In ideal approach might use client-side apply might seem like the perfect solution since with the entire object configuration doesn't have to be stored as an annotation (last-applied-configuration) on the server. However, it's worth noting that as of now, it isn't supported by controller-gen or kubebuilder. For more on this, refer to: [Controller-tool-discussion][controller-tool-pr].
+
+Therefore, you have a few options to workround this scenario such as:
+
+**By removing the descriptions from CRDs:**
+
+Your CRDs are generated using [controller-gen][controller-gen]. By using the option `maxDescLen=0` to remove the description, you may reduce the size, potentially resolving the issue. To do it you can update the Makefile as the following example and then, call the target `make manifest` to regenerate your CRDs without description, see:
+
+```shell
+
+ .PHONY: manifests
+ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
+ # Note that the option maxDescLen=0 was added in the default scaffold in order to sort out the issue
+ # Too long: must have at most 262144 bytes. By using kubectl apply to create / update resources an annotation
+ # is created by K8s API to store the latest version of the resource ( kubectl.kubernetes.io/last-applied-configuration).
+ # However, it has a size limit and if the CRD is too big with so many long descriptions as this one it will cause the failure.
+ $(CONTROLLER_GEN) rbac:roleName=manager-role crd:maxDescLen=0 webhook paths="./..." output:crd:artifacts:config=config/crd/bases
+```
+**By re-design your APIs:**
+
+You can review the design of your APIs and see if it has not more specs than should be by hurting single responsibility principle for example. So that you might to re-design them.
+
+
+
+
+[k8s-obj-creation]: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-to-create-objects
[gvk]: ./cronjob-tutorial/gvks.md
[project-file-def]: ./reference/project-config.md
[klog]: https://github.com/kubernetes/klog
[zap]: https://github.com/uber-go/zap
[permission-issue]: https://github.com/kubernetes/kubernetes/issues/82573
[permission-PR]: https://github.com/kubernetes/kubernetes/pull/89193
+[controller-gen]: ./reference/controller-gen.html
+[controller-tool-pr]: https://github.com/kubernetes-sigs/controller-tools/pull/536
\ No newline at end of file
From e769e769d3601df7aad127592a9dda769645e3c1 Mon Sep 17 00:00:00 2001
From: dragon-fly
Date: Sun, 17 Sep 2023 11:18:41 +0800
Subject: [PATCH 0301/1245] =?UTF-8?q?=E2=9C=A8=20update=20controller-runti?=
=?UTF-8?q?me=20to=200.16.2=20(#3625)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
update controller-runtime to 0.16.2
Signed-off-by: lowang-bh
---
.../src/component-config-tutorial/testdata/project/go.mod | 2 +-
.../src/component-config-tutorial/testdata/project/go.sum | 4 ++--
docs/book/src/cronjob-tutorial/testdata/project/go.mod | 2 +-
docs/book/src/cronjob-tutorial/testdata/project/go.sum | 4 ++--
.../project/internal/controller/cronjob_controller.go | 2 +-
pkg/plugins/golang/v4/scaffolds/init.go | 2 +-
testdata/project-v4-multigroup/go.mod | 2 +-
.../internal/controller/apps/deployment_controller.go | 2 +-
.../internal/controller/crew/captain_controller.go | 2 +-
.../internal/controller/example.com/busybox_controller.go | 2 +-
.../internal/controller/example.com/memcached_controller.go | 2 +-
.../internal/controller/fiz/bar_controller.go | 2 +-
.../controller/foo.policy/healthcheckpolicy_controller.go | 2 +-
.../internal/controller/foo/bar_controller.go | 2 +-
.../internal/controller/lakers_controller.go | 2 +-
.../internal/controller/sea-creatures/kraken_controller.go | 2 +-
.../internal/controller/sea-creatures/leviathan_controller.go | 2 +-
.../internal/controller/ship/cruiser_controller.go | 2 +-
.../internal/controller/ship/destroyer_controller.go | 2 +-
.../internal/controller/ship/frigate_controller.go | 2 +-
testdata/project-v4-with-deploy-image/go.mod | 2 +-
.../internal/controller/busybox_controller.go | 2 +-
.../internal/controller/memcached_controller.go | 2 +-
testdata/project-v4-with-grafana/go.mod | 2 +-
testdata/project-v4/go.mod | 2 +-
testdata/project-v4/internal/controller/admiral_controller.go | 2 +-
testdata/project-v4/internal/controller/captain_controller.go | 2 +-
.../project-v4/internal/controller/firstmate_controller.go | 2 +-
testdata/project-v4/internal/controller/laker_controller.go | 2 +-
29 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod
index 2ffa49421b2..33d35f0a378 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.mod
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
+ sigs.k8s.io/controller-runtime v0.16.2
)
require (
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum
index de2d668e659..ca8e604cd14 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.sum
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum
@@ -204,8 +204,8 @@ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5Ohx
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.16.1 h1:+15lzrmHsE0s2kNl0Dl8cTchI5Cs8qofo5PGcPrV9z0=
-sigs.k8s.io/controller-runtime v0.16.1/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
+sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=
+sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
index 187bd8a19ca..7943fdcae21 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
@@ -9,7 +9,7 @@ require (
k8s.io/api v0.28.1
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
+ sigs.k8s.io/controller-runtime v0.16.2
)
require (
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index 31ee90eefb9..1fb37925fa6 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -218,8 +218,8 @@ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5Ohx
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.16.1 h1:+15lzrmHsE0s2kNl0Dl8cTchI5Cs8qofo5PGcPrV9z0=
-sigs.k8s.io/controller-runtime v0.16.1/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
+sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=
+sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
index ad5b7247319..127c3df2bac 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
@@ -95,7 +95,7 @@ var (
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index 120690d8c5c..9641b0a9053 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -31,7 +31,7 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.16.1"
+ ControllerRuntimeVersion = "v0.16.2"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.13.0"
// EnvtestK8SVersion is the k8s version used to do the scaffold
diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod
index 58a6ed04231..e24f5f59e1e 100644
--- a/testdata/project-v4-multigroup/go.mod
+++ b/testdata/project-v4-multigroup/go.mod
@@ -8,7 +8,7 @@ require (
k8s.io/api v0.28.1
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
+ sigs.k8s.io/controller-runtime v0.16.2
)
require (
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
index 24f8f5c4ef1..b3c6c551193 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
index b69ce80b664..6e54f1a133b 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
index 639ca1ee0ad..9a0c05baafe 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
@@ -77,7 +77,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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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-multigroup/internal/controller/example.com/memcached_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
index 5e508374c23..d9ab9250786 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
@@ -77,7 +77,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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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-multigroup/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
index 56974bcf2af..d00e8917128 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
index 6dafb8ef6d0..1edbcb9c941 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
index 24d289393a4..36fcce98cae 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
index 06d1f90f27e..84f1dabc141 100644
--- a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
index ed978a94498..928f08cbeab 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
index f4f36401021..22db56aece4 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
index 553a643c830..e667b99d1e0 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
index 197f60cafe2..b23c16905bd 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
index aec94378542..504ee3be98f 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *FrigateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod
index f771cdfd71a..f544e5bcf47 100644
--- a/testdata/project-v4-with-deploy-image/go.mod
+++ b/testdata/project-v4-with-deploy-image/go.mod
@@ -8,7 +8,7 @@ require (
k8s.io/api v0.28.1
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
+ sigs.k8s.io/controller-runtime v0.16.2
)
require (
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index d562d09bb91..9a84413ec13 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -77,7 +77,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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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/internal/controller/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index f496e68f92e..5ebb803874c 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -77,7 +77,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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/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-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
index 2988dd2b414..ce5cb3689f1 100644
--- a/testdata/project-v4-with-grafana/go.mod
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
+ sigs.k8s.io/controller-runtime v0.16.2
)
require (
diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod
index 69298c5fef2..2af7846c045 100644
--- a/testdata/project-v4/go.mod
+++ b/testdata/project-v4/go.mod
@@ -8,7 +8,7 @@ require (
k8s.io/api v0.28.1
k8s.io/apimachinery v0.28.1
k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.1
+ sigs.k8s.io/controller-runtime v0.16.2
)
require (
diff --git a/testdata/project-v4/internal/controller/admiral_controller.go b/testdata/project-v4/internal/controller/admiral_controller.go
index b300a601984..beb722fe14d 100644
--- a/testdata/project-v4/internal/controller/admiral_controller.go
+++ b/testdata/project-v4/internal/controller/admiral_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/captain_controller.go b/testdata/project-v4/internal/controller/captain_controller.go
index b03f4e85925..fe6a9214a9a 100644
--- a/testdata/project-v4/internal/controller/captain_controller.go
+++ b/testdata/project-v4/internal/controller/captain_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/firstmate_controller.go b/testdata/project-v4/internal/controller/firstmate_controller.go
index a6a3c0344cf..c7a74874e85 100644
--- a/testdata/project-v4/internal/controller/firstmate_controller.go
+++ b/testdata/project-v4/internal/controller/firstmate_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/laker_controller.go b/testdata/project-v4/internal/controller/laker_controller.go
index 690b6c172e5..2f0223c415c 100644
--- a/testdata/project-v4/internal/controller/laker_controller.go
+++ b/testdata/project-v4/internal/controller/laker_controller.go
@@ -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.16.1/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
From 0885a2c63002ff39b85c54723a05090131d3219c Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sun, 17 Sep 2023 08:44:57 +0100
Subject: [PATCH 0302/1245] fix readme
---
.../testdata/project/README.md | 67 +++++++++----------
.../testdata/project/README.md | 67 +++++++++----------
.../v4/scaffolds/internal/templates/readme.go | 62 +++++++++--------
testdata/project-v4-multigroup/README.md | 67 +++++++++----------
.../project-v4-with-deploy-image/README.md | 67 +++++++++----------
testdata/project-v4-with-grafana/README.md | 67 +++++++++----------
testdata/project-v4/README.md | 67 +++++++++----------
7 files changed, 222 insertions(+), 242 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/README.md b/docs/book/src/component-config-tutorial/testdata/project/README.md
index a6dd2e20a6c..8a221c01379 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/README.md
+++ b/docs/book/src/component-config-tutorial/testdata/project/README.md
@@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-```sh
-kubectl apply -k config/samples/
-```
-
-2. Build and push your image to the location specified by `IMG`:
+### To Deploy on the cluster
+**Build and push your image to the location specified by `IMG`:**
```sh
make docker-build docker-push IMG=/project:tag
```
-3. Deploy the controller to the cluster with the image specified by `IMG`:
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
```sh
-make deploy IMG=/project:tag
+make install
```
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
```sh
-make uninstall
+make deploy IMG=/project:tag
```
-### Undeploy controller
-UnDeploy the controller from the cluster:
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
```sh
-make undeploy
+kubectl apply -k config/samples/
```
-## Contributing
-// 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/).
+>**NOTE**: Ensure that the samples has default values to test it out.
-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:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
```sh
-make install
+kubectl delete -k config/samples/
```
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
```sh
-make run
+make uninstall
```
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
```sh
-make manifests
+make undeploy
```
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run `make --help` for more information on all potential `make` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/README.md b/docs/book/src/cronjob-tutorial/testdata/project/README.md
index a6dd2e20a6c..8a221c01379 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/README.md
+++ b/docs/book/src/cronjob-tutorial/testdata/project/README.md
@@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-```sh
-kubectl apply -k config/samples/
-```
-
-2. Build and push your image to the location specified by `IMG`:
+### To Deploy on the cluster
+**Build and push your image to the location specified by `IMG`:**
```sh
make docker-build docker-push IMG=/project:tag
```
-3. Deploy the controller to the cluster with the image specified by `IMG`:
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
```sh
-make deploy IMG=/project:tag
+make install
```
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
```sh
-make uninstall
+make deploy IMG=/project:tag
```
-### Undeploy controller
-UnDeploy the controller from the cluster:
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
```sh
-make undeploy
+kubectl apply -k config/samples/
```
-## Contributing
-// 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/).
+>**NOTE**: Ensure that the samples has default values to test it out.
-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:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
```sh
-make install
+kubectl delete -k config/samples/
```
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
```sh
-make run
+make uninstall
```
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
```sh
-make manifests
+make undeploy
```
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run `make --help` for more information on all potential `make` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
index 577f5a62a49..7a7d6734938 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/readme.go
@@ -45,14 +45,13 @@ func (f *Readme) SetTemplateDefaults() error {
"*/", "", 1)
f.TemplateBody = fmt.Sprintf(readmeFileTemplate,
- codeFence("kubectl apply -k config/samples/"),
codeFence("make docker-build docker-push IMG=/{{ .ProjectName }}:tag"),
+ codeFence("make install"),
codeFence("make deploy IMG=/{{ .ProjectName }}:tag"),
+ codeFence("kubectl apply -k config/samples/"),
+ codeFence("kubectl delete -k config/samples/"),
codeFence("make uninstall"),
- codeFence("make undeploy"),
- codeFence("make install"),
- codeFence("make run"),
- codeFence("make manifests"))
+ codeFence("make undeploy"))
return nil
}
@@ -65,57 +64,56 @@ const readmeFileTemplate = `# {{ .ProjectName }}
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster ` + "`kubectl cluster-info`" + ` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-%s
-
-2. Build and push your image to the location specified by ` + "`IMG`" + `:
+### To Deploy on the cluster
+**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
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Install the CRDs into the cluster:**
%s
-### Undeploy controller
-UnDeploy the controller from the cluster:
+**Deploy the Manager to the cluster with the image specified by ` + "`IMG`" + `:**
%s
-## Contributing
-// TODO(user): Add detailed information on how you would like others to contribute to this project
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
-### How it works
-This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
+
+%s
-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.
+>**NOTE**: Ensure that the samples has default values to test it out.
-### Test It Out
-1. Install the CRDs into the cluster:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
%s
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
%s
-**NOTE:** You can also run this in one step by running: ` + "`make install run`" + `
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
%s
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run ` + "`make --help`" + ` for more information on all potential ` + "`make`" + ` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
diff --git a/testdata/project-v4-multigroup/README.md b/testdata/project-v4-multigroup/README.md
index 39a1873fad4..d89d15c8ed6 100644
--- a/testdata/project-v4-multigroup/README.md
+++ b/testdata/project-v4-multigroup/README.md
@@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-```sh
-kubectl apply -k config/samples/
-```
-
-2. Build and push your image to the location specified by `IMG`:
+### To Deploy on the cluster
+**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`:
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
```sh
-make deploy IMG=/project-v4-multigroup:tag
+make install
```
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
```sh
-make uninstall
+make deploy IMG=/project-v4-multigroup:tag
```
-### Undeploy controller
-UnDeploy the controller from the cluster:
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
```sh
-make undeploy
+kubectl apply -k config/samples/
```
-## Contributing
-// 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/).
+>**NOTE**: Ensure that the samples has default values to test it out.
-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:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
```sh
-make install
+kubectl delete -k config/samples/
```
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
```sh
-make run
+make uninstall
```
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
```sh
-make manifests
+make undeploy
```
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run `make --help` for more information on all potential `make` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
diff --git a/testdata/project-v4-with-deploy-image/README.md b/testdata/project-v4-with-deploy-image/README.md
index 395ffff16bb..dff22730ce6 100644
--- a/testdata/project-v4-with-deploy-image/README.md
+++ b/testdata/project-v4-with-deploy-image/README.md
@@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-```sh
-kubectl apply -k config/samples/
-```
-
-2. Build and push your image to the location specified by `IMG`:
+### To Deploy on the cluster
+**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`:
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
```sh
-make deploy IMG=/project-v4-with-deploy-image:tag
+make install
```
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
```sh
-make uninstall
+make deploy IMG=/project-v4-with-deploy-image:tag
```
-### Undeploy controller
-UnDeploy the controller from the cluster:
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
```sh
-make undeploy
+kubectl apply -k config/samples/
```
-## Contributing
-// 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/).
+>**NOTE**: Ensure that the samples has default values to test it out.
-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:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
```sh
-make install
+kubectl delete -k config/samples/
```
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
```sh
-make run
+make uninstall
```
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
```sh
-make manifests
+make undeploy
```
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run `make --help` for more information on all potential `make` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
diff --git a/testdata/project-v4-with-grafana/README.md b/testdata/project-v4-with-grafana/README.md
index 76c83cd34b7..ab2df6a57f3 100644
--- a/testdata/project-v4-with-grafana/README.md
+++ b/testdata/project-v4-with-grafana/README.md
@@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-```sh
-kubectl apply -k config/samples/
-```
-
-2. Build and push your image to the location specified by `IMG`:
+### To Deploy on the cluster
+**Build and push your image to the location specified by `IMG`:**
```sh
make docker-build docker-push IMG=/project-v4-with-grafana:tag
```
-3. Deploy the controller to the cluster with the image specified by `IMG`:
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
```sh
-make deploy IMG=/project-v4-with-grafana:tag
+make install
```
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
```sh
-make uninstall
+make deploy IMG=/project-v4-with-grafana:tag
```
-### Undeploy controller
-UnDeploy the controller from the cluster:
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
```sh
-make undeploy
+kubectl apply -k config/samples/
```
-## Contributing
-// 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/).
+>**NOTE**: Ensure that the samples has default values to test it out.
-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:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
```sh
-make install
+kubectl delete -k config/samples/
```
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
```sh
-make run
+make uninstall
```
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
```sh
-make manifests
+make undeploy
```
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run `make --help` for more information on all potential `make` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
diff --git a/testdata/project-v4/README.md b/testdata/project-v4/README.md
index 215622184f4..54e62956d1b 100644
--- a/testdata/project-v4/README.md
+++ b/testdata/project-v4/README.md
@@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use
## Getting Started
-You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
-**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).
-### Running on the cluster
-1. Install Instances of Custom Resources:
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
-```sh
-kubectl apply -k config/samples/
-```
-
-2. Build and push your image to the location specified by `IMG`:
+### To Deploy on the cluster
+**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`:
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
```sh
-make deploy IMG=/project-v4:tag
+make install
```
-### Uninstall CRDs
-To delete the CRDs from the cluster:
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
```sh
-make uninstall
+make deploy IMG=/project-v4:tag
```
-### Undeploy controller
-UnDeploy the controller from the cluster:
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
```sh
-make undeploy
+kubectl apply -k config/samples/
```
-## Contributing
-// 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/).
+>**NOTE**: Ensure that the samples has default values to test it out.
-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:
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
```sh
-make install
+kubectl delete -k config/samples/
```
-2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
+**Delete the APIs(CRDs) from the cluster:**
```sh
-make run
+make uninstall
```
-**NOTE:** You can also run this in one step by running: `make install run`
-
-### Modifying the API definitions
-If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
+**UnDeploy the controller from the cluster:**
```sh
-make manifests
+make undeploy
```
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
**NOTE:** Run `make --help` for more information on all potential `make` targets
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
From a9104259479b94aca677ce852fde5d3da0abc7ac Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sun, 17 Sep 2023 09:44:29 +0100
Subject: [PATCH 0303/1245] fix: uncomment kustomize files when webhooks are
generate
---
.../cronjob-tutorial/generate_cronjob.go | 17 -----------
.../common/kustomize/v2/scaffolds/webhook.go | 30 +++++++++++++++++++
test/e2e/v4/generate_test.go | 13 --------
.../config/crd/kustomization.yaml | 12 ++++----
.../config/default/kustomization.yaml | 4 +--
.../config/crd/kustomization.yaml | 2 +-
.../config/default/kustomization.yaml | 4 +--
.../project-v4/config/crd/kustomization.yaml | 6 ++--
.../config/default/kustomization.yaml | 4 +--
9 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index f64a28ea3d5..c14fbaed488 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -542,22 +542,11 @@ var _ = AfterSuite(func() {
func updateKustomization(sp *Sample) {
var err error
- // uncomment default/kustomization
- err = pluginutil.UncommentCode(
- filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
- `#- ../webhook`, `#`)
- CheckError("fixing default/kustomization", err)
-
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
`#- ../certmanager`, `#`)
CheckError("fixing default/kustomization", err)
- err = pluginutil.UncommentCode(
- filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
- `#- manager_webhook_patch.yaml`, `#`)
- CheckError("fixing default/kustomization", err)
-
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
`#- webhookcainjection`, `#`)
@@ -573,12 +562,6 @@ func updateKustomization(sp *Sample) {
DefaultKustomization, `#`)
CheckError("fixing default/kustomization", err)
- // uncomment crd/kustomization
- err = pluginutil.UncommentCode(
- filepath.Join(sp.ctx.Dir, "config/crd/kustomization.yaml"),
- `#- path: patches/webhook_in_cronjobs.yaml`, `#`)
- CheckError("fixing crd/kustomization", err)
-
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/crd/kustomization.yaml"),
`#- path: patches/cainjection_in_cronjobs.yaml`, `#`)
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
index 2dedaa52e22..6324e028c15 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+ pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
log "github.com/sirupsen/logrus"
@@ -69,6 +70,35 @@ func (s *webhookScaffolder) Scaffold() error {
return fmt.Errorf("error updating resource: %w", err)
}
+ kustomizeFilePath := "config/default/kustomization.yaml"
+ err := pluginutil.UncommentCode(kustomizeFilePath, "#- ../webhook", `#`)
+ if err != nil {
+ hasWebHookUncommented, err := pluginutil.HasFragment(kustomizeFilePath, "- ../webhook")
+ if !hasWebHookUncommented || err != nil {
+ log.Errorf("Unable to find the target #- ../webhook to uncomment in the file "+
+ "%s.", kustomizeFilePath)
+ }
+ }
+
+ err = pluginutil.UncommentCode(kustomizeFilePath, "#- manager_webhook_patch.yaml", `#`)
+ if err != nil {
+ hasWebHookUncommented, err := pluginutil.HasFragment(kustomizeFilePath, "- manager_webhook_patch.yaml")
+ if !hasWebHookUncommented || err != nil {
+ log.Errorf("Unable to find the target #- manager_webhook_patch.yaml to uncomment in the file "+
+ "%s.", kustomizeFilePath)
+ }
+ }
+
+ crdKustomizationsFilePath := "config/crd/kustomization.yaml"
+ err = pluginutil.UncommentCode(crdKustomizationsFilePath, "#- path: patches/webhook", `#`)
+ if err != nil {
+ hasWebHookUncommented, err := pluginutil.HasFragment(crdKustomizationsFilePath, "- path: patches/webhook")
+ if !hasWebHookUncommented || err != nil {
+ log.Errorf("Unable to find the target(s) #- path: patches/webhook/* to uncomment in the file "+
+ "%s.", crdKustomizationsFilePath)
+ }
+ }
+
if err := scaffold.Execute(
&kdefault.WebhookCAInjectionPatch{},
&kdefault.ManagerWebhookPatch{},
diff --git a/test/e2e/v4/generate_test.go b/test/e2e/v4/generate_test.go
index d4fc718bc25..e7056394d34 100644
--- a/test/e2e/v4/generate_test.go
+++ b/test/e2e/v4/generate_test.go
@@ -82,25 +82,12 @@ Count int `+"`"+`json:"count,omitempty"`+"`"+`
fmt.Sprintf("%s_webhook.go", strings.ToLower(kbc.Kind))))
ExpectWithOffset(1, err).NotTo(HaveOccurred())
- By("uncomment kustomization.yaml to enable webhook and ca injection")
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "crd", "kustomization.yaml"),
- fmt.Sprintf("#- path: patches/webhook_in_%s.yaml", kbc.Resources), "#")).To(Succeed())
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "crd", "kustomization.yaml"),
- fmt.Sprintf("#- path: patches/cainjection_in_%s.yaml", kbc.Resources), "#")).To(Succeed())
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- "#- ../webhook", "#")).To(Succeed())
ExpectWithOffset(1, pluginutil.UncommentCode(
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
"#- ../certmanager", "#")).To(Succeed())
ExpectWithOffset(1, pluginutil.UncommentCode(
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
"#- ../prometheus", "#")).To(Succeed())
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- "#- manager_webhook_patch.yaml", "#")).To(Succeed())
ExpectWithOffset(1, pluginutil.UncommentCode(
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
"#- webhookcainjection_patch.yaml", "#")).To(Succeed())
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index e3729c3f731..edb4eaf7c9b 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -19,12 +19,12 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_crew_captains.yaml
-#- path: patches/webhook_in_ship_frigates.yaml
-#- path: patches/webhook_in_ship_destroyers.yaml
-#- path: patches/webhook_in_ship_cruisers.yaml
-#- path: patches/webhook_in_sea-creatures_krakens.yaml
-#- path: patches/webhook_in_sea-creatures_leviathans.yaml
+- path: patches/webhook_in_crew_captains.yaml
+- path: patches/webhook_in_ship_frigates.yaml
+- path: patches/webhook_in_ship_destroyers.yaml
+- path: patches/webhook_in_ship_cruisers.yaml
+- path: patches/webhook_in_sea-creatures_krakens.yaml
+- path: patches/webhook_in_sea-creatures_leviathans.yaml
#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
#- path: patches/webhook_in_foo_bars.yaml
#- path: patches/webhook_in_fiz_bars.yaml
diff --git a/testdata/project-v4-multigroup/config/default/kustomization.yaml b/testdata/project-v4-multigroup/config/default/kustomization.yaml
index baea92fc167..ce2920a1301 100644
--- a/testdata/project-v4-multigroup/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/default/kustomization.yaml
@@ -20,7 +20,7 @@ resources:
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- ../webhook
+- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
@@ -36,7 +36,7 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
diff --git a/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
index 1385006e680..c4fb2e1b99b 100644
--- a/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
+++ b/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
@@ -9,7 +9,7 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_memcacheds.yaml
+- path: patches/webhook_in_memcacheds.yaml
#- path: patches/webhook_in_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
diff --git a/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
index faf2235f91f..9a8d7b34515 100644
--- a/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
@@ -20,7 +20,7 @@ resources:
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- ../webhook
+- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
@@ -36,7 +36,7 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
diff --git a/testdata/project-v4/config/crd/kustomization.yaml b/testdata/project-v4/config/crd/kustomization.yaml
index a67f99e5ea3..55a06bf09c9 100644
--- a/testdata/project-v4/config/crd/kustomization.yaml
+++ b/testdata/project-v4/config/crd/kustomization.yaml
@@ -10,9 +10,9 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_captains.yaml
-#- path: patches/webhook_in_firstmates.yaml
-#- path: patches/webhook_in_admirales.yaml
+- path: patches/webhook_in_captains.yaml
+- path: patches/webhook_in_firstmates.yaml
+- path: patches/webhook_in_admirales.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
diff --git a/testdata/project-v4/config/default/kustomization.yaml b/testdata/project-v4/config/default/kustomization.yaml
index 1516d32747f..c96e5df1142 100644
--- a/testdata/project-v4/config/default/kustomization.yaml
+++ b/testdata/project-v4/config/default/kustomization.yaml
@@ -20,7 +20,7 @@ resources:
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- ../webhook
+- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
@@ -36,7 +36,7 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
From fc12050151efeb5718e07cb99fdef471868f0495 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sun, 17 Sep 2023 07:34:25 +0100
Subject: [PATCH 0304/1245] fix role generation when no CRDs are added to the
project
---
.../testdata/project/config/rbac/role.yaml | 15 +++++
.../common/kustomize/v2/scaffolds/api.go | 11 ++++
.../common/kustomize/v2/scaffolds/init.go | 3 +
.../config/kdefault/kustomization.go | 2 +-
.../internal/templates/config/rbac/role.go | 61 +++++++++++++++++++
.../config/default/kustomization.yaml | 2 +-
.../config/rbac/role.yaml | 15 +++++
7 files changed, 107 insertions(+), 2 deletions(-)
create mode 100644 docs/book/src/component-config-tutorial/testdata/project/config/rbac/role.yaml
create mode 100644 pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/rbac/role.go
create mode 100644 testdata/project-v4-with-grafana/config/rbac/role.yaml
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/rbac/role.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/rbac/role.yaml
new file mode 100644
index 00000000000..9f0ce00dd55
--- /dev/null
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/rbac/role.yaml
@@ -0,0 +1,15 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: manager-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project
+ app.kubernetes.io/part-of: project
+ app.kubernetes.io/managed-by: kustomize
+ name: manager-role
+rules:
+- apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["get", "list", "watch"]
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/api.go b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
index 8bafbf9f9d1..2c69dc6f271 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+ pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
log "github.com/sirupsen/logrus"
@@ -90,6 +91,16 @@ func (s *apiScaffolder) Scaffold() error {
return fmt.Errorf("error scaffolding manifests: %v", err)
}
}
+
+ kustomizeFilePath := "config/default/kustomization.yaml"
+ err := pluginutil.UncommentCode(kustomizeFilePath, "#- ../crd", `#`)
+ if err != nil {
+ hasCRUncommented, err := pluginutil.HasFragment(kustomizeFilePath, "- ../crd")
+ if !hasCRUncommented || err != nil {
+ log.Errorf("Unable to find the target #- ../crd to uncomment in the file "+
+ "%s.", kustomizeFilePath)
+ }
+ }
}
return nil
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/init.go b/pkg/plugins/common/kustomize/v2/scaffolds/init.go
index 3d5785255a0..baea4bb55c6 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/init.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/init.go
@@ -69,6 +69,9 @@ func (s *initScaffolder) Scaffold() error {
&rbac.AuthProxyService{},
&rbac.AuthProxyClientRole{},
&rbac.RoleBinding{},
+ // We need to create a Role because if the project
+ // has not CRD define the controller-gen will not generate this file
+ &rbac.Role{},
&rbac.LeaderElectionRole{},
&rbac.LeaderElectionRoleBinding{},
&rbac.ServiceAccount{},
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
index 4919a8d8c9b..7d8c8449f6e 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
@@ -61,7 +61,7 @@ namePrefix: {{ .ProjectName }}-
# someName: someValue
resources:
-- ../crd
+#- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/rbac/role.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/rbac/role.go
new file mode 100644
index 00000000000..4b3dd815deb
--- /dev/null
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/rbac/role.go
@@ -0,0 +1,61 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package rbac
+
+import (
+ "path/filepath"
+
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &Role{}
+
+// Role scaffolds a file that defines the role for the manager
+type Role struct {
+ machinery.TemplateMixin
+ machinery.ProjectNameMixin
+}
+
+// SetTemplateDefaults implements file.Template
+func (f *Role) SetTemplateDefaults() error {
+ if f.Path == "" {
+ f.Path = filepath.Join("config", "rbac", "role.yaml")
+ }
+
+ f.TemplateBody = managerRoleTemplate
+
+ f.IfExistsAction = machinery.SkipFile
+
+ return nil
+}
+
+const managerRoleTemplate = `apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: manager-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: {{ .ProjectName }}
+ app.kubernetes.io/part-of: {{ .ProjectName }}
+ app.kubernetes.io/managed-by: kustomize
+ name: manager-role
+rules:
+- apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["get", "list", "watch"]
+`
diff --git a/testdata/project-v4-with-grafana/config/default/kustomization.yaml b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
index d392dadc0fd..50746f77fce 100644
--- a/testdata/project-v4-with-grafana/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
@@ -15,7 +15,7 @@ namePrefix: project-v4-with-grafana-
# someName: someValue
resources:
-- ../crd
+#- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
diff --git a/testdata/project-v4-with-grafana/config/rbac/role.yaml b/testdata/project-v4-with-grafana/config/rbac/role.yaml
new file mode 100644
index 00000000000..7d58c9ed049
--- /dev/null
+++ b/testdata/project-v4-with-grafana/config/rbac/role.yaml
@@ -0,0 +1,15 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: manager-role
+ app.kubernetes.io/component: rbac
+ 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-role
+rules:
+- apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["get", "list", "watch"]
From b69a7fca7a3fbceea54403eb53aaffa1835a6d00 Mon Sep 17 00:00:00 2001
From: yuridekim
Date: Tue, 11 Jul 2023 00:08:18 +0900
Subject: [PATCH 0305/1245] Docs fixes for code blocks, links and minor typos
Add revisions for markdown changes
Refactor link to relative path
---
docs/book/src/cronjob-tutorial/testdata/finalizer_example.go | 5 ++---
docs/book/src/multiversion-tutorial/api-changes.md | 4 ++--
docs/book/src/reference/completion.md | 2 +-
docs/book/src/reference/platform.md | 3 +--
docs/book/src/reference/raising-events.md | 1 -
docs/book/src/reference/webhook-overview.md | 4 ++--
6 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/docs/book/src/cronjob-tutorial/testdata/finalizer_example.go b/docs/book/src/cronjob-tutorial/testdata/finalizer_example.go
index ae68eb4b541..134a5311c7d 100644
--- a/docs/book/src/cronjob-tutorial/testdata/finalizer_example.go
+++ b/docs/book/src/cronjob-tutorial/testdata/finalizer_example.go
@@ -65,7 +65,7 @@ func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
if cronJob.ObjectMeta.DeletionTimestamp.IsZero() {
// The object is not being deleted, so if it does not have our finalizer,
// then lets add the finalizer and update the object. This is equivalent
- // registering our finalizer.
+ // to registering our finalizer.
if !controllerutil.ContainsFinalizer(cronJob, myFinalizerName) {
controllerutil.AddFinalizer(cronJob, myFinalizerName)
if err := r.Update(ctx, cronJob); err != nil {
@@ -78,7 +78,7 @@ func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
// our finalizer is present, so lets handle any external dependency
if err := r.deleteExternalResources(cronJob); err != nil {
// if fail to delete the external dependency here, return with error
- // so that it can be retried
+ // so that it can be retried.
return ctrl.Result{}, err
}
@@ -105,4 +105,3 @@ func (r *Reconciler) deleteExternalResources(cronJob *batch.CronJob) error {
// Ensure that delete implementation is idempotent and safe to invoke
// multiple times for same object.
}
-
diff --git a/docs/book/src/multiversion-tutorial/api-changes.md b/docs/book/src/multiversion-tutorial/api-changes.md
index 8bca9fc9148..a5a11c2bcd4 100644
--- a/docs/book/src/multiversion-tutorial/api-changes.md
+++ b/docs/book/src/multiversion-tutorial/api-changes.md
@@ -12,7 +12,7 @@ schedule: "*/1 * * * *"
That's a pretty textbook example of a special string format (it's also
pretty unreadable unless you're a Unix sysadmin).
-Let's make it a bit more structured. According to the our [CronJob
+Let's make it a bit more structured. According to our [CronJob
code][cronjob-sched-code], we support "standard" Cron format.
In Kubernetes, **all versions must be safely round-tripable through each
@@ -52,4 +52,4 @@ Now, let's copy over our existing types, and make the change:
Now that we've got our types in place, we'll need to set up conversion...
-[cronjob-sched-code]: /TODO.md
+[cronjob-sched-code]: ./multiversion-tutorial/testdata/project/api/v2/cronjob_types.go "CronJob Code"
diff --git a/docs/book/src/reference/completion.md b/docs/book/src/reference/completion.md
index 9a838ad05a0..eaeead7cd78 100644
--- a/docs/book/src/reference/completion.md
+++ b/docs/book/src/reference/completion.md
@@ -27,7 +27,7 @@ if [ -f /usr/local/share/bash-completion/bash_completion ]; then
fi
. <(kubebuilder completion bash)
```
-- Restart terminal for the changes to be reflected.
+- Restart terminal for the changes to be reflected or `source` the changed bash file.
Zsh
diff --git a/docs/book/src/reference/platform.md b/docs/book/src/reference/platform.md
index 9471e31c567..b8c93cfab68 100644
--- a/docs/book/src/reference/platform.md
+++ b/docs/book/src/reference/platform.md
@@ -6,8 +6,7 @@ build and configure your workloads. This guide aims to help you properly configu
## Overview
To provide support on specific or multiple platforms, you must ensure that all images used in workloads are built to
-support the desired platforms. Note that may not be the same as the platform where you develop your solutions
-and use KubeBuilder, but instead the platform(s) where your solution should run and be distributed.
+support the desired platforms. Note that they may not be the same as the platform where you develop your solutions and use KubeBuilder, but instead the platform(s) where your solution should run and be distributed.
It is recommended to build solutions that work on multiple platforms so that your project works
on any Kubernetes cluster regardless of the underlying operating system and architecture.
diff --git a/docs/book/src/reference/raising-events.md b/docs/book/src/reference/raising-events.md
index 7e22c5d4862..a1f4ff872a7 100644
--- a/docs/book/src/reference/raising-events.md
+++ b/docs/book/src/reference/raising-events.md
@@ -76,7 +76,6 @@ type MyKindReconciler struct {
Recorder record.EventRecorder
}
```
-
### Passing the EventRecorder to the Controller
Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`,
diff --git a/docs/book/src/reference/webhook-overview.md b/docs/book/src/reference/webhook-overview.md
index 533636444eb..8fffb8914ed 100644
--- a/docs/book/src/reference/webhook-overview.md
+++ b/docs/book/src/reference/webhook-overview.md
@@ -1,8 +1,8 @@
# Webhook
Webhooks are requests for information sent in a blocking fashion. A web
-application implementing webhooks will send an HTTP request to other application
-when certain event happens.
+application implementing webhooks will send a HTTP request to other applications
+when a certain event happens.
In the kubernetes world, there are 3 kinds of webhooks:
[admission webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#admission-webhooks),
From c0d25b94224c45f0ef5b132ea4ae3878ea4a4b4f Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Tue, 12 Sep 2023 09:38:14 +0100
Subject: [PATCH 0306/1245] improve samples and ci checks
---
.github/workflows/lint-sample.yml | 54 ++
.github/workflows/lint.yml | 1 -
test/testdata/generate.sh | 20 +-
test/testdata/test.sh | 1 +
.../.dockerignore | 3 +
.../.gitignore | 26 +
.../.golangci.yml | 40 +
.../Dockerfile | 33 +
.../Makefile | 178 +++++
.../PROJECT | 121 +++
.../README.md | 91 +++
.../api/crew/v1/captain_types.go | 64 ++
.../api/crew/v1/captain_webhook.go | 77 ++
.../api/crew/v1}/groupversion_info.go | 8 +-
.../api/crew/v1}/webhook_suite_test.go | 4 +-
.../api/crew/v1/zz_generated.deepcopy.go | 114 +++
.../api/fiz/v1/bar_types.go | 64 ++
.../api/fiz/v1/groupversion_info.go | 36 +
.../api/fiz/v1/zz_generated.deepcopy.go | 114 +++
.../api/foo.policy/v1/groupversion_info.go | 36 +
.../foo.policy/v1/healthcheckpolicy_types.go | 64 ++
.../foo.policy/v1/zz_generated.deepcopy.go | 114 +++
.../api/foo/v1/bar_types.go | 64 ++
.../api/foo/v1/groupversion_info.go | 36 +
.../api/foo/v1/zz_generated.deepcopy.go | 114 +++
.../v1beta1/groupversion_info.go | 36 +
.../api/sea-creatures/v1beta1/kraken_types.go | 64 ++
.../v1beta1/zz_generated.deepcopy.go | 114 +++
.../v1beta2/groupversion_info.go | 36 +
.../sea-creatures/v1beta2/leviathan_types.go | 64 ++
.../v1beta2/zz_generated.deepcopy.go | 114 +++
.../api/ship/v1/destroyer_types.go | 65 ++
.../api/ship/v1/destroyer_webhook.go | 46 ++
.../api/ship/v1/groupversion_info.go | 36 +
.../api/ship/v1/webhook_suite_test.go | 145 ++++
.../api/ship/v1/zz_generated.deepcopy.go | 114 +++
.../api/ship/v1beta1/frigate_types.go | 64 ++
.../api/ship/v1beta1/frigate_webhook.go | 34 +
.../api/ship/v1beta1/groupversion_info.go | 36 +
.../api/ship/v1beta1/zz_generated.deepcopy.go | 114 +++
.../api/ship/v2alpha1/cruiser_types.go | 65 ++
.../api/ship/v2alpha1/cruiser_webhook.go} | 22 +-
.../api/ship/v2alpha1/groupversion_info.go | 36 +
.../api/ship/v2alpha1/webhook_suite_test.go | 145 ++++
.../ship/v2alpha1/zz_generated.deepcopy.go | 114 +++
.../api/v1/groupversion_info.go | 36 +
.../api/v1/lakers_types.go | 64 ++
.../api/v1/lakers_webhook.go | 77 ++
.../api/v1/webhook_suite_test.go | 145 ++++
.../api/v1/zz_generated.deepcopy.go | 114 +++
.../cmd/main.go | 240 ++++++
.../config/certmanager/certificate.yaml | 39 +
.../config/certmanager/kustomization.yaml | 5 +
.../config/certmanager/kustomizeconfig.yaml | 8 +
.../bases/crew.testproject.org_captains.yaml | 49 ++
.../crd/bases/fiz.testproject.org_bars.yaml | 49 ++
...y.testproject.org_healthcheckpolicies.yaml | 49 ++
.../crd/bases/foo.testproject.org_bars.yaml | 49 ++
...sea-creatures.testproject.org_krakens.yaml | 49 ++
...-creatures.testproject.org_leviathans.yaml | 49 ++
.../bases/ship.testproject.org_cruisers.yaml | 49 ++
.../ship.testproject.org_destroyers.yaml | 49 ++
.../bases/ship.testproject.org_frigates.yaml | 49 ++
.../crd/bases/testproject.org_lakers.yaml | 49 ++
.../config/crd/kustomization.yaml | 48 ++
.../config/crd/kustomizeconfig.yaml | 19 +
.../crd/patches/cainjection_in__lakers.yaml} | 2 +-
.../cainjection_in_crew_captains.yaml} | 2 +-
.../crd/patches/cainjection_in_fiz_bars.yaml | 7 +
...ion_in_foo.policy_healthcheckpolicies.yaml | 7 +
.../crd/patches/cainjection_in_foo_bars.yaml | 7 +
.../cainjection_in_sea-creatures_krakens.yaml | 7 +
...injection_in_sea-creatures_leviathans.yaml | 7 +
.../patches/cainjection_in_ship_cruisers.yaml | 7 +
.../cainjection_in_ship_destroyers.yaml | 7 +
.../patches/cainjection_in_ship_frigates.yaml | 7 +
.../crd/patches/webhook_in__lakers.yaml} | 2 +-
.../patches/webhook_in_crew_captains.yaml} | 2 +-
.../crd/patches/webhook_in_fiz_bars.yaml | 16 +
...ook_in_foo.policy_healthcheckpolicies.yaml | 16 +
.../crd/patches/webhook_in_foo_bars.yaml | 16 +
.../webhook_in_sea-creatures_krakens.yaml | 16 +
.../webhook_in_sea-creatures_leviathans.yaml | 16 +
.../crd/patches/webhook_in_ship_cruisers.yaml | 16 +
.../patches/webhook_in_ship_destroyers.yaml | 16 +
.../crd/patches/webhook_in_ship_frigates.yaml | 16 +
.../config/default/kustomization.yaml | 144 ++++
.../default/manager_auth_proxy_patch.yaml | 39 +
.../config/default/manager_config_patch.yaml | 10 +
.../config/default/manager_webhook_patch.yaml | 23 +
.../default/webhookcainjection_patch.yaml | 29 +
.../config/manager/kustomization.yaml | 2 +
.../config/manager/manager.yaml | 102 +++
.../config/prometheus/kustomization.yaml | 2 +
.../config/prometheus/monitor.yaml | 26 +
.../config/rbac/_lakers_editor_role.yaml} | 18 +-
.../config/rbac/_lakers_viewer_role.yaml | 27 +
.../rbac/auth_proxy_client_clusterrole.yaml | 16 +
.../config/rbac/auth_proxy_role.yaml | 24 +
.../config/rbac/auth_proxy_role_binding.yaml | 19 +
.../config/rbac/auth_proxy_service.yaml | 21 +
.../config/rbac/crew_captain_editor_role.yaml | 31 +
.../config/rbac/crew_captain_viewer_role.yaml | 27 +
.../config/rbac/fiz_bar_editor_role.yaml} | 18 +-
.../config/rbac/fiz_bar_viewer_role.yaml | 27 +
....policy_healthcheckpolicy_editor_role.yaml | 31 +
....policy_healthcheckpolicy_viewer_role.yaml | 27 +
.../config/rbac/foo_bar_editor_role.yaml | 31 +
.../config/rbac/foo_bar_viewer_role.yaml | 27 +
.../config/rbac/kustomization.yaml | 18 +
.../config/rbac/leader_election_role.yaml | 44 ++
.../rbac/leader_election_role_binding.yaml | 19 +
.../config/rbac/role.yaml | 292 +++++++
.../config/rbac/role_binding.yaml | 19 +
.../sea-creatures_kraken_editor_role.yaml | 31 +
.../sea-creatures_kraken_viewer_role.yaml | 27 +
.../sea-creatures_leviathan_editor_role.yaml | 31 +
.../sea-creatures_leviathan_viewer_role.yaml | 27 +
.../config/rbac/service_account.yaml | 12 +
.../config/rbac/ship_cruiser_editor_role.yaml | 31 +
.../config/rbac/ship_cruiser_viewer_role.yaml | 27 +
.../rbac/ship_destroyer_editor_role.yaml | 31 +
.../rbac/ship_destroyer_viewer_role.yaml | 27 +
.../config/rbac/ship_frigate_editor_role.yaml | 31 +
.../config/rbac/ship_frigate_viewer_role.yaml | 27 +
.../config/samples/_v1_lakers.yaml | 12 +
.../config/samples/crew_v1_captain.yaml | 12 +
.../config/samples/fiz_v1_bar.yaml | 12 +
.../foo.policy_v1_healthcheckpolicy.yaml | 12 +
.../config/samples/foo_v1_bar.yaml | 12 +
.../config/samples/kustomization.yaml | 13 +
.../samples/sea-creatures_v1beta1_kraken.yaml | 12 +
.../sea-creatures_v1beta2_leviathan.yaml | 12 +
.../config/samples/ship_v1_destroyer.yaml | 12 +
.../config/samples/ship_v1beta1_frigate.yaml | 12 +
.../config/samples/ship_v2alpha1_cruiser.yaml | 12 +
.../config/webhook/kustomization.yaml | 6 +
.../config/webhook/kustomizeconfig.yaml | 22 +
.../config/webhook/manifests.yaml | 132 ++++
.../config/webhook/service.yaml | 20 +
.../go.mod | 73 ++
.../hack/boilerplate.go.txt | 15 +
.../controller/apps/deployment_controller.go | 61 ++
.../internal/controller/apps/suite_test.go | 89 +++
.../controller/crew/captain_controller.go | 62 ++
.../internal/controller/crew}/suite_test.go | 6 +-
.../internal/controller/fiz/bar_controller.go | 62 ++
.../internal/controller/fiz/suite_test.go | 90 +++
.../healthcheckpolicy_controller.go | 62 ++
.../controller/foo.policy/suite_test.go | 90 +++
.../internal/controller/foo/bar_controller.go | 62 ++
.../internal/controller/foo/suite_test.go | 90 +++
.../internal/controller/lakers_controller.go | 62 ++
.../sea-creatures/kraken_controller.go | 62 ++
.../sea-creatures/leviathan_controller.go | 62 ++
.../controller/sea-creatures/suite_test.go | 94 +++
.../controller/ship/cruiser_controller.go | 62 ++
.../controller/ship/destroyer_controller.go | 62 ++
.../controller/ship/frigate_controller.go | 62 ++
.../internal/controller/ship/suite_test.go | 98 +++
.../internal/controller/suite_test.go | 90 +++
testdata/project-v4-multigroup/PROJECT | 40 -
.../api/example.com/v1alpha1/busybox_types.go | 77 --
.../example.com/v1alpha1/memcached_types.go | 80 --
.../v1alpha1/zz_generated.deepcopy.go | 218 ------
testdata/project-v4-multigroup/cmd/main.go | 25 -
...example.com.testproject.org_busyboxes.yaml | 122 ---
...xample.com.testproject.org_memcacheds.yaml | 127 ----
.../config/crd/kustomization.yaml | 6 -
.../config/manager/manager.yaml | 5 -
.../rbac/example.com_busybox_viewer_role.yaml | 27 -
.../example.com_memcached_viewer_role.yaml | 27 -
.../config/rbac/role.yaml | 67 --
.../samples/example.com_v1alpha1_busybox.yaml | 9 -
.../example.com_v1alpha1_memcached.yaml | 10 -
.../config/samples/kustomization.yaml | 2 -
.../config/webhook/manifests.yaml | 20 -
.../grafana/controller-resources-metrics.json | 306 --------
.../grafana/controller-runtime-metrics.json | 710 ------------------
.../grafana/custom-metrics/config.yaml | 15 -
.../example.com/busybox_controller.go | 433 -----------
.../example.com/busybox_controller_test.go | 153 ----
.../example.com/memcached_controller.go | 439 -----------
.../example.com/memcached_controller_test.go | 154 ----
184 files changed, 7505 insertions(+), 3129 deletions(-)
create mode 100644 .github/workflows/lint-sample.yml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/.dockerignore
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/.gitignore
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/.golangci.yml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/Dockerfile
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/Makefile
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/PROJECT
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/README.md
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook.go
rename testdata/{project-v4-multigroup/api/example.com/v1alpha1 => project-v4-multigroup-with-deploy-image/api/crew/v1}/groupversion_info.go (80%)
rename testdata/{project-v4-multigroup/api/example.com/v1alpha1 => project-v4-multigroup-with-deploy-image/api/crew/v1}/webhook_suite_test.go (98%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/bar_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/healthcheckpolicy_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/bar_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/kraken_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/leviathan_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_types.go
rename testdata/{project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go => project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook.go} (66%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/v1/groupversion_info.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_types.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/v1/zz_generated.deepcopy.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/cmd/main.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/certmanager/certificate.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomizeconfig.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/crew.testproject.org_captains.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/fiz.testproject.org_bars.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.testproject.org_bars.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_cruisers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_destroyers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_frigates.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/testproject.org_lakers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomizeconfig.yaml
rename testdata/{project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml => project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in__lakers.yaml} (84%)
rename testdata/{project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml => project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_crew_captains.yaml} (84%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_cruisers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_destroyers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_frigates.yaml
rename testdata/{project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml => project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in__lakers.yaml} (88%)
rename testdata/{project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml => project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_crew_captains.yaml} (88%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_cruisers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_destroyers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_frigates.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/default/manager_config_patch.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/default/manager_webhook_patch.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/default/webhookcainjection_patch.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/manager/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/prometheus/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml
rename testdata/{project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml => project-v4-multigroup-with-deploy-image/config/rbac/_lakers_editor_role.yaml} (51%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_client_clusterrole.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role_binding.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_service.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_viewer_role.yaml
rename testdata/{project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml => project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_editor_role.yaml} (51%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role_binding.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/role_binding.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/service_account.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_editor_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_viewer_role.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/_v1_lakers.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/crew_v1_captain.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/fiz_v1_bar.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/foo.policy_v1_healthcheckpolicy.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/foo_v1_bar.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta1_kraken.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta2_leviathan.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1_destroyer.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1beta1_frigate.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v2alpha1_cruiser.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomization.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomizeconfig.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/webhook/manifests.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/go.mod
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/hack/boilerplate.go.txt
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go
rename testdata/{project-v4-multigroup/internal/controller/example.com => project-v4-multigroup-with-deploy-image/internal/controller/crew}/suite_test.go (93%)
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go
delete mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go
delete mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go
delete mode 100644 testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
delete mode 100644 testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
delete mode 100644 testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml
delete mode 100644 testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml
delete mode 100644 testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml
delete mode 100644 testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml
delete mode 100644 testdata/project-v4-multigroup/grafana/controller-resources-metrics.json
delete mode 100644 testdata/project-v4-multigroup/grafana/controller-runtime-metrics.json
delete mode 100644 testdata/project-v4-multigroup/grafana/custom-metrics/config.yaml
delete mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
delete mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
delete mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
delete mode 100644 testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
diff --git a/.github/workflows/lint-sample.yml b/.github/workflows/lint-sample.yml
new file mode 100644
index 00000000000..984b2512c3e
--- /dev/null
+++ b/.github/workflows/lint-sample.yml
@@ -0,0 +1,54 @@
+# Copyright 2023 The Caramello-io Authors.
+
+name: Sample Testdata Tests
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ test:
+ name: "Testdata - make test"
+ runs-on: ubuntu-latest
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
+ steps:
+ - name: Clone the code
+ uses: actions/checkout@v3
+ - name: Setup Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: '~1.20'
+ - name: Remove pre-installed kustomize
+ run: sudo rm -f /usr/local/bin/kustomize
+ - name: Run make test for project-v4-with-deploy-image
+ run: cd testdata/project-v4-with-deploy-image && go mod tidy && make all && make test
+ - name: Run make test for project-v4-multigroup-with-deploy-image
+ run: cd testdata/project-v4-multigroup-with-deploy-image && go mod tidy && make all && make test
+
+ lint:
+ name: "Testdata - Lint"
+ runs-on: ubuntu-latest
+ # Pull requests from the same repository won't trigger this checks as they were already triggered by the push
+ if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
+ steps:
+ - name: Setup Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: '~1.20'
+ - name: Clone the code
+ uses: actions/checkout@v4
+ - name: Run linter
+ uses: golangci/golangci-lint-action@v3
+ with:
+ version: v1.54
+ working-directory: testdata/project-v4-with-deploy-image
+ args: --config .golangci.yml ./...
+ skip-cache: true # first lint action will handle
+ - name: Run linter
+ uses: golangci/golangci-lint-action@v3
+ with:
+ version: v1.54
+ working-directory: testdata/project-v4-multigroup-with-deploy-image
+ args: --config .golangci.yml ./...
+ skip-cache: true # first lint action will handle
+
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 6c8d0ddd8bb..b60db866861 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -22,7 +22,6 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
- only-new-issues: true # Show only new issues if it's a pull request
yamllint:
runs-on: ubuntu-latest
diff --git a/test/testdata/generate.sh b/test/testdata/generate.sh
index f37c007b63a..eeb6c9bad78 100755
--- a/test/testdata/generate.sh
+++ b/test/testdata/generate.sh
@@ -98,32 +98,23 @@ function scaffold_test_project {
$kb create api --group foo --version v1 --kind Bar --controller=true --resource=true --make=false
$kb create api --group fiz --version v1 --kind Bar --controller=true --resource=true --make=false
- if [ $project == "project-v3-multigroup" ] || [ $project == "project-v4-multigroup" ]; then
+ if [ $project == "project-v4-multigroup" ] || [ $project == "project-v4-multigroup-with-deploy-image" ] ; then
$kb create api --version v1 --kind Lakers --controller=true --resource=true --make=false
$kb create webhook --version v1 --kind Lakers --defaulting --programmatic-validation
fi
-
- # Call ALL optional plugins within multigroup layout to ensure that they can work within
- header_text 'Creating Memcached API with deploy-image plugin ...'
- $kb create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,-o,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha" --make=false
- $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
-
- header_text 'Editing project with Grafana plugin ...'
- $kb edit --plugins=grafana.kubebuilder.io/v1-alpha
-
elif [[ $project =~ deploy-image ]]; then
header_text 'Creating Memcached API with deploy-image plugin ...'
$kb create api --group example.com --version v1alpha1 --kind Memcached --image=memcached:1.4.36-alpine --image-container-command="memcached,-m=64,-o,modern,-v" --image-container-port="11211" --run-as-user="1001" --plugins="deploy-image/v1-alpha" --make=false
$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-grafana" ]]; then
+ fi
+
+ if [[ $project == project-v4-with-grafana ]]; then
header_text 'Editing project with Grafana plugin ...'
$kb edit --plugins=grafana.kubebuilder.io/v1-alpha
fi
-
+
make generate manifests
rm -f go.sum
go mod tidy
@@ -141,5 +132,6 @@ scaffold_test_project project-v3 --plugins="go/v3"
# [Currently, default CLI plugin] - [Next version, alpha] Project version v4-alpha
scaffold_test_project project-v4 --plugins="go/v4"
scaffold_test_project project-v4-multigroup --plugins="go/v4"
+scaffold_test_project project-v4-multigroup-with-deploy-image --plugins="go/v4"
scaffold_test_project project-v4-with-deploy-image --plugins="go/v4"
scaffold_test_project project-v4-with-grafana --plugins="go/v4"
diff --git a/test/testdata/test.sh b/test/testdata/test.sh
index 162a66419a1..abf7ffb5f04 100755
--- a/test/testdata/test.sh
+++ b/test/testdata/test.sh
@@ -33,5 +33,6 @@ build_kb
# Project version v4-alpha
test_project project-v4
test_project project-v4-multigroup
+test_project project-v4-multigroup-with-deploy-image
test_project project-v4-with-deploy-image
test_project project-v4-with-grafana
diff --git a/testdata/project-v4-multigroup-with-deploy-image/.dockerignore b/testdata/project-v4-multigroup-with-deploy-image/.dockerignore
new file mode 100644
index 00000000000..a3aab7af70c
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/.dockerignore
@@ -0,0 +1,3 @@
+# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
+# Ignore build and test binaries.
+bin/
diff --git a/testdata/project-v4-multigroup-with-deploy-image/.gitignore b/testdata/project-v4-multigroup-with-deploy-image/.gitignore
new file mode 100644
index 00000000000..7f02333db7a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/.gitignore
@@ -0,0 +1,26 @@
+
+# Binaries for programs and plugins
+*.exe
+*.exe~
+*.dll
+*.so
+*.dylib
+bin/*
+Dockerfile.cross
+
+# Test binary, build with `go test -c`
+*.test
+
+# Output of the go coverage tool, specifically when used with LiteIDE
+*.out
+
+# Kubernetes Generated files - skip generated files, except for vendored files
+
+!vendor/**/zz_generated.*
+
+# editor and IDE paraphernalia
+.idea
+.vscode
+*.swp
+*.swo
+*~
diff --git a/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml b/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml
new file mode 100644
index 00000000000..aed8644d11e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/.golangci.yml
@@ -0,0 +1,40 @@
+run:
+ deadline: 5m
+ allow-parallel-runners: true
+
+issues:
+ # don't skip warning about doc comments
+ # don't exclude the default set of lint
+ exclude-use-default: false
+ # restore some of the defaults
+ # (fill in the rest as needed)
+ exclude-rules:
+ - path: "api/*"
+ linters:
+ - lll
+ - path: "internal/*"
+ linters:
+ - dupl
+ - lll
+linters:
+ disable-all: true
+ enable:
+ - dupl
+ - errcheck
+ - exportloopref
+ - goconst
+ - gocyclo
+ - gofmt
+ - goimports
+ - gosimple
+ - govet
+ - ineffassign
+ - lll
+ - misspell
+ - nakedret
+ - prealloc
+ - staticcheck
+ - typecheck
+ - unconvert
+ - unparam
+ - unused
diff --git a/testdata/project-v4-multigroup-with-deploy-image/Dockerfile b/testdata/project-v4-multigroup-with-deploy-image/Dockerfile
new file mode 100644
index 00000000000..c389c0981af
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/Dockerfile
@@ -0,0 +1,33 @@
+# Build the manager binary
+FROM golang:1.20 as builder
+ARG TARGETOS
+ARG TARGETARCH
+
+WORKDIR /workspace
+# Copy the Go Modules manifests
+COPY go.mod go.mod
+COPY go.sum go.sum
+# cache deps before building and copying source so that we don't need to re-download as much
+# and so that source changes don't invalidate our downloaded layer
+RUN go mod download
+
+# Copy the go source
+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 cmd/main.go
+
+# Use distroless as minimal base image to package the manager binary
+# Refer to https://github.com/GoogleContainerTools/distroless for more details
+FROM gcr.io/distroless/static:nonroot
+WORKDIR /
+COPY --from=builder /workspace/manager .
+USER 65532:65532
+
+ENTRYPOINT ["/manager"]
diff --git a/testdata/project-v4-multigroup-with-deploy-image/Makefile b/testdata/project-v4-multigroup-with-deploy-image/Makefile
new file mode 100644
index 00000000000..fc949b7f470
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/Makefile
@@ -0,0 +1,178 @@
+
+# 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.28.0
+
+# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
+ifeq (,$(shell go env GOBIN))
+GOBIN=$(shell go env GOPATH)/bin
+else
+GOBIN=$(shell go env GOBIN)
+endif
+
+# CONTAINER_TOOL defines the container tool to be used for building images.
+# Be aware that the target commands are only tested with Docker which is
+# scaffolded by default. However, you might want to replace it to use other
+# tools. (i.e. podman)
+CONTAINER_TOOL ?= docker
+
+# Setting SHELL to bash allows bash commands to be executed by recipes.
+# Options are set to exit when a recipe line exits non-zero or a piped command fails.
+SHELL = /usr/bin/env bash -o pipefail
+.SHELLFLAGS = -ec
+
+.PHONY: all
+all: build
+
+##@ General
+
+# The help target prints out all targets with their descriptions organized
+# beneath their categories. The categories are represented by '##@' and the
+# target descriptions by '##'. The awk command is responsible for reading the
+# entire set of makefiles included in this invocation, looking for lines of the
+# file as xyz: ## something, and then pretty-format the target and help. Then,
+# if there's a line with ##@ something, that gets pretty-printed as a category.
+# More info on the usage of ANSI control characters for terminal formatting:
+# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
+# More info on the awk command:
+# http://linuxcommand.org/lc3_adv_awk.php
+
+.PHONY: help
+help: ## Display this help.
+ @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
+
+##@ Development
+
+.PHONY: manifests
+manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
+ $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
+
+.PHONY: generate
+generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
+ $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
+
+.PHONY: fmt
+fmt: ## Run go fmt against code.
+ go fmt ./...
+
+.PHONY: vet
+vet: ## Run go vet against code.
+ go vet ./...
+
+.PHONY: test
+test: manifests generate fmt vet envtest ## Run tests.
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+
+GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+golangci-lint:
+ @[ -f $(GOLANGCI_LINT) ] || { \
+ set -e ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ }
+
+.PHONY: lint
+lint: golangci-lint ## Run golangci-lint linter & yamllint
+ $(GOLANGCI_LINT) run
+
+.PHONY: lint-fix
+lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
+ $(GOLANGCI_LINT) run --fix
+
+##@ Build
+
+.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
+
+# If you wish to build the manager image targeting other platforms you can use the --platform flag.
+# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
+# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+.PHONY: docker-build
+docker-build: ## Build docker image with the manager.
+ $(CONTAINER_TOOL) build -t ${IMG} .
+
+.PHONY: docker-push
+docker-push: ## Push docker image with the manager.
+ $(CONTAINER_TOOL) push ${IMG}
+
+# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
+# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
+# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
+# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
+# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=> then the export will fail)
+# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
+PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
+.PHONY: docker-buildx
+docker-buildx: ## Build and push docker image for the manager for cross-platform support
+ # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
+ sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
+ - $(CONTAINER_TOOL) buildx create --name project-v3-builder
+ $(CONTAINER_TOOL) buildx use project-v3-builder
+ - $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
+ - $(CONTAINER_TOOL) buildx rm project-v3-builder
+ rm Dockerfile.cross
+
+##@ Deployment
+
+ifndef ignore-not-found
+ ignore-not-found = false
+endif
+
+.PHONY: install
+install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
+
+.PHONY: uninstall
+uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
+ $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
+
+.PHONY: deploy
+deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
+ cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
+ $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
+
+.PHONY: undeploy
+undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
+ $(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
+
+##@ Build Dependencies
+
+## Location to install dependencies to
+LOCALBIN ?= $(shell pwd)/bin
+$(LOCALBIN):
+ mkdir -p $(LOCALBIN)
+
+## Tool Binaries
+KUBECTL ?= kubectl
+KUSTOMIZE ?= $(LOCALBIN)/kustomize
+CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
+ENVTEST ?= $(LOCALBIN)/setup-envtest
+
+## Tool Versions
+KUSTOMIZE_VERSION ?= v5.1.1
+CONTROLLER_TOOLS_VERSION ?= v0.13.0
+
+.PHONY: kustomize
+kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
+$(KUSTOMIZE): $(LOCALBIN)
+ @if test -x $(LOCALBIN)/kustomize && ! $(LOCALBIN)/kustomize version | grep -q $(KUSTOMIZE_VERSION); then \
+ echo "$(LOCALBIN)/kustomize version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \
+ rm -rf $(LOCALBIN)/kustomize; \
+ fi
+ test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION)
+
+.PHONY: controller-gen
+controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
+$(CONTROLLER_GEN): $(LOCALBIN)
+ test -s $(LOCALBIN)/controller-gen && $(LOCALBIN)/controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \
+ GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
+
+.PHONY: envtest
+envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
+$(ENVTEST): $(LOCALBIN)
+ test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
diff --git a/testdata/project-v4-multigroup-with-deploy-image/PROJECT b/testdata/project-v4-multigroup-with-deploy-image/PROJECT
new file mode 100644
index 00000000000..c225adc3d9e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/PROJECT
@@ -0,0 +1,121 @@
+# 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
+multigroup: true
+projectName: project-v4-multigroup-with-deploy-image
+repo: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image
+resources:
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: crew
+ kind: Captain
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1
+ version: v1
+ webhooks:
+ defaulting: true
+ validation: true
+ webhookVersion: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: ship
+ kind: Frigate
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1
+ version: v1beta1
+ webhooks:
+ conversion: true
+ webhookVersion: v1
+- api:
+ crdVersion: v1
+ controller: true
+ domain: testproject.org
+ group: ship
+ kind: Destroyer
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1
+ version: v1
+ webhooks:
+ defaulting: true
+ webhookVersion: v1
+- api:
+ crdVersion: v1
+ controller: true
+ domain: testproject.org
+ group: ship
+ kind: Cruiser
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1
+ version: v2alpha1
+ webhooks:
+ validation: true
+ webhookVersion: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: sea-creatures
+ kind: Kraken
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1
+ version: v1beta1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: sea-creatures
+ kind: Leviathan
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2
+ version: v1beta2
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: foo.policy
+ kind: HealthCheckPolicy
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1
+ version: v1
+- controller: true
+ group: apps
+ kind: Deployment
+ path: k8s.io/api/apps/v1
+ version: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: foo
+ kind: Bar
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1
+ version: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ group: fiz
+ kind: Bar
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1
+ version: v1
+- api:
+ crdVersion: v1
+ namespaced: true
+ controller: true
+ domain: testproject.org
+ kind: Lakers
+ path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/v1
+ version: v1
+ webhooks:
+ defaulting: true
+ validation: true
+ webhookVersion: v1
+version: "3"
diff --git a/testdata/project-v4-multigroup-with-deploy-image/README.md b/testdata/project-v4-multigroup-with-deploy-image/README.md
new file mode 100644
index 00000000000..4ea3ae8127a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/README.md
@@ -0,0 +1,91 @@
+# project-v4-multigroup-with-deploy-image
+// TODO(user): Add simple overview of use/purpose
+
+## Description
+// TODO(user): An in-depth paragraph about your project and overview of use
+
+## Getting Started
+
+### Prerequisites
+- go version v1.20.0+
+- docker version 17.03+.
+- kubectl version v1.11.3+.
+- Access to a Kubernetes v1.11.3+ cluster.
+
+### To Deploy on the cluster
+**Build and push your image to the location specified by `IMG`:**
+
+```sh
+make docker-build docker-push IMG=/project-v4-multigroup-with-deploy-image:tag
+```
+
+**NOTE:** This image ought to be published in the personal registry you specified.
+And it is required to have access to pull the image from the working environment.
+Make sure you have the proper permission to the registry if the above commands don’t work.
+
+**Install the CRDs into the cluster:**
+
+```sh
+make install
+```
+
+**Deploy the Manager to the cluster with the image specified by `IMG`:**
+
+```sh
+make deploy IMG=/project-v4-multigroup-with-deploy-image:tag
+```
+
+> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
+privileges or be logged in as admin.
+
+**Create instances of your solution**
+You can apply the samples (examples) from the config/sample:
+
+```sh
+kubectl apply -k config/samples/
+```
+
+>**NOTE**: Ensure that the samples has default values to test it out.
+
+### To Uninstall
+**Delete the instances (CRs) from the cluster:**
+
+```sh
+kubectl delete -k config/samples/
+```
+
+**Delete the APIs(CRDs) from the cluster:**
+
+```sh
+make uninstall
+```
+
+**UnDeploy the controller from the cluster:**
+
+```sh
+make undeploy
+```
+
+## Contributing
+// TODO(user): Add detailed information on how you would like others to contribute to this project
+
+**NOTE:** Run `make --help` for more information on all potential `make` targets
+
+More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
+
+## License
+
+Copyright 2023 The 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.
+
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_types.go
new file mode 100644
index 00000000000..6eafa937b54
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// CaptainSpec defines the desired state of Captain
+type CaptainSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Captain. Edit captain_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// CaptainStatus defines the observed state of Captain
+type CaptainStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Captain is the Schema for the captains API
+type Captain struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec CaptainSpec `json:"spec,omitempty"`
+ Status CaptainStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// CaptainList contains a list of Captain
+type CaptainList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Captain `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Captain{}, &CaptainList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook.go
new file mode 100644
index 00000000000..ed99f7f0e55
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook.go
@@ -0,0 +1,77 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+// log is for logging in this package.
+var captainlog = logf.Log.WithName("captain-resource")
+
+// SetupWebhookWithManager will setup the manager to manage the webhooks
+func (r *Captain) SetupWebhookWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewWebhookManagedBy(mgr).
+ For(r).
+ Complete()
+}
+
+// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+
+//+kubebuilder:webhook:path=/mutate-crew-testproject-org-v1-captain,mutating=true,failurePolicy=fail,sideEffects=None,groups=crew.testproject.org,resources=captains,verbs=create;update,versions=v1,name=mcaptain.kb.io,admissionReviewVersions=v1
+
+var _ webhook.Defaulter = &Captain{}
+
+// Default implements webhook.Defaulter so a webhook will be registered for the type
+func (r *Captain) Default() {
+ captainlog.Info("default", "name", r.Name)
+
+ // TODO(user): fill in your defaulting logic.
+}
+
+// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
+//+kubebuilder:webhook:path=/validate-crew-testproject-org-v1-captain,mutating=false,failurePolicy=fail,sideEffects=None,groups=crew.testproject.org,resources=captains,verbs=create;update,versions=v1,name=vcaptain.kb.io,admissionReviewVersions=v1
+
+var _ webhook.Validator = &Captain{}
+
+// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
+func (r *Captain) ValidateCreate() (admission.Warnings, error) {
+ captainlog.Info("validate create", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object creation.
+ return nil, nil
+}
+
+// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
+func (r *Captain) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
+ captainlog.Info("validate update", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object update.
+ return nil, nil
+}
+
+// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
+func (r *Captain) ValidateDelete() (admission.Warnings, error) {
+ captainlog.Info("validate delete", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object deletion.
+ return nil, nil
+}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/groupversion_info.go
similarity index 80%
rename from testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go
rename to testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/groupversion_info.go
index 9541616caff..fe267f232c5 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/groupversion_info.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/groupversion_info.go
@@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// Package v1alpha1 contains API Schema definitions for the example.com v1alpha1 API group
+// Package v1 contains API Schema definitions for the crew v1 API group
// +kubebuilder:object:generate=true
-// +groupName=example.com.testproject.org
-package v1alpha1
+// +groupName=crew.testproject.org
+package v1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -26,7 +26,7 @@ import (
var (
// GroupVersion is group version used to register these objects
- GroupVersion = schema.GroupVersion{Group: "example.com.testproject.org", Version: "v1alpha1"}
+ GroupVersion = schema.GroupVersion{Group: "crew.testproject.org", Version: "v1"}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go
similarity index 98%
rename from testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
rename to testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go
index 17d019e74f8..d58a13812d1 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package v1
import (
"context"
@@ -113,7 +113,7 @@ var _ = BeforeSuite(func() {
})
Expect(err).NotTo(HaveOccurred())
- err = (&Memcached{}).SetupWebhookWithManager(mgr)
+ err = (&Captain{}).SetupWebhookWithManager(mgr)
Expect(err).NotTo(HaveOccurred())
//+kubebuilder:scaffold:webhook
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..83b88d335a7
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Captain) DeepCopyInto(out *Captain) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Captain.
+func (in *Captain) DeepCopy() *Captain {
+ if in == nil {
+ return nil
+ }
+ out := new(Captain)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Captain) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CaptainList) DeepCopyInto(out *CaptainList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Captain, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainList.
+func (in *CaptainList) DeepCopy() *CaptainList {
+ if in == nil {
+ return nil
+ }
+ out := new(CaptainList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *CaptainList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CaptainSpec) DeepCopyInto(out *CaptainSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainSpec.
+func (in *CaptainSpec) DeepCopy() *CaptainSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(CaptainSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CaptainStatus) DeepCopyInto(out *CaptainStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CaptainStatus.
+func (in *CaptainStatus) DeepCopy() *CaptainStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(CaptainStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/bar_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/bar_types.go
new file mode 100644
index 00000000000..7cc002b4610
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/bar_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// BarSpec defines the desired state of Bar
+type BarSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Bar. Edit bar_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// BarStatus defines the observed state of Bar
+type BarStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Bar is the Schema for the bars API
+type Bar struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec BarSpec `json:"spec,omitempty"`
+ Status BarStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// BarList contains a list of Bar
+type BarList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Bar `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Bar{}, &BarList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/groupversion_info.go
new file mode 100644
index 00000000000..15af8f01654
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1 contains API Schema definitions for the fiz v1 API group
+// +kubebuilder:object:generate=true
+// +groupName=fiz.testproject.org
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "fiz.testproject.org", Version: "v1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..76023cf206f
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Bar) DeepCopyInto(out *Bar) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bar.
+func (in *Bar) DeepCopy() *Bar {
+ if in == nil {
+ return nil
+ }
+ out := new(Bar)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Bar) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BarList) DeepCopyInto(out *BarList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Bar, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarList.
+func (in *BarList) DeepCopy() *BarList {
+ if in == nil {
+ return nil
+ }
+ out := new(BarList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *BarList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BarSpec) DeepCopyInto(out *BarSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarSpec.
+func (in *BarSpec) DeepCopy() *BarSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(BarSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BarStatus) DeepCopyInto(out *BarStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarStatus.
+func (in *BarStatus) DeepCopy() *BarStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(BarStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/groupversion_info.go
new file mode 100644
index 00000000000..33bf52ac801
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1 contains API Schema definitions for the foo.policy v1 API group
+// +kubebuilder:object:generate=true
+// +groupName=foo.policy.testproject.org
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "foo.policy.testproject.org", Version: "v1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/healthcheckpolicy_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/healthcheckpolicy_types.go
new file mode 100644
index 00000000000..01e8d1765a6
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/healthcheckpolicy_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// HealthCheckPolicySpec defines the desired state of HealthCheckPolicy
+type HealthCheckPolicySpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of HealthCheckPolicy. Edit healthcheckpolicy_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// HealthCheckPolicyStatus defines the observed state of HealthCheckPolicy
+type HealthCheckPolicyStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// HealthCheckPolicy is the Schema for the healthcheckpolicies API
+type HealthCheckPolicy struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec HealthCheckPolicySpec `json:"spec,omitempty"`
+ Status HealthCheckPolicyStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// HealthCheckPolicyList contains a list of HealthCheckPolicy
+type HealthCheckPolicyList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []HealthCheckPolicy `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&HealthCheckPolicy{}, &HealthCheckPolicyList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..66bf028e3ba
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HealthCheckPolicy) DeepCopyInto(out *HealthCheckPolicy) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicy.
+func (in *HealthCheckPolicy) DeepCopy() *HealthCheckPolicy {
+ if in == nil {
+ return nil
+ }
+ out := new(HealthCheckPolicy)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *HealthCheckPolicy) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HealthCheckPolicyList) DeepCopyInto(out *HealthCheckPolicyList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]HealthCheckPolicy, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicyList.
+func (in *HealthCheckPolicyList) DeepCopy() *HealthCheckPolicyList {
+ if in == nil {
+ return nil
+ }
+ out := new(HealthCheckPolicyList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *HealthCheckPolicyList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HealthCheckPolicySpec) DeepCopyInto(out *HealthCheckPolicySpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicySpec.
+func (in *HealthCheckPolicySpec) DeepCopy() *HealthCheckPolicySpec {
+ if in == nil {
+ return nil
+ }
+ out := new(HealthCheckPolicySpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *HealthCheckPolicyStatus) DeepCopyInto(out *HealthCheckPolicyStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckPolicyStatus.
+func (in *HealthCheckPolicyStatus) DeepCopy() *HealthCheckPolicyStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(HealthCheckPolicyStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/bar_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/bar_types.go
new file mode 100644
index 00000000000..7cc002b4610
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/bar_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// BarSpec defines the desired state of Bar
+type BarSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Bar. Edit bar_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// BarStatus defines the observed state of Bar
+type BarStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Bar is the Schema for the bars API
+type Bar struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec BarSpec `json:"spec,omitempty"`
+ Status BarStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// BarList contains a list of Bar
+type BarList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Bar `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Bar{}, &BarList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/groupversion_info.go
new file mode 100644
index 00000000000..d0d26e62293
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1 contains API Schema definitions for the foo v1 API group
+// +kubebuilder:object:generate=true
+// +groupName=foo.testproject.org
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "foo.testproject.org", Version: "v1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..76023cf206f
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Bar) DeepCopyInto(out *Bar) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bar.
+func (in *Bar) DeepCopy() *Bar {
+ if in == nil {
+ return nil
+ }
+ out := new(Bar)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Bar) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BarList) DeepCopyInto(out *BarList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Bar, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarList.
+func (in *BarList) DeepCopy() *BarList {
+ if in == nil {
+ return nil
+ }
+ out := new(BarList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *BarList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BarSpec) DeepCopyInto(out *BarSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarSpec.
+func (in *BarSpec) DeepCopy() *BarSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(BarSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *BarStatus) DeepCopyInto(out *BarStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BarStatus.
+func (in *BarStatus) DeepCopy() *BarStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(BarStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/groupversion_info.go
new file mode 100644
index 00000000000..9200968a3a5
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1beta1 contains API Schema definitions for the sea-creatures v1beta1 API group
+// +kubebuilder:object:generate=true
+// +groupName=sea-creatures.testproject.org
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "sea-creatures.testproject.org", Version: "v1beta1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/kraken_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/kraken_types.go
new file mode 100644
index 00000000000..4c4d33ef844
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/kraken_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// KrakenSpec defines the desired state of Kraken
+type KrakenSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Kraken. Edit kraken_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// KrakenStatus defines the observed state of Kraken
+type KrakenStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Kraken is the Schema for the krakens API
+type Kraken struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec KrakenSpec `json:"spec,omitempty"`
+ Status KrakenStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// KrakenList contains a list of Kraken
+type KrakenList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Kraken `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Kraken{}, &KrakenList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..64ce14510af
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Kraken) DeepCopyInto(out *Kraken) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kraken.
+func (in *Kraken) DeepCopy() *Kraken {
+ if in == nil {
+ return nil
+ }
+ out := new(Kraken)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Kraken) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KrakenList) DeepCopyInto(out *KrakenList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Kraken, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KrakenList.
+func (in *KrakenList) DeepCopy() *KrakenList {
+ if in == nil {
+ return nil
+ }
+ out := new(KrakenList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *KrakenList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KrakenSpec) DeepCopyInto(out *KrakenSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KrakenSpec.
+func (in *KrakenSpec) DeepCopy() *KrakenSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(KrakenSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KrakenStatus) DeepCopyInto(out *KrakenStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KrakenStatus.
+func (in *KrakenStatus) DeepCopy() *KrakenStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(KrakenStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/groupversion_info.go
new file mode 100644
index 00000000000..c6059651fad
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1beta2 contains API Schema definitions for the sea-creatures v1beta2 API group
+// +kubebuilder:object:generate=true
+// +groupName=sea-creatures.testproject.org
+package v1beta2
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "sea-creatures.testproject.org", Version: "v1beta2"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/leviathan_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/leviathan_types.go
new file mode 100644
index 00000000000..470019dc160
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/leviathan_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1beta2
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// LeviathanSpec defines the desired state of Leviathan
+type LeviathanSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Leviathan. Edit leviathan_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// LeviathanStatus defines the observed state of Leviathan
+type LeviathanStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Leviathan is the Schema for the leviathans API
+type Leviathan struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec LeviathanSpec `json:"spec,omitempty"`
+ Status LeviathanStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// LeviathanList contains a list of Leviathan
+type LeviathanList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Leviathan `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Leviathan{}, &LeviathanList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..6777d3b537d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1beta2
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Leviathan) DeepCopyInto(out *Leviathan) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Leviathan.
+func (in *Leviathan) DeepCopy() *Leviathan {
+ if in == nil {
+ return nil
+ }
+ out := new(Leviathan)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Leviathan) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeviathanList) DeepCopyInto(out *LeviathanList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Leviathan, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeviathanList.
+func (in *LeviathanList) DeepCopy() *LeviathanList {
+ if in == nil {
+ return nil
+ }
+ out := new(LeviathanList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LeviathanList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeviathanSpec) DeepCopyInto(out *LeviathanSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeviathanSpec.
+func (in *LeviathanSpec) DeepCopy() *LeviathanSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(LeviathanSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeviathanStatus) DeepCopyInto(out *LeviathanStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeviathanStatus.
+func (in *LeviathanStatus) DeepCopy() *LeviathanStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(LeviathanStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_types.go
new file mode 100644
index 00000000000..f8cc80eefb5
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_types.go
@@ -0,0 +1,65 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// DestroyerSpec defines the desired state of Destroyer
+type DestroyerSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Destroyer. Edit destroyer_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// DestroyerStatus defines the observed state of Destroyer
+type DestroyerStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+//+kubebuilder:resource:scope=Cluster
+
+// Destroyer is the Schema for the destroyers API
+type Destroyer struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec DestroyerSpec `json:"spec,omitempty"`
+ Status DestroyerStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// DestroyerList contains a list of Destroyer
+type DestroyerList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Destroyer `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Destroyer{}, &DestroyerList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook.go
new file mode 100644
index 00000000000..4b0fb739d55
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook.go
@@ -0,0 +1,46 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ ctrl "sigs.k8s.io/controller-runtime"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+)
+
+// log is for logging in this package.
+var destroyerlog = logf.Log.WithName("destroyer-resource")
+
+// SetupWebhookWithManager will setup the manager to manage the webhooks
+func (r *Destroyer) SetupWebhookWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewWebhookManagedBy(mgr).
+ For(r).
+ Complete()
+}
+
+// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+
+//+kubebuilder:webhook:path=/mutate-ship-testproject-org-v1-destroyer,mutating=true,failurePolicy=fail,sideEffects=None,groups=ship.testproject.org,resources=destroyers,verbs=create;update,versions=v1,name=mdestroyer.kb.io,admissionReviewVersions=v1
+
+var _ webhook.Defaulter = &Destroyer{}
+
+// Default implements webhook.Defaulter so a webhook will be registered for the type
+func (r *Destroyer) Default() {
+ destroyerlog.Info("default", "name", r.Name)
+
+ // TODO(user): fill in your defaulting logic.
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/groupversion_info.go
new file mode 100644
index 00000000000..7ca96e4ea8c
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1 contains API Schema definitions for the ship v1 API group
+// +kubebuilder:object:generate=true
+// +groupName=ship.testproject.org
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "ship.testproject.org", Version: "v1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go
new file mode 100644
index 00000000000..1c6bb164c54
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go
@@ -0,0 +1,145 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ "context"
+ "crypto/tls"
+ "fmt"
+ "net"
+ "path/filepath"
+ "runtime"
+ "testing"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ admissionv1 "k8s.io/api/admission/v1"
+ //+kubebuilder:scaffold:imports
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+var ctx context.Context
+var cancel context.CancelFunc
+
+func TestAPIs(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Webhook Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ ctx, cancel = context.WithCancel(context.TODO())
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
+ WebhookInstallOptions: envtest.WebhookInstallOptions{
+ Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
+ },
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ scheme := apimachineryruntime.NewScheme()
+ err = AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = admissionv1.AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+ // start webhook server using Manager
+ webhookInstallOptions := &testEnv.WebhookInstallOptions
+ mgr, err := ctrl.NewManager(cfg, ctrl.Options{
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
+ })
+ Expect(err).NotTo(HaveOccurred())
+
+ err = (&Destroyer{}).SetupWebhookWithManager(mgr)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:webhook
+
+ go func() {
+ defer GinkgoRecover()
+ err = mgr.Start(ctx)
+ Expect(err).NotTo(HaveOccurred())
+ }()
+
+ // wait for the webhook server to get ready
+ dialer := &net.Dialer{Timeout: time.Second}
+ addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
+ Eventually(func() error {
+ conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
+ if err != nil {
+ return err
+ }
+ return conn.Close()
+ }).Should(Succeed())
+
+})
+
+var _ = AfterSuite(func() {
+ cancel()
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..f33c86fef82
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Destroyer) DeepCopyInto(out *Destroyer) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destroyer.
+func (in *Destroyer) DeepCopy() *Destroyer {
+ if in == nil {
+ return nil
+ }
+ out := new(Destroyer)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Destroyer) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DestroyerList) DeepCopyInto(out *DestroyerList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Destroyer, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestroyerList.
+func (in *DestroyerList) DeepCopy() *DestroyerList {
+ if in == nil {
+ return nil
+ }
+ out := new(DestroyerList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *DestroyerList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DestroyerSpec) DeepCopyInto(out *DestroyerSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestroyerSpec.
+func (in *DestroyerSpec) DeepCopy() *DestroyerSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(DestroyerSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *DestroyerStatus) DeepCopyInto(out *DestroyerStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestroyerStatus.
+func (in *DestroyerStatus) DeepCopy() *DestroyerStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(DestroyerStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_types.go
new file mode 100644
index 00000000000..bd62ed8ed7d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1beta1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// FrigateSpec defines the desired state of Frigate
+type FrigateSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Frigate. Edit frigate_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// FrigateStatus defines the observed state of Frigate
+type FrigateStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Frigate is the Schema for the frigates API
+type Frigate struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec FrigateSpec `json:"spec,omitempty"`
+ Status FrigateStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// FrigateList contains a list of Frigate
+type FrigateList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Frigate `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Frigate{}, &FrigateList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook.go
new file mode 100644
index 00000000000..e03bafd22b2
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook.go
@@ -0,0 +1,34 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1beta1
+
+import (
+ ctrl "sigs.k8s.io/controller-runtime"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+)
+
+// log is for logging in this package.
+var frigatelog = logf.Log.WithName("frigate-resource")
+
+// SetupWebhookWithManager will setup the manager to manage the webhooks
+func (r *Frigate) SetupWebhookWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewWebhookManagedBy(mgr).
+ For(r).
+ Complete()
+}
+
+// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/groupversion_info.go
new file mode 100644
index 00000000000..a27e3ab1af0
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1beta1 contains API Schema definitions for the ship v1beta1 API group
+// +kubebuilder:object:generate=true
+// +groupName=ship.testproject.org
+package v1beta1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "ship.testproject.org", Version: "v1beta1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..b72247060db
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1beta1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Frigate) DeepCopyInto(out *Frigate) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Frigate.
+func (in *Frigate) DeepCopy() *Frigate {
+ if in == nil {
+ return nil
+ }
+ out := new(Frigate)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Frigate) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *FrigateList) DeepCopyInto(out *FrigateList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Frigate, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrigateList.
+func (in *FrigateList) DeepCopy() *FrigateList {
+ if in == nil {
+ return nil
+ }
+ out := new(FrigateList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *FrigateList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *FrigateSpec) DeepCopyInto(out *FrigateSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrigateSpec.
+func (in *FrigateSpec) DeepCopy() *FrigateSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(FrigateSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *FrigateStatus) DeepCopyInto(out *FrigateStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrigateStatus.
+func (in *FrigateStatus) DeepCopy() *FrigateStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(FrigateStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_types.go
new file mode 100644
index 00000000000..b79187f2766
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_types.go
@@ -0,0 +1,65 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v2alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// CruiserSpec defines the desired state of Cruiser
+type CruiserSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Cruiser. Edit cruiser_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// CruiserStatus defines the observed state of Cruiser
+type CruiserStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+//+kubebuilder:resource:scope=Cluster
+
+// Cruiser is the Schema for the cruisers API
+type Cruiser struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec CruiserSpec `json:"spec,omitempty"`
+ Status CruiserStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// CruiserList contains a list of Cruiser
+type CruiserList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Cruiser `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Cruiser{}, &CruiserList{})
+}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook.go
similarity index 66%
rename from testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
rename to testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook.go
index 77993bc8d50..14d5710a831 100644
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_webhook.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package v2alpha1
import (
"k8s.io/apimachinery/pkg/runtime"
@@ -25,10 +25,10 @@ import (
)
// log is for logging in this package.
-var memcachedlog = logf.Log.WithName("memcached-resource")
+var cruiserlog = logf.Log.WithName("cruiser-resource")
// SetupWebhookWithManager will setup the manager to manage the webhooks
-func (r *Memcached) SetupWebhookWithManager(mgr ctrl.Manager) error {
+func (r *Cruiser) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(r).
Complete()
@@ -37,29 +37,29 @@ func (r *Memcached) SetupWebhookWithManager(mgr ctrl.Manager) error {
// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
-//+kubebuilder:webhook:path=/validate-example-com-testproject-org-v1alpha1-memcached,mutating=false,failurePolicy=fail,sideEffects=None,groups=example.com.testproject.org,resources=memcacheds,verbs=create;update,versions=v1alpha1,name=vmemcached.kb.io,admissionReviewVersions=v1
+//+kubebuilder:webhook:path=/validate-ship-testproject-org-v2alpha1-cruiser,mutating=false,failurePolicy=fail,sideEffects=None,groups=ship.testproject.org,resources=cruisers,verbs=create;update,versions=v2alpha1,name=vcruiser.kb.io,admissionReviewVersions=v1
-var _ webhook.Validator = &Memcached{}
+var _ webhook.Validator = &Cruiser{}
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
-func (r *Memcached) ValidateCreate() (admission.Warnings, error) {
- memcachedlog.Info("validate create", "name", r.Name)
+func (r *Cruiser) ValidateCreate() (admission.Warnings, error) {
+ cruiserlog.Info("validate create", "name", r.Name)
// TODO(user): fill in your validation logic upon object creation.
return nil, nil
}
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
-func (r *Memcached) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
- memcachedlog.Info("validate update", "name", r.Name)
+func (r *Cruiser) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
+ cruiserlog.Info("validate update", "name", r.Name)
// TODO(user): fill in your validation logic upon object update.
return nil, nil
}
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
-func (r *Memcached) ValidateDelete() (admission.Warnings, error) {
- memcachedlog.Info("validate delete", "name", r.Name)
+func (r *Cruiser) ValidateDelete() (admission.Warnings, error) {
+ cruiserlog.Info("validate delete", "name", r.Name)
// TODO(user): fill in your validation logic upon object deletion.
return nil, nil
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/groupversion_info.go
new file mode 100644
index 00000000000..1b291530c6b
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v2alpha1 contains API Schema definitions for the ship v2alpha1 API group
+// +kubebuilder:object:generate=true
+// +groupName=ship.testproject.org
+package v2alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "ship.testproject.org", Version: "v2alpha1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go
new file mode 100644
index 00000000000..38482d55ee7
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go
@@ -0,0 +1,145 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v2alpha1
+
+import (
+ "context"
+ "crypto/tls"
+ "fmt"
+ "net"
+ "path/filepath"
+ "runtime"
+ "testing"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ admissionv1 "k8s.io/api/admission/v1"
+ //+kubebuilder:scaffold:imports
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+var ctx context.Context
+var cancel context.CancelFunc
+
+func TestAPIs(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Webhook Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ ctx, cancel = context.WithCancel(context.TODO())
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
+ WebhookInstallOptions: envtest.WebhookInstallOptions{
+ Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
+ },
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ scheme := apimachineryruntime.NewScheme()
+ err = AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = admissionv1.AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+ // start webhook server using Manager
+ webhookInstallOptions := &testEnv.WebhookInstallOptions
+ mgr, err := ctrl.NewManager(cfg, ctrl.Options{
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
+ })
+ Expect(err).NotTo(HaveOccurred())
+
+ err = (&Cruiser{}).SetupWebhookWithManager(mgr)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:webhook
+
+ go func() {
+ defer GinkgoRecover()
+ err = mgr.Start(ctx)
+ Expect(err).NotTo(HaveOccurred())
+ }()
+
+ // wait for the webhook server to get ready
+ dialer := &net.Dialer{Timeout: time.Second}
+ addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
+ Eventually(func() error {
+ conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
+ if err != nil {
+ return err
+ }
+ return conn.Close()
+ }).Should(Succeed())
+
+})
+
+var _ = AfterSuite(func() {
+ cancel()
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..1a54bea8d43
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v2alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Cruiser) DeepCopyInto(out *Cruiser) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cruiser.
+func (in *Cruiser) DeepCopy() *Cruiser {
+ if in == nil {
+ return nil
+ }
+ out := new(Cruiser)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Cruiser) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CruiserList) DeepCopyInto(out *CruiserList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Cruiser, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CruiserList.
+func (in *CruiserList) DeepCopy() *CruiserList {
+ if in == nil {
+ return nil
+ }
+ out := new(CruiserList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *CruiserList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CruiserSpec) DeepCopyInto(out *CruiserSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CruiserSpec.
+func (in *CruiserSpec) DeepCopy() *CruiserSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(CruiserSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CruiserStatus) DeepCopyInto(out *CruiserStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CruiserStatus.
+func (in *CruiserStatus) DeepCopy() *CruiserStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(CruiserStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/groupversion_info.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/groupversion_info.go
new file mode 100644
index 00000000000..49502eee2c5
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/groupversion_info.go
@@ -0,0 +1,36 @@
+/*
+Copyright 2023 The 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.
+*/
+
+// Package v1 contains API Schema definitions for the v1 API group
+// +kubebuilder:object:generate=true
+// +groupName=testproject.org
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "sigs.k8s.io/controller-runtime/pkg/scheme"
+)
+
+var (
+ // GroupVersion is group version used to register these objects
+ GroupVersion = schema.GroupVersion{Group: "testproject.org", Version: "v1"}
+
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+ // AddToScheme adds the types in this group-version to the given scheme.
+ AddToScheme = SchemeBuilder.AddToScheme
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_types.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_types.go
new file mode 100644
index 00000000000..415b5bc3924
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_types.go
@@ -0,0 +1,64 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
+
+// LakersSpec defines the desired state of Lakers
+type LakersSpec struct {
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Foo is an example field of Lakers. Edit lakers_types.go to remove/update
+ Foo string `json:"foo,omitempty"`
+}
+
+// LakersStatus defines the observed state of Lakers
+type LakersStatus struct {
+ // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+
+// Lakers is the Schema for the lakers API
+type Lakers struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ Spec LakersSpec `json:"spec,omitempty"`
+ Status LakersStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// LakersList contains a list of Lakers
+type LakersList struct {
+ metav1.TypeMeta `json:",inline"`
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []Lakers `json:"items"`
+}
+
+func init() {
+ SchemeBuilder.Register(&Lakers{}, &LakersList{})
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook.go
new file mode 100644
index 00000000000..26041fdfc75
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook.go
@@ -0,0 +1,77 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+ "sigs.k8s.io/controller-runtime/pkg/webhook/admission"
+)
+
+// log is for logging in this package.
+var lakerslog = logf.Log.WithName("lakers-resource")
+
+// SetupWebhookWithManager will setup the manager to manage the webhooks
+func (r *Lakers) SetupWebhookWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewWebhookManagedBy(mgr).
+ For(r).
+ Complete()
+}
+
+// TODO(user): EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
+
+//+kubebuilder:webhook:path=/mutate-testproject-org-v1-lakers,mutating=true,failurePolicy=fail,sideEffects=None,groups=testproject.org,resources=lakers,verbs=create;update,versions=v1,name=mlakers.kb.io,admissionReviewVersions=v1
+
+var _ webhook.Defaulter = &Lakers{}
+
+// Default implements webhook.Defaulter so a webhook will be registered for the type
+func (r *Lakers) Default() {
+ lakerslog.Info("default", "name", r.Name)
+
+ // TODO(user): fill in your defaulting logic.
+}
+
+// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
+//+kubebuilder:webhook:path=/validate-testproject-org-v1-lakers,mutating=false,failurePolicy=fail,sideEffects=None,groups=testproject.org,resources=lakers,verbs=create;update,versions=v1,name=vlakers.kb.io,admissionReviewVersions=v1
+
+var _ webhook.Validator = &Lakers{}
+
+// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
+func (r *Lakers) ValidateCreate() (admission.Warnings, error) {
+ lakerslog.Info("validate create", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object creation.
+ return nil, nil
+}
+
+// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
+func (r *Lakers) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
+ lakerslog.Info("validate update", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object update.
+ return nil, nil
+}
+
+// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
+func (r *Lakers) ValidateDelete() (admission.Warnings, error) {
+ lakerslog.Info("validate delete", "name", r.Name)
+
+ // TODO(user): fill in your validation logic upon object deletion.
+ return nil, nil
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go
new file mode 100644
index 00000000000..250b42b87b3
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go
@@ -0,0 +1,145 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ "context"
+ "crypto/tls"
+ "fmt"
+ "net"
+ "path/filepath"
+ "runtime"
+ "testing"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ admissionv1 "k8s.io/api/admission/v1"
+ //+kubebuilder:scaffold:imports
+ apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/client-go/rest"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+var ctx context.Context
+var cancel context.CancelFunc
+
+func TestAPIs(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Webhook Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ ctx, cancel = context.WithCancel(context.TODO())
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+
+ WebhookInstallOptions: envtest.WebhookInstallOptions{
+ Paths: []string{filepath.Join("..", "..", "config", "webhook")},
+ },
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ scheme := apimachineryruntime.NewScheme()
+ err = AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = admissionv1.AddToScheme(scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+ // start webhook server using Manager
+ webhookInstallOptions := &testEnv.WebhookInstallOptions
+ mgr, err := ctrl.NewManager(cfg, ctrl.Options{
+ Scheme: scheme,
+ WebhookServer: webhook.NewServer(webhook.Options{
+ Host: webhookInstallOptions.LocalServingHost,
+ Port: webhookInstallOptions.LocalServingPort,
+ CertDir: webhookInstallOptions.LocalServingCertDir,
+ }),
+ LeaderElection: false,
+ Metrics: metricsserver.Options{BindAddress: "0"},
+ })
+ Expect(err).NotTo(HaveOccurred())
+
+ err = (&Lakers{}).SetupWebhookWithManager(mgr)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:webhook
+
+ go func() {
+ defer GinkgoRecover()
+ err = mgr.Start(ctx)
+ Expect(err).NotTo(HaveOccurred())
+ }()
+
+ // wait for the webhook server to get ready
+ dialer := &net.Dialer{Timeout: time.Second}
+ addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
+ Eventually(func() error {
+ conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
+ if err != nil {
+ return err
+ }
+ return conn.Close()
+ }).Should(Succeed())
+
+})
+
+var _ = AfterSuite(func() {
+ cancel()
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/zz_generated.deepcopy.go
new file mode 100644
index 00000000000..904f7ad869a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/zz_generated.deepcopy.go
@@ -0,0 +1,114 @@
+//go:build !ignore_autogenerated
+
+/*
+Copyright 2023 The 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.
+*/
+
+// Code generated by controller-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Lakers) DeepCopyInto(out *Lakers) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ out.Spec = in.Spec
+ out.Status = in.Status
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Lakers.
+func (in *Lakers) DeepCopy() *Lakers {
+ if in == nil {
+ return nil
+ }
+ out := new(Lakers)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *Lakers) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LakersList) DeepCopyInto(out *LakersList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]Lakers, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LakersList.
+func (in *LakersList) DeepCopy() *LakersList {
+ if in == nil {
+ return nil
+ }
+ out := new(LakersList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LakersList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LakersSpec) DeepCopyInto(out *LakersSpec) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LakersSpec.
+func (in *LakersSpec) DeepCopy() *LakersSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(LakersSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LakersStatus) DeepCopyInto(out *LakersStatus) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LakersStatus.
+func (in *LakersStatus) DeepCopy() *LakersStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(LakersStatus)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/cmd/main.go b/testdata/project-v4-multigroup-with-deploy-image/cmd/main.go
new file mode 100644
index 00000000000..69b93d3824b
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/cmd/main.go
@@ -0,0 +1,240 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package main
+
+import (
+ "flag"
+ "os"
+
+ // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
+ // to ensure that exec-entrypoint and run can make use of them.
+ _ "k8s.io/client-go/plugin/pkg/client/auth"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ clientgoscheme "k8s.io/client-go/kubernetes/scheme"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/healthz"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1"
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1"
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1"
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1"
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1"
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2"
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1"
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1"
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1"
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/v1"
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller"
+ appscontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps"
+ crewcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew"
+ fizcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz"
+ foocontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo"
+ foopolicycontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy"
+ seacreaturescontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures"
+ shipcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship"
+ //+kubebuilder:scaffold:imports
+)
+
+var (
+ scheme = runtime.NewScheme()
+ setupLog = ctrl.Log.WithName("setup")
+)
+
+func init() {
+ utilruntime.Must(clientgoscheme.AddToScheme(scheme))
+
+ utilruntime.Must(crewv1.AddToScheme(scheme))
+ utilruntime.Must(shipv1beta1.AddToScheme(scheme))
+ utilruntime.Must(shipv1.AddToScheme(scheme))
+ utilruntime.Must(shipv2alpha1.AddToScheme(scheme))
+ utilruntime.Must(seacreaturesv1beta1.AddToScheme(scheme))
+ utilruntime.Must(seacreaturesv1beta2.AddToScheme(scheme))
+ utilruntime.Must(foopolicyv1.AddToScheme(scheme))
+ utilruntime.Must(foov1.AddToScheme(scheme))
+ utilruntime.Must(fizv1.AddToScheme(scheme))
+ utilruntime.Must(testprojectorgv1.AddToScheme(scheme))
+ //+kubebuilder:scaffold:scheme
+}
+
+func main() {
+ var metricsAddr string
+ var enableLeaderElection bool
+ var probeAddr string
+ flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
+ flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
+ flag.BoolVar(&enableLeaderElection, "leader-elect", false,
+ "Enable leader election for controller manager. "+
+ "Enabling this will ensure there is only one active controller manager.")
+ opts := zap.Options{
+ Development: true,
+ }
+ opts.BindFlags(flag.CommandLine)
+ flag.Parse()
+
+ ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
+
+ mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
+ Scheme: scheme,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
+ HealthProbeBindAddress: probeAddr,
+ LeaderElection: enableLeaderElection,
+ LeaderElectionID: "65c8a5ec.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
+ // speeds up voluntary leader transitions as the new leader don't have to wait
+ // LeaseDuration time first.
+ //
+ // In the default scaffold provided, the program ends immediately after
+ // the manager stops, so would be fine to enable this option. However,
+ // if you are doing or is intended to do any operation such as perform cleanups
+ // after the manager stops then its usage might be unsafe.
+ // LeaderElectionReleaseOnCancel: true,
+ })
+ if err != nil {
+ setupLog.Error(err, "unable to start manager")
+ os.Exit(1)
+ }
+
+ if err = (&crewcontroller.CaptainReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Captain")
+ os.Exit(1)
+ }
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&crewv1.Captain{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Captain")
+ os.Exit(1)
+ }
+ }
+ if err = (&shipcontroller.FrigateReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Frigate")
+ os.Exit(1)
+ }
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&shipv1beta1.Frigate{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Frigate")
+ os.Exit(1)
+ }
+ }
+ if err = (&shipcontroller.DestroyerReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Destroyer")
+ os.Exit(1)
+ }
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&shipv1.Destroyer{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Destroyer")
+ os.Exit(1)
+ }
+ }
+ if err = (&shipcontroller.CruiserReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Cruiser")
+ os.Exit(1)
+ }
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&shipv2alpha1.Cruiser{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Cruiser")
+ os.Exit(1)
+ }
+ }
+ 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 = (&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 = (&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 = (&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 = (&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 = (&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 = (&controller.LakersReconciler{
+ Client: mgr.GetClient(),
+ Scheme: mgr.GetScheme(),
+ }).SetupWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create controller", "controller", "Lakers")
+ os.Exit(1)
+ }
+ if os.Getenv("ENABLE_WEBHOOKS") != "false" {
+ if err = (&testprojectorgv1.Lakers{}).SetupWebhookWithManager(mgr); err != nil {
+ setupLog.Error(err, "unable to create webhook", "webhook", "Lakers")
+ os.Exit(1)
+ }
+ }
+ //+kubebuilder:scaffold:builder
+
+ if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
+ setupLog.Error(err, "unable to set up health check")
+ os.Exit(1)
+ }
+ if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
+ setupLog.Error(err, "unable to set up ready check")
+ os.Exit(1)
+ }
+
+ setupLog.Info("starting manager")
+ if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
+ setupLog.Error(err, "problem running manager")
+ os.Exit(1)
+ }
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/certificate.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/certificate.yaml
new file mode 100644
index 00000000000..67a1128b1cd
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/certificate.yaml
@@ -0,0 +1,39 @@
+# The following manifests contain a self-signed issuer CR and a certificate CR.
+# More document can be found at https://docs.cert-manager.io
+# WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes.
+apiVersion: cert-manager.io/v1
+kind: Issuer
+metadata:
+ labels:
+ app.kubernetes.io/name: certificate
+ app.kubernetes.io/instance: serving-cert
+ app.kubernetes.io/component: certificate
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: selfsigned-issuer
+ namespace: system
+spec:
+ selfSigned: {}
+---
+apiVersion: cert-manager.io/v1
+kind: Certificate
+metadata:
+ labels:
+ app.kubernetes.io/name: certificate
+ app.kubernetes.io/instance: serving-cert
+ app.kubernetes.io/component: certificate
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml
+ namespace: system
+spec:
+ # SERVICE_NAME and SERVICE_NAMESPACE will be substituted by kustomize
+ dnsNames:
+ - SERVICE_NAME.SERVICE_NAMESPACE.svc
+ - SERVICE_NAME.SERVICE_NAMESPACE.svc.cluster.local
+ issuerRef:
+ kind: Issuer
+ name: selfsigned-issuer
+ secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomization.yaml
new file mode 100644
index 00000000000..bebea5a595e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomization.yaml
@@ -0,0 +1,5 @@
+resources:
+- certificate.yaml
+
+configurations:
+- kustomizeconfig.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomizeconfig.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomizeconfig.yaml
new file mode 100644
index 00000000000..cf6f89e8892
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/certmanager/kustomizeconfig.yaml
@@ -0,0 +1,8 @@
+# This configuration is for teaching kustomize how to update name ref substitution
+nameReference:
+- kind: Issuer
+ group: cert-manager.io
+ fieldSpecs:
+ - kind: Certificate
+ group: cert-manager.io
+ path: spec/issuerRef/name
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/crew.testproject.org_captains.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/crew.testproject.org_captains.yaml
new file mode 100644
index 00000000000..fb3c3619819
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/crew.testproject.org_captains.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: captains.crew.testproject.org
+spec:
+ group: crew.testproject.org
+ names:
+ kind: Captain
+ listKind: CaptainList
+ plural: captains
+ singular: captain
+ scope: Namespaced
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: Captain is the Schema for the captains API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: CaptainSpec defines the desired state of Captain
+ properties:
+ foo:
+ description: Foo is an example field of Captain. Edit captain_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: CaptainStatus defines the observed state of Captain
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/fiz.testproject.org_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/fiz.testproject.org_bars.yaml
new file mode 100644
index 00000000000..f82ce349aa7
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/fiz.testproject.org_bars.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: bars.fiz.testproject.org
+spec:
+ group: fiz.testproject.org
+ names:
+ kind: Bar
+ listKind: BarList
+ plural: bars
+ singular: bar
+ scope: Namespaced
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: Bar is the Schema for the bars API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: BarSpec defines the desired state of Bar
+ properties:
+ foo:
+ description: Foo is an example field of Bar. Edit bar_types.go to
+ remove/update
+ type: string
+ type: object
+ status:
+ description: BarStatus defines the observed state of Bar
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
new file mode 100644
index 00000000000..fccaf45ebcf
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.policy.testproject.org_healthcheckpolicies.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: healthcheckpolicies.foo.policy.testproject.org
+spec:
+ group: foo.policy.testproject.org
+ names:
+ kind: HealthCheckPolicy
+ listKind: HealthCheckPolicyList
+ plural: healthcheckpolicies
+ singular: healthcheckpolicy
+ scope: Namespaced
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: HealthCheckPolicy is the Schema for the healthcheckpolicies API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: HealthCheckPolicySpec defines the desired state of HealthCheckPolicy
+ properties:
+ foo:
+ description: Foo is an example field of HealthCheckPolicy. Edit healthcheckpolicy_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: HealthCheckPolicyStatus defines the observed state of HealthCheckPolicy
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.testproject.org_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.testproject.org_bars.yaml
new file mode 100644
index 00000000000..2ac74780e21
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/foo.testproject.org_bars.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: bars.foo.testproject.org
+spec:
+ group: foo.testproject.org
+ names:
+ kind: Bar
+ listKind: BarList
+ plural: bars
+ singular: bar
+ scope: Namespaced
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: Bar is the Schema for the bars API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: BarSpec defines the desired state of Bar
+ properties:
+ foo:
+ description: Foo is an example field of Bar. Edit bar_types.go to
+ remove/update
+ type: string
+ type: object
+ status:
+ description: BarStatus defines the observed state of Bar
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_krakens.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
new file mode 100644
index 00000000000..893171cd25c
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_krakens.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: krakens.sea-creatures.testproject.org
+spec:
+ group: sea-creatures.testproject.org
+ names:
+ kind: Kraken
+ listKind: KrakenList
+ plural: krakens
+ singular: kraken
+ scope: Namespaced
+ versions:
+ - name: v1beta1
+ schema:
+ openAPIV3Schema:
+ description: Kraken is the Schema for the krakens API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: KrakenSpec defines the desired state of Kraken
+ properties:
+ foo:
+ description: Foo is an example field of Kraken. Edit kraken_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: KrakenStatus defines the observed state of Kraken
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
new file mode 100644
index 00000000000..23354ee849b
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/sea-creatures.testproject.org_leviathans.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: leviathans.sea-creatures.testproject.org
+spec:
+ group: sea-creatures.testproject.org
+ names:
+ kind: Leviathan
+ listKind: LeviathanList
+ plural: leviathans
+ singular: leviathan
+ scope: Namespaced
+ versions:
+ - name: v1beta2
+ schema:
+ openAPIV3Schema:
+ description: Leviathan is the Schema for the leviathans API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: LeviathanSpec defines the desired state of Leviathan
+ properties:
+ foo:
+ description: Foo is an example field of Leviathan. Edit leviathan_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: LeviathanStatus defines the observed state of Leviathan
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_cruisers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_cruisers.yaml
new file mode 100644
index 00000000000..822b7ddcd07
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_cruisers.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: cruisers.ship.testproject.org
+spec:
+ group: ship.testproject.org
+ names:
+ kind: Cruiser
+ listKind: CruiserList
+ plural: cruisers
+ singular: cruiser
+ scope: Cluster
+ versions:
+ - name: v2alpha1
+ schema:
+ openAPIV3Schema:
+ description: Cruiser is the Schema for the cruisers API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: CruiserSpec defines the desired state of Cruiser
+ properties:
+ foo:
+ description: Foo is an example field of Cruiser. Edit cruiser_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: CruiserStatus defines the observed state of Cruiser
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_destroyers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_destroyers.yaml
new file mode 100644
index 00000000000..1d16092fb0e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_destroyers.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: destroyers.ship.testproject.org
+spec:
+ group: ship.testproject.org
+ names:
+ kind: Destroyer
+ listKind: DestroyerList
+ plural: destroyers
+ singular: destroyer
+ scope: Cluster
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: Destroyer is the Schema for the destroyers API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: DestroyerSpec defines the desired state of Destroyer
+ properties:
+ foo:
+ description: Foo is an example field of Destroyer. Edit destroyer_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: DestroyerStatus defines the observed state of Destroyer
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_frigates.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_frigates.yaml
new file mode 100644
index 00000000000..a39aaa5e962
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/ship.testproject.org_frigates.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: frigates.ship.testproject.org
+spec:
+ group: ship.testproject.org
+ names:
+ kind: Frigate
+ listKind: FrigateList
+ plural: frigates
+ singular: frigate
+ scope: Namespaced
+ versions:
+ - name: v1beta1
+ schema:
+ openAPIV3Schema:
+ description: Frigate is the Schema for the frigates API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: FrigateSpec defines the desired state of Frigate
+ properties:
+ foo:
+ description: Foo is an example field of Frigate. Edit frigate_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: FrigateStatus defines the observed state of Frigate
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/testproject.org_lakers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/testproject.org_lakers.yaml
new file mode 100644
index 00000000000..1677f648fab
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/bases/testproject.org_lakers.yaml
@@ -0,0 +1,49 @@
+---
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ controller-gen.kubebuilder.io/version: v0.13.0
+ name: lakers.testproject.org
+spec:
+ group: testproject.org
+ names:
+ kind: Lakers
+ listKind: LakersList
+ plural: lakers
+ singular: lakers
+ scope: Namespaced
+ versions:
+ - name: v1
+ schema:
+ openAPIV3Schema:
+ description: Lakers is the Schema for the lakers API
+ properties:
+ apiVersion:
+ description: 'APIVersion defines the versioned schema of this representation
+ of an object. Servers should convert recognized schemas to the latest
+ internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
+ type: string
+ kind:
+ description: 'Kind is a string value representing the REST resource this
+ object represents. Servers may infer this from the endpoint the client
+ submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+ type: string
+ metadata:
+ type: object
+ spec:
+ description: LakersSpec defines the desired state of Lakers
+ properties:
+ foo:
+ description: Foo is an example field of Lakers. Edit lakers_types.go
+ to remove/update
+ type: string
+ type: object
+ status:
+ description: LakersStatus defines the observed state of Lakers
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
new file mode 100644
index 00000000000..9b25692779d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
@@ -0,0 +1,48 @@
+# This kustomization.yaml is not intended to be run by itself,
+# since it depends on service name and namespace that are out of this kustomize package.
+# It should be run by config/default
+resources:
+- bases/crew.testproject.org_captains.yaml
+- bases/ship.testproject.org_frigates.yaml
+- bases/ship.testproject.org_destroyers.yaml
+- bases/ship.testproject.org_cruisers.yaml
+- bases/sea-creatures.testproject.org_krakens.yaml
+- bases/sea-creatures.testproject.org_leviathans.yaml
+- bases/foo.policy.testproject.org_healthcheckpolicies.yaml
+- bases/foo.testproject.org_bars.yaml
+- bases/fiz.testproject.org_bars.yaml
+- bases/testproject.org_lakers.yaml
+#+kubebuilder:scaffold:crdkustomizeresource
+
+patches:
+# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
+# patches here are for enabling the conversion webhook for each CRD
+#- path: patches/webhook_in_crew_captains.yaml
+#- path: patches/webhook_in_ship_frigates.yaml
+#- path: patches/webhook_in_ship_destroyers.yaml
+#- path: patches/webhook_in_ship_cruisers.yaml
+#- path: patches/webhook_in_sea-creatures_krakens.yaml
+#- path: patches/webhook_in_sea-creatures_leviathans.yaml
+#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
+#- path: patches/webhook_in_foo_bars.yaml
+#- path: patches/webhook_in_fiz_bars.yaml
+#- path: patches/webhook_in__lakers.yaml
+#+kubebuilder:scaffold:crdkustomizewebhookpatch
+
+# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
+# patches here are for enabling the CA injection for each CRD
+#- path: patches/cainjection_in_crew_captains.yaml
+#- path: patches/cainjection_in_ship_frigates.yaml
+#- path: patches/cainjection_in_ship_destroyers.yaml
+#- path: patches/cainjection_in_ship_cruisers.yaml
+#- path: patches/cainjection_in_sea-creatures_krakens.yaml
+#- path: patches/cainjection_in_sea-creatures_leviathans.yaml
+#- path: patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
+#- path: patches/cainjection_in_foo_bars.yaml
+#- path: patches/cainjection_in_fiz_bars.yaml
+#- path: patches/cainjection_in__lakers.yaml
+#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+
+# the following config is for teaching kustomize how to do kustomization for CRDs.
+configurations:
+- kustomizeconfig.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomizeconfig.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomizeconfig.yaml
new file mode 100644
index 00000000000..ec5c150a9df
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomizeconfig.yaml
@@ -0,0 +1,19 @@
+# This file is for teaching kustomize how to substitute name and namespace reference in CRD
+nameReference:
+- kind: Service
+ version: v1
+ fieldSpecs:
+ - kind: CustomResourceDefinition
+ version: v1
+ group: apiextensions.k8s.io
+ path: spec/conversion/webhook/clientConfig/service/name
+
+namespace:
+- kind: CustomResourceDefinition
+ version: v1
+ group: apiextensions.k8s.io
+ path: spec/conversion/webhook/clientConfig/service/namespace
+ create: false
+
+varReference:
+- path: metadata/annotations
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in__lakers.yaml
similarity index 84%
rename from testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml
rename to testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in__lakers.yaml
index 5f6b0384f48..90be9dfc598 100644
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_busyboxes.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in__lakers.yaml
@@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: busyboxes.example.com.testproject.org
+ name: lakers.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_crew_captains.yaml
similarity index 84%
rename from testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml
rename to testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_crew_captains.yaml
index 5b9e839364d..fba0c3ed6fd 100644
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_example.com_memcacheds.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_crew_captains.yaml
@@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: memcacheds.example.com.testproject.org
+ name: captains.crew.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml
new file mode 100644
index 00000000000..c6dfcc97f3e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: bars.fiz.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
new file mode 100644
index 00000000000..887d632ef1d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: healthcheckpolicies.foo.policy.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml
new file mode 100644
index 00000000000..7cacea184db
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: bars.foo.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
new file mode 100644
index 00000000000..b16c174c7b2
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: krakens.sea-creatures.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
new file mode 100644
index 00000000000..35b16d717cb
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: leviathans.sea-creatures.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_cruisers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_cruisers.yaml
new file mode 100644
index 00000000000..0d31cb0b8af
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_cruisers.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: cruisers.ship.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_destroyers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_destroyers.yaml
new file mode 100644
index 00000000000..865395574ff
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_destroyers.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: destroyers.ship.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_frigates.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_frigates.yaml
new file mode 100644
index 00000000000..d4acb9d24c1
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_ship_frigates.yaml
@@ -0,0 +1,7 @@
+# The following patch adds a directive for certmanager to inject CA into the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+ name: frigates.ship.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in__lakers.yaml
similarity index 88%
rename from testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml
rename to testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in__lakers.yaml
index 5dbd9da7176..58df2264dde 100644
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_busyboxes.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in__lakers.yaml
@@ -2,7 +2,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
- name: busyboxes.example.com.testproject.org
+ name: lakers.testproject.org
spec:
conversion:
strategy: Webhook
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_crew_captains.yaml
similarity index 88%
rename from testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml
rename to testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_crew_captains.yaml
index 4a56b0f4c69..f73ae2e8abc 100644
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_example.com_memcacheds.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_crew_captains.yaml
@@ -2,7 +2,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
- name: memcacheds.example.com.testproject.org
+ name: captains.crew.testproject.org
spec:
conversion:
strategy: Webhook
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml
new file mode 100644
index 00000000000..eddaa868fdd
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: bars.fiz.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
new file mode 100644
index 00000000000..61381b747c5
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: healthcheckpolicies.foo.policy.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml
new file mode 100644
index 00000000000..831ad1b8164
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: bars.foo.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
new file mode 100644
index 00000000000..620a12faaee
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: krakens.sea-creatures.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
new file mode 100644
index 00000000000..5cb95bc7b38
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: leviathans.sea-creatures.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_cruisers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_cruisers.yaml
new file mode 100644
index 00000000000..99b6b6741b6
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_cruisers.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: cruisers.ship.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_destroyers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_destroyers.yaml
new file mode 100644
index 00000000000..0e0095cb3a6
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_destroyers.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: destroyers.ship.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_frigates.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_frigates.yaml
new file mode 100644
index 00000000000..cdc5078ae71
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_ship_frigates.yaml
@@ -0,0 +1,16 @@
+# The following patch enables a conversion webhook for the CRD
+apiVersion: apiextensions.k8s.io/v1
+kind: CustomResourceDefinition
+metadata:
+ name: frigates.ship.testproject.org
+spec:
+ conversion:
+ strategy: Webhook
+ webhook:
+ clientConfig:
+ service:
+ namespace: system
+ name: webhook-service
+ path: /convert
+ conversionReviewVersions:
+ - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
new file mode 100644
index 00000000000..c6c6da56c46
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
@@ -0,0 +1,144 @@
+# Adds namespace to all resources.
+namespace: project-v4-multigroup-with-deploy-image-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-multigroup-with-deploy-image-
+
+# Labels to add to all resources and selectors.
+#labels:
+#- includeSelectors: true
+# pairs:
+# someName: someValue
+
+resources:
+- ../crd
+- ../rbac
+- ../manager
+# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
+# crd/kustomization.yaml
+#- ../webhook
+# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
+#- ../certmanager
+# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
+#- ../prometheus
+
+patchesStrategicMerge:
+# Protect the /metrics endpoint by putting it behind auth.
+# If you want your controller-manager to expose the /metrics
+# endpoint w/o any authn/z, please comment the following line.
+- manager_auth_proxy_patch.yaml
+
+
+
+# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
+# crd/kustomization.yaml
+#- manager_webhook_patch.yaml
+
+# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
+# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
+# 'CERTMANAGER' needs to be enabled to use ca injection
+#- webhookcainjection_patch.yaml
+
+# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
+# Uncomment the following replacements to add the cert-manager CA injection annotations
+#replacements:
+# - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
+# kind: Certificate
+# group: cert-manager.io
+# version: v1
+# name: serving-cert # this name should match the one in certificate.yaml
+# fieldPath: .metadata.namespace # namespace of the certificate CR
+# targets:
+# - select:
+# kind: ValidatingWebhookConfiguration
+# fieldPaths:
+# - .metadata.annotations.[cert-manager.io/inject-ca-from]
+# options:
+# delimiter: '/'
+# index: 0
+# create: true
+# - select:
+# kind: MutatingWebhookConfiguration
+# fieldPaths:
+# - .metadata.annotations.[cert-manager.io/inject-ca-from]
+# options:
+# delimiter: '/'
+# index: 0
+# create: true
+# - select:
+# kind: CustomResourceDefinition
+# fieldPaths:
+# - .metadata.annotations.[cert-manager.io/inject-ca-from]
+# options:
+# delimiter: '/'
+# index: 0
+# create: true
+# - source:
+# kind: Certificate
+# group: cert-manager.io
+# version: v1
+# name: serving-cert # this name should match the one in certificate.yaml
+# fieldPath: .metadata.name
+# targets:
+# - select:
+# kind: ValidatingWebhookConfiguration
+# fieldPaths:
+# - .metadata.annotations.[cert-manager.io/inject-ca-from]
+# options:
+# delimiter: '/'
+# index: 1
+# create: true
+# - select:
+# kind: MutatingWebhookConfiguration
+# fieldPaths:
+# - .metadata.annotations.[cert-manager.io/inject-ca-from]
+# options:
+# delimiter: '/'
+# index: 1
+# create: true
+# - select:
+# kind: CustomResourceDefinition
+# fieldPaths:
+# - .metadata.annotations.[cert-manager.io/inject-ca-from]
+# options:
+# delimiter: '/'
+# index: 1
+# create: true
+# - source: # Add cert-manager annotation to the webhook Service
+# kind: Service
+# version: v1
+# name: webhook-service
+# fieldPath: .metadata.name # namespace of the service
+# targets:
+# - select:
+# kind: Certificate
+# group: cert-manager.io
+# version: v1
+# fieldPaths:
+# - .spec.dnsNames.0
+# - .spec.dnsNames.1
+# options:
+# delimiter: '.'
+# index: 0
+# create: true
+# - source:
+# kind: Service
+# version: v1
+# name: webhook-service
+# fieldPath: .metadata.namespace # namespace of the service
+# targets:
+# - select:
+# kind: Certificate
+# group: cert-manager.io
+# version: v1
+# fieldPaths:
+# - .spec.dnsNames.0
+# - .spec.dnsNames.1
+# options:
+# delimiter: '.'
+# index: 1
+# create: true
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
new file mode 100644
index 00000000000..73fad2a6754
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
@@ -0,0 +1,39 @@
+# This patch inject a sidecar container which is a HTTP proxy for the
+# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: controller-manager
+ namespace: system
+spec:
+ template:
+ spec:
+ containers:
+ - name: kube-rbac-proxy
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - "ALL"
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ args:
+ - "--secure-listen-address=0.0.0.0:8443"
+ - "--upstream=http://127.0.0.1:8080/"
+ - "--logtostderr=true"
+ - "--v=0"
+ ports:
+ - containerPort: 8443
+ protocol: TCP
+ name: https
+ resources:
+ limits:
+ cpu: 500m
+ memory: 128Mi
+ requests:
+ cpu: 5m
+ memory: 64Mi
+ - name: manager
+ args:
+ - "--health-probe-bind-address=:8081"
+ - "--metrics-bind-address=127.0.0.1:8080"
+ - "--leader-elect"
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_config_patch.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_config_patch.yaml
new file mode 100644
index 00000000000..f6f58916922
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_config_patch.yaml
@@ -0,0 +1,10 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: controller-manager
+ namespace: system
+spec:
+ template:
+ spec:
+ containers:
+ - name: manager
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_webhook_patch.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_webhook_patch.yaml
new file mode 100644
index 00000000000..738de350b71
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_webhook_patch.yaml
@@ -0,0 +1,23 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: controller-manager
+ namespace: system
+spec:
+ template:
+ spec:
+ containers:
+ - name: manager
+ ports:
+ - containerPort: 9443
+ name: webhook-server
+ protocol: TCP
+ volumeMounts:
+ - mountPath: /tmp/k8s-webhook-server/serving-certs
+ name: cert
+ readOnly: true
+ volumes:
+ - name: cert
+ secret:
+ defaultMode: 420
+ secretName: webhook-server-cert
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/webhookcainjection_patch.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/webhookcainjection_patch.yaml
new file mode 100644
index 00000000000..f5129665598
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/webhookcainjection_patch.yaml
@@ -0,0 +1,29 @@
+# This patch add annotation to admission webhook config and
+# CERTIFICATE_NAMESPACE and CERTIFICATE_NAME will be substituted by kustomize
+apiVersion: admissionregistration.k8s.io/v1
+kind: MutatingWebhookConfiguration
+metadata:
+ labels:
+ app.kubernetes.io/name: mutatingwebhookconfiguration
+ app.kubernetes.io/instance: mutating-webhook-configuration
+ app.kubernetes.io/component: webhook
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: mutating-webhook-configuration
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
+---
+apiVersion: admissionregistration.k8s.io/v1
+kind: ValidatingWebhookConfiguration
+metadata:
+ labels:
+ app.kubernetes.io/name: validatingwebhookconfiguration
+ app.kubernetes.io/instance: validating-webhook-configuration
+ app.kubernetes.io/component: webhook
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: validating-webhook-configuration
+ annotations:
+ cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/manager/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/manager/kustomization.yaml
new file mode 100644
index 00000000000..5c5f0b84cba
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/manager/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+- manager.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml
new file mode 100644
index 00000000000..e6ec6dfc06d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml
@@ -0,0 +1,102 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ labels:
+ control-plane: controller-manager
+ app.kubernetes.io/name: namespace
+ app.kubernetes.io/instance: system
+ app.kubernetes.io/component: manager
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: system
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: controller-manager
+ namespace: system
+ labels:
+ control-plane: controller-manager
+ app.kubernetes.io/name: deployment
+ app.kubernetes.io/instance: controller-manager
+ app.kubernetes.io/component: manager
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+spec:
+ selector:
+ matchLabels:
+ control-plane: controller-manager
+ replicas: 1
+ template:
+ metadata:
+ annotations:
+ kubectl.kubernetes.io/default-container: manager
+ labels:
+ control-plane: controller-manager
+ spec:
+ # TODO(user): Uncomment the following code to configure the nodeAffinity expression
+ # according to the platforms which are supported by your solution.
+ # It is considered best practice to support multiple architectures. You can
+ # build your manager image using the makefile target docker-buildx.
+ # affinity:
+ # nodeAffinity:
+ # requiredDuringSchedulingIgnoredDuringExecution:
+ # nodeSelectorTerms:
+ # - matchExpressions:
+ # - key: kubernetes.io/arch
+ # operator: In
+ # values:
+ # - amd64
+ # - arm64
+ # - ppc64le
+ # - s390x
+ # - key: kubernetes.io/os
+ # operator: In
+ # values:
+ # - linux
+ securityContext:
+ runAsNonRoot: true
+ # TODO(user): For common cases that do not require escalating privileges
+ # it is recommended to ensure that all your Pods/Containers are restrictive.
+ # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
+ # Please uncomment the following code if your project does NOT have to work on old Kubernetes
+ # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ).
+ # seccompProfile:
+ # type: RuntimeDefault
+ containers:
+ - command:
+ - /manager
+ args:
+ - --leader-elect
+ image: controller:latest
+ name: manager
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - "ALL"
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: 8081
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ readinessProbe:
+ httpGet:
+ path: /readyz
+ port: 8081
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ # TODO(user): Configure the resources accordingly based on the project requirements.
+ # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ resources:
+ limits:
+ cpu: 500m
+ memory: 128Mi
+ requests:
+ cpu: 10m
+ memory: 64Mi
+ serviceAccountName: controller-manager
+ terminationGracePeriodSeconds: 10
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/kustomization.yaml
new file mode 100644
index 00000000000..ed137168a1d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/kustomization.yaml
@@ -0,0 +1,2 @@
+resources:
+- monitor.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml
new file mode 100644
index 00000000000..3a4f61fb0e9
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml
@@ -0,0 +1,26 @@
+
+# Prometheus Monitor Service (Metrics)
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ labels:
+ control-plane: controller-manager
+ app.kubernetes.io/name: servicemonitor
+ app.kubernetes.io/instance: controller-manager-metrics-monitor
+ app.kubernetes.io/component: metrics
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: controller-manager-metrics-monitor
+ namespace: system
+spec:
+ endpoints:
+ - path: /metrics
+ port: https
+ scheme: https
+ bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
+ tlsConfig:
+ insecureSkipVerify: true
+ selector:
+ matchLabels:
+ control-plane: controller-manager
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_editor_role.yaml
similarity index 51%
rename from testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml
rename to testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_editor_role.yaml
index aacaa6ffb8a..a714b834cec 100644
--- a/testdata/project-v4-multigroup/config/rbac/example.com_memcached_editor_role.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_editor_role.yaml
@@ -1,20 +1,20 @@
-# permissions for end users to edit memcacheds.
+# permissions for end users to edit lakers.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: memcached-editor-role
+ app.kubernetes.io/instance: lakers-editor-role
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-multigroup
- app.kubernetes.io/part-of: project-v4-multigroup
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
app.kubernetes.io/managed-by: kustomize
- name: memcached-editor-role
+ name: lakers-editor-role
rules:
- apiGroups:
- - example.com.testproject.org
+ - testproject.org
resources:
- - memcacheds
+ - lakers
verbs:
- create
- delete
@@ -24,8 +24,8 @@ rules:
- update
- watch
- apiGroups:
- - example.com.testproject.org
+ - testproject.org
resources:
- - memcacheds/status
+ - lakers/status
verbs:
- get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_viewer_role.yaml
new file mode 100644
index 00000000000..5aa120091d9
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/_lakers_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view lakers.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: lakers-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: lakers-viewer-role
+rules:
+- apiGroups:
+ - testproject.org
+ resources:
+ - lakers
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - testproject.org
+ resources:
+ - lakers/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_client_clusterrole.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_client_clusterrole.yaml
new file mode 100644
index 00000000000..3c9ad11fc52
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_client_clusterrole.yaml
@@ -0,0 +1,16 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: metrics-reader
+ app.kubernetes.io/component: kube-rbac-proxy
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: metrics-reader
+rules:
+- nonResourceURLs:
+ - "/metrics"
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role.yaml
new file mode 100644
index 00000000000..0050db22e36
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role.yaml
@@ -0,0 +1,24 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: proxy-role
+ app.kubernetes.io/component: kube-rbac-proxy
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: proxy-role
+rules:
+- apiGroups:
+ - authentication.k8s.io
+ resources:
+ - tokenreviews
+ verbs:
+ - create
+- apiGroups:
+ - authorization.k8s.io
+ resources:
+ - subjectaccessreviews
+ verbs:
+ - create
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role_binding.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role_binding.yaml
new file mode 100644
index 00000000000..2865bf6007b
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_role_binding.yaml
@@ -0,0 +1,19 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrolebinding
+ app.kubernetes.io/instance: proxy-rolebinding
+ app.kubernetes.io/component: kube-rbac-proxy
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: proxy-rolebinding
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: proxy-role
+subjects:
+- kind: ServiceAccount
+ name: controller-manager
+ namespace: system
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_service.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_service.yaml
new file mode 100644
index 00000000000..eaa3581887a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/auth_proxy_service.yaml
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ control-plane: controller-manager
+ app.kubernetes.io/name: service
+ app.kubernetes.io/instance: controller-manager-metrics-service
+ app.kubernetes.io/component: kube-rbac-proxy
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: controller-manager-metrics-service
+ namespace: system
+spec:
+ ports:
+ - name: https
+ port: 8443
+ protocol: TCP
+ targetPort: https
+ selector:
+ control-plane: controller-manager
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_editor_role.yaml
new file mode 100644
index 00000000000..bd5635e807a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit captains.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: captain-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: captain-editor-role
+rules:
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_viewer_role.yaml
new file mode 100644
index 00000000000..4b2d5239891
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/crew_captain_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view captains.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: captain-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: captain-viewer-role
+rules:
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_editor_role.yaml
similarity index 51%
rename from testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml
rename to testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_editor_role.yaml
index ceae6910a0e..b78e82144a5 100644
--- a/testdata/project-v4-multigroup/config/rbac/example.com_busybox_editor_role.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_editor_role.yaml
@@ -1,20 +1,20 @@
-# permissions for end users to edit busyboxes.
+# permissions for end users to edit bars.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: busybox-editor-role
+ app.kubernetes.io/instance: bar-editor-role
app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-multigroup
- app.kubernetes.io/part-of: project-v4-multigroup
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
app.kubernetes.io/managed-by: kustomize
- name: busybox-editor-role
+ name: bar-editor-role
rules:
- apiGroups:
- - example.com.testproject.org
+ - fiz.testproject.org
resources:
- - busyboxes
+ - bars
verbs:
- create
- delete
@@ -24,8 +24,8 @@ rules:
- update
- watch
- apiGroups:
- - example.com.testproject.org
+ - fiz.testproject.org
resources:
- - busyboxes/status
+ - bars/status
verbs:
- get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_viewer_role.yaml
new file mode 100644
index 00000000000..08c01ae9813
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/fiz_bar_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view bars.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: bar-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: bar-viewer-role
+rules:
+- apiGroups:
+ - fiz.testproject.org
+ resources:
+ - bars
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - fiz.testproject.org
+ resources:
+ - bars/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_editor_role.yaml
new file mode 100644
index 00000000000..40c5d23d3ba
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit healthcheckpolicies.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: healthcheckpolicy-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: healthcheckpolicy-editor-role
+rules:
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_viewer_role.yaml
new file mode 100644
index 00000000000..8ea5332cc09
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo.policy_healthcheckpolicy_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view healthcheckpolicies.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: healthcheckpolicy-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: healthcheckpolicy-viewer-role
+rules:
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_editor_role.yaml
new file mode 100644
index 00000000000..9e7821cf8c4
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit bars.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: bar-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: bar-editor-role
+rules:
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_viewer_role.yaml
new file mode 100644
index 00000000000..fdcc0f8cf60
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/foo_bar_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view bars.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: bar-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: bar-viewer-role
+rules:
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/kustomization.yaml
new file mode 100644
index 00000000000..731832a6ac3
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/kustomization.yaml
@@ -0,0 +1,18 @@
+resources:
+# All RBAC will be applied under this service account in
+# the deployment namespace. You may comment out this resource
+# if your manager will use a service account that exists at
+# runtime. Be sure to update RoleBinding and ClusterRoleBinding
+# subjects if changing service account names.
+- service_account.yaml
+- role.yaml
+- role_binding.yaml
+- leader_election_role.yaml
+- leader_election_role_binding.yaml
+# Comment the following 4 lines if you want to disable
+# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
+# which protects your /metrics endpoint.
+- auth_proxy_service.yaml
+- auth_proxy_role.yaml
+- auth_proxy_role_binding.yaml
+- auth_proxy_client_clusterrole.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role.yaml
new file mode 100644
index 00000000000..71eb53be354
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role.yaml
@@ -0,0 +1,44 @@
+# permissions to do leader election.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ labels:
+ app.kubernetes.io/name: role
+ app.kubernetes.io/instance: leader-election-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: leader-election-role
+rules:
+- apiGroups:
+ - ""
+ resources:
+ - configmaps
+ verbs:
+ - get
+ - list
+ - watch
+ - create
+ - update
+ - patch
+ - delete
+- apiGroups:
+ - coordination.k8s.io
+ resources:
+ - leases
+ verbs:
+ - get
+ - list
+ - watch
+ - create
+ - update
+ - patch
+ - delete
+- apiGroups:
+ - ""
+ resources:
+ - events
+ verbs:
+ - create
+ - patch
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role_binding.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role_binding.yaml
new file mode 100644
index 00000000000..46b200947c6
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/leader_election_role_binding.yaml
@@ -0,0 +1,19 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ labels:
+ app.kubernetes.io/name: rolebinding
+ app.kubernetes.io/instance: leader-election-rolebinding
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: leader-election-rolebinding
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: leader-election-role
+subjects:
+- kind: ServiceAccount
+ name: controller-manager
+ namespace: system
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/role.yaml
new file mode 100644
index 00000000000..e2d30b23205
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/role.yaml
@@ -0,0 +1,292 @@
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ name: manager-role
+rules:
+- apiGroups:
+ - apps
+ resources:
+ - deployments
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - apps
+ resources:
+ - deployments/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - apps
+ resources:
+ - deployments/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - crew.testproject.org
+ resources:
+ - captains/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - fiz.testproject.org
+ resources:
+ - bars
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - fiz.testproject.org
+ resources:
+ - bars/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - fiz.testproject.org
+ resources:
+ - bars/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - foo.policy.testproject.org
+ resources:
+ - healthcheckpolicies/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - foo.testproject.org
+ resources:
+ - bars/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - testproject.org
+ resources:
+ - lakers
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - testproject.org
+ resources:
+ - lakers/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - testproject.org
+ resources:
+ - lakers/status
+ verbs:
+ - get
+ - patch
+ - update
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/role_binding.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/role_binding.yaml
new file mode 100644
index 00000000000..a21e269bbeb
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/role_binding.yaml
@@ -0,0 +1,19 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrolebinding
+ app.kubernetes.io/instance: manager-rolebinding
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: manager-rolebinding
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: manager-role
+subjects:
+- kind: ServiceAccount
+ name: controller-manager
+ namespace: system
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_editor_role.yaml
new file mode 100644
index 00000000000..12a22f31ef8
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit krakens.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: kraken-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: kraken-editor-role
+rules:
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_viewer_role.yaml
new file mode 100644
index 00000000000..de8052ce7a4
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_kraken_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view krakens.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: kraken-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: kraken-viewer-role
+rules:
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - krakens/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_editor_role.yaml
new file mode 100644
index 00000000000..9915768283d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit leviathans.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: leviathan-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: leviathan-editor-role
+rules:
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_viewer_role.yaml
new file mode 100644
index 00000000000..d07705c5eb3
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/sea-creatures_leviathan_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view leviathans.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: leviathan-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: leviathan-viewer-role
+rules:
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - sea-creatures.testproject.org
+ resources:
+ - leviathans/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/service_account.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/service_account.yaml
new file mode 100644
index 00000000000..e14982021a9
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/service_account.yaml
@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ labels:
+ app.kubernetes.io/name: serviceaccount
+ app.kubernetes.io/instance: controller-manager-sa
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: controller-manager
+ namespace: system
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_editor_role.yaml
new file mode 100644
index 00000000000..52a5c228354
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit cruisers.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: cruiser-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: cruiser-editor-role
+rules:
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_viewer_role.yaml
new file mode 100644
index 00000000000..e4c28e54811
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_cruiser_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view cruisers.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: cruiser-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: cruiser-viewer-role
+rules:
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - cruisers/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_editor_role.yaml
new file mode 100644
index 00000000000..540cd60f0d0
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit destroyers.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: destroyer-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: destroyer-editor-role
+rules:
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_viewer_role.yaml
new file mode 100644
index 00000000000..0a3fb441bfd
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_destroyer_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view destroyers.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: destroyer-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: destroyer-viewer-role
+rules:
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - destroyers/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_editor_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_editor_role.yaml
new file mode 100644
index 00000000000..a7fe83c260d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_editor_role.yaml
@@ -0,0 +1,31 @@
+# permissions for end users to edit frigates.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: frigate-editor-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: frigate-editor-role
+rules:
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_viewer_role.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_viewer_role.yaml
new file mode 100644
index 00000000000..e3dc1d4b033
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/rbac/ship_frigate_viewer_role.yaml
@@ -0,0 +1,27 @@
+# permissions for end users to view frigates.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/name: clusterrole
+ app.kubernetes.io/instance: frigate-viewer-role
+ app.kubernetes.io/component: rbac
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: frigate-viewer-role
+rules:
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ship.testproject.org
+ resources:
+ - frigates/status
+ verbs:
+ - get
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/_v1_lakers.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/_v1_lakers.yaml
new file mode 100644
index 00000000000..212abd9cb63
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/_v1_lakers.yaml
@@ -0,0 +1,12 @@
+apiVersion: testproject.org/v1
+kind: Lakers
+metadata:
+ labels:
+ app.kubernetes.io/name: lakers
+ app.kubernetes.io/instance: lakers-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: lakers-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/crew_v1_captain.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/crew_v1_captain.yaml
new file mode 100644
index 00000000000..f673b14f595
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/crew_v1_captain.yaml
@@ -0,0 +1,12 @@
+apiVersion: crew.testproject.org/v1
+kind: Captain
+metadata:
+ labels:
+ app.kubernetes.io/name: captain
+ app.kubernetes.io/instance: captain-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: captain-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/fiz_v1_bar.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/fiz_v1_bar.yaml
new file mode 100644
index 00000000000..8e8bbe548a7
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/fiz_v1_bar.yaml
@@ -0,0 +1,12 @@
+apiVersion: fiz.testproject.org/v1
+kind: Bar
+metadata:
+ labels:
+ app.kubernetes.io/name: bar
+ app.kubernetes.io/instance: bar-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: bar-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/foo.policy_v1_healthcheckpolicy.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/foo.policy_v1_healthcheckpolicy.yaml
new file mode 100644
index 00000000000..2e186a61163
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/foo.policy_v1_healthcheckpolicy.yaml
@@ -0,0 +1,12 @@
+apiVersion: foo.policy.testproject.org/v1
+kind: HealthCheckPolicy
+metadata:
+ labels:
+ app.kubernetes.io/name: healthcheckpolicy
+ app.kubernetes.io/instance: healthcheckpolicy-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: healthcheckpolicy-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/foo_v1_bar.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/foo_v1_bar.yaml
new file mode 100644
index 00000000000..b53b7541890
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/foo_v1_bar.yaml
@@ -0,0 +1,12 @@
+apiVersion: foo.testproject.org/v1
+kind: Bar
+metadata:
+ labels:
+ app.kubernetes.io/name: bar
+ app.kubernetes.io/instance: bar-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: bar-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/kustomization.yaml
new file mode 100644
index 00000000000..a74ed904341
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/kustomization.yaml
@@ -0,0 +1,13 @@
+## Append samples of your project ##
+resources:
+- crew_v1_captain.yaml
+- ship_v1beta1_frigate.yaml
+- ship_v1_destroyer.yaml
+- ship_v2alpha1_cruiser.yaml
+- sea-creatures_v1beta1_kraken.yaml
+- sea-creatures_v1beta2_leviathan.yaml
+- foo.policy_v1_healthcheckpolicy.yaml
+- foo_v1_bar.yaml
+- fiz_v1_bar.yaml
+- _v1_lakers.yaml
+#+kubebuilder:scaffold:manifestskustomizesamples
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta1_kraken.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta1_kraken.yaml
new file mode 100644
index 00000000000..0df2e7f9614
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta1_kraken.yaml
@@ -0,0 +1,12 @@
+apiVersion: sea-creatures.testproject.org/v1beta1
+kind: Kraken
+metadata:
+ labels:
+ app.kubernetes.io/name: kraken
+ app.kubernetes.io/instance: kraken-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: kraken-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta2_leviathan.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta2_leviathan.yaml
new file mode 100644
index 00000000000..0e5fff34936
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/sea-creatures_v1beta2_leviathan.yaml
@@ -0,0 +1,12 @@
+apiVersion: sea-creatures.testproject.org/v1beta2
+kind: Leviathan
+metadata:
+ labels:
+ app.kubernetes.io/name: leviathan
+ app.kubernetes.io/instance: leviathan-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: leviathan-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1_destroyer.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1_destroyer.yaml
new file mode 100644
index 00000000000..1a22738bd1d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1_destroyer.yaml
@@ -0,0 +1,12 @@
+apiVersion: ship.testproject.org/v1
+kind: Destroyer
+metadata:
+ labels:
+ app.kubernetes.io/name: destroyer
+ app.kubernetes.io/instance: destroyer-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: destroyer-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1beta1_frigate.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1beta1_frigate.yaml
new file mode 100644
index 00000000000..b7361d362d0
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v1beta1_frigate.yaml
@@ -0,0 +1,12 @@
+apiVersion: ship.testproject.org/v1beta1
+kind: Frigate
+metadata:
+ labels:
+ app.kubernetes.io/name: frigate
+ app.kubernetes.io/instance: frigate-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: frigate-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v2alpha1_cruiser.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v2alpha1_cruiser.yaml
new file mode 100644
index 00000000000..c55fc456ae7
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/samples/ship_v2alpha1_cruiser.yaml
@@ -0,0 +1,12 @@
+apiVersion: ship.testproject.org/v2alpha1
+kind: Cruiser
+metadata:
+ labels:
+ app.kubernetes.io/name: cruiser
+ app.kubernetes.io/instance: cruiser-sample
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ name: cruiser-sample
+spec:
+ # TODO(user): Add fields here
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomization.yaml
new file mode 100644
index 00000000000..9cf26134e4d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomization.yaml
@@ -0,0 +1,6 @@
+resources:
+- manifests.yaml
+- service.yaml
+
+configurations:
+- kustomizeconfig.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomizeconfig.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomizeconfig.yaml
new file mode 100644
index 00000000000..206316e54ff
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/kustomizeconfig.yaml
@@ -0,0 +1,22 @@
+# the following config is for teaching kustomize where to look at when substituting nameReference.
+# It requires kustomize v2.1.0 or newer to work properly.
+nameReference:
+- kind: Service
+ version: v1
+ fieldSpecs:
+ - kind: MutatingWebhookConfiguration
+ group: admissionregistration.k8s.io
+ path: webhooks/clientConfig/service/name
+ - kind: ValidatingWebhookConfiguration
+ group: admissionregistration.k8s.io
+ path: webhooks/clientConfig/service/name
+
+namespace:
+- kind: MutatingWebhookConfiguration
+ group: admissionregistration.k8s.io
+ path: webhooks/clientConfig/service/namespace
+ create: true
+- kind: ValidatingWebhookConfiguration
+ group: admissionregistration.k8s.io
+ path: webhooks/clientConfig/service/namespace
+ create: true
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/webhook/manifests.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/manifests.yaml
new file mode 100644
index 00000000000..62374002227
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/manifests.yaml
@@ -0,0 +1,132 @@
+---
+apiVersion: admissionregistration.k8s.io/v1
+kind: MutatingWebhookConfiguration
+metadata:
+ name: mutating-webhook-configuration
+webhooks:
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /mutate-crew-testproject-org-v1-captain
+ failurePolicy: Fail
+ name: mcaptain.kb.io
+ rules:
+ - apiGroups:
+ - crew.testproject.org
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - captains
+ sideEffects: None
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /mutate-ship-testproject-org-v1-destroyer
+ failurePolicy: Fail
+ name: mdestroyer.kb.io
+ rules:
+ - apiGroups:
+ - ship.testproject.org
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - destroyers
+ sideEffects: None
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /mutate-testproject-org-v1-lakers
+ failurePolicy: Fail
+ name: mlakers.kb.io
+ rules:
+ - apiGroups:
+ - testproject.org
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - lakers
+ sideEffects: None
+---
+apiVersion: admissionregistration.k8s.io/v1
+kind: ValidatingWebhookConfiguration
+metadata:
+ name: validating-webhook-configuration
+webhooks:
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /validate-crew-testproject-org-v1-captain
+ failurePolicy: Fail
+ name: vcaptain.kb.io
+ rules:
+ - apiGroups:
+ - crew.testproject.org
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - captains
+ sideEffects: None
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /validate-ship-testproject-org-v2alpha1-cruiser
+ failurePolicy: Fail
+ name: vcruiser.kb.io
+ rules:
+ - apiGroups:
+ - ship.testproject.org
+ apiVersions:
+ - v2alpha1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - cruisers
+ sideEffects: None
+- admissionReviewVersions:
+ - v1
+ clientConfig:
+ service:
+ name: webhook-service
+ namespace: system
+ path: /validate-testproject-org-v1-lakers
+ failurePolicy: Fail
+ name: vlakers.kb.io
+ rules:
+ - apiGroups:
+ - testproject.org
+ apiVersions:
+ - v1
+ operations:
+ - CREATE
+ - UPDATE
+ resources:
+ - lakers
+ sideEffects: None
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml
new file mode 100644
index 00000000000..beb16dfbee1
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml
@@ -0,0 +1,20 @@
+
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app.kubernetes.io/name: service
+ app.kubernetes.io/instance: webhook-service
+ app.kubernetes.io/component: webhook
+ app.kubernetes.io/created-by: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/part-of: project-v4-multigroup-with-deploy-image
+ app.kubernetes.io/managed-by: kustomize
+ name: webhook-service
+ namespace: system
+spec:
+ ports:
+ - port: 443
+ protocol: TCP
+ targetPort: 9443
+ selector:
+ control-plane: controller-manager
diff --git a/testdata/project-v4-multigroup-with-deploy-image/go.mod b/testdata/project-v4-multigroup-with-deploy-image/go.mod
new file mode 100644
index 00000000000..5adf8d5ec1c
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/go.mod
@@ -0,0 +1,73 @@
+module sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image
+
+go 1.20
+
+require (
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
+ k8s.io/api v0.28.1
+ k8s.io/apimachinery v0.28.1
+ k8s.io/client-go v0.28.1
+ sigs.k8s.io/controller-runtime v0.16.2
+)
+
+require (
+ github.com/beorn7/perks v1.0.1 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // 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.4 // indirect
+ github.com/go-logr/zapr v1.2.4 // indirect
+ github.com/go-openapi/jsonpointer v0.19.6 // indirect
+ github.com/go-openapi/jsonreference v0.20.2 // indirect
+ github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
+ github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
+ github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/gnostic-models v0.6.8 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
+ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
+ github.com/google/uuid v1.3.0 // indirect
+ github.com/imdario/mergo v0.3.6 // indirect
+ github.com/josharian/intern v1.0.0 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/mailru/easyjson v0.7.7 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
+ github.com/prometheus/client_golang v1.16.0 // indirect
+ github.com/prometheus/client_model v0.4.0 // indirect
+ github.com/prometheus/common v0.44.0 // indirect
+ github.com/prometheus/procfs v0.10.1 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.25.0 // indirect
+ golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
+ golang.org/x/net v0.13.0 // indirect
+ golang.org/x/oauth2 v0.8.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.10.0 // indirect
+ golang.org/x/text v0.11.0 // indirect
+ golang.org/x/time v0.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
+ gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
+ google.golang.org/appengine v1.6.7 // indirect
+ google.golang.org/protobuf v1.30.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/apiextensions-apiserver v0.28.0 // indirect
+ k8s.io/component-base v0.28.1 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
+ sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
+ sigs.k8s.io/yaml v1.3.0 // indirect
+)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/hack/boilerplate.go.txt b/testdata/project-v4-multigroup-with-deploy-image/hack/boilerplate.go.txt
new file mode 100644
index 00000000000..8c36d12450d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/hack/boilerplate.go.txt
@@ -0,0 +1,15 @@
+/*
+Copyright 2023 The 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.
+*/
\ No newline at end of file
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go
new file mode 100644
index 00000000000..b3c6c551193
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go
@@ -0,0 +1,61 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package apps
+
+import (
+ "context"
+
+ appsv1 "k8s.io/api/apps/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+)
+
+// DeploymentReconciler reconciles a Deployment object
+type DeploymentReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=apps,resources=deployments/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=apps,resources=deployments/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Deployment object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *DeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *DeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&appsv1.Deployment{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go
new file mode 100644
index 00000000000..78f8abdf282
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go
@@ -0,0 +1,89 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package apps
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ appsv1 "k8s.io/api/apps/v1"
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ logf "sigs.k8s.io/controller-runtime/pkg/log"
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: false,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = appsv1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go
new file mode 100644
index 00000000000..933d7dba70e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package crew
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1"
+)
+
+// CaptainReconciler reconciles a Captain object
+type CaptainReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=crew.testproject.org,resources=captains/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Captain object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *CaptainReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&crewv1.Captain{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go
similarity index 93%
rename from testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
rename to testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go
index b298e0a96d8..92de83f12c0 100644
--- a/testdata/project-v4-multigroup/internal/controller/example.com/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package examplecom
+package crew
import (
"fmt"
@@ -32,7 +32,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
- examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1"
//+kubebuilder:scaffold:imports
)
@@ -72,7 +72,7 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
- err = examplecomv1alpha1.AddToScheme(scheme.Scheme)
+ err = crewv1.AddToScheme(scheme.Scheme)
Expect(err).NotTo(HaveOccurred())
//+kubebuilder:scaffold:scheme
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go
new file mode 100644
index 00000000000..e4431b49bb9
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package fiz
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1"
+)
+
+// BarReconciler reconciles a Bar object
+type BarReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=fiz.testproject.org,resources=bars,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=fiz.testproject.org,resources=bars/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=fiz.testproject.org,resources=bars/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Bar object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *BarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *BarReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&fizv1.Bar{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go
new file mode 100644
index 00000000000..08507362144
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package fiz
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ 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-with-deploy-image/api/fiz/v1"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = fizv1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go
new file mode 100644
index 00000000000..39e00649b0d
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foopolicy
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1"
+)
+
+// HealthCheckPolicyReconciler reconciles a HealthCheckPolicy object
+type HealthCheckPolicyReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=foo.policy.testproject.org,resources=healthcheckpolicies,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=foo.policy.testproject.org,resources=healthcheckpolicies/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=foo.policy.testproject.org,resources=healthcheckpolicies/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the HealthCheckPolicy object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *HealthCheckPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *HealthCheckPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&foopolicyv1.HealthCheckPolicy{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go
new file mode 100644
index 00000000000..4b54814270f
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foopolicy
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ 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-with-deploy-image/api/foo.policy/v1"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = foopolicyv1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go
new file mode 100644
index 00000000000..f6a60424a5b
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foo
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1"
+)
+
+// BarReconciler reconciles a Bar object
+type BarReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=foo.testproject.org,resources=bars,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=foo.testproject.org,resources=bars/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=foo.testproject.org,resources=bars/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Bar object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *BarReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *BarReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&foov1.Bar{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go
new file mode 100644
index 00000000000..0b8a1f7de20
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foo
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ 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-with-deploy-image/api/foo/v1"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = foov1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go
new file mode 100644
index 00000000000..08da8ca4d23
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/v1"
+)
+
+// LakersReconciler reconciles a Lakers object
+type LakersReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=testproject.org,resources=lakers,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=testproject.org,resources=lakers/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=testproject.org,resources=lakers/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Lakers object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *LakersReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *LakersReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&testprojectorgv1.Lakers{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go
new file mode 100644
index 00000000000..a5db31bca89
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1"
+)
+
+// KrakenReconciler reconciles a Kraken object
+type KrakenReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=krakens,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=krakens/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=krakens/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Kraken object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *KrakenReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *KrakenReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&seacreaturesv1beta1.Kraken{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go
new file mode 100644
index 00000000000..3f16deff8ce
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2"
+)
+
+// LeviathanReconciler reconciles a Leviathan object
+type LeviathanReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=leviathans,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=leviathans/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=sea-creatures.testproject.org,resources=leviathans/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Leviathan object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *LeviathanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *LeviathanReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&seacreaturesv1beta2.Leviathan{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go
new file mode 100644
index 00000000000..9035668a10a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go
@@ -0,0 +1,94 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ 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-with-deploy-image/api/sea-creatures/v1beta1"
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = seacreaturesv1beta1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = seacreaturesv1beta2.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go
new file mode 100644
index 00000000000..98b460da68a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1"
+)
+
+// CruiserReconciler reconciles a Cruiser object
+type CruiserReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=cruisers,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=cruisers/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=cruisers/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Cruiser object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *CruiserReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *CruiserReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&shipv2alpha1.Cruiser{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go
new file mode 100644
index 00000000000..10fd8c3f6e6
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1"
+)
+
+// DestroyerReconciler reconciles a Destroyer object
+type DestroyerReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=destroyers,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=destroyers/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=destroyers/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Destroyer object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *DestroyerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *DestroyerReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&shipv1.Destroyer{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go
new file mode 100644
index 00000000000..93036286f67
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go
@@ -0,0 +1,62 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ "k8s.io/apimachinery/pkg/runtime"
+ ctrl "sigs.k8s.io/controller-runtime"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/log"
+
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1"
+)
+
+// FrigateReconciler reconciles a Frigate object
+type FrigateReconciler struct {
+ client.Client
+ Scheme *runtime.Scheme
+}
+
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=frigates,verbs=get;list;watch;create;update;patch;delete
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=frigates/status,verbs=get;update;patch
+//+kubebuilder:rbac:groups=ship.testproject.org,resources=frigates/finalizers,verbs=update
+
+// Reconcile is part of the main kubernetes reconciliation loop which aims to
+// move the current state of the cluster closer to the desired state.
+// TODO(user): Modify the Reconcile function to compare the state specified by
+// the Frigate object against the actual cluster state, and then
+// perform operations to make the cluster state reflect the state specified by
+// the user.
+//
+// For more details, check Reconcile and its Result here:
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+func (r *FrigateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
+ _ = log.FromContext(ctx)
+
+ // TODO(user): your logic here
+
+ return ctrl.Result{}, nil
+}
+
+// SetupWithManager sets up the controller with the Manager.
+func (r *FrigateReconciler) SetupWithManager(mgr ctrl.Manager) error {
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&shipv1beta1.Frigate{}).
+ Complete(r)
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go
new file mode 100644
index 00000000000..dfd58b12897
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go
@@ -0,0 +1,98 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ 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-with-deploy-image/api/ship/v1"
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1"
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = shipv1beta1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = shipv1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ err = shipv2alpha1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go
new file mode 100644
index 00000000000..4d8c3984d6f
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "fmt"
+ "path/filepath"
+ "runtime"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "k8s.io/client-go/kubernetes/scheme"
+ "k8s.io/client-go/rest"
+ "sigs.k8s.io/controller-runtime/pkg/client"
+ "sigs.k8s.io/controller-runtime/pkg/envtest"
+ 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-with-deploy-image/api/v1"
+ //+kubebuilder:scaffold:imports
+)
+
+// These tests use Ginkgo (BDD-style Go testing framework). Refer to
+// http://onsi.github.io/ginkgo/ to learn more about Ginkgo.
+
+var cfg *rest.Config
+var k8sClient client.Client
+var testEnv *envtest.Environment
+
+func TestControllers(t *testing.T) {
+ RegisterFailHandler(Fail)
+
+ RunSpecs(t, "Controller Suite")
+}
+
+var _ = BeforeSuite(func() {
+ logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
+
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ ErrorIfCRDPathMissing: true,
+
+ // The BinaryAssetsDirectory is only required if you want to run the tests directly
+ // without call the makefile target test. If not informed it will look for the
+ // default path defined in controller-runtime which is /usr/local/kubebuilder/.
+ // Note that you must have the required binaries setup under the bin directory to perform
+ // the tests directly. When we run make test it will be setup and used automatically.
+ BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
+ fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ }
+
+ var err error
+ // cfg is defined in this file globally.
+ cfg, err = testEnv.Start()
+ Expect(err).NotTo(HaveOccurred())
+ Expect(cfg).NotTo(BeNil())
+
+ err = testprojectorgv1.AddToScheme(scheme.Scheme)
+ Expect(err).NotTo(HaveOccurred())
+
+ //+kubebuilder:scaffold:scheme
+
+ k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
+ Expect(err).NotTo(HaveOccurred())
+ Expect(k8sClient).NotTo(BeNil())
+
+})
+
+var _ = AfterSuite(func() {
+ By("tearing down the test environment")
+ err := testEnv.Stop()
+ Expect(err).NotTo(HaveOccurred())
+})
diff --git a/testdata/project-v4-multigroup/PROJECT b/testdata/project-v4-multigroup/PROJECT
index 12d9db3cd58..92f8bcfd7a5 100644
--- a/testdata/project-v4-multigroup/PROJECT
+++ b/testdata/project-v4-multigroup/PROJECT
@@ -6,25 +6,6 @@ domain: testproject.org
layout:
- go.kubebuilder.io/v4
multigroup: true
-plugins:
- deploy-image.go.kubebuilder.io/v1-alpha:
- resources:
- - domain: testproject.org
- group: example.com
- kind: Memcached
- options:
- containerCommand: memcached,-m=64,-o,modern,-v
- containerPort: "11211"
- image: memcached:1.4.36-alpine
- runAsUser: "1001"
- version: v1alpha1
- - domain: testproject.org
- group: example.com
- kind: Busybox
- options:
- image: busybox:1.28
- version: v1alpha1
- grafana.kubebuilder.io/v1-alpha: {}
projectName: project-v4-multigroup
repo: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup
resources:
@@ -137,25 +118,4 @@ resources:
defaulting: true
validation: true
webhookVersion: v1
-- api:
- crdVersion: v1
- namespaced: true
- controller: true
- domain: testproject.org
- group: example.com
- kind: Memcached
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1
- version: v1alpha1
- webhooks:
- validation: true
- webhookVersion: v1
-- api:
- crdVersion: v1
- namespaced: true
- controller: true
- domain: testproject.org
- group: example.com
- kind: Busybox
- path: sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1
- version: v1alpha1
version: "3"
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go
deleted file mode 100644
index 440dd96baef..00000000000
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/busybox_types.go
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-
-// BusyboxSpec defines the desired state of Busybox
-type BusyboxSpec struct {
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-
- // Size defines the number of Busybox instances
- // The following markers will use OpenAPI v3 schema to validate the value
- // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
- // +kubebuilder:validation:Minimum=1
- // +kubebuilder:validation:Maximum=3
- // +kubebuilder:validation:ExclusiveMaximum=false
- Size int32 `json:"size,omitempty"`
-}
-
-// BusyboxStatus defines the observed state of Busybox
-type BusyboxStatus struct {
- // Represents the observations of a Busybox's current state.
- // Busybox.status.conditions.type are: "Available", "Progressing", and "Degraded"
- // Busybox.status.conditions.status are one of True, False, Unknown.
- // Busybox.status.conditions.reason the value should be a CamelCase string and producers of specific
- // condition types may define expected values and meanings for this field, and whether the values
- // are considered a guaranteed API.
- // Busybox.status.conditions.Message is a human readable message indicating details about the transition.
- // For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
-
- Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
-}
-
-//+kubebuilder:object:root=true
-//+kubebuilder:subresource:status
-
-// Busybox is the Schema for the busyboxes API
-type Busybox struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- Spec BusyboxSpec `json:"spec,omitempty"`
- Status BusyboxStatus `json:"status,omitempty"`
-}
-
-//+kubebuilder:object:root=true
-
-// BusyboxList contains a list of Busybox
-type BusyboxList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []Busybox `json:"items"`
-}
-
-func init() {
- SchemeBuilder.Register(&Busybox{}, &BusyboxList{})
-}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go
deleted file mode 100644
index aa82a833c00..00000000000
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/memcached_types.go
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-)
-
-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-
-// MemcachedSpec defines the desired state of Memcached
-type MemcachedSpec struct {
- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
- // Important: Run "make" to regenerate code after modifying this file
-
- // Size defines the number of Memcached instances
- // The following markers will use OpenAPI v3 schema to validate the value
- // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
- // +kubebuilder:validation:Minimum=1
- // +kubebuilder:validation:Maximum=3
- // +kubebuilder:validation:ExclusiveMaximum=false
- Size int32 `json:"size,omitempty"`
-
- // Port defines the port that will be used to init the container with the image
- ContainerPort int32 `json:"containerPort,omitempty"`
-}
-
-// MemcachedStatus defines the observed state of Memcached
-type MemcachedStatus struct {
- // Represents the observations of a Memcached's current state.
- // Memcached.status.conditions.type are: "Available", "Progressing", and "Degraded"
- // Memcached.status.conditions.status are one of True, False, Unknown.
- // Memcached.status.conditions.reason the value should be a CamelCase string and producers of specific
- // condition types may define expected values and meanings for this field, and whether the values
- // are considered a guaranteed API.
- // Memcached.status.conditions.Message is a human readable message indicating details about the transition.
- // For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
-
- Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
-}
-
-//+kubebuilder:object:root=true
-//+kubebuilder:subresource:status
-
-// Memcached is the Schema for the memcacheds API
-type Memcached struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ObjectMeta `json:"metadata,omitempty"`
-
- Spec MemcachedSpec `json:"spec,omitempty"`
- Status MemcachedStatus `json:"status,omitempty"`
-}
-
-//+kubebuilder:object:root=true
-
-// MemcachedList contains a list of Memcached
-type MemcachedList struct {
- metav1.TypeMeta `json:",inline"`
- metav1.ListMeta `json:"metadata,omitempty"`
- Items []Memcached `json:"items"`
-}
-
-func init() {
- SchemeBuilder.Register(&Memcached{}, &MemcachedList{})
-}
diff --git a/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go b/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
deleted file mode 100644
index fa209b7c2b2..00000000000
--- a/testdata/project-v4-multigroup/api/example.com/v1alpha1/zz_generated.deepcopy.go
+++ /dev/null
@@ -1,218 +0,0 @@
-//go:build !ignore_autogenerated
-
-/*
-Copyright 2023 The 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.
-*/
-
-// Code generated by controller-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
-)
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Busybox) DeepCopyInto(out *Busybox) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- out.Spec = in.Spec
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Busybox.
-func (in *Busybox) DeepCopy() *Busybox {
- if in == nil {
- return nil
- }
- out := new(Busybox)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *Busybox) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *BusyboxList) DeepCopyInto(out *BusyboxList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]Busybox, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusyboxList.
-func (in *BusyboxList) DeepCopy() *BusyboxList {
- if in == nil {
- return nil
- }
- out := new(BusyboxList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *BusyboxList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *BusyboxSpec) DeepCopyInto(out *BusyboxSpec) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusyboxSpec.
-func (in *BusyboxSpec) DeepCopy() *BusyboxSpec {
- if in == nil {
- return nil
- }
- out := new(BusyboxSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *BusyboxStatus) DeepCopyInto(out *BusyboxStatus) {
- *out = *in
- if in.Conditions != nil {
- in, out := &in.Conditions, &out.Conditions
- *out = make([]v1.Condition, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BusyboxStatus.
-func (in *BusyboxStatus) DeepCopy() *BusyboxStatus {
- if in == nil {
- return nil
- }
- out := new(BusyboxStatus)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *Memcached) DeepCopyInto(out *Memcached) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
- out.Spec = in.Spec
- in.Status.DeepCopyInto(&out.Status)
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Memcached.
-func (in *Memcached) DeepCopy() *Memcached {
- if in == nil {
- return nil
- }
- out := new(Memcached)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *Memcached) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MemcachedList) DeepCopyInto(out *MemcachedList) {
- *out = *in
- out.TypeMeta = in.TypeMeta
- in.ListMeta.DeepCopyInto(&out.ListMeta)
- if in.Items != nil {
- in, out := &in.Items, &out.Items
- *out = make([]Memcached, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemcachedList.
-func (in *MemcachedList) DeepCopy() *MemcachedList {
- if in == nil {
- return nil
- }
- out := new(MemcachedList)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
-func (in *MemcachedList) DeepCopyObject() runtime.Object {
- if c := in.DeepCopy(); c != nil {
- return c
- }
- return nil
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MemcachedSpec) DeepCopyInto(out *MemcachedSpec) {
- *out = *in
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemcachedSpec.
-func (in *MemcachedSpec) DeepCopy() *MemcachedSpec {
- if in == nil {
- return nil
- }
- out := new(MemcachedSpec)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *MemcachedStatus) DeepCopyInto(out *MemcachedStatus) {
- *out = *in
- if in.Conditions != nil {
- in, out := &in.Conditions, &out.Conditions
- *out = make([]v1.Condition, len(*in))
- for i := range *in {
- (*in)[i].DeepCopyInto(&(*out)[i])
- }
- }
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemcachedStatus.
-func (in *MemcachedStatus) DeepCopy() *MemcachedStatus {
- if in == nil {
- return nil
- }
- out := new(MemcachedStatus)
- in.DeepCopyInto(out)
- return out
-}
diff --git a/testdata/project-v4-multigroup/cmd/main.go b/testdata/project-v4-multigroup/cmd/main.go
index c9bebd9afbc..d6453cef006 100644
--- a/testdata/project-v4-multigroup/cmd/main.go
+++ b/testdata/project-v4-multigroup/cmd/main.go
@@ -33,7 +33,6 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
- examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
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"
@@ -46,7 +45,6 @@ import (
"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"
- examplecomcontroller "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/internal/controller/example.com"
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"
@@ -73,7 +71,6 @@ func init() {
utilruntime.Must(foov1.AddToScheme(scheme))
utilruntime.Must(fizv1.AddToScheme(scheme))
utilruntime.Must(testprojectorgv1.AddToScheme(scheme))
- utilruntime.Must(examplecomv1alpha1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}
@@ -224,28 +221,6 @@ func main() {
os.Exit(1)
}
}
- if err = (&examplecomcontroller.MemcachedReconciler{
- Client: mgr.GetClient(),
- Scheme: mgr.GetScheme(),
- Recorder: mgr.GetEventRecorderFor("memcached-controller"),
- }).SetupWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create controller", "controller", "Memcached")
- os.Exit(1)
- }
- if err = (&examplecomcontroller.BusyboxReconciler{
- Client: mgr.GetClient(),
- Scheme: mgr.GetScheme(),
- Recorder: mgr.GetEventRecorderFor("busybox-controller"),
- }).SetupWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create controller", "controller", "Busybox")
- os.Exit(1)
- }
- if os.Getenv("ENABLE_WEBHOOKS") != "false" {
- if err = (&examplecomv1alpha1.Memcached{}).SetupWebhookWithManager(mgr); err != nil {
- setupLog.Error(err, "unable to create webhook", "webhook", "Memcached")
- os.Exit(1)
- }
- }
//+kubebuilder:scaffold:builder
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
diff --git a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
deleted file mode 100644
index 5f6cac569ec..00000000000
--- a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_busyboxes.yaml
+++ /dev/null
@@ -1,122 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- controller-gen.kubebuilder.io/version: v0.13.0
- name: busyboxes.example.com.testproject.org
-spec:
- group: example.com.testproject.org
- names:
- kind: Busybox
- listKind: BusyboxList
- plural: busyboxes
- singular: busybox
- scope: Namespaced
- versions:
- - name: v1alpha1
- schema:
- openAPIV3Schema:
- description: Busybox is the Schema for the busyboxes API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: BusyboxSpec defines the desired state of Busybox
- properties:
- size:
- description: 'Size defines the number of Busybox instances The following
- markers will use OpenAPI v3 schema to validate the value More info:
- https://book.kubebuilder.io/reference/markers/crd-validation.html'
- format: int32
- maximum: 3
- minimum: 1
- type: integer
- type: object
- status:
- description: BusyboxStatus defines the observed state of Busybox
- properties:
- conditions:
- items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource. --- This struct is intended for direct
- use as an array at the field path .status.conditions. For example,
- \n type FooStatus struct{ // Represents the observations of a
- foo's current state. // Known .status.conditions.type are: \"Available\",
- \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
- properties:
- lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should be when
- the underlying condition changed. If that is not known, then
- using the time when the API field changed is acceptable.
- format: date-time
- type: string
- message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
- maxLength: 32768
- type: string
- observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance, if .metadata.generation
- is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the current
- state of the instance.
- format: int64
- minimum: 0
- type: integer
- reason:
- description: reason contains a programmatic identifier indicating
- the reason for the condition's last transition. Producers
- of specific condition types may define expected values and
- meanings for this field, and whether the values are considered
- a guaranteed API. The value should be a CamelCase string.
- This field may not be empty.
- maxLength: 1024
- minLength: 1
- pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
- type: string
- status:
- description: status of the condition, one of True, False, Unknown.
- enum:
- - "True"
- - "False"
- - Unknown
- type: string
- type:
- description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across resources
- like Available, but because arbitrary conditions can be useful
- (see .node.status.conditions), the ability to deconflict is
- important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
- maxLength: 316
- pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
- type: string
- required:
- - lastTransitionTime
- - message
- - reason
- - status
- - type
- type: object
- type: array
- type: object
- type: object
- served: true
- storage: true
- subresources:
- status: {}
diff --git a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml b/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
deleted file mode 100644
index 8d09426d3a8..00000000000
--- a/testdata/project-v4-multigroup/config/crd/bases/example.com.testproject.org_memcacheds.yaml
+++ /dev/null
@@ -1,127 +0,0 @@
----
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- controller-gen.kubebuilder.io/version: v0.13.0
- name: memcacheds.example.com.testproject.org
-spec:
- group: example.com.testproject.org
- names:
- kind: Memcached
- listKind: MemcachedList
- plural: memcacheds
- singular: memcached
- scope: Namespaced
- versions:
- - name: v1alpha1
- schema:
- openAPIV3Schema:
- description: Memcached is the Schema for the memcacheds API
- properties:
- apiVersion:
- description: 'APIVersion defines the versioned schema of this representation
- of an object. Servers should convert recognized schemas to the latest
- internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
- type: string
- kind:
- description: 'Kind is a string value representing the REST resource this
- object represents. Servers may infer this from the endpoint the client
- submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
- type: string
- metadata:
- type: object
- spec:
- description: MemcachedSpec defines the desired state of Memcached
- properties:
- containerPort:
- description: Port defines the port that will be used to init the container
- with the image
- format: int32
- type: integer
- size:
- description: 'Size defines the number of Memcached instances The following
- markers will use OpenAPI v3 schema to validate the value More info:
- https://book.kubebuilder.io/reference/markers/crd-validation.html'
- format: int32
- maximum: 3
- minimum: 1
- type: integer
- type: object
- status:
- description: MemcachedStatus defines the observed state of Memcached
- properties:
- conditions:
- items:
- description: "Condition contains details for one aspect of the current
- state of this API Resource. --- This struct is intended for direct
- use as an array at the field path .status.conditions. For example,
- \n type FooStatus struct{ // Represents the observations of a
- foo's current state. // Known .status.conditions.type are: \"Available\",
- \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
- // +listType=map // +listMapKey=type Conditions []metav1.Condition
- `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
- protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
- properties:
- lastTransitionTime:
- description: lastTransitionTime is the last time the condition
- transitioned from one status to another. This should be when
- the underlying condition changed. If that is not known, then
- using the time when the API field changed is acceptable.
- format: date-time
- type: string
- message:
- description: message is a human readable message indicating
- details about the transition. This may be an empty string.
- maxLength: 32768
- type: string
- observedGeneration:
- description: observedGeneration represents the .metadata.generation
- that the condition was set based upon. For instance, if .metadata.generation
- is currently 12, but the .status.conditions[x].observedGeneration
- is 9, the condition is out of date with respect to the current
- state of the instance.
- format: int64
- minimum: 0
- type: integer
- reason:
- description: reason contains a programmatic identifier indicating
- the reason for the condition's last transition. Producers
- of specific condition types may define expected values and
- meanings for this field, and whether the values are considered
- a guaranteed API. The value should be a CamelCase string.
- This field may not be empty.
- maxLength: 1024
- minLength: 1
- pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
- type: string
- status:
- description: status of the condition, one of True, False, Unknown.
- enum:
- - "True"
- - "False"
- - Unknown
- type: string
- type:
- description: type of condition in CamelCase or in foo.example.com/CamelCase.
- --- Many .condition.type values are consistent across resources
- like Available, but because arbitrary conditions can be useful
- (see .node.status.conditions), the ability to deconflict is
- important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
- maxLength: 316
- pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
- type: string
- required:
- - lastTransitionTime
- - message
- - reason
- - status
- - type
- type: object
- type: array
- type: object
- type: object
- served: true
- storage: true
- subresources:
- status: {}
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index e3729c3f731..9b25692779d 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -12,8 +12,6 @@ resources:
- bases/foo.testproject.org_bars.yaml
- bases/fiz.testproject.org_bars.yaml
- bases/testproject.org_lakers.yaml
-- bases/example.com.testproject.org_memcacheds.yaml
-- bases/example.com.testproject.org_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizeresource
patches:
@@ -29,8 +27,6 @@ patches:
#- path: patches/webhook_in_foo_bars.yaml
#- path: patches/webhook_in_fiz_bars.yaml
#- path: patches/webhook_in__lakers.yaml
-#- path: patches/webhook_in_example.com_memcacheds.yaml
-#- path: patches/webhook_in_example.com_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
@@ -45,8 +41,6 @@ patches:
#- path: patches/cainjection_in_foo_bars.yaml
#- path: patches/cainjection_in_fiz_bars.yaml
#- path: patches/cainjection_in__lakers.yaml
-#- path: patches/cainjection_in_example.com_memcacheds.yaml
-#- path: patches/cainjection_in_example.com_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
# the following config is for teaching kustomize how to do kustomization for CRDs.
diff --git a/testdata/project-v4-multigroup/config/manager/manager.yaml b/testdata/project-v4-multigroup/config/manager/manager.yaml
index e36823baac8..b9d340945db 100644
--- a/testdata/project-v4-multigroup/config/manager/manager.yaml
+++ b/testdata/project-v4-multigroup/config/manager/manager.yaml
@@ -72,11 +72,6 @@ spec:
- --leader-elect
image: controller:latest
name: manager
- env:
- - name: BUSYBOX_IMAGE
- value: busybox:1.28
- - name: MEMCACHED_IMAGE
- value: memcached:1.4.36-alpine
securityContext:
allowPrivilegeEscalation: false
capabilities:
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml b/testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml
deleted file mode 100644
index b3f6d566507..00000000000
--- a/testdata/project-v4-multigroup/config/rbac/example.com_busybox_viewer_role.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# permissions for end users to view busyboxes.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: busybox-viewer-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-multigroup
- app.kubernetes.io/part-of: project-v4-multigroup
- app.kubernetes.io/managed-by: kustomize
- name: busybox-viewer-role
-rules:
-- apiGroups:
- - example.com.testproject.org
- resources:
- - busyboxes
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - example.com.testproject.org
- resources:
- - busyboxes/status
- verbs:
- - get
diff --git a/testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml b/testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml
deleted file mode 100644
index 251117ddb78..00000000000
--- a/testdata/project-v4-multigroup/config/rbac/example.com_memcached_viewer_role.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# permissions for end users to view memcacheds.
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
- labels:
- app.kubernetes.io/name: clusterrole
- app.kubernetes.io/instance: memcached-viewer-role
- app.kubernetes.io/component: rbac
- app.kubernetes.io/created-by: project-v4-multigroup
- app.kubernetes.io/part-of: project-v4-multigroup
- app.kubernetes.io/managed-by: kustomize
- name: memcached-viewer-role
-rules:
-- apiGroups:
- - example.com.testproject.org
- resources:
- - memcacheds
- verbs:
- - get
- - list
- - watch
-- apiGroups:
- - example.com.testproject.org
- resources:
- - memcacheds/status
- verbs:
- - get
diff --git a/testdata/project-v4-multigroup/config/rbac/role.yaml b/testdata/project-v4-multigroup/config/rbac/role.yaml
index 0744d29613d..e2d30b23205 100644
--- a/testdata/project-v4-multigroup/config/rbac/role.yaml
+++ b/testdata/project-v4-multigroup/config/rbac/role.yaml
@@ -30,21 +30,6 @@ rules:
- get
- patch
- update
-- apiGroups:
- - ""
- resources:
- - events
- verbs:
- - create
- - patch
-- apiGroups:
- - ""
- resources:
- - pods
- verbs:
- - get
- - list
- - watch
- apiGroups:
- crew.testproject.org
resources:
@@ -71,58 +56,6 @@ rules:
- get
- patch
- update
-- apiGroups:
- - example.com.testproject.org
- resources:
- - busyboxes
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - example.com.testproject.org
- resources:
- - busyboxes/finalizers
- verbs:
- - update
-- apiGroups:
- - example.com.testproject.org
- resources:
- - busyboxes/status
- verbs:
- - get
- - patch
- - update
-- apiGroups:
- - example.com.testproject.org
- resources:
- - memcacheds
- verbs:
- - create
- - delete
- - get
- - list
- - patch
- - update
- - watch
-- apiGroups:
- - example.com.testproject.org
- resources:
- - memcacheds/finalizers
- verbs:
- - update
-- apiGroups:
- - example.com.testproject.org
- resources:
- - memcacheds/status
- verbs:
- - get
- - patch
- - update
- apiGroups:
- fiz.testproject.org
resources:
diff --git a/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml b/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml
deleted file mode 100644
index e5ba7642dd1..00000000000
--- a/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_busybox.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-apiVersion: example.com.testproject.org/v1alpha1
-kind: Busybox
-metadata:
- name: busybox-sample
-spec:
- # TODO(user): edit the following value to ensure the number
- # of Pods/Instances your Operand must have on cluster
- size: 1
-
diff --git a/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml b/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml
deleted file mode 100644
index 153d1db36c8..00000000000
--- a/testdata/project-v4-multigroup/config/samples/example.com_v1alpha1_memcached.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-apiVersion: example.com.testproject.org/v1alpha1
-kind: Memcached
-metadata:
- name: memcached-sample
-spec:
- # TODO(user): edit the following value to ensure the number
- # of Pods/Instances your Operand must have on cluster
- size: 1
-# TODO(user): edit the following value to ensure the container has the right port to be initialized
- containerPort: 11211
diff --git a/testdata/project-v4-multigroup/config/samples/kustomization.yaml b/testdata/project-v4-multigroup/config/samples/kustomization.yaml
index 7018e7905d0..a74ed904341 100644
--- a/testdata/project-v4-multigroup/config/samples/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/samples/kustomization.yaml
@@ -10,6 +10,4 @@ resources:
- foo_v1_bar.yaml
- fiz_v1_bar.yaml
- _v1_lakers.yaml
-- example.com_v1alpha1_memcached.yaml
-- example.com_v1alpha1_busybox.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
diff --git a/testdata/project-v4-multigroup/config/webhook/manifests.yaml b/testdata/project-v4-multigroup/config/webhook/manifests.yaml
index 8537370eb6e..62374002227 100644
--- a/testdata/project-v4-multigroup/config/webhook/manifests.yaml
+++ b/testdata/project-v4-multigroup/config/webhook/manifests.yaml
@@ -90,26 +90,6 @@ webhooks:
resources:
- captains
sideEffects: None
-- admissionReviewVersions:
- - v1
- clientConfig:
- service:
- name: webhook-service
- namespace: system
- path: /validate-example-com-testproject-org-v1alpha1-memcached
- failurePolicy: Fail
- name: vmemcached.kb.io
- rules:
- - apiGroups:
- - example.com.testproject.org
- apiVersions:
- - v1alpha1
- operations:
- - CREATE
- - UPDATE
- resources:
- - memcacheds
- sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
diff --git a/testdata/project-v4-multigroup/grafana/controller-resources-metrics.json b/testdata/project-v4-multigroup/grafana/controller-resources-metrics.json
deleted file mode 100644
index 629e0d3c9b1..00000000000
--- a/testdata/project-v4-multigroup/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-multigroup/grafana/controller-runtime-metrics.json b/testdata/project-v4-multigroup/grafana/controller-runtime-metrics.json
deleted file mode 100644
index 70023a42d82..00000000000
--- a/testdata/project-v4-multigroup/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-multigroup/grafana/custom-metrics/config.yaml b/testdata/project-v4-multigroup/grafana/custom-metrics/config.yaml
deleted file mode 100644
index 3ee1bebdf24..00000000000
--- a/testdata/project-v4-multigroup/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-multigroup/internal/controller/example.com/busybox_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
deleted file mode 100644
index 9a0c05baafe..00000000000
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller.go
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package examplecom
-
-import (
- "context"
- "fmt"
- "os"
- "strings"
- "time"
-
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- apierrors "k8s.io/apimachinery/pkg/api/errors"
- "k8s.io/apimachinery/pkg/api/meta"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/tools/record"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
- "sigs.k8s.io/controller-runtime/pkg/log"
-
- examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
-)
-
-const busyboxFinalizer = "example.com.testproject.org/finalizer"
-
-// Definitions to manage status conditions
-const (
- // typeAvailableBusybox represents the status of the Deployment reconciliation
- typeAvailableBusybox = "Available"
- // typeDegradedBusybox represents the status used when the custom resource is deleted and the finalizer operations are must to occur.
- typeDegradedBusybox = "Degraded"
-)
-
-// BusyboxReconciler reconciles a Busybox object
-type BusyboxReconciler struct {
- client.Client
- Scheme *runtime.Scheme
- Recorder record.EventRecorder
-}
-
-// The following markers are used to generate the rules permissions (RBAC) on config/rbac using controller-gen
-// when the command is executed.
-// To know more about markers see: https://book.kubebuilder.io/reference/markers.html
-
-//+kubebuilder:rbac:groups=example.com.testproject.org,resources=busyboxes,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=example.com.testproject.org,resources=busyboxes/status,verbs=get;update;patch
-//+kubebuilder:rbac:groups=example.com.testproject.org,resources=busyboxes/finalizers,verbs=update
-//+kubebuilder:rbac:groups=core,resources=events,verbs=create;patch
-//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch
-
-// Reconcile is part of the main kubernetes reconciliation loop which aims to
-// move the current state of the cluster closer to the desired state.
-// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
-// pattern you will create Controllers which provide a reconcile function
-// responsible for synchronizing resources until the desired state is reached on the cluster.
-// Breaking this recommendation goes against the design principles of controller-runtime.
-// and may lead to unforeseen consequences such as resources becoming stuck and requiring manual intervention.
-// 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.16.2/pkg/reconcile
-func (r *BusyboxReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
- log := log.FromContext(ctx)
-
- // Fetch the Busybox instance
- // The purpose is check if the Custom Resource for the Kind Busybox
- // is applied on the cluster if not we return nil to stop the reconciliation
- busybox := &examplecomv1alpha1.Busybox{}
- err := r.Get(ctx, req.NamespacedName, busybox)
- if err != nil {
- if apierrors.IsNotFound(err) {
- // If the custom resource is not found then, it usually means that it was deleted or not created
- // In this way, we will stop the reconciliation
- log.Info("busybox resource not found. Ignoring since object must be deleted")
- return ctrl.Result{}, nil
- }
- // Error reading the object - requeue the request.
- log.Error(err, "Failed to get busybox")
- return ctrl.Result{}, err
- }
-
- // Let's just set the status as Unknown when no status are available
- if busybox.Status.Conditions == nil || len(busybox.Status.Conditions) == 0 {
- meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
- if err = r.Status().Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update Busybox status")
- return ctrl.Result{}, err
- }
-
- // Let's re-fetch the busybox Custom Resource after update the status
- // so that we have the latest state of the resource on the cluster and we will avoid
- // raise the issue "the object has been modified, please apply
- // your changes to the latest version and try again" which would re-trigger the reconciliation
- // if we try to update it again in the following operations
- if err := r.Get(ctx, req.NamespacedName, busybox); err != nil {
- log.Error(err, "Failed to re-fetch busybox")
- return ctrl.Result{}, err
- }
- }
-
- // Let's add a finalizer. Then, we can define some operations which should
- // occurs before the custom resource to be deleted.
- // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
- if !controllerutil.ContainsFinalizer(busybox, busyboxFinalizer) {
- log.Info("Adding Finalizer for Busybox")
- if ok := controllerutil.AddFinalizer(busybox, busyboxFinalizer); !ok {
- log.Error(err, "Failed to add finalizer into the custom resource")
- return ctrl.Result{Requeue: true}, nil
- }
-
- if err = r.Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update custom resource to add finalizer")
- return ctrl.Result{}, err
- }
- }
-
- // Check if the Busybox instance is marked to be deleted, which is
- // indicated by the deletion timestamp being set.
- isBusyboxMarkedToBeDeleted := busybox.GetDeletionTimestamp() != nil
- if isBusyboxMarkedToBeDeleted {
- if controllerutil.ContainsFinalizer(busybox, busyboxFinalizer) {
- log.Info("Performing Finalizer Operations for Busybox before delete CR")
-
- // Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
- meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeDegradedBusybox,
- Status: metav1.ConditionUnknown, Reason: "Finalizing",
- Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", busybox.Name)})
-
- if err := r.Status().Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update Busybox status")
- return ctrl.Result{}, err
- }
-
- // Perform all operations required before remove the finalizer and allow
- // the Kubernetes API to remove the custom resource.
- r.doFinalizerOperationsForBusybox(busybox)
-
- // TODO(user): If you add operations to the doFinalizerOperationsForBusybox method
- // then you need to ensure that all worked fine before deleting and updating the Downgrade status
- // otherwise, you should requeue here.
-
- // Re-fetch the busybox Custom Resource before update the status
- // so that we have the latest state of the resource on the cluster and we will avoid
- // raise the issue "the object has been modified, please apply
- // your changes to the latest version and try again" which would re-trigger the reconciliation
- if err := r.Get(ctx, req.NamespacedName, busybox); err != nil {
- log.Error(err, "Failed to re-fetch busybox")
- return ctrl.Result{}, err
- }
-
- meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeDegradedBusybox,
- Status: metav1.ConditionTrue, Reason: "Finalizing",
- Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", busybox.Name)})
-
- if err := r.Status().Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update Busybox status")
- return ctrl.Result{}, err
- }
-
- log.Info("Removing Finalizer for Busybox after successfully perform the operations")
- if ok := controllerutil.RemoveFinalizer(busybox, busyboxFinalizer); !ok {
- log.Error(err, "Failed to remove finalizer for Busybox")
- return ctrl.Result{Requeue: true}, nil
- }
-
- if err := r.Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to remove finalizer for Busybox")
- return ctrl.Result{}, err
- }
- }
- return ctrl.Result{}, nil
- }
-
- // Check if the deployment already exists, if not create a new one
- found := &appsv1.Deployment{}
- err = r.Get(ctx, types.NamespacedName{Name: busybox.Name, Namespace: busybox.Namespace}, found)
- if err != nil && apierrors.IsNotFound(err) {
- // Define a new deployment
- dep, err := r.deploymentForBusybox(busybox)
- if err != nil {
- log.Error(err, "Failed to define new Deployment resource for Busybox")
-
- // The following implementation will update the status
- meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox,
- Status: metav1.ConditionFalse, Reason: "Reconciling",
- Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", busybox.Name, err)})
-
- if err := r.Status().Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update Busybox status")
- return ctrl.Result{}, err
- }
-
- return ctrl.Result{}, err
- }
-
- log.Info("Creating a new Deployment",
- "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
- if err = r.Create(ctx, dep); err != nil {
- log.Error(err, "Failed to create new Deployment",
- "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
- return ctrl.Result{}, err
- }
-
- // Deployment created successfully
- // We will requeue the reconciliation so that we can ensure the state
- // and move forward for the next operations
- return ctrl.Result{RequeueAfter: time.Minute}, nil
- } else if err != nil {
- log.Error(err, "Failed to get Deployment")
- // Let's return the error for the reconciliation be re-trigged again
- return ctrl.Result{}, err
- }
-
- // The CRD API is defining that the Busybox type, have a BusyboxSpec.Size field
- // to set the quantity of Deployment instances is the desired state on the cluster.
- // Therefore, the following code will ensure the Deployment size is the same as defined
- // via the Size spec of the Custom Resource which we are reconciling.
- size := busybox.Spec.Size
- if *found.Spec.Replicas != size {
- found.Spec.Replicas = &size
- if err = r.Update(ctx, found); err != nil {
- log.Error(err, "Failed to update Deployment",
- "Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
-
- // Re-fetch the busybox Custom Resource before update the status
- // so that we have the latest state of the resource on the cluster and we will avoid
- // raise the issue "the object has been modified, please apply
- // your changes to the latest version and try again" which would re-trigger the reconciliation
- if err := r.Get(ctx, req.NamespacedName, busybox); err != nil {
- log.Error(err, "Failed to re-fetch busybox")
- return ctrl.Result{}, err
- }
-
- // The following implementation will update the status
- meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox,
- Status: metav1.ConditionFalse, Reason: "Resizing",
- Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", busybox.Name, err)})
-
- if err := r.Status().Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update Busybox status")
- return ctrl.Result{}, err
- }
-
- return ctrl.Result{}, err
- }
-
- // Now, that we update the size we want to requeue the reconciliation
- // so that we can ensure that we have the latest state of the resource before
- // update. Also, it will help ensure the desired state on the cluster
- return ctrl.Result{Requeue: true}, nil
- }
-
- // The following implementation will update the status
- meta.SetStatusCondition(&busybox.Status.Conditions, metav1.Condition{Type: typeAvailableBusybox,
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", busybox.Name, size)})
-
- if err := r.Status().Update(ctx, busybox); err != nil {
- log.Error(err, "Failed to update Busybox status")
- return ctrl.Result{}, err
- }
-
- return ctrl.Result{}, nil
-}
-
-// finalizeBusybox will perform the required operations before delete the CR.
-func (r *BusyboxReconciler) doFinalizerOperationsForBusybox(cr *examplecomv1alpha1.Busybox) {
- // TODO(user): Add the cleanup steps that the operator
- // needs to do before the CR can be deleted. Examples
- // of finalizers include performing backups and deleting
- // resources that are not owned by this CR, like a PVC.
-
- // Note: It is not recommended to use finalizers with the purpose of delete resources which are
- // created and managed in the reconciliation. These ones, such as the Deployment created on this reconcile,
- // are defined as depended of the custom resource. See that we use the method ctrl.SetControllerReference.
- // to set the ownerRef which means that the Deployment will be deleted by the Kubernetes API.
- // More info: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/
-
- // The following implementation will raise an event
- r.Recorder.Event(cr, "Warning", "Deleting",
- fmt.Sprintf("Custom Resource %s is being deleted from the namespace %s",
- cr.Name,
- cr.Namespace))
-}
-
-// deploymentForBusybox returns a Busybox Deployment object
-func (r *BusyboxReconciler) deploymentForBusybox(
- busybox *examplecomv1alpha1.Busybox) (*appsv1.Deployment, error) {
- ls := labelsForBusybox(busybox.Name)
- replicas := busybox.Spec.Size
-
- // Get the Operand image
- image, err := imageForBusybox()
- if err != nil {
- return nil, err
- }
-
- dep := &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{
- Name: busybox.Name,
- Namespace: busybox.Namespace,
- },
- Spec: appsv1.DeploymentSpec{
- Replicas: &replicas,
- Selector: &metav1.LabelSelector{
- MatchLabels: ls,
- },
- Template: corev1.PodTemplateSpec{
- ObjectMeta: metav1.ObjectMeta{
- Labels: ls,
- },
- Spec: corev1.PodSpec{
- // TODO(user): Uncomment the following code to configure the nodeAffinity expression
- // according to the platforms which are supported by your solution. It is considered
- // best practice to support multiple architectures. build your manager image using the
- // makefile target docker-buildx. Also, you can use docker manifest inspect
- // to check what are the platforms supported.
- // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
- //Affinity: &corev1.Affinity{
- // NodeAffinity: &corev1.NodeAffinity{
- // RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
- // NodeSelectorTerms: []corev1.NodeSelectorTerm{
- // {
- // MatchExpressions: []corev1.NodeSelectorRequirement{
- // {
- // Key: "kubernetes.io/arch",
- // Operator: "In",
- // Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
- // },
- // {
- // Key: "kubernetes.io/os",
- // Operator: "In",
- // Values: []string{"linux"},
- // },
- // },
- // },
- // },
- // },
- // },
- //},
- SecurityContext: &corev1.PodSecurityContext{
- RunAsNonRoot: &[]bool{true}[0],
- // IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
- // If you are looking for to produce solutions to be supported
- // on lower versions you must remove this option.
- SeccompProfile: &corev1.SeccompProfile{
- Type: corev1.SeccompProfileTypeRuntimeDefault,
- },
- },
- Containers: []corev1.Container{{
- Image: image,
- Name: "busybox",
- ImagePullPolicy: corev1.PullIfNotPresent,
- // Ensure restrictive context for the container
- // More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
- SecurityContext: &corev1.SecurityContext{
- RunAsNonRoot: &[]bool{true}[0],
- AllowPrivilegeEscalation: &[]bool{false}[0],
- Capabilities: &corev1.Capabilities{
- Drop: []corev1.Capability{
- "ALL",
- },
- },
- },
- }},
- },
- },
- },
- }
-
- // Set the ownerRef for the Deployment
- // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
- if err := ctrl.SetControllerReference(busybox, dep, r.Scheme); err != nil {
- return nil, err
- }
- return dep, nil
-}
-
-// labelsForBusybox returns the labels for selecting the resources
-// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
-func labelsForBusybox(name string) map[string]string {
- var imageTag string
- image, err := imageForBusybox()
- if err == nil {
- imageTag = strings.Split(image, ":")[1]
- }
- return map[string]string{"app.kubernetes.io/name": "Busybox",
- "app.kubernetes.io/instance": name,
- "app.kubernetes.io/version": imageTag,
- "app.kubernetes.io/part-of": "project-v4-multigroup",
- "app.kubernetes.io/created-by": "controller-manager",
- }
-}
-
-// imageForBusybox gets the Operand image which is managed by this controller
-// from the BUSYBOX_IMAGE environment variable defined in the config/manager/manager.yaml
-func imageForBusybox() (string, error) {
- var imageEnvVar = "BUSYBOX_IMAGE"
- image, found := os.LookupEnv(imageEnvVar)
- if !found {
- return "", fmt.Errorf("Unable to find %s environment variable with the image", imageEnvVar)
- }
- return image, nil
-}
-
-// SetupWithManager sets up the controller with the Manager.
-// Note that the Deployment will be also watched in order to ensure its
-// desirable state on the cluster
-func (r *BusyboxReconciler) SetupWithManager(mgr ctrl.Manager) error {
- return ctrl.NewControllerManagedBy(mgr).
- For(&examplecomv1alpha1.Busybox{}).
- Owns(&appsv1.Deployment{}).
- Complete(r)
-}
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
deleted file mode 100644
index 1d06b715f88..00000000000
--- a/testdata/project-v4-multigroup/internal/controller/example.com/busybox_controller_test.go
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package examplecom
-
-import (
- "context"
- "fmt"
- "os"
- "time"
-
- //nolint:golint
- . "github.com/onsi/ginkgo/v2"
- . "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/api/errors"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/types"
- "sigs.k8s.io/controller-runtime/pkg/reconcile"
-
- examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
-)
-
-var _ = Describe("Busybox controller", func() {
- Context("Busybox controller test", func() {
-
- const BusyboxName = "test-busybox"
-
- ctx := context.Background()
-
- namespace := &corev1.Namespace{
- ObjectMeta: metav1.ObjectMeta{
- Name: BusyboxName,
- Namespace: BusyboxName,
- },
- }
-
- typeNamespaceName := types.NamespacedName{
- Name: BusyboxName,
- Namespace: BusyboxName,
- }
- busybox := &examplecomv1alpha1.Busybox{}
-
- BeforeEach(func() {
- By("Creating the Namespace to perform the tests")
- err := k8sClient.Create(ctx, namespace)
- Expect(err).To(Not(HaveOccurred()))
-
- By("Setting the Image ENV VAR which stores the Operand image")
- err = os.Setenv("BUSYBOX_IMAGE", "example.com/image:test")
- Expect(err).To(Not(HaveOccurred()))
-
- By("creating the custom resource for the Kind Busybox")
- err = k8sClient.Get(ctx, typeNamespaceName, busybox)
- if err != nil && errors.IsNotFound(err) {
- // Let's mock our custom resource at the same way that we would
- // apply on the cluster the manifest under config/samples
- busybox := &examplecomv1alpha1.Busybox{
- ObjectMeta: metav1.ObjectMeta{
- Name: BusyboxName,
- Namespace: namespace.Name,
- },
- Spec: examplecomv1alpha1.BusyboxSpec{
- Size: 1,
- },
- }
-
- err = k8sClient.Create(ctx, busybox)
- Expect(err).To(Not(HaveOccurred()))
- }
- })
-
- AfterEach(func() {
- By("removing the custom resource for the Kind Busybox")
- found := &examplecomv1alpha1.Busybox{}
- err := k8sClient.Get(ctx, typeNamespaceName, found)
- Expect(err).To(Not(HaveOccurred()))
-
- Eventually(func() error {
- return k8sClient.Delete(context.TODO(), found)
- }, 2*time.Minute, time.Second).Should(Succeed())
-
- // TODO(user): Attention if you improve this code by adding other context test you MUST
- // be aware of the current delete namespace limitations.
- // More info: https://book.kubebuilder.io/reference/envtest.html#testing-considerations
- By("Deleting the Namespace to perform the tests")
- _ = k8sClient.Delete(ctx, namespace)
-
- By("Removing the Image ENV VAR which stores the Operand image")
- _ = os.Unsetenv("BUSYBOX_IMAGE")
- })
-
- It("should successfully reconcile a custom resource for Busybox", func() {
- By("Checking if the custom resource was successfully created")
- Eventually(func() error {
- found := &examplecomv1alpha1.Busybox{}
- return k8sClient.Get(ctx, typeNamespaceName, found)
- }, time.Minute, time.Second).Should(Succeed())
-
- By("Reconciling the custom resource created")
- busyboxReconciler := &BusyboxReconciler{
- Client: k8sClient,
- Scheme: k8sClient.Scheme(),
- }
-
- _, err := busyboxReconciler.Reconcile(ctx, reconcile.Request{
- NamespacedName: typeNamespaceName,
- })
- Expect(err).To(Not(HaveOccurred()))
-
- By("Checking if Deployment was successfully created in the reconciliation")
- Eventually(func() error {
- found := &appsv1.Deployment{}
- return k8sClient.Get(ctx, typeNamespaceName, found)
- }, time.Minute, time.Second).Should(Succeed())
-
- By("Checking the latest Status Condition added to the Busybox instance")
- Eventually(func() error {
- if busybox.Status.Conditions != nil &&
- len(busybox.Status.Conditions) != 0 {
- latestStatusCondition := busybox.Status.Conditions[len(busybox.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{
- Type: typeAvailableBusybox,
- Status: metav1.ConditionTrue,
- Reason: "Reconciling",
- Message: fmt.Sprintf(
- "Deployment for custom resource (%s) with %d replicas created successfully",
- busybox.Name,
- busybox.Spec.Size),
- }
- if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the Busybox instance is not as expected")
- }
- }
- return nil
- }, time.Minute, time.Second).Should(Succeed())
- })
- })
-})
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
deleted file mode 100644
index d9ab9250786..00000000000
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller.go
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package examplecom
-
-import (
- "context"
- "fmt"
- "os"
- "strings"
- "time"
-
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- apierrors "k8s.io/apimachinery/pkg/api/errors"
- "k8s.io/apimachinery/pkg/api/meta"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/runtime"
- "k8s.io/apimachinery/pkg/types"
- "k8s.io/client-go/tools/record"
- ctrl "sigs.k8s.io/controller-runtime"
- "sigs.k8s.io/controller-runtime/pkg/client"
- "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
- "sigs.k8s.io/controller-runtime/pkg/log"
-
- examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
-)
-
-const memcachedFinalizer = "example.com.testproject.org/finalizer"
-
-// Definitions to manage status conditions
-const (
- // typeAvailableMemcached represents the status of the Deployment reconciliation
- typeAvailableMemcached = "Available"
- // typeDegradedMemcached represents the status used when the custom resource is deleted and the finalizer operations are must to occur.
- typeDegradedMemcached = "Degraded"
-)
-
-// MemcachedReconciler reconciles a Memcached object
-type MemcachedReconciler struct {
- client.Client
- Scheme *runtime.Scheme
- Recorder record.EventRecorder
-}
-
-// The following markers are used to generate the rules permissions (RBAC) on config/rbac using controller-gen
-// when the command is executed.
-// To know more about markers see: https://book.kubebuilder.io/reference/markers.html
-
-//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds/status,verbs=get;update;patch
-//+kubebuilder:rbac:groups=example.com.testproject.org,resources=memcacheds/finalizers,verbs=update
-//+kubebuilder:rbac:groups=core,resources=events,verbs=create;patch
-//+kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
-//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch
-
-// Reconcile is part of the main kubernetes reconciliation loop which aims to
-// move the current state of the cluster closer to the desired state.
-// It is essential for the controller's reconciliation loop to be idempotent. By following the Operator
-// pattern you will create Controllers which provide a reconcile function
-// responsible for synchronizing resources until the desired state is reached on the cluster.
-// Breaking this recommendation goes against the design principles of controller-runtime.
-// and may lead to unforeseen consequences such as resources becoming stuck and requiring manual intervention.
-// 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.16.2/pkg/reconcile
-func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
- log := log.FromContext(ctx)
-
- // Fetch the Memcached instance
- // The purpose is check if the Custom Resource for the Kind Memcached
- // is applied on the cluster if not we return nil to stop the reconciliation
- memcached := &examplecomv1alpha1.Memcached{}
- err := r.Get(ctx, req.NamespacedName, memcached)
- if err != nil {
- if apierrors.IsNotFound(err) {
- // If the custom resource is not found then, it usually means that it was deleted or not created
- // In this way, we will stop the reconciliation
- log.Info("memcached resource not found. Ignoring since object must be deleted")
- return ctrl.Result{}, nil
- }
- // Error reading the object - requeue the request.
- log.Error(err, "Failed to get memcached")
- return ctrl.Result{}, err
- }
-
- // Let's just set the status as Unknown when no status are available
- if memcached.Status.Conditions == nil || len(memcached.Status.Conditions) == 0 {
- meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
- if err = r.Status().Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update Memcached status")
- return ctrl.Result{}, err
- }
-
- // Let's re-fetch the memcached Custom Resource after update the status
- // so that we have the latest state of the resource on the cluster and we will avoid
- // raise the issue "the object has been modified, please apply
- // your changes to the latest version and try again" which would re-trigger the reconciliation
- // if we try to update it again in the following operations
- if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
- log.Error(err, "Failed to re-fetch memcached")
- return ctrl.Result{}, err
- }
- }
-
- // Let's add a finalizer. Then, we can define some operations which should
- // occurs before the custom resource to be deleted.
- // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
- if !controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
- log.Info("Adding Finalizer for Memcached")
- if ok := controllerutil.AddFinalizer(memcached, memcachedFinalizer); !ok {
- log.Error(err, "Failed to add finalizer into the custom resource")
- return ctrl.Result{Requeue: true}, nil
- }
-
- if err = r.Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update custom resource to add finalizer")
- return ctrl.Result{}, err
- }
- }
-
- // Check if the Memcached instance is marked to be deleted, which is
- // indicated by the deletion timestamp being set.
- isMemcachedMarkedToBeDeleted := memcached.GetDeletionTimestamp() != nil
- if isMemcachedMarkedToBeDeleted {
- if controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
- log.Info("Performing Finalizer Operations for Memcached before delete CR")
-
- // Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
- meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
- Status: metav1.ConditionUnknown, Reason: "Finalizing",
- Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", memcached.Name)})
-
- if err := r.Status().Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update Memcached status")
- return ctrl.Result{}, err
- }
-
- // Perform all operations required before remove the finalizer and allow
- // the Kubernetes API to remove the custom resource.
- r.doFinalizerOperationsForMemcached(memcached)
-
- // TODO(user): If you add operations to the doFinalizerOperationsForMemcached method
- // then you need to ensure that all worked fine before deleting and updating the Downgrade status
- // otherwise, you should requeue here.
-
- // Re-fetch the memcached Custom Resource before update the status
- // so that we have the latest state of the resource on the cluster and we will avoid
- // raise the issue "the object has been modified, please apply
- // your changes to the latest version and try again" which would re-trigger the reconciliation
- if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
- log.Error(err, "Failed to re-fetch memcached")
- return ctrl.Result{}, err
- }
-
- meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
- Status: metav1.ConditionTrue, Reason: "Finalizing",
- Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", memcached.Name)})
-
- if err := r.Status().Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update Memcached status")
- return ctrl.Result{}, err
- }
-
- log.Info("Removing Finalizer for Memcached after successfully perform the operations")
- if ok := controllerutil.RemoveFinalizer(memcached, memcachedFinalizer); !ok {
- log.Error(err, "Failed to remove finalizer for Memcached")
- return ctrl.Result{Requeue: true}, nil
- }
-
- if err := r.Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to remove finalizer for Memcached")
- return ctrl.Result{}, err
- }
- }
- return ctrl.Result{}, nil
- }
-
- // Check if the deployment already exists, if not create a new one
- found := &appsv1.Deployment{}
- err = r.Get(ctx, types.NamespacedName{Name: memcached.Name, Namespace: memcached.Namespace}, found)
- if err != nil && apierrors.IsNotFound(err) {
- // Define a new deployment
- dep, err := r.deploymentForMemcached(memcached)
- if err != nil {
- log.Error(err, "Failed to define new Deployment resource for Memcached")
-
- // The following implementation will update the status
- meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
- Status: metav1.ConditionFalse, Reason: "Reconciling",
- Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", memcached.Name, err)})
-
- if err := r.Status().Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update Memcached status")
- return ctrl.Result{}, err
- }
-
- return ctrl.Result{}, err
- }
-
- log.Info("Creating a new Deployment",
- "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
- if err = r.Create(ctx, dep); err != nil {
- log.Error(err, "Failed to create new Deployment",
- "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
- return ctrl.Result{}, err
- }
-
- // Deployment created successfully
- // We will requeue the reconciliation so that we can ensure the state
- // and move forward for the next operations
- return ctrl.Result{RequeueAfter: time.Minute}, nil
- } else if err != nil {
- log.Error(err, "Failed to get Deployment")
- // Let's return the error for the reconciliation be re-trigged again
- return ctrl.Result{}, err
- }
-
- // The CRD API is defining that the Memcached type, have a MemcachedSpec.Size field
- // to set the quantity of Deployment instances is the desired state on the cluster.
- // Therefore, the following code will ensure the Deployment size is the same as defined
- // via the Size spec of the Custom Resource which we are reconciling.
- size := memcached.Spec.Size
- if *found.Spec.Replicas != size {
- found.Spec.Replicas = &size
- if err = r.Update(ctx, found); err != nil {
- log.Error(err, "Failed to update Deployment",
- "Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
-
- // Re-fetch the memcached Custom Resource before update the status
- // so that we have the latest state of the resource on the cluster and we will avoid
- // raise the issue "the object has been modified, please apply
- // your changes to the latest version and try again" which would re-trigger the reconciliation
- if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
- log.Error(err, "Failed to re-fetch memcached")
- return ctrl.Result{}, err
- }
-
- // The following implementation will update the status
- meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
- Status: metav1.ConditionFalse, Reason: "Resizing",
- Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", memcached.Name, err)})
-
- if err := r.Status().Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update Memcached status")
- return ctrl.Result{}, err
- }
-
- return ctrl.Result{}, err
- }
-
- // Now, that we update the size we want to requeue the reconciliation
- // so that we can ensure that we have the latest state of the resource before
- // update. Also, it will help ensure the desired state on the cluster
- return ctrl.Result{Requeue: true}, nil
- }
-
- // The following implementation will update the status
- meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
- Status: metav1.ConditionTrue, Reason: "Reconciling",
- Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, size)})
-
- if err := r.Status().Update(ctx, memcached); err != nil {
- log.Error(err, "Failed to update Memcached status")
- return ctrl.Result{}, err
- }
-
- return ctrl.Result{}, nil
-}
-
-// finalizeMemcached will perform the required operations before delete the CR.
-func (r *MemcachedReconciler) doFinalizerOperationsForMemcached(cr *examplecomv1alpha1.Memcached) {
- // TODO(user): Add the cleanup steps that the operator
- // needs to do before the CR can be deleted. Examples
- // of finalizers include performing backups and deleting
- // resources that are not owned by this CR, like a PVC.
-
- // Note: It is not recommended to use finalizers with the purpose of delete resources which are
- // created and managed in the reconciliation. These ones, such as the Deployment created on this reconcile,
- // are defined as depended of the custom resource. See that we use the method ctrl.SetControllerReference.
- // to set the ownerRef which means that the Deployment will be deleted by the Kubernetes API.
- // More info: https://kubernetes.io/docs/tasks/administer-cluster/use-cascading-deletion/
-
- // The following implementation will raise an event
- r.Recorder.Event(cr, "Warning", "Deleting",
- fmt.Sprintf("Custom Resource %s is being deleted from the namespace %s",
- cr.Name,
- cr.Namespace))
-}
-
-// deploymentForMemcached returns a Memcached Deployment object
-func (r *MemcachedReconciler) deploymentForMemcached(
- memcached *examplecomv1alpha1.Memcached) (*appsv1.Deployment, error) {
- ls := labelsForMemcached(memcached.Name)
- replicas := memcached.Spec.Size
-
- // Get the Operand image
- image, err := imageForMemcached()
- if err != nil {
- return nil, err
- }
-
- dep := &appsv1.Deployment{
- ObjectMeta: metav1.ObjectMeta{
- Name: memcached.Name,
- Namespace: memcached.Namespace,
- },
- Spec: appsv1.DeploymentSpec{
- Replicas: &replicas,
- Selector: &metav1.LabelSelector{
- MatchLabels: ls,
- },
- Template: corev1.PodTemplateSpec{
- ObjectMeta: metav1.ObjectMeta{
- Labels: ls,
- },
- Spec: corev1.PodSpec{
- // TODO(user): Uncomment the following code to configure the nodeAffinity expression
- // according to the platforms which are supported by your solution. It is considered
- // best practice to support multiple architectures. build your manager image using the
- // makefile target docker-buildx. Also, you can use docker manifest inspect
- // to check what are the platforms supported.
- // More info: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
- //Affinity: &corev1.Affinity{
- // NodeAffinity: &corev1.NodeAffinity{
- // RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{
- // NodeSelectorTerms: []corev1.NodeSelectorTerm{
- // {
- // MatchExpressions: []corev1.NodeSelectorRequirement{
- // {
- // Key: "kubernetes.io/arch",
- // Operator: "In",
- // Values: []string{"amd64", "arm64", "ppc64le", "s390x"},
- // },
- // {
- // Key: "kubernetes.io/os",
- // Operator: "In",
- // Values: []string{"linux"},
- // },
- // },
- // },
- // },
- // },
- // },
- //},
- SecurityContext: &corev1.PodSecurityContext{
- RunAsNonRoot: &[]bool{true}[0],
- // IMPORTANT: seccomProfile was introduced with Kubernetes 1.19
- // If you are looking for to produce solutions to be supported
- // on lower versions you must remove this option.
- SeccompProfile: &corev1.SeccompProfile{
- Type: corev1.SeccompProfileTypeRuntimeDefault,
- },
- },
- Containers: []corev1.Container{{
- Image: image,
- Name: "memcached",
- ImagePullPolicy: corev1.PullIfNotPresent,
- // Ensure restrictive context for the container
- // More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
- SecurityContext: &corev1.SecurityContext{
- RunAsNonRoot: &[]bool{true}[0],
- RunAsUser: &[]int64{1001}[0],
- AllowPrivilegeEscalation: &[]bool{false}[0],
- Capabilities: &corev1.Capabilities{
- Drop: []corev1.Capability{
- "ALL",
- },
- },
- },
- Ports: []corev1.ContainerPort{{
- ContainerPort: memcached.Spec.ContainerPort,
- Name: "memcached",
- }},
- Command: []string{"memcached", "-m=64", "-o", "modern", "-v"},
- }},
- },
- },
- },
- }
-
- // Set the ownerRef for the Deployment
- // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
- if err := ctrl.SetControllerReference(memcached, dep, r.Scheme); err != nil {
- return nil, err
- }
- return dep, nil
-}
-
-// labelsForMemcached returns the labels for selecting the resources
-// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
-func labelsForMemcached(name string) map[string]string {
- var imageTag string
- image, err := imageForMemcached()
- if err == nil {
- imageTag = strings.Split(image, ":")[1]
- }
- return map[string]string{"app.kubernetes.io/name": "Memcached",
- "app.kubernetes.io/instance": name,
- "app.kubernetes.io/version": imageTag,
- "app.kubernetes.io/part-of": "project-v4-multigroup",
- "app.kubernetes.io/created-by": "controller-manager",
- }
-}
-
-// imageForMemcached gets the Operand image which is managed by this controller
-// from the MEMCACHED_IMAGE environment variable defined in the config/manager/manager.yaml
-func imageForMemcached() (string, error) {
- var imageEnvVar = "MEMCACHED_IMAGE"
- image, found := os.LookupEnv(imageEnvVar)
- if !found {
- return "", fmt.Errorf("Unable to find %s environment variable with the image", imageEnvVar)
- }
- return image, nil
-}
-
-// SetupWithManager sets up the controller with the Manager.
-// Note that the Deployment will be also watched in order to ensure its
-// desirable state on the cluster
-func (r *MemcachedReconciler) SetupWithManager(mgr ctrl.Manager) error {
- return ctrl.NewControllerManagedBy(mgr).
- For(&examplecomv1alpha1.Memcached{}).
- Owns(&appsv1.Deployment{}).
- Complete(r)
-}
diff --git a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go b/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
deleted file mode 100644
index 920db20dd05..00000000000
--- a/testdata/project-v4-multigroup/internal/controller/example.com/memcached_controller_test.go
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
-Copyright 2023 The 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.
-*/
-
-package examplecom
-
-import (
- "context"
- "fmt"
- "os"
- "time"
-
- //nolint:golint
- . "github.com/onsi/ginkgo/v2"
- . "github.com/onsi/gomega"
- appsv1 "k8s.io/api/apps/v1"
- corev1 "k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/api/errors"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/types"
- "sigs.k8s.io/controller-runtime/pkg/reconcile"
-
- examplecomv1alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/example.com/v1alpha1"
-)
-
-var _ = Describe("Memcached controller", func() {
- Context("Memcached controller test", func() {
-
- const MemcachedName = "test-memcached"
-
- ctx := context.Background()
-
- namespace := &corev1.Namespace{
- ObjectMeta: metav1.ObjectMeta{
- Name: MemcachedName,
- Namespace: MemcachedName,
- },
- }
-
- typeNamespaceName := types.NamespacedName{
- Name: MemcachedName,
- Namespace: MemcachedName,
- }
- memcached := &examplecomv1alpha1.Memcached{}
-
- BeforeEach(func() {
- By("Creating the Namespace to perform the tests")
- err := k8sClient.Create(ctx, namespace)
- Expect(err).To(Not(HaveOccurred()))
-
- By("Setting the Image ENV VAR which stores the Operand image")
- err = os.Setenv("MEMCACHED_IMAGE", "example.com/image:test")
- Expect(err).To(Not(HaveOccurred()))
-
- By("creating the custom resource for the Kind Memcached")
- err = k8sClient.Get(ctx, typeNamespaceName, memcached)
- if err != nil && errors.IsNotFound(err) {
- // Let's mock our custom resource at the same way that we would
- // apply on the cluster the manifest under config/samples
- memcached := &examplecomv1alpha1.Memcached{
- ObjectMeta: metav1.ObjectMeta{
- Name: MemcachedName,
- Namespace: namespace.Name,
- },
- Spec: examplecomv1alpha1.MemcachedSpec{
- Size: 1,
- ContainerPort: 11211,
- },
- }
-
- err = k8sClient.Create(ctx, memcached)
- Expect(err).To(Not(HaveOccurred()))
- }
- })
-
- AfterEach(func() {
- By("removing the custom resource for the Kind Memcached")
- found := &examplecomv1alpha1.Memcached{}
- err := k8sClient.Get(ctx, typeNamespaceName, found)
- Expect(err).To(Not(HaveOccurred()))
-
- Eventually(func() error {
- return k8sClient.Delete(context.TODO(), found)
- }, 2*time.Minute, time.Second).Should(Succeed())
-
- // TODO(user): Attention if you improve this code by adding other context test you MUST
- // be aware of the current delete namespace limitations.
- // More info: https://book.kubebuilder.io/reference/envtest.html#testing-considerations
- By("Deleting the Namespace to perform the tests")
- _ = k8sClient.Delete(ctx, namespace)
-
- By("Removing the Image ENV VAR which stores the Operand image")
- _ = os.Unsetenv("MEMCACHED_IMAGE")
- })
-
- It("should successfully reconcile a custom resource for Memcached", func() {
- By("Checking if the custom resource was successfully created")
- Eventually(func() error {
- found := &examplecomv1alpha1.Memcached{}
- return k8sClient.Get(ctx, typeNamespaceName, found)
- }, time.Minute, time.Second).Should(Succeed())
-
- By("Reconciling the custom resource created")
- memcachedReconciler := &MemcachedReconciler{
- Client: k8sClient,
- Scheme: k8sClient.Scheme(),
- }
-
- _, err := memcachedReconciler.Reconcile(ctx, reconcile.Request{
- NamespacedName: typeNamespaceName,
- })
- Expect(err).To(Not(HaveOccurred()))
-
- By("Checking if Deployment was successfully created in the reconciliation")
- Eventually(func() error {
- found := &appsv1.Deployment{}
- return k8sClient.Get(ctx, typeNamespaceName, found)
- }, time.Minute, time.Second).Should(Succeed())
-
- By("Checking the latest Status Condition added to the Memcached instance")
- Eventually(func() error {
- if memcached.Status.Conditions != nil &&
- len(memcached.Status.Conditions) != 0 {
- latestStatusCondition := memcached.Status.Conditions[len(memcached.Status.Conditions)-1]
- expectedLatestStatusCondition := metav1.Condition{
- Type: typeAvailableMemcached,
- Status: metav1.ConditionTrue,
- Reason: "Reconciling",
- Message: fmt.Sprintf(
- "Deployment for custom resource (%s) with %d replicas created successfully",
- memcached.Name,
- memcached.Spec.Size),
- }
- if latestStatusCondition != expectedLatestStatusCondition {
- return fmt.Errorf("The latest status condition added to the Memcached instance is not as expected")
- }
- }
- return nil
- }, time.Minute, time.Second).Should(Succeed())
- })
- })
-})
From 54535fa08bb57b8a8731050c62066c486c8ad418 Mon Sep 17 00:00:00 2001
From: Majid Garoosi
Date: Mon, 25 Sep 2023 03:32:03 +0330
Subject: [PATCH 0307/1245] Fix yamllint warnings
---
Makefile | 2 +-
.../testdata/project/config/default/kustomization.yaml | 1 -
.../project/config/default/manager_auth_proxy_patch.yaml | 2 +-
.../testdata/project/config/manager/manager.yaml | 2 +-
.../testdata/project/config/prometheus/monitor.yaml | 1 -
.../testdata/project/config/default/kustomization.yaml | 2 --
.../project/config/default/manager_auth_proxy_patch.yaml | 2 +-
.../testdata/project/config/manager/manager.yaml | 2 +-
.../testdata/project/config/prometheus/monitor.yaml | 1 -
.../testdata/project/config/webhook/service.yaml | 1 -
.../internal/templates/config/kdefault/kustomization.go | 6 ++++--
.../templates/config/kdefault/manager_auth_proxy_patch.go | 2 +-
.../scaffolds/internal/templates/config/manager/config.go | 2 +-
.../internal/templates/config/prometheus/monitor.go | 3 +--
.../scaffolds/internal/templates/config/webhook/service.go | 3 +--
.../internal/templates/config/samples/crd_sample.go | 4 ++--
.../config/default/kustomization.yaml | 2 --
.../config/default/manager_auth_proxy_patch.yaml | 2 +-
.../config/manager/manager.yaml | 2 +-
.../config/prometheus/monitor.yaml | 1 -
.../config/webhook/service.yaml | 1 -
.../project-v4-multigroup/config/default/kustomization.yaml | 2 --
.../config/default/manager_auth_proxy_patch.yaml | 2 +-
testdata/project-v4-multigroup/config/manager/manager.yaml | 2 +-
.../project-v4-multigroup/config/prometheus/monitor.yaml | 1 -
testdata/project-v4-multigroup/config/webhook/service.yaml | 1 -
.../config/default/kustomization.yaml | 2 --
.../config/default/manager_auth_proxy_patch.yaml | 2 +-
.../config/manager/manager.yaml | 2 +-
.../config/prometheus/monitor.yaml | 1 -
.../config/samples/example.com_v1alpha1_busybox.yaml | 1 -
.../config/samples/example.com_v1alpha1_memcached.yaml | 3 ++-
.../config/webhook/service.yaml | 1 -
.../config/default/kustomization.yaml | 2 --
.../config/default/manager_auth_proxy_patch.yaml | 2 +-
.../project-v4-with-grafana/config/manager/manager.yaml | 2 +-
.../project-v4-with-grafana/config/prometheus/monitor.yaml | 1 -
testdata/project-v4/config/default/kustomization.yaml | 2 --
.../project-v4/config/default/manager_auth_proxy_patch.yaml | 2 +-
testdata/project-v4/config/manager/manager.yaml | 2 +-
testdata/project-v4/config/prometheus/monitor.yaml | 1 -
testdata/project-v4/config/webhook/service.yaml | 1 -
42 files changed, 27 insertions(+), 52 deletions(-)
diff --git a/Makefile b/Makefile
index b7103457b32..02c666f090f 100644
--- a/Makefile
+++ b/Makefile
@@ -91,7 +91,7 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
.PHONY: yamllint
yamllint:
- @docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/yamllint:latest testdata -d "{extends: relaxed, rules: {line-length: {max: 120}}}" --no-warnings
+ @docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/yamllint:latest testdata -d '{extends: relaxed, rules: {line-length: {max: 120}}, ignore: "/testdata/project-v2/\n/testdata/project-v3/"}'
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml
index ea608f256b7..742fea61830 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml
@@ -32,7 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
- manager_config_patch.yaml
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
index 18fa56fc4e2..61455256f0d 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
@@ -14,7 +14,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/manager/manager.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/manager/manager.yaml
index 6e09e6bf26e..7d415421f9f 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/manager/manager.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/manager/manager.yaml
@@ -74,7 +74,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/prometheus/monitor.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/prometheus/monitor.yaml
index b694c241666..d67c6106f87 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/prometheus/monitor.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
index f91d0c64e09..7f7f7cefb8c 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
@@ -32,8 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- manager_webhook_patch.yaml
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
index fa8cf799391..33d8c505930 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
@@ -30,7 +30,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/manager/manager.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/manager/manager.yaml
index a5989e41094..30ecf899e68 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/manager/manager.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/manager/manager.yaml
@@ -76,7 +76,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/prometheus/monitor.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/prometheus/monitor.yaml
index b694c241666..d67c6106f87 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/prometheus/monitor.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/webhook/service.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/webhook/service.yaml
index 91a279617fb..440ffc233ec 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/webhook/service.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/webhook/service.yaml
@@ -1,4 +1,3 @@
-
apiVersion: v1
kind: Service
metadata:
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
index 4919a8d8c9b..5d7d3cef608 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
@@ -78,10 +78,12 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-{{ if .ComponentConfig }}
+{{ if .ComponentConfig -}}
# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
-- manager_config_patch.yaml{{ end }}
+- manager_config_patch.yaml
+
+{{ end -}}
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go
index 520892bcfed..2e56ab28f14 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go
@@ -59,7 +59,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/manager/config.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/manager/config.go
index 0a471835d65..07a7e723cf9 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/manager/config.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/manager/config.go
@@ -125,7 +125,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/prometheus/monitor.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/prometheus/monitor.go
index 2a541cd5e6e..5408fff0f59 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/prometheus/monitor.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/prometheus/monitor.go
@@ -41,8 +41,7 @@ func (f *Monitor) SetTemplateDefaults() error {
return nil
}
-const serviceMonitorTemplate = `
-# Prometheus Monitor Service (Metrics)
+const serviceMonitorTemplate = `# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/webhook/service.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/webhook/service.go
index c9a292a1672..2c989778cd2 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/webhook/service.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/webhook/service.go
@@ -44,8 +44,7 @@ func (f *Service) SetTemplateDefaults() error {
return nil
}
-const serviceTemplate = `
-apiVersion: v1
+const serviceTemplate = `apiVersion: v1
kind: Service
metadata:
labels:
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 43b324aa8dc..a698f481f19 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
@@ -55,8 +55,8 @@ spec:
# TODO(user): edit the following value to ensure the number
# of Pods/Instances your Operand must have on cluster
size: 1
-{{ if not (isEmptyStr .Port) -}}
+{{ if not (isEmptyStr .Port) }}
# TODO(user): edit the following value to ensure the container has the right port to be initialized
containerPort: {{ .Port }}
-{{- end }}
+{{ end -}}
`
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
index c6c6da56c46..f54da704bcb 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
@@ -32,8 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
index 73fad2a6754..56f8e260736 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
@@ -14,7 +14,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml
index e6ec6dfc06d..6d105508039 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/manager/manager.yaml
@@ -76,7 +76,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml
index 3a4f61fb0e9..bf55d64ae3a 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml
index beb16dfbee1..a4d91d99775 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/webhook/service.yaml
@@ -1,4 +1,3 @@
-
apiVersion: v1
kind: Service
metadata:
diff --git a/testdata/project-v4-multigroup/config/default/kustomization.yaml b/testdata/project-v4-multigroup/config/default/kustomization.yaml
index baea92fc167..ac01d878b7b 100644
--- a/testdata/project-v4-multigroup/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/default/kustomization.yaml
@@ -32,8 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
diff --git a/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml
index 73fad2a6754..56f8e260736 100644
--- a/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml
@@ -14,7 +14,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/testdata/project-v4-multigroup/config/manager/manager.yaml b/testdata/project-v4-multigroup/config/manager/manager.yaml
index b9d340945db..81485d6e660 100644
--- a/testdata/project-v4-multigroup/config/manager/manager.yaml
+++ b/testdata/project-v4-multigroup/config/manager/manager.yaml
@@ -76,7 +76,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/testdata/project-v4-multigroup/config/prometheus/monitor.yaml b/testdata/project-v4-multigroup/config/prometheus/monitor.yaml
index d3ce1edfba0..b4435aa9aaa 100644
--- a/testdata/project-v4-multigroup/config/prometheus/monitor.yaml
+++ b/testdata/project-v4-multigroup/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/testdata/project-v4-multigroup/config/webhook/service.yaml b/testdata/project-v4-multigroup/config/webhook/service.yaml
index babe479751b..d7e1bcd5364 100644
--- a/testdata/project-v4-multigroup/config/webhook/service.yaml
+++ b/testdata/project-v4-multigroup/config/webhook/service.yaml
@@ -1,4 +1,3 @@
-
apiVersion: v1
kind: Service
metadata:
diff --git a/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
index faf2235f91f..8a4a369e4ea 100644
--- a/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
@@ -32,8 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
diff --git a/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
index 73fad2a6754..56f8e260736 100644
--- a/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
@@ -14,7 +14,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/testdata/project-v4-with-deploy-image/config/manager/manager.yaml b/testdata/project-v4-with-deploy-image/config/manager/manager.yaml
index 7394f7024e1..7fd6b1d46c1 100644
--- a/testdata/project-v4-with-deploy-image/config/manager/manager.yaml
+++ b/testdata/project-v4-with-deploy-image/config/manager/manager.yaml
@@ -81,7 +81,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/testdata/project-v4-with-deploy-image/config/prometheus/monitor.yaml b/testdata/project-v4-with-deploy-image/config/prometheus/monitor.yaml
index ff90e88a9d1..7f52a66ad36 100644
--- a/testdata/project-v4-with-deploy-image/config/prometheus/monitor.yaml
+++ b/testdata/project-v4-with-deploy-image/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_busybox.yaml b/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_busybox.yaml
index e5ba7642dd1..a25ecea315f 100644
--- a/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_busybox.yaml
+++ b/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_busybox.yaml
@@ -6,4 +6,3 @@ spec:
# TODO(user): edit the following value to ensure the number
# of Pods/Instances your Operand must have on cluster
size: 1
-
diff --git a/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_memcached.yaml b/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_memcached.yaml
index 153d1db36c8..dcb23eb8631 100644
--- a/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_memcached.yaml
+++ b/testdata/project-v4-with-deploy-image/config/samples/example.com_v1alpha1_memcached.yaml
@@ -6,5 +6,6 @@ spec:
# TODO(user): edit the following value to ensure the number
# of Pods/Instances your Operand must have on cluster
size: 1
-# TODO(user): edit the following value to ensure the container has the right port to be initialized
+
+ # TODO(user): edit the following value to ensure the container has the right port to be initialized
containerPort: 11211
diff --git a/testdata/project-v4-with-deploy-image/config/webhook/service.yaml b/testdata/project-v4-with-deploy-image/config/webhook/service.yaml
index daa2462577f..c1b1fa6be04 100644
--- a/testdata/project-v4-with-deploy-image/config/webhook/service.yaml
+++ b/testdata/project-v4-with-deploy-image/config/webhook/service.yaml
@@ -1,4 +1,3 @@
-
apiVersion: v1
kind: Service
metadata:
diff --git a/testdata/project-v4-with-grafana/config/default/kustomization.yaml b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
index d392dadc0fd..b1fa34c2523 100644
--- a/testdata/project-v4-with-grafana/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
@@ -32,8 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
diff --git a/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
index 73fad2a6754..56f8e260736 100644
--- a/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
@@ -14,7 +14,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/testdata/project-v4-with-grafana/config/manager/manager.yaml b/testdata/project-v4-with-grafana/config/manager/manager.yaml
index 220b518a748..f5c922126f2 100644
--- a/testdata/project-v4-with-grafana/config/manager/manager.yaml
+++ b/testdata/project-v4-with-grafana/config/manager/manager.yaml
@@ -76,7 +76,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/testdata/project-v4-with-grafana/config/prometheus/monitor.yaml b/testdata/project-v4-with-grafana/config/prometheus/monitor.yaml
index d71b79c554b..910e297d3bb 100644
--- a/testdata/project-v4-with-grafana/config/prometheus/monitor.yaml
+++ b/testdata/project-v4-with-grafana/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/testdata/project-v4/config/default/kustomization.yaml b/testdata/project-v4/config/default/kustomization.yaml
index 1516d32747f..2912e6f70bb 100644
--- a/testdata/project-v4/config/default/kustomization.yaml
+++ b/testdata/project-v4/config/default/kustomization.yaml
@@ -32,8 +32,6 @@ patchesStrategicMerge:
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
-
-
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
diff --git a/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml
index 73fad2a6754..56f8e260736 100644
--- a/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml
@@ -14,7 +14,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
args:
- "--secure-listen-address=0.0.0.0:8443"
diff --git a/testdata/project-v4/config/manager/manager.yaml b/testdata/project-v4/config/manager/manager.yaml
index 2ca24dcbbfc..0bec76d9a8e 100644
--- a/testdata/project-v4/config/manager/manager.yaml
+++ b/testdata/project-v4/config/manager/manager.yaml
@@ -76,7 +76,7 @@ spec:
allowPrivilegeEscalation: false
capabilities:
drop:
- - "ALL"
+ - "ALL"
livenessProbe:
httpGet:
path: /healthz
diff --git a/testdata/project-v4/config/prometheus/monitor.yaml b/testdata/project-v4/config/prometheus/monitor.yaml
index 854bbfb785f..905e15b285c 100644
--- a/testdata/project-v4/config/prometheus/monitor.yaml
+++ b/testdata/project-v4/config/prometheus/monitor.yaml
@@ -1,4 +1,3 @@
-
# Prometheus Monitor Service (Metrics)
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
diff --git a/testdata/project-v4/config/webhook/service.yaml b/testdata/project-v4/config/webhook/service.yaml
index ab079136af5..143e9b35ec3 100644
--- a/testdata/project-v4/config/webhook/service.yaml
+++ b/testdata/project-v4/config/webhook/service.yaml
@@ -1,4 +1,3 @@
-
apiVersion: v1
kind: Service
metadata:
From 975a944d8bbd0520eb0a710eca329a94ce227d47 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 25 Sep 2023 23:16:19 +0000
Subject: [PATCH 0308/1245] Bump github.com/spf13/afero from 1.9.5 to 1.10.0
Bumps [github.com/spf13/afero](https://github.com/spf13/afero) from 1.9.5 to 1.10.0.
- [Release notes](https://github.com/spf13/afero/releases)
- [Commits](https://github.com/spf13/afero/compare/v1.9.5...v1.10.0)
---
updated-dependencies:
- dependency-name: github.com/spf13/afero
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 6ba49262914..f6b6c233491 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,7 @@ require (
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
github.com/sirupsen/logrus v1.9.3
- github.com/spf13/afero v1.9.5
+ github.com/spf13/afero v1.10.0
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.13.0
diff --git a/go.sum b/go.sum
index 8ee4a7b93f3..5ee47e929c9 100644
--- a/go.sum
+++ b/go.sum
@@ -152,8 +152,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
-github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
+github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
+github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
From 781e7be54c71788ce95882c65bb3399a5c61f64a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 25 Sep 2023 23:16:25 +0000
Subject: [PATCH 0309/1245] Bump github.com/onsi/ginkgo/v2 from 2.12.0 to
2.12.1
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.12.0...v2.12.1)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 6ba49262914..747d9f12008 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.12.0
+ github.com/onsi/ginkgo/v2 v2.12.1
github.com/onsi/gomega v1.27.10
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.9.5
diff --git a/go.sum b/go.sum
index 8ee4a7b93f3..e9176576122 100644
--- a/go.sum
+++ b/go.sum
@@ -139,8 +139,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
-github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ=
+github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA=
+github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
From 96cc017dece317a1ff3d7c964dbdc7d15208edb1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 25 Sep 2023 23:50:26 +0000
Subject: [PATCH 0310/1245] :seedling: Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
---
.github/workflows/lint-sample.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/lint-sample.yml b/.github/workflows/lint-sample.yml
index 984b2512c3e..bb63612269b 100644
--- a/.github/workflows/lint-sample.yml
+++ b/.github/workflows/lint-sample.yml
@@ -13,7 +13,7 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
From a36cb8579149446e80b400dbfa6c504f56ea0e75 Mon Sep 17 00:00:00 2001
From: Majid Garoosi
Date: Tue, 26 Sep 2023 10:51:40 +0330
Subject: [PATCH 0311/1245] Update kubebuilder demo svg in README
---
README.md | 2 +-
docs/gif/kb-demo.v2.0.1.svg | 1 -
docs/gif/kb-demo.v3.11.1.svg | 1 +
scripts/demo/README.md | 4 +++-
scripts/demo/run.sh | 2 +-
5 files changed, 6 insertions(+), 4 deletions(-)
delete mode 100644 docs/gif/kb-demo.v2.0.1.svg
create mode 100644 docs/gif/kb-demo.v3.11.1.svg
diff --git a/README.md b/README.md
index 7ec6dd5ab8a..c1dc36984fa 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ Follow the [instructions](https://book.kubebuilder.io/quick-start.html#installat
See the [Getting Started](https://book.kubebuilder.io/quick-start.html) documentation.
-
+
Also, ensure that you check out the [Deploy Image](https://book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html)
Plugin. This plugin allows users to scaffold API/Controllers to deploy and manage an
diff --git a/docs/gif/kb-demo.v2.0.1.svg b/docs/gif/kb-demo.v2.0.1.svg
deleted file mode 100644
index a720163264c..00000000000
--- a/docs/gif/kb-demo.v2.0.1.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/docs/gif/kb-demo.v3.11.1.svg b/docs/gif/kb-demo.v3.11.1.svg
new file mode 100644
index 00000000000..4310d233cb3
--- /dev/null
+++ b/docs/gif/kb-demo.v3.11.1.svg
@@ -0,0 +1 @@
+$$#$#InitializeGomodules$gomodinitdemo.kubebuilder.iogo:creatingnewgo.mod:moduledemo.kubebuilder.io$#Let'sinitializetheproject$k$kub$kubebu$kubebuil$kubebuilder$kubebuilderinit--domaintutorial.kubebuilder.ioINFO[0000]Addingexternalplugin:sampleexternalpluginWritingkustomizemanifestsforyoutoedit...Writingscaffoldforyoutoedit...Getcontrollerruntime:$gogetsigs.k8s.io/controller-runtime@v0.15.0Updatedependencies:$gomodtidyNext:definearesourcewith:$kubebuildercreateapi##Examinescaffoldedfiles...$t$tre$tree..├──Dockerfile├──Makefile├──PROJECT├──README.md├──cmd│└──main.go├──config│├──default││├──kustomization.yaml││├──manager_auth_proxy_patch.yaml││└──manager_config_patch.yaml│├──manager││└──manager.yaml│├──prometheus││└──monitor.yaml│└──rbac│├──auth_proxy_client_clusterrole.yaml│├──auth_proxy_role.yaml│├──auth_proxy_role_binding.yaml│├──auth_proxy_service.yaml│├──kustomization.yaml│├──leader_election_role.yaml│├──leader_election_role_binding.yaml│├──role_binding.yaml│└──service_account.yaml├──go.mod├──go.sum└──hack└──boilerplate.go.txt7directories,24files#Createourcustomcronjobapi$kubebuildercreateapi--groupbatch--versionv1--kindCronJobCreateResource[y/n]yCreateController[y/n]api/v1/cronjob_types.goapi/v1/groupversion_info.gointernal/controller/suite_test.gointernal/controller/cronjob_controller.goRunningmake:$makegeneratemkdir-p/tmp/kb-demo/bintest-s/tmp/kb-demo/bin/controller-gen&&/tmp/kb-demo/bin/controller-gen--version|grep-qv0.12.0||\GOBIN=/tmp/kb-demo/bingoinstallsigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0/tmp/kb-demo/bin/controller-genobject:headerFile="hack/boilerplate.go.txt"paths="./..."Next:implementyournewAPIandgeneratethemanifests(e.g.CRDs,CRs)with:$makemanifests#Let'stakealookattheAPIandControllerfiles$tree./api./internal/controller./api└──v1├──cronjob_types.go├──groupversion_info.go└──zz_generated.deepcopy.go./internal/controller├──cronjob_controller.go└──suite_test.go0directories,2files#InstallCRDsinKubernetescluster$m$mak$makeinstall/tmp/kb-demo/bin/controller-genrbac:roleName=manager-rolecrdwebhookpaths="./..."output:crd:artifacts:config=config/crd/basestest-s/tmp/kb-demo/bin/kustomize||GOBIN=/tmp/kb-demo/binGO111MODULE=ongoinstallsigs.k8s.io/kustomize/kustomize/v5@v5.0.1/tmp/kb-demo/bin/kustomizebuildconfig/crd|kubectlapply-f-customresourcedefinition.apiextensions.k8s.io/cronjobs.batch.tutorial.kubebuilder.iocreated#Runcontrollermanagerlocally$makerungofmt./...govet./...gorun./cmd/main.go2023-09-26T10:41:42+03:30INFOcontroller-runtime.metricsMetricsserverisstartingtolisten{"addr":":8080"}2023-09-26T10:41:42+03:30INFOsetupstartingmanager2023-09-26T10:41:42+03:30INFOstartingserver{"path":"/metrics","kind":"metrics","addr":"[::]:8080"}2023-09-26T10:41:42+03:30INFOStartingserver{"kind":"healthprobe","addr":"[::]:8081"}2023-09-26T10:41:42+03:30INFOStartingEventSource{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob","source":"kindsource:*v1.CronJob"}2023-09-26T10:41:42+03:30INFOStartingController{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob"}2023-09-26T10:41:42+03:30INFOStartingworkers{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob","workercount":1}^C2023-09-26T10:41:47+03:30INFOStoppingandwaitingfornonleaderelectionrunnables2023-09-26T10:41:47+03:30INFOshuttingdownserver{"path":"/metrics","kind":"metrics","addr":"[::]:8080"}2023-09-26T10:41:47+03:30INFOStoppingandwaitingforleaderelectionrunnables2023-09-26T10:41:47+03:30INFOShutdownsignalreceived,waitingforallworkerstofinish{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob"}2023-09-26T10:41:47+03:30INFOAllworkersfinished{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob"}2023-09-26T10:41:47+03:30INFOStoppingandwaitingforcaches$#I$#Init$#Initia$#Initializ$#Initialize$#InitializeGo$#InitializeGomo$#InitializeGomodul$g$go$gomod$gomodi$gomodinit$gomodinitd$gomodinitdemo$gomodinitdemo.k$gomodinitdemo.kube$gomodinitdemo.kubebu$gomodinitdemo.kubebuild$gomodinitdemo.kubebuilder$#L$#Let'$#Let's$#Let'sini$#Let'siniti$#Let'sinitiali$#Let'sinitialize$#Let'sinitializeth$#Let'sinitializethe$#Let'sinitializethepro$#Let'sinitializetheproje$kubebuilderi$kubebuilderinit$kubebuilderinit-$kubebuilderinit--do$kubebuilderinit--doma$kubebuilderinit--domain$kubebuilderinit--domaintu$kubebuilderinit--domaintutor$kubebuilderinit--domaintutoria$kubebuilderinit--domaintutorial.k$kubebuilderinit--domaintutorial.kub$kubebuilderinit--domaintutorial.kubebu$kubebuilderinit--domaintutorial.kubebuil$kubebuilderinit--domaintutorial.kubebuilder$kubebuilderinit--domaintutorial.kubebuilder.i#E#Exam#Examin#Examines#Examinesca#Examinescaffo#Examinescaffold#Examinescaffolded#Examinescaffoldedfi#Examinescaffoldedfiles#Examinescaffoldedfiles..#C#Crea#Create#Createou#Createour#Createourcus#Createourcusto#Createourcustomc#Createourcustomcro#Createourcustomcronjo#Createourcustomcronjob$kubebuilderc$kubebuildercrea$kubebuildercreate$kubebuildercreateap$kubebuildercreateapi$kubebuildercreateapi--g$kubebuildercreateapi--gro$kubebuildercreateapi--group$kubebuildercreateapi--groupba$kubebuildercreateapi--groupbatch$kubebuildercreateapi--groupbatch-$kubebuildercreateapi--groupbatch--ve$kubebuildercreateapi--groupbatch--vers$kubebuildercreateapi--groupbatch--version$kubebuildercreateapi--groupbatch--versionv$kubebuildercreateapi--groupbatch--versionv1-$kubebuildercreateapi--groupbatch--versionv1--k$kubebuildercreateapi--groupbatch--versionv1--kind$kubebuildercreateapi--groupbatch--versionv1--kindC$kubebuildercreateapi--groupbatch--versionv1--kindCron$kubebuildercreateapi--groupbatch--versionv1--kindCronJo#L#Let'#Let's#Let'stak#Let'stake#Let'stakeal#Let'stakealoo#Let'stakealooka#Let'stakealookat#Let'stakealookatthe#Let'stakealookattheA#Let'stakealookattheAPI#Let'stakealookattheAPIan#Let'stakealookattheAPIandC#Let'stakealookattheAPIandCon#Let'stakealookattheAPIandContro#Let'stakealookattheAPIandControll#Let'stakealookattheAPIandController#Let'stakealookattheAPIandControllerfi$tree./a$tree./api$tree./api./$tree./api./int$tree./api./inter$tree./api./internal$tree./api./internal/c$tree./api./internal/cont$tree./api./internal/contro$tree./api./internal/controlle#I#Inst#Instal#InstallC#InstallCRD#InstallCRDsi#InstallCRDsin#InstallCRDsinKub#InstallCRDsinKuber#InstallCRDsinKubernet#InstallCRDsinKubernetes#InstallCRDsinKubernetescl#InstallCRDsinKubernetesclus$makei$makeins$makeinstal#R#Run#Runco#Runcontr#Runcontrol#Runcontroller#Runcontrollerm#Runcontrollermana#Runcontrollermanage#Runcontrollermanagerl#Runcontrollermanagerloc#Runcontrollermanagerlocall$maker^C2023-09-26T10:41:47+03:30INFOStoppingandwaitingforwebhooks2023-09-26T10:41:47+03:30INFOWaitcompleted,proceedingtoshutdownthemanager
\ No newline at end of file
diff --git a/scripts/demo/README.md b/scripts/demo/README.md
index cb33d6ddd7c..96f6fe6e4a1 100644
--- a/scripts/demo/README.md
+++ b/scripts/demo/README.md
@@ -20,6 +20,8 @@ cd /tmp/kb-demo
asciinema rec
/scripts/demo/run.sh
+# After each step, press to proceed to the next step
+
to terminate the script
to terminate the asciinema recording
to save the recording locally
@@ -27,5 +29,5 @@ asciinema rec
# Edit the recorded file by editing the controller-gen path
# Once you are happy with the recording, use svg-term program to generate the svg
-svg-term --cast= --out demo.svg --window
+svg-term --in= --out demo.svg --window
```
diff --git a/scripts/demo/run.sh b/scripts/demo/run.sh
index 50837e0a2ec..bbd8980d647 100755
--- a/scripts/demo/run.sh
+++ b/scripts/demo/run.sh
@@ -32,7 +32,7 @@ run "kubebuilder create api --group batch --version v1 --kind CronJob"
clear
desc "Let's take a look at the API and Controller files"
-run "tree ./api ./controllers"
+run "tree ./api ./internal/controller"
clear
desc "Install CRDs in Kubernetes cluster"
From 19a147aac7be18f8c865e9651828fc73c8375b0d Mon Sep 17 00:00:00 2001
From: Vaibhav Khurana
Date: Wed, 27 Sep 2023 18:26:04 +0530
Subject: [PATCH 0312/1245] Fix variable reference in docs
---
docs/book/src/reference/webhook-for-core-types.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/book/src/reference/webhook-for-core-types.md b/docs/book/src/reference/webhook-for-core-types.md
index 5e487c2d5ae..dd0258a44c9 100644
--- a/docs/book/src/reference/webhook-for-core-types.md
+++ b/docs/book/src/reference/webhook-for-core-types.md
@@ -60,7 +60,7 @@ If you need a client and/or decoder, just pass them in at struct construction ti
mgr.GetWebhookServer().Register("/mutate-v1-pod", &webhook.Admission{
Handler: &podAnnotator{
Client: mgr.GetClient(),
- Decoder: admission.NewDecoder(mgr.GetScheme()),
+ decoder: admission.NewDecoder(mgr.GetScheme()),
},
})
```
From 71e2a64c9a2e8f4426db34a87c515ffb237645ec Mon Sep 17 00:00:00 2001
From: Gabe Alford
Date: Wed, 27 Sep 2023 13:22:27 -0600
Subject: [PATCH 0313/1245] =?UTF-8?q?=F0=9F=90=9B=20(go/v4)=20golangci-lin?=
=?UTF-8?q?t=20version=20should=20be=20customizable?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Gabe Alford
---
.../testdata/project/Makefile | 3 ++-
.../src/cronjob-tutorial/testdata/project/Makefile | 3 ++-
pkg/plugins/common/kustomize/v2/scaffolds/webhook.go | 1 +
.../golang/v4/scaffolds/internal/templates/makefile.go | 3 ++-
.../project-v4-multigroup-with-deploy-image/Makefile | 3 ++-
.../config/crd/kustomization.yaml | 10 +++++-----
.../config/default/kustomization.yaml | 4 ++--
testdata/project-v4-multigroup/Makefile | 3 ++-
.../config/crd/kustomization.yaml | 2 +-
testdata/project-v4-with-deploy-image/Makefile | 3 ++-
testdata/project-v4-with-grafana/Makefile | 3 ++-
testdata/project-v4/Makefile | 3 ++-
12 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
index 6324e028c15..57e88d4a58f 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
log "github.com/sirupsen/logrus"
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 28ffa442cb7..21092188151 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -129,10 +129,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/testdata/project-v4-multigroup-with-deploy-image/Makefile b/testdata/project-v4-multigroup-with-deploy-image/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/Makefile
+++ b/testdata/project-v4-multigroup-with-deploy-image/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
index 9b25692779d..51fa2481343 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
@@ -17,11 +17,11 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_crew_captains.yaml
-#- path: patches/webhook_in_ship_frigates.yaml
-#- path: patches/webhook_in_ship_destroyers.yaml
-#- path: patches/webhook_in_ship_cruisers.yaml
-#- path: patches/webhook_in_sea-creatures_krakens.yaml
+- path: patches/webhook_in_crew_captains.yaml
+- path: patches/webhook_in_ship_frigates.yaml
+- path: patches/webhook_in_ship_destroyers.yaml
+- path: patches/webhook_in_ship_cruisers.yaml
+- path: patches/webhook_in_sea-creatures_krakens.yaml
#- path: patches/webhook_in_sea-creatures_leviathans.yaml
#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
#- path: patches/webhook_in_foo_bars.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
index f54da704bcb..8027afebe13 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
@@ -20,7 +20,7 @@ resources:
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- ../webhook
+- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
@@ -34,7 +34,7 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index 221a80a6b82..51fa2481343 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -22,7 +22,7 @@ patches:
- path: patches/webhook_in_ship_destroyers.yaml
- path: patches/webhook_in_ship_cruisers.yaml
- path: patches/webhook_in_sea-creatures_krakens.yaml
-- path: patches/webhook_in_sea-creatures_leviathans.yaml
+#- path: patches/webhook_in_sea-creatures_leviathans.yaml
#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
#- path: patches/webhook_in_foo_bars.yaml
#- path: patches/webhook_in_fiz_bars.yaml
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index fc949b7f470..a4a190c2605 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -65,10 +65,11 @@ test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
+GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
From 569f8263d2a5c391d87dc5bab5c0567b6209365b Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sat, 30 Sep 2023 23:36:34 +0100
Subject: [PATCH 0314/1245] fix testdata get outdated
---
pkg/plugins/common/kustomize/v2/scaffolds/webhook.go | 1 +
.../config/crd/kustomization.yaml | 10 +++++-----
.../config/default/kustomization.yaml | 4 ++--
.../config/crd/kustomization.yaml | 2 +-
4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
index 6324e028c15..57e88d4a58f 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
log "github.com/sirupsen/logrus"
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
index 9b25692779d..51fa2481343 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
@@ -17,11 +17,11 @@ resources:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
-#- path: patches/webhook_in_crew_captains.yaml
-#- path: patches/webhook_in_ship_frigates.yaml
-#- path: patches/webhook_in_ship_destroyers.yaml
-#- path: patches/webhook_in_ship_cruisers.yaml
-#- path: patches/webhook_in_sea-creatures_krakens.yaml
+- path: patches/webhook_in_crew_captains.yaml
+- path: patches/webhook_in_ship_frigates.yaml
+- path: patches/webhook_in_ship_destroyers.yaml
+- path: patches/webhook_in_ship_cruisers.yaml
+- path: patches/webhook_in_sea-creatures_krakens.yaml
#- path: patches/webhook_in_sea-creatures_leviathans.yaml
#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
#- path: patches/webhook_in_foo_bars.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
index f54da704bcb..8027afebe13 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
@@ -20,7 +20,7 @@ resources:
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- ../webhook
+- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
#- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
@@ -34,7 +34,7 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index 221a80a6b82..51fa2481343 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -22,7 +22,7 @@ patches:
- path: patches/webhook_in_ship_destroyers.yaml
- path: patches/webhook_in_ship_cruisers.yaml
- path: patches/webhook_in_sea-creatures_krakens.yaml
-- path: patches/webhook_in_sea-creatures_leviathans.yaml
+#- path: patches/webhook_in_sea-creatures_leviathans.yaml
#- path: patches/webhook_in_foo.policy_healthcheckpolicies.yaml
#- path: patches/webhook_in_foo_bars.yaml
#- path: patches/webhook_in_fiz_bars.yaml
From 274de811da9a9ce4b5a0d40b2d4f3b09d0eb1c7e Mon Sep 17 00:00:00 2001
From: Tomas Aschan <1550920+tomasaschan@users.noreply.github.com>
Date: Sun, 1 Oct 2023 00:43:10 +0200
Subject: [PATCH 0315/1245] :book: Clarify plugin executable locations (#3643)
Clarify plugin executable locations
This was confusing to me, so I tried to make it less confusing.
See https://kubernetes.slack.com/archives/CAR30FCJZ/p1695820734815719
---
docs/book/src/plugins/external-plugins.md | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/docs/book/src/plugins/external-plugins.md b/docs/book/src/plugins/external-plugins.md
index 0539fa1c19a..c8a545ae706 100644
--- a/docs/book/src/plugins/external-plugins.md
+++ b/docs/book/src/plugins/external-plugins.md
@@ -84,11 +84,17 @@ If you need to include logs or debug messages while developing your plugin, cons
This can be done by setting the `${EXTERNAL_PLUGINS_PATH}` environment variable, or by placing the plugin in a path that follows a `group-like name and version` scheme:
```sh
# for Linux
-$HOME/.config/kubebuilder/plugins/${name}/${version}
+$HOME/.config/kubebuilder/plugins/${name}/${version}/${name}
# for OSX
-~/Library/Application Support/kubebuilder/plugins/${name}/${version}
+~/Library/Application Support/kubebuilder/plugins/${name}/${version}/${name}
```
+As an example, if you're on Linux and you want to use `v2` of an external plugin called `foo.acme.io`, you'd place the executable in the folder `$HOME/.config/kubebuilder/plugins/foo.acme.io/v2/` with a file name that also matches the plugin name up to an (optional) file extension.
+In other words, passing the flag `--plugins=foo.acme.io/v2` to `kubebuilder` would find the plugin at either of these locations
+* `$HOME/.config/kubebuilder/plugins/foo.acme.io/v2/foo.acme.io`
+* `$HOME/.config/kubebuilder/plugins/foo.acme.io/v2/foo.acme.io.sh`
+* `$HOME/.config/kubebuilder/plugins/foo.acme.io/v2/foo.acme.io.py`
+* etc...
### Subcommands:
From c3bd4a8389c62c0e97bc177d14933d5c53a29aa5 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Sun, 1 Oct 2023 23:25:51 +0100
Subject: [PATCH 0316/1245] doc: add link from k8s to clarify admission
webhooks
---
docs/book/src/reference/admission-webhook.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/book/src/reference/admission-webhook.md b/docs/book/src/reference/admission-webhook.md
index e1ec2256fea..226106fc830 100644
--- a/docs/book/src/reference/admission-webhook.md
+++ b/docs/book/src/reference/admission-webhook.md
@@ -1,6 +1,6 @@
# Admission Webhooks
-Admission webhooks are HTTP callbacks that receive admission requests, process
+[Admission webhooks][k8s-doc-admission-webhooks] are HTTP callbacks that receive admission requests, process
them and return admission responses.
Kubernetes provides the following types of admission webhooks:
@@ -98,4 +98,6 @@ spec:
While certain edge scenarios might allow a mutating webhook to seamlessly modify the status, treading this path isn't a
universally acclaimed or recommended strategy. Entrusting the controller logic with status updates remains the
-most advocated approach.
\ No newline at end of file
+most advocated approach.
+
+k8s-doc-admission-webhooks: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks
\ No newline at end of file
From fc9d04bf50eeece9e28c89937ae1b05e78713a11 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 2 Oct 2023 23:20:34 +0000
Subject: [PATCH 0317/1245] Bump github.com/onsi/gomega from 1.27.10 to 1.28.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.10 to 1.28.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.27.10...v1.28.0)
---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 327c1ed21ce..3dd60ff6682 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.12.1
- github.com/onsi/gomega v1.27.10
+ github.com/onsi/gomega v1.28.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
github.com/spf13/cobra v1.7.0
diff --git a/go.sum b/go.sum
index 8f9d79c929a..d47e6304c65 100644
--- a/go.sum
+++ b/go.sum
@@ -141,8 +141,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA=
github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
-github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
+github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c=
+github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8=
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=
From fc064f59e6a6925c334316e0507cd29f8076a2c6 Mon Sep 17 00:00:00 2001
From: dashanji
Date: Tue, 10 Oct 2023 01:39:05 +0800
Subject: [PATCH 0318/1245] Add the unit test template for webhook and
controllers so that suite_test are no longer ignored.
Signed-off-by: dashanji
---
.../project/api/v1/cronjob_webhook_test.go | 47 ++++++
.../common/kustomize/v2/scaffolds/api.go | 1 +
.../templates/controllers/controller-test.go | 2 +
pkg/plugins/golang/v4/scaffolds/api.go | 1 +
.../templates/api/webhook_test_template.go | 120 ++++++++++++++
.../controllers/controller_test_template.go | 147 ++++++++++++++++++
pkg/plugins/golang/v4/scaffolds/webhook.go | 1 +
.../api/crew/v1/captain_webhook_test.go | 47 ++++++
.../api/ship/v1/destroyer_webhook_test.go | 33 ++++
.../api/ship/v1beta1/frigate_webhook_test.go | 33 ++++
.../api/ship/v2alpha1/cruiser_webhook_test.go | 39 +++++
.../api/v1/lakers_webhook_test.go | 47 ++++++
.../apps/deployment_controller_test.go | 32 ++++
.../crew/captain_controller_test.go | 84 ++++++++++
.../controller/fiz/bar_controller_test.go | 84 ++++++++++
.../healthcheckpolicy_controller_test.go | 84 ++++++++++
.../controller/foo/bar_controller_test.go | 84 ++++++++++
.../controller/lakers_controller_test.go | 84 ++++++++++
.../sea-creatures/kraken_controller_test.go | 84 ++++++++++
.../leviathan_controller_test.go | 84 ++++++++++
.../ship/cruiser_controller_test.go | 84 ++++++++++
.../ship/destroyer_controller_test.go | 84 ++++++++++
.../ship/frigate_controller_test.go | 84 ++++++++++
.../api/crew/v1/captain_webhook_test.go | 47 ++++++
.../api/ship/v1/destroyer_webhook_test.go | 33 ++++
.../api/ship/v1beta1/frigate_webhook_test.go | 33 ++++
.../api/ship/v2alpha1/cruiser_webhook_test.go | 39 +++++
.../api/v1/lakers_webhook_test.go | 47 ++++++
.../apps/deployment_controller_test.go | 32 ++++
.../crew/captain_controller_test.go | 84 ++++++++++
.../controller/fiz/bar_controller_test.go | 84 ++++++++++
.../healthcheckpolicy_controller_test.go | 84 ++++++++++
.../controller/foo/bar_controller_test.go | 84 ++++++++++
.../controller/lakers_controller_test.go | 84 ++++++++++
.../sea-creatures/kraken_controller_test.go | 84 ++++++++++
.../leviathan_controller_test.go | 84 ++++++++++
.../ship/cruiser_controller_test.go | 84 ++++++++++
.../ship/destroyer_controller_test.go | 84 ++++++++++
.../ship/frigate_controller_test.go | 84 ++++++++++
.../api/v1alpha1/memcached_webhook_test.go | 39 +++++
.../project-v4/api/v1/admiral_webhook_test.go | 33 ++++
.../project-v4/api/v1/captain_webhook_test.go | 47 ++++++
.../api/v1/firstmate_webhook_test.go | 33 ++++
.../controller/admiral_controller_test.go | 84 ++++++++++
.../controller/captain_controller_test.go | 84 ++++++++++
.../controller/firstmate_controller_test.go | 84 ++++++++++
.../controller/laker_controller_test.go | 32 ++++
47 files changed, 2897 insertions(+)
create mode 100644 docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook_test.go
create mode 100644 pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go
create mode 100644 pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_test_template.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller_test.go
create mode 100644 testdata/project-v4-multigroup/api/crew/v1/captain_webhook_test.go
create mode 100644 testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook_test.go
create mode 100644 testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook_test.go
create mode 100644 testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook_test.go
create mode 100644 testdata/project-v4-multigroup/api/v1/lakers_webhook_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/apps/deployment_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/crew/captain_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/fiz/bar_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/foo/bar_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/lakers_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller_test.go
create mode 100644 testdata/project-v4-multigroup/internal/controller/ship/frigate_controller_test.go
create mode 100644 testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook_test.go
create mode 100644 testdata/project-v4/api/v1/admiral_webhook_test.go
create mode 100644 testdata/project-v4/api/v1/captain_webhook_test.go
create mode 100644 testdata/project-v4/api/v1/firstmate_webhook_test.go
create mode 100644 testdata/project-v4/internal/controller/admiral_controller_test.go
create mode 100644 testdata/project-v4/internal/controller/captain_controller_test.go
create mode 100644 testdata/project-v4/internal/controller/firstmate_controller_test.go
create mode 100644 testdata/project-v4/internal/controller/laker_controller_test.go
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook_test.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook_test.go
new file mode 100644
index 00000000000..08eeb3f050a
--- /dev/null
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("CronJob Webhook", func() {
+
+ Context("When creating CronJob under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+ Context("When creating CronJob under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/api.go b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
index 2c69dc6f271..fce3f52a2d3 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
log "github.com/sirupsen/logrus"
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 4ecfb708032..a0e2ca1f45c 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
@@ -64,6 +64,8 @@ func (f *ControllerTest) SetTemplateDefaults() error {
f.PackageName = "controllers"
}
+ f.IfExistsAction = machinery.OverwriteFile
+
log.Println("creating import for %", f.Resource.Path)
f.TemplateBody = controllerTestTemplate
diff --git a/pkg/plugins/golang/v4/scaffolds/api.go b/pkg/plugins/golang/v4/scaffolds/api.go
index a2de5f578b1..7e65326d8e3 100755
--- a/pkg/plugins/golang/v4/scaffolds/api.go
+++ b/pkg/plugins/golang/v4/scaffolds/api.go
@@ -104,6 +104,7 @@ func (s *apiScaffolder) Scaffold() error {
if err := scaffold.Execute(
&controllers.SuiteTest{Force: s.force, K8SVersion: EnvtestK8SVersion},
&controllers.Controller{ControllerRuntimeVersion: ControllerRuntimeVersion, Force: s.force},
+ &controllers.ControllerTest{Force: s.force, DoAPI: doAPI},
); err != nil {
return fmt.Errorf("error scaffolding controller: %v", err)
}
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go
new file mode 100644
index 00000000000..9a23081f9e9
--- /dev/null
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/api/webhook_test_template.go
@@ -0,0 +1,120 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package api
+
+import (
+ "fmt"
+ "path/filepath"
+ "strings"
+
+ log "github.com/sirupsen/logrus"
+
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &WebhookTest{}
+
+// WebhookTest scaffolds the file that sets up the webhook unit tests
+type WebhookTest struct { // nolint:maligned
+ machinery.TemplateMixin
+ machinery.MultiGroupMixin
+ machinery.BoilerplateMixin
+ machinery.ResourceMixin
+
+ Force bool
+}
+
+// SetTemplateDefaults implements file.Template
+func (f *WebhookTest) SetTemplateDefaults() error {
+ if f.Path == "" {
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("api", "%[group]", "%[version]", "%[kind]_webhook_test.go")
+ } else {
+ f.Path = filepath.Join("api", "%[version]", "%[kind]_webhook_test.go")
+ }
+ }
+ f.Path = f.Resource.Replacer().Replace(f.Path)
+ log.Println(f.Path)
+
+ webhookTestTemplate := webhookTestTemplate
+ templates := make([]string, 0)
+ if f.Resource.HasDefaultingWebhook() {
+ templates = append(templates, defaultWebhookTestTemplate)
+ }
+ if f.Resource.HasValidationWebhook() {
+ templates = append(templates, validateWebhookTestTemplate)
+ }
+ if f.Resource.HasConversionWebhook() {
+ templates = append(templates, conversionWebhookTestTemplate)
+ }
+ f.TemplateBody = fmt.Sprintf(webhookTestTemplate, strings.Join(templates, "\n"))
+
+ if f.Force {
+ f.IfExistsAction = machinery.OverwriteFile
+ }
+
+ return nil
+}
+
+const webhookTestTemplate = `{{ .Boilerplate }}
+
+package {{ .Resource.Version }}
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("{{ .Resource.Kind }} Webhook", func() {
+ %s
+})
+`
+
+const conversionWebhookTestTemplate = `
+Context("When creating {{ .Resource.Kind }} under Conversion Webhook", func() {
+ It("Should get the converted version of {{ .Resource.Kind }}" , func() {
+
+ // TODO(user): Add your logic here
+
+ })
+})
+`
+
+const validateWebhookTestTemplate = `
+Context("When creating {{ .Resource.Kind }} under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+})
+`
+
+const defaultWebhookTestTemplate = `
+Context("When creating {{ .Resource.Kind }} under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+})
+`
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_test_template.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_test_template.go
new file mode 100644
index 00000000000..abe04cffb8b
--- /dev/null
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/controllers/controller_test_template.go
@@ -0,0 +1,147 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package controllers
+
+import (
+ "path/filepath"
+
+ log "github.com/sirupsen/logrus"
+
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &ControllerTest{}
+
+// ControllerTest scaffolds the file that sets up the controller unit tests
+// nolint:maligned
+type ControllerTest struct {
+ machinery.TemplateMixin
+ machinery.MultiGroupMixin
+ machinery.BoilerplateMixin
+ machinery.ResourceMixin
+
+ Force bool
+
+ DoAPI bool
+}
+
+// SetTemplateDefaults implements file.Template
+func (f *ControllerTest) SetTemplateDefaults() error {
+ if f.Path == "" {
+ if f.MultiGroup && f.Resource.Group != "" {
+ f.Path = filepath.Join("internal", "controller", "%[group]", "%[kind]_controller_test.go")
+ } else {
+ f.Path = filepath.Join("internal", "controller", "%[kind]_controller_test.go")
+ }
+ }
+
+ f.Path = f.Resource.Replacer().Replace(f.Path)
+ log.Println(f.Path)
+
+ f.TemplateBody = controllerTestTemplate
+
+ if f.Force {
+ f.IfExistsAction = machinery.OverwriteFile
+ }
+
+ return nil
+}
+
+const controllerTestTemplate = `{{ .Boilerplate }}
+
+{{if and .MultiGroup .Resource.Group }}
+package {{ .Resource.PackageName }}
+{{else}}
+package controller
+{{end}}
+
+import (
+ {{ if .DoAPI -}}
+ "context"
+ {{- end }}
+ . "github.com/onsi/ginkgo/v2"
+ {{ if .DoAPI -}}
+
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ {{ if not (isEmptyStr .Resource.Path) -}}
+ {{ .Resource.ImportAlias }} "{{ .Resource.Path }}"
+ {{- end }}
+ {{- end }}
+)
+
+var _ = Describe("{{ .Resource.Kind }} Controller", func() {
+ Context("When reconciling a resource", func() {
+ {{ if .DoAPI -}}
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ {{ lower .Resource.Kind }} := &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind {{ .Resource.Kind }}")
+ err := k8sClient.Get(ctx, typeNamespacedName, {{ lower .Resource.Kind }})
+ if err != nil && errors.IsNotFound(err) {
+ resource := &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance {{ .Resource.Kind }}")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ {{- end }}
+ It("should successfully reconcile the resource", func() {
+ {{ if .DoAPI -}}
+ By("Reconciling the created resource")
+ controllerReconciler := &{{ .Resource.Kind }}Reconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ {{- end }}
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
+`
diff --git a/pkg/plugins/golang/v4/scaffolds/webhook.go b/pkg/plugins/golang/v4/scaffolds/webhook.go
index 40c66e54440..ab853d8f555 100644
--- a/pkg/plugins/golang/v4/scaffolds/webhook.go
+++ b/pkg/plugins/golang/v4/scaffolds/webhook.go
@@ -87,6 +87,7 @@ func (s *webhookScaffolder) Scaffold() error {
if err := scaffold.Execute(
&api.Webhook{Force: s.force},
&templates.MainUpdater{WireWebhook: true},
+ &api.WebhookTest{Force: s.force},
); err != nil {
return err
}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook_test.go
new file mode 100644
index 00000000000..0ddd4945a7f
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/captain_webhook_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Captain Webhook", func() {
+
+ Context("When creating Captain under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+ Context("When creating Captain under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook_test.go
new file mode 100644
index 00000000000..382ab1f3e65
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/destroyer_webhook_test.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Destroyer Webhook", func() {
+
+ Context("When creating Destroyer under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook_test.go
new file mode 100644
index 00000000000..c45091191bc
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1/frigate_webhook_test.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1beta1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Frigate Webhook", func() {
+
+ Context("When creating Frigate under Conversion Webhook", func() {
+ It("Should get the converted version of Frigate", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook_test.go
new file mode 100644
index 00000000000..5d447de28e8
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/cruiser_webhook_test.go
@@ -0,0 +1,39 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v2alpha1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Cruiser Webhook", func() {
+
+ Context("When creating Cruiser under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook_test.go
new file mode 100644
index 00000000000..eba3ee2217f
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/lakers_webhook_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Lakers Webhook", func() {
+
+ Context("When creating Lakers under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+ Context("When creating Lakers under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller_test.go
new file mode 100644
index 00000000000..8a57d4f167e
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package apps
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Deployment Controller", func() {
+ Context("When reconciling a resource", func() {
+
+ It("should successfully reconcile the resource", func() {
+
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller_test.go
new file mode 100644
index 00000000000..d3855557a50
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package crew
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1"
+)
+
+var _ = Describe("Captain Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ captain := &crewv1.Captain{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Captain")
+ err := k8sClient.Get(ctx, typeNamespacedName, captain)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &crewv1.Captain{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &crewv1.Captain{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Captain")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &CaptainReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller_test.go
new file mode 100644
index 00000000000..cea9ff47faa
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package fiz
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/fiz/v1"
+)
+
+var _ = Describe("Bar Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ bar := &fizv1.Bar{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Bar")
+ err := k8sClient.Get(ctx, typeNamespacedName, bar)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &fizv1.Bar{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &fizv1.Bar{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Bar")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &BarReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller_test.go
new file mode 100644
index 00000000000..d6e68aab774
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foopolicy
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo.policy/v1"
+)
+
+var _ = Describe("HealthCheckPolicy Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ healthcheckpolicy := &foopolicyv1.HealthCheckPolicy{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind HealthCheckPolicy")
+ err := k8sClient.Get(ctx, typeNamespacedName, healthcheckpolicy)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &foopolicyv1.HealthCheckPolicy{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &foopolicyv1.HealthCheckPolicy{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance HealthCheckPolicy")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &HealthCheckPolicyReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller_test.go
new file mode 100644
index 00000000000..22d4b3354e5
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foo
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/foo/v1"
+)
+
+var _ = Describe("Bar Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ bar := &foov1.Bar{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Bar")
+ err := k8sClient.Get(ctx, typeNamespacedName, bar)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &foov1.Bar{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &foov1.Bar{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Bar")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &BarReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller_test.go
new file mode 100644
index 00000000000..4e890ab2ae0
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/v1"
+)
+
+var _ = Describe("Lakers Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ lakers := &testprojectorgv1.Lakers{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Lakers")
+ err := k8sClient.Get(ctx, typeNamespacedName, lakers)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &testprojectorgv1.Lakers{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &testprojectorgv1.Lakers{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Lakers")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &LakersReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller_test.go
new file mode 100644
index 00000000000..8c4d4624d50
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta1"
+)
+
+var _ = Describe("Kraken Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ kraken := &seacreaturesv1beta1.Kraken{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Kraken")
+ err := k8sClient.Get(ctx, typeNamespacedName, kraken)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &seacreaturesv1beta1.Kraken{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &seacreaturesv1beta1.Kraken{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Kraken")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &KrakenReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller_test.go
new file mode 100644
index 00000000000..4e42cbe1ef3
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/sea-creatures/v1beta2"
+)
+
+var _ = Describe("Leviathan Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ leviathan := &seacreaturesv1beta2.Leviathan{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Leviathan")
+ err := k8sClient.Get(ctx, typeNamespacedName, leviathan)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &seacreaturesv1beta2.Leviathan{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &seacreaturesv1beta2.Leviathan{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Leviathan")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &LeviathanReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller_test.go
new file mode 100644
index 00000000000..4cc95cd5588
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1"
+)
+
+var _ = Describe("Cruiser Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ cruiser := &shipv2alpha1.Cruiser{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Cruiser")
+ err := k8sClient.Get(ctx, typeNamespacedName, cruiser)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &shipv2alpha1.Cruiser{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &shipv2alpha1.Cruiser{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Cruiser")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &CruiserReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller_test.go
new file mode 100644
index 00000000000..fca9ec5c405
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1"
+)
+
+var _ = Describe("Destroyer Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ destroyer := &shipv1.Destroyer{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Destroyer")
+ err := k8sClient.Get(ctx, typeNamespacedName, destroyer)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &shipv1.Destroyer{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &shipv1.Destroyer{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Destroyer")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &DestroyerReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller_test.go
new file mode 100644
index 00000000000..b7c0e27a04a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1beta1"
+)
+
+var _ = Describe("Frigate Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ frigate := &shipv1beta1.Frigate{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Frigate")
+ err := k8sClient.Get(ctx, typeNamespacedName, frigate)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &shipv1beta1.Frigate{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &shipv1beta1.Frigate{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Frigate")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &FrigateReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/api/crew/v1/captain_webhook_test.go b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook_test.go
new file mode 100644
index 00000000000..0ddd4945a7f
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/crew/v1/captain_webhook_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Captain Webhook", func() {
+
+ Context("When creating Captain under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+ Context("When creating Captain under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook_test.go b/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook_test.go
new file mode 100644
index 00000000000..382ab1f3e65
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/ship/v1/destroyer_webhook_test.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Destroyer Webhook", func() {
+
+ Context("When creating Destroyer under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook_test.go b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook_test.go
new file mode 100644
index 00000000000..c45091191bc
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/ship/v1beta1/frigate_webhook_test.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1beta1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Frigate Webhook", func() {
+
+ Context("When creating Frigate under Conversion Webhook", func() {
+ It("Should get the converted version of Frigate", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook_test.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook_test.go
new file mode 100644
index 00000000000..5d447de28e8
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/cruiser_webhook_test.go
@@ -0,0 +1,39 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v2alpha1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Cruiser Webhook", func() {
+
+ Context("When creating Cruiser under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup/api/v1/lakers_webhook_test.go b/testdata/project-v4-multigroup/api/v1/lakers_webhook_test.go
new file mode 100644
index 00000000000..eba3ee2217f
--- /dev/null
+++ b/testdata/project-v4-multigroup/api/v1/lakers_webhook_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Lakers Webhook", func() {
+
+ Context("When creating Lakers under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+ Context("When creating Lakers under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller_test.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller_test.go
new file mode 100644
index 00000000000..8a57d4f167e
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package apps
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Deployment Controller", func() {
+ Context("When reconciling a resource", func() {
+
+ It("should successfully reconcile the resource", func() {
+
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller_test.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller_test.go
new file mode 100644
index 00000000000..f821052062c
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package crew
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/crew/v1"
+)
+
+var _ = Describe("Captain Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ captain := &crewv1.Captain{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Captain")
+ err := k8sClient.Get(ctx, typeNamespacedName, captain)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &crewv1.Captain{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &crewv1.Captain{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Captain")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &CaptainReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller_test.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller_test.go
new file mode 100644
index 00000000000..0368456ac27
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package fiz
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ fizv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/fiz/v1"
+)
+
+var _ = Describe("Bar Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ bar := &fizv1.Bar{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Bar")
+ err := k8sClient.Get(ctx, typeNamespacedName, bar)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &fizv1.Bar{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &fizv1.Bar{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Bar")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &BarReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller_test.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller_test.go
new file mode 100644
index 00000000000..e0900959f93
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foopolicy
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ foopolicyv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo.policy/v1"
+)
+
+var _ = Describe("HealthCheckPolicy Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ healthcheckpolicy := &foopolicyv1.HealthCheckPolicy{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind HealthCheckPolicy")
+ err := k8sClient.Get(ctx, typeNamespacedName, healthcheckpolicy)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &foopolicyv1.HealthCheckPolicy{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &foopolicyv1.HealthCheckPolicy{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance HealthCheckPolicy")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &HealthCheckPolicyReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller_test.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller_test.go
new file mode 100644
index 00000000000..4814c7591f1
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package foo
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ foov1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/foo/v1"
+)
+
+var _ = Describe("Bar Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ bar := &foov1.Bar{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Bar")
+ err := k8sClient.Get(ctx, typeNamespacedName, bar)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &foov1.Bar{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &foov1.Bar{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Bar")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &BarReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/lakers_controller_test.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller_test.go
new file mode 100644
index 00000000000..4903a2e2a73
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ testprojectorgv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/v1"
+)
+
+var _ = Describe("Lakers Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ lakers := &testprojectorgv1.Lakers{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Lakers")
+ err := k8sClient.Get(ctx, typeNamespacedName, lakers)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &testprojectorgv1.Lakers{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &testprojectorgv1.Lakers{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Lakers")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &LakersReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller_test.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller_test.go
new file mode 100644
index 00000000000..e23dbde2793
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ seacreaturesv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta1"
+)
+
+var _ = Describe("Kraken Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ kraken := &seacreaturesv1beta1.Kraken{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Kraken")
+ err := k8sClient.Get(ctx, typeNamespacedName, kraken)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &seacreaturesv1beta1.Kraken{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &seacreaturesv1beta1.Kraken{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Kraken")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &KrakenReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller_test.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller_test.go
new file mode 100644
index 00000000000..be2fb251c50
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package seacreatures
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ seacreaturesv1beta2 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/sea-creatures/v1beta2"
+)
+
+var _ = Describe("Leviathan Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ leviathan := &seacreaturesv1beta2.Leviathan{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Leviathan")
+ err := k8sClient.Get(ctx, typeNamespacedName, leviathan)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &seacreaturesv1beta2.Leviathan{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &seacreaturesv1beta2.Leviathan{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Leviathan")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &LeviathanReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller_test.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller_test.go
new file mode 100644
index 00000000000..151c0c410f2
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ shipv2alpha1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v2alpha1"
+)
+
+var _ = Describe("Cruiser Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ cruiser := &shipv2alpha1.Cruiser{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Cruiser")
+ err := k8sClient.Get(ctx, typeNamespacedName, cruiser)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &shipv2alpha1.Cruiser{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &shipv2alpha1.Cruiser{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Cruiser")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &CruiserReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller_test.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller_test.go
new file mode 100644
index 00000000000..4e428469b0e
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ shipv1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1"
+)
+
+var _ = Describe("Destroyer Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ destroyer := &shipv1.Destroyer{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Destroyer")
+ err := k8sClient.Get(ctx, typeNamespacedName, destroyer)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &shipv1.Destroyer{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &shipv1.Destroyer{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Destroyer")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &DestroyerReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller_test.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller_test.go
new file mode 100644
index 00000000000..fb360585c9a
--- /dev/null
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package ship
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ shipv1beta1 "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/api/ship/v1beta1"
+)
+
+var _ = Describe("Frigate Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ frigate := &shipv1beta1.Frigate{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Frigate")
+ err := k8sClient.Get(ctx, typeNamespacedName, frigate)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &shipv1beta1.Frigate{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &shipv1beta1.Frigate{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Frigate")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &FrigateReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook_test.go b/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook_test.go
new file mode 100644
index 00000000000..bde8c7b3db0
--- /dev/null
+++ b/testdata/project-v4-with-deploy-image/api/v1alpha1/memcached_webhook_test.go
@@ -0,0 +1,39 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1alpha1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Memcached Webhook", func() {
+
+ Context("When creating Memcached under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4/api/v1/admiral_webhook_test.go b/testdata/project-v4/api/v1/admiral_webhook_test.go
new file mode 100644
index 00000000000..890e78aa99c
--- /dev/null
+++ b/testdata/project-v4/api/v1/admiral_webhook_test.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Admiral Webhook", func() {
+
+ Context("When creating Admiral under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4/api/v1/captain_webhook_test.go b/testdata/project-v4/api/v1/captain_webhook_test.go
new file mode 100644
index 00000000000..0ddd4945a7f
--- /dev/null
+++ b/testdata/project-v4/api/v1/captain_webhook_test.go
@@ -0,0 +1,47 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Captain Webhook", func() {
+
+ Context("When creating Captain under Defaulting Webhook", func() {
+ It("Should fill in the default value if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+ Context("When creating Captain under Validating Webhook", func() {
+ It("Should deny if a required field is empty", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+
+ It("Should admit if all required fields are provided", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4/api/v1/firstmate_webhook_test.go b/testdata/project-v4/api/v1/firstmate_webhook_test.go
new file mode 100644
index 00000000000..6c9d3cc6d9d
--- /dev/null
+++ b/testdata/project-v4/api/v1/firstmate_webhook_test.go
@@ -0,0 +1,33 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package v1
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("FirstMate Webhook", func() {
+
+ Context("When creating FirstMate under Conversion Webhook", func() {
+ It("Should get the converted version of FirstMate", func() {
+
+ // TODO(user): Add your logic here
+
+ })
+ })
+
+})
diff --git a/testdata/project-v4/internal/controller/admiral_controller_test.go b/testdata/project-v4/internal/controller/admiral_controller_test.go
new file mode 100644
index 00000000000..82497845257
--- /dev/null
+++ b/testdata/project-v4/internal/controller/admiral_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4/api/v1"
+)
+
+var _ = Describe("Admiral Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ admiral := &crewv1.Admiral{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Admiral")
+ err := k8sClient.Get(ctx, typeNamespacedName, admiral)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &crewv1.Admiral{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &crewv1.Admiral{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Admiral")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &AdmiralReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4/internal/controller/captain_controller_test.go b/testdata/project-v4/internal/controller/captain_controller_test.go
new file mode 100644
index 00000000000..d8934de9c19
--- /dev/null
+++ b/testdata/project-v4/internal/controller/captain_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4/api/v1"
+)
+
+var _ = Describe("Captain Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ captain := &crewv1.Captain{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind Captain")
+ err := k8sClient.Get(ctx, typeNamespacedName, captain)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &crewv1.Captain{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &crewv1.Captain{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance Captain")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &CaptainReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4/internal/controller/firstmate_controller_test.go b/testdata/project-v4/internal/controller/firstmate_controller_test.go
new file mode 100644
index 00000000000..f151eee0317
--- /dev/null
+++ b/testdata/project-v4/internal/controller/firstmate_controller_test.go
@@ -0,0 +1,84 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ "context"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/types"
+ "sigs.k8s.io/controller-runtime/pkg/reconcile"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+
+ crewv1 "sigs.k8s.io/kubebuilder/testdata/project-v4/api/v1"
+)
+
+var _ = Describe("FirstMate Controller", func() {
+ Context("When reconciling a resource", func() {
+ const resourceName = "test-resource"
+
+ ctx := context.Background()
+
+ typeNamespacedName := types.NamespacedName{
+ Name: resourceName,
+ Namespace: "default", // TODO(user):Modify as needed
+ }
+ firstmate := &crewv1.FirstMate{}
+
+ BeforeEach(func() {
+ By("creating the custom resource for the Kind FirstMate")
+ err := k8sClient.Get(ctx, typeNamespacedName, firstmate)
+ if err != nil && errors.IsNotFound(err) {
+ resource := &crewv1.FirstMate{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: resourceName,
+ Namespace: "default",
+ },
+ // TODO(user): Specify other spec details if needed.
+ }
+ Expect(k8sClient.Create(ctx, resource)).To(Succeed())
+ }
+ })
+
+ AfterEach(func() {
+ // TODO(user): Cleanup logic after each test, like removing the resource instance.
+ resource := &crewv1.FirstMate{}
+ err := k8sClient.Get(ctx, typeNamespacedName, resource)
+ Expect(err).NotTo(HaveOccurred())
+
+ By("Cleanup the specific resource instance FirstMate")
+ Expect(k8sClient.Delete(ctx, resource)).To(Succeed())
+ })
+ It("should successfully reconcile the resource", func() {
+ By("Reconciling the created resource")
+ controllerReconciler := &FirstMateReconciler{
+ Client: k8sClient,
+ Scheme: k8sClient.Scheme(),
+ }
+
+ _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
+ NamespacedName: typeNamespacedName,
+ })
+ Expect(err).NotTo(HaveOccurred())
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
diff --git a/testdata/project-v4/internal/controller/laker_controller_test.go b/testdata/project-v4/internal/controller/laker_controller_test.go
new file mode 100644
index 00000000000..c4d2cdb1741
--- /dev/null
+++ b/testdata/project-v4/internal/controller/laker_controller_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package controller
+
+import (
+ . "github.com/onsi/ginkgo/v2"
+)
+
+var _ = Describe("Laker Controller", func() {
+ Context("When reconciling a resource", func() {
+
+ It("should successfully reconcile the resource", func() {
+
+ // TODO(user): Add more specific assertions depending on your controller's reconciliation logic.
+ // Example: If you expect a certain status condition after reconciliation, verify it here.
+ })
+ })
+})
From 27ccc43fd0168a144d31cd5ba05f47b43bddd929 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Tue, 10 Oct 2023 07:38:07 +0100
Subject: [PATCH 0319/1245] fix lint issue
---
pkg/plugins/common/kustomize/v2/scaffolds/api.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/api.go b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
index 2c69dc6f271..fce3f52a2d3 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
@@ -18,6 +18,7 @@ package scaffolds
import (
"fmt"
+
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
log "github.com/sirupsen/logrus"
From cae23249cd7e67da4d2b725b82308ce96efc6e56 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 10 Oct 2023 07:49:41 +0000
Subject: [PATCH 0320/1245] :seedling: Bump
kubernetes-sigs/kubebuilder-release-tools
Bumps [kubernetes-sigs/kubebuilder-release-tools](https://github.com/kubernetes-sigs/kubebuilder-release-tools) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder-release-tools/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder-release-tools/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder-release-tools/compare/v0.3.0...v0.4.0)
---
updated-dependencies:
- dependency-name: kubernetes-sigs/kubebuilder-release-tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.github/workflows/verify.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index 03bc6556d2f..f423bfa67f3 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -13,6 +13,6 @@ jobs:
steps:
- name: Verifier action
id: verifier
- uses: kubernetes-sigs/kubebuilder-release-tools@v0.3.0
+ uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
From 98d3b9e938c497dd20e7a067018b43def20ce817 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 10 Oct 2023 07:49:58 +0000
Subject: [PATCH 0321/1245] Bump golang.org/x/tools from 0.13.0 to 0.14.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.13.0...v0.14.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 8 ++++----
go.sum | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/go.mod b/go.mod
index 3dd60ff6682..0ff820b9cbe 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.13.0
- golang.org/x/tools v0.13.0
+ golang.org/x/tools v0.14.0
sigs.k8s.io/yaml v1.3.0
)
@@ -21,9 +21,9 @@ require (
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
- golang.org/x/mod v0.12.0 // indirect
- golang.org/x/net v0.15.0 // indirect
- golang.org/x/sys v0.12.0 // indirect
+ golang.org/x/mod v0.13.0 // indirect
+ golang.org/x/net v0.16.0 // indirect
+ golang.org/x/sys v0.13.0 // 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 d47e6304c65..bce99f4f9d3 100644
--- a/go.sum
+++ b/go.sum
@@ -219,8 +219,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
+golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -253,8 +253,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
-golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
+golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
+golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
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=
@@ -274,7 +274,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
+golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -311,8 +311,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
-golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
+golang.org/x/sys v0.13.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=
@@ -374,8 +374,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.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
-golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
+golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
+golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
From 93421e178b354ca4457c69b79e2db9f8193dd23e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 10 Oct 2023 07:50:31 +0000
Subject: [PATCH 0322/1245] Bump github.com/onsi/ginkgo/v2 from 2.12.1 to
2.13.0
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.12.1 to 2.13.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.12.1...v2.13.0)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 3dd60ff6682..11d26fee491 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.12.1
+ github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.28.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
diff --git a/go.sum b/go.sum
index d47e6304c65..3227d0cd26d 100644
--- a/go.sum
+++ b/go.sum
@@ -139,8 +139,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA=
-github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
+github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
+github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c=
github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
From a4ad443977769f9257b4bab3d70ff151acec1065 Mon Sep 17 00:00:00 2001
From: lowang-bh
Date: Mon, 4 Sep 2023 22:30:53 +0800
Subject: [PATCH 0323/1245] stop to generate crd webhooks patches and
cainjetions for any CRD/API and projects without webhooks
At present, we scaffold config/crd/patches, kustomizations, and CA injections for every CRD, irrespective of whether webhooks are enabled in the project or not. However, these configurations are only relevant and valid if the project has webhooks.
Consequently, for projects without webhooks, this leads to failures as documented in kubebuilder pull request #3585.
To address this, we are now introducing a test to ensure that projects without enabled webhooks function correctly and as anticipated.
Signed-off-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
Co-authored-by: lowang-bh
---
.../project/config/crd/kustomization.yaml | 6 +-
.../cainjection_in_projectconfigs.yaml | 7 --
.../patches/webhook_in_projectconfigs.yaml | 16 ---
.../project/config/crd/kustomization.yaml | 2 +
.../common/kustomize/v2/scaffolds/api.go | 6 +-
.../templates/config/crd/kustomization.go | 6 +-
.../templates/config/crd/kustomizeconfig.go | 12 +--
.../crd/patches/enablecainjection_patch.go | 5 +-
.../config/crd/patches/enablewebhook_patch.go | 15 +--
.../common/kustomize/v2/scaffolds/webhook.go | 37 ++++---
test/e2e/v4/generate_test.go | 101 +++++++++++-------
test/e2e/v4/plugin_cluster_test.go | 92 +++++++++-------
.../config/crd/kustomization.yaml | 2 +
.../crd/patches/cainjection_in_fiz_bars.yaml | 7 --
...ion_in_foo.policy_healthcheckpolicies.yaml | 7 --
.../crd/patches/cainjection_in_foo_bars.yaml | 7 --
.../cainjection_in_sea-creatures_krakens.yaml | 7 --
...injection_in_sea-creatures_leviathans.yaml | 7 --
.../crd/patches/webhook_in_fiz_bars.yaml | 16 ---
...ook_in_foo.policy_healthcheckpolicies.yaml | 16 ---
.../crd/patches/webhook_in_foo_bars.yaml | 16 ---
.../webhook_in_sea-creatures_krakens.yaml | 16 ---
.../webhook_in_sea-creatures_leviathans.yaml | 16 ---
.../config/crd/kustomization.yaml | 2 +
.../crd/patches/cainjection_in_fiz_bars.yaml | 7 --
...ion_in_foo.policy_healthcheckpolicies.yaml | 7 --
.../crd/patches/cainjection_in_foo_bars.yaml | 7 --
.../cainjection_in_sea-creatures_krakens.yaml | 7 --
...injection_in_sea-creatures_leviathans.yaml | 7 --
.../crd/patches/webhook_in_fiz_bars.yaml | 16 ---
...ook_in_foo.policy_healthcheckpolicies.yaml | 16 ---
.../crd/patches/webhook_in_foo_bars.yaml | 16 ---
.../webhook_in_sea-creatures_krakens.yaml | 16 ---
.../webhook_in_sea-creatures_leviathans.yaml | 16 ---
.../config/crd/kustomization.yaml | 2 +
.../crd/patches/cainjection_in_busyboxes.yaml | 7 --
.../crd/patches/webhook_in_busyboxes.yaml | 16 ---
.../project-v4/config/crd/kustomization.yaml | 2 +
38 files changed, 162 insertions(+), 404 deletions(-)
delete mode 100644 docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/cainjection_in_projectconfigs.yaml
delete mode 100644 docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/webhook_in_projectconfigs.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
delete mode 100644 testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_fiz_bars.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo_bars.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_fiz_bars.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo_bars.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
delete mode 100644 testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
delete mode 100644 testdata/project-v4-with-deploy-image/config/crd/patches/cainjection_in_busyboxes.yaml
delete mode 100644 testdata/project-v4-with-deploy-image/config/crd/patches/webhook_in_busyboxes.yaml
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml
index 97cb6432412..d2d782cd47f 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/crd/kustomization.yaml
@@ -16,6 +16,8 @@ patches:
#- path: patches/cainjection_in_projectconfigs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
-configurations:
-- kustomizeconfig.yaml
+
+#configurations:
+#- kustomizeconfig.yaml
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/cainjection_in_projectconfigs.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/cainjection_in_projectconfigs.yaml
deleted file mode 100644
index 4d4409aacb8..00000000000
--- a/docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/cainjection_in_projectconfigs.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: projectconfigs.config.tutorial.kubebuilder.io
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/webhook_in_projectconfigs.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/webhook_in_projectconfigs.yaml
deleted file mode 100644
index 4046e3632f9..00000000000
--- a/docs/book/src/component-config-tutorial/testdata/project/config/crd/patches/webhook_in_projectconfigs.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: projectconfigs.config.tutorial.kubebuilder.io
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml
index 726852ee68b..ac447c6e61d 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml
@@ -16,6 +16,8 @@ patches:
- path: patches/cainjection_in_cronjobs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
+
configurations:
- kustomizeconfig.yaml
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/api.go b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
index fce3f52a2d3..21afda71155 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/api.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/api.go
@@ -20,15 +20,13 @@ import (
"fmt"
pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd"
log "github.com/sirupsen/logrus"
-
"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/plugins"
- "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd"
- "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/rbac"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/samples"
)
@@ -78,8 +76,6 @@ func (s *apiScaffolder) Scaffold() error {
&samples.CRDSample{Force: s.force},
&rbac.CRDEditorRole{},
&rbac.CRDViewerRole{},
- &patches.EnableWebhookPatch{},
- &patches.EnableCAInjectionPatch{},
&crd.Kustomization{},
&crd.KustomizeConfig{},
); err != nil {
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
index 87137778bf8..e87b40b4178 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomization.go
@@ -125,7 +125,9 @@ patches:
# patches here are for enabling the CA injection for each CRD
%s
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
-configurations:
-- kustomizeconfig.yaml
+
+#configurations:
+#- kustomizeconfig.yaml
`
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomizeconfig.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomizeconfig.go
index 428bfde8b88..c5006e2b10a 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomizeconfig.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/kustomizeconfig.go
@@ -48,23 +48,15 @@ nameReference:
version: v1
fieldSpecs:
- kind: CustomResourceDefinition
- version: {{ .Resource.API.CRDVersion }}
+ version: v1
group: apiextensions.k8s.io
- {{- if ne .Resource.API.CRDVersion "v1" }}
- path: spec/conversion/webhookClientConfig/service/name
- {{- else }}
path: spec/conversion/webhook/clientConfig/service/name
- {{- end }}
namespace:
- kind: CustomResourceDefinition
- version: {{ .Resource.API.CRDVersion }}
+ version: v1
group: apiextensions.k8s.io
- {{- if ne .Resource.API.CRDVersion "v1" }}
- path: spec/conversion/webhookClientConfig/service/namespace
- {{- else }}
path: spec/conversion/webhook/clientConfig/service/namespace
- {{- end }}
create: false
varReference:
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go
index 1847743ecde..5a734dc6af3 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablecainjection_patch.go
@@ -49,10 +49,7 @@ func (f *EnableCAInjectionPatch) SetTemplateDefaults() error {
//nolint:lll
const enableCAInjectionPatchTemplate = `# The following patch adds a directive for certmanager to inject CA into the CRD
-{{- if ne .Resource.API.CRDVersion "v1" }}
-# CRD conversion requires k8s 1.13 or later.
-{{- end }}
-apiVersion: apiextensions.k8s.io/{{ .Resource.API.CRDVersion }}
+apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablewebhook_patch.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablewebhook_patch.go
index 35662c647ae..19d8df5d8cb 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablewebhook_patch.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches/enablewebhook_patch.go
@@ -49,23 +49,13 @@ func (f *EnableWebhookPatch) SetTemplateDefaults() error {
}
const enableWebhookPatchTemplate = `# The following patch enables a conversion webhook for the CRD
-{{- if ne .Resource.API.CRDVersion "v1" }}
-# CRD conversion requires k8s 1.13 or later.
-{{- end }}
-apiVersion: apiextensions.k8s.io/{{ .Resource.API.CRDVersion }}
+apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: {{ .Resource.Plural }}.{{ .Resource.QualifiedGroup }}
spec:
conversion:
strategy: Webhook
- {{- if ne .Resource.API.CRDVersion "v1" }}
- webhookClientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- {{- else }}
webhook:
clientConfig:
service:
@@ -73,6 +63,5 @@ spec:
name: webhook-service
path: /convert
conversionReviewVersions:
- - {{ .Resource.API.CRDVersion }}
- {{- end }}
+ - v1
`
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
index 57e88d4a58f..5ca84c75f4c 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
@@ -19,9 +19,9 @@ package scaffolds
import (
"fmt"
- pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
-
log "github.com/sirupsen/logrus"
+ pluginutil "sigs.k8s.io/kubebuilder/v3/pkg/plugin/util"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/crd/patches"
"sigs.k8s.io/kubebuilder/v3/pkg/config"
"sigs.k8s.io/kubebuilder/v3/pkg/machinery"
@@ -71,6 +71,21 @@ func (s *webhookScaffolder) Scaffold() error {
return fmt.Errorf("error updating resource: %w", err)
}
+ if err := scaffold.Execute(
+ &kdefault.WebhookCAInjectionPatch{},
+ &kdefault.ManagerWebhookPatch{},
+ &webhook.Kustomization{Force: s.force},
+ &webhook.KustomizeConfig{},
+ &webhook.Service{},
+ &certmanager.Certificate{},
+ &certmanager.Kustomization{},
+ &certmanager.KustomizeConfig{},
+ &patches.EnableWebhookPatch{},
+ &patches.EnableCAInjectionPatch{},
+ ); err != nil {
+ return fmt.Errorf("error scaffolding kustomize webhook manifests: %v", err)
+ }
+
kustomizeFilePath := "config/default/kustomization.yaml"
err := pluginutil.UncommentCode(kustomizeFilePath, "#- ../webhook", `#`)
if err != nil {
@@ -100,17 +115,13 @@ func (s *webhookScaffolder) Scaffold() error {
}
}
- if err := scaffold.Execute(
- &kdefault.WebhookCAInjectionPatch{},
- &kdefault.ManagerWebhookPatch{},
- &webhook.Kustomization{Force: s.force},
- &webhook.KustomizeConfig{},
- &webhook.Service{},
- &certmanager.Certificate{},
- &certmanager.Kustomization{},
- &certmanager.KustomizeConfig{},
- ); err != nil {
- return fmt.Errorf("error scaffolding kustomize webhook manifests: %v", err)
+ err = pluginutil.UncommentCode(crdKustomizationsFilePath, "#configurations:\n#- kustomizeconfig.yaml", `#`)
+ if err != nil {
+ hasWebHookUncommented, err := pluginutil.HasFragment(crdKustomizationsFilePath, "- kustomizeconfig.yaml")
+ if !hasWebHookUncommented || err != nil {
+ log.Errorf("Unable to find the target(s) #configurations:\n#- kustomizeconfig.yaml to uncomment in the file "+
+ "%s.", crdKustomizationsFilePath)
+ }
}
return nil
diff --git a/test/e2e/v4/generate_test.go b/test/e2e/v4/generate_test.go
index e7056394d34..7fc05c73f95 100644
--- a/test/e2e/v4/generate_test.go
+++ b/test/e2e/v4/generate_test.go
@@ -33,20 +33,63 @@ import (
"sigs.k8s.io/kubebuilder/v3/test/e2e/utils"
)
-// GenerateV4 implements a go/v4(-alpha) plugin project defined by a TestContext.
+// GenerateV4 implements a go/v4 plugin project defined by a TestContext.
func GenerateV4(kbc *utils.TestContext) {
- var err error
+ initingTheProject(kbc)
+ creatingAPI(kbc)
- By("initializing a project")
- err = kbc.Init(
- "--plugins", "go/v4",
- "--project-version", "3",
- "--domain", kbc.Domain,
+ By("scaffolding mutating and validating webhooks")
+ err := kbc.CreateWebhook(
+ "--group", kbc.Group,
+ "--version", kbc.Version,
+ "--kind", kbc.Kind,
+ "--defaulting",
+ "--programmatic-validation",
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ By("implementing the mutating and validating webhooks")
+ err = pluginutil.ImplementWebhooks(filepath.Join(
+ kbc.Dir, "api", kbc.Version,
+ fmt.Sprintf("%s_webhook.go", strings.ToLower(kbc.Kind))))
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ ExpectWithOffset(1, pluginutil.UncommentCode(
+ filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
+ "#- ../certmanager", "#")).To(Succeed())
+ ExpectWithOffset(1, pluginutil.UncommentCode(
+ filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
+ "#- ../prometheus", "#")).To(Succeed())
+ ExpectWithOffset(1, pluginutil.UncommentCode(
+ filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
+ "#- webhookcainjection_patch.yaml", "#")).To(Succeed())
+ ExpectWithOffset(1, pluginutil.UncommentCode(filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
+ certManagerTarget, "#")).To(Succeed())
+
+ if kbc.IsRestricted {
+ By("uncomment kustomize files to ensure that pods are restricted")
+ uncommentPodStandards(kbc)
+ }
+}
+
+// GenerateV4WithoutWebhooks implements a go/v4 plugin with APIs and enable Prometheus and CertManager
+func GenerateV4WithoutWebhooks(kbc *utils.TestContext) {
+ initingTheProject(kbc)
+ creatingAPI(kbc)
+
+ ExpectWithOffset(1, pluginutil.UncommentCode(
+ filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
+ "#- ../prometheus", "#")).To(Succeed())
+
+ if kbc.IsRestricted {
+ By("uncomment kustomize files to ensure that pods are restricted")
+ uncommentPodStandards(kbc)
+ }
+}
+
+func creatingAPI(kbc *utils.TestContext) {
By("creating API definition")
- err = kbc.CreateAPI(
+ err := kbc.CreateAPI(
"--group", kbc.Group,
"--version", kbc.Version,
"--kind", kbc.Kind,
@@ -65,34 +108,20 @@ func GenerateV4(kbc *utils.TestContext) {
` // +optional
Count int `+"`"+`json:"count,omitempty"`+"`"+`
`)).Should(Succeed())
+}
- By("scaffolding mutating and validating webhooks")
- err = kbc.CreateWebhook(
- "--group", kbc.Group,
- "--version", kbc.Version,
- "--kind", kbc.Kind,
- "--defaulting",
- "--programmatic-validation",
+func initingTheProject(kbc *utils.TestContext) {
+ By("initializing a project")
+ err := kbc.Init(
+ "--plugins", "go/v4",
+ "--project-version", "3",
+ "--domain", kbc.Domain,
)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
+}
- By("implementing the mutating and validating webhooks")
- err = pluginutil.ImplementWebhooks(filepath.Join(
- kbc.Dir, "api", kbc.Version,
- fmt.Sprintf("%s_webhook.go", strings.ToLower(kbc.Kind))))
- ExpectWithOffset(1, err).NotTo(HaveOccurred())
-
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- "#- ../certmanager", "#")).To(Succeed())
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- "#- ../prometheus", "#")).To(Succeed())
- ExpectWithOffset(1, pluginutil.UncommentCode(
- filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- "#- webhookcainjection_patch.yaml", "#")).To(Succeed())
- ExpectWithOffset(1, pluginutil.UncommentCode(filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- `#replacements:
+//nolint:lll
+const certManagerTarget = `#replacements:
# - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs
# kind: Certificate
# group: cert-manager.io
@@ -188,13 +217,7 @@ Count int `+"`"+`json:"count,omitempty"`+"`"+`
# options:
# delimiter: '.'
# index: 1
-# create: true`, "#")).To(Succeed())
-
- if kbc.IsRestricted {
- By("uncomment kustomize files to ensure that pods are restricted")
- uncommentPodStandards(kbc)
- }
-}
+# create: true`
func uncommentPodStandards(kbc *utils.TestContext) {
configManager := filepath.Join(kbc.Dir, "config", "manager", "manager.yaml")
diff --git a/test/e2e/v4/plugin_cluster_test.go b/test/e2e/v4/plugin_cluster_test.go
index 65679b6a9b7..5ea6d33ceaf 100644
--- a/test/e2e/v4/plugin_cluster_test.go
+++ b/test/e2e/v4/plugin_cluster_test.go
@@ -85,13 +85,19 @@ var _ = Describe("kubebuilder", func() {
" with restricted pods", func() {
kbc.IsRestricted = true
GenerateV4(kbc)
- Run(kbc)
+ Run(kbc, true)
+ })
+ It("should generate a runnable project without webhooks"+
+ " with restricted pods", func() {
+ kbc.IsRestricted = true
+ GenerateV4WithoutWebhooks(kbc)
+ Run(kbc, false)
})
})
})
// Run runs a set of e2e tests for a scaffolded project defined by a TestContext.
-func Run(kbc *utils.TestContext) {
+func Run(kbc *utils.TestContext, hasWebhook bool) {
var controllerPodName string
var err error
@@ -181,13 +187,15 @@ func Run(kbc *utils.TestContext) {
_ = curlMetrics(kbc)
- By("validating that cert-manager has provisioned the certificate Secret")
- EventuallyWithOffset(1, func() error {
- _, err := kbc.Kubectl.Get(
- true,
- "secrets", "webhook-server-cert")
- return err
- }, time.Minute, time.Second).Should(Succeed())
+ if hasWebhook {
+ By("validating that cert-manager has provisioned the certificate Secret")
+ EventuallyWithOffset(1, func() error {
+ _, err := kbc.Kubectl.Get(
+ true,
+ "secrets", "webhook-server-cert")
+ return err
+ }, time.Minute, time.Second).Should(Succeed())
+ }
By("validating that the Prometheus manager has provisioned the Service")
EventuallyWithOffset(1, func() error {
@@ -203,29 +211,31 @@ func Run(kbc *utils.TestContext) {
"ServiceMonitor")
ExpectWithOffset(1, err).NotTo(HaveOccurred())
- By("validating that the mutating|validating webhooks have the CA injected")
- verifyCAInjection := func() error {
- mwhOutput, err := kbc.Kubectl.Get(
- false,
- "mutatingwebhookconfigurations.admissionregistration.k8s.io",
- fmt.Sprintf("e2e-%s-mutating-webhook-configuration", kbc.TestSuffix),
- "-o", "go-template={{ range .webhooks }}{{ .clientConfig.caBundle }}{{ end }}")
- ExpectWithOffset(2, err).NotTo(HaveOccurred())
- // check that ca should be long enough, because there may be a place holder "\n"
- ExpectWithOffset(2, len(mwhOutput)).To(BeNumerically(">", 10))
-
- vwhOutput, err := kbc.Kubectl.Get(
- false,
- "validatingwebhookconfigurations.admissionregistration.k8s.io",
- fmt.Sprintf("e2e-%s-validating-webhook-configuration", kbc.TestSuffix),
- "-o", "go-template={{ range .webhooks }}{{ .clientConfig.caBundle }}{{ end }}")
- ExpectWithOffset(2, err).NotTo(HaveOccurred())
- // check that ca should be long enough, because there may be a place holder "\n"
- ExpectWithOffset(2, len(vwhOutput)).To(BeNumerically(">", 10))
-
- return nil
+ if hasWebhook {
+ By("validating that the mutating|validating webhooks have the CA injected")
+ verifyCAInjection := func() error {
+ mwhOutput, err := kbc.Kubectl.Get(
+ false,
+ "mutatingwebhookconfigurations.admissionregistration.k8s.io",
+ fmt.Sprintf("e2e-%s-mutating-webhook-configuration", kbc.TestSuffix),
+ "-o", "go-template={{ range .webhooks }}{{ .clientConfig.caBundle }}{{ end }}")
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ // check that ca should be long enough, because there may be a place holder "\n"
+ ExpectWithOffset(2, len(mwhOutput)).To(BeNumerically(">", 10))
+
+ vwhOutput, err := kbc.Kubectl.Get(
+ false,
+ "validatingwebhookconfigurations.admissionregistration.k8s.io",
+ fmt.Sprintf("e2e-%s-validating-webhook-configuration", kbc.TestSuffix),
+ "-o", "go-template={{ range .webhooks }}{{ .clientConfig.caBundle }}{{ end }}")
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ // check that ca should be long enough, because there may be a place holder "\n"
+ ExpectWithOffset(2, len(vwhOutput)).To(BeNumerically(">", 10))
+
+ return nil
+ }
+ EventuallyWithOffset(1, verifyCAInjection, time.Minute, time.Second).Should(Succeed())
}
- EventuallyWithOffset(1, verifyCAInjection, time.Minute, time.Second).Should(Succeed())
By("creating an instance of the CR")
// currently controller-runtime doesn't provide a readiness probe, we retry a few times
@@ -274,15 +284,17 @@ func Run(kbc *utils.TestContext) {
strings.ToLower(kbc.Kind),
)))
- By("validating that mutating and validating webhooks are working fine")
- cnt, err := kbc.Kubectl.Get(
- true,
- "-f", sampleFile,
- "-o", "go-template={{ .spec.count }}")
- ExpectWithOffset(1, err).NotTo(HaveOccurred())
- count, err := strconv.Atoi(cnt)
- ExpectWithOffset(1, err).NotTo(HaveOccurred())
- ExpectWithOffset(1, count).To(BeNumerically("==", 5))
+ if hasWebhook {
+ By("validating that mutating and validating webhooks are working fine")
+ cnt, err := kbc.Kubectl.Get(
+ true,
+ "-f", sampleFile,
+ "-o", "go-template={{ .spec.count }}")
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ count, err := strconv.Atoi(cnt)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+ ExpectWithOffset(1, count).To(BeNumerically("==", 5))
+ }
}
// curlMetrics curl's the /metrics endpoint, returning all logs once a 200 status is returned.
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
index 51fa2481343..240fd658848 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/crd/kustomization.yaml
@@ -43,6 +43,8 @@ patches:
#- path: patches/cainjection_in__lakers.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
+
configurations:
- kustomizeconfig.yaml
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml
deleted file mode 100644
index c6dfcc97f3e..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_fiz_bars.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: bars.fiz.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
deleted file mode 100644
index 887d632ef1d..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: healthcheckpolicies.foo.policy.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml
deleted file mode 100644
index 7cacea184db..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_foo_bars.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: bars.foo.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
deleted file mode 100644
index b16c174c7b2..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: krakens.sea-creatures.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
deleted file mode 100644
index 35b16d717cb..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: leviathans.sea-creatures.testproject.org
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml
deleted file mode 100644
index eddaa868fdd..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_fiz_bars.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: bars.fiz.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
deleted file mode 100644
index 61381b747c5..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: healthcheckpolicies.foo.policy.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml
deleted file mode 100644
index 831ad1b8164..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_foo_bars.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: bars.foo.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
deleted file mode 100644
index 620a12faaee..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: krakens.sea-creatures.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
deleted file mode 100644
index 5cb95bc7b38..00000000000
--- a/testdata/project-v4-multigroup-with-deploy-image/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: leviathans.sea-creatures.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup/config/crd/kustomization.yaml b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
index 51fa2481343..240fd658848 100644
--- a/testdata/project-v4-multigroup/config/crd/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/crd/kustomization.yaml
@@ -43,6 +43,8 @@ patches:
#- path: patches/cainjection_in__lakers.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
+
configurations:
- kustomizeconfig.yaml
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_fiz_bars.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_fiz_bars.yaml
deleted file mode 100644
index c6dfcc97f3e..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_fiz_bars.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: bars.fiz.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
deleted file mode 100644
index 887d632ef1d..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo.policy_healthcheckpolicies.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: healthcheckpolicies.foo.policy.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo_bars.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo_bars.yaml
deleted file mode 100644
index 7cacea184db..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_foo_bars.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: bars.foo.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
deleted file mode 100644
index b16c174c7b2..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_krakens.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: krakens.sea-creatures.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml b/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
deleted file mode 100644
index 35b16d717cb..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/cainjection_in_sea-creatures_leviathans.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: leviathans.sea-creatures.testproject.org
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_fiz_bars.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_fiz_bars.yaml
deleted file mode 100644
index eddaa868fdd..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_fiz_bars.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: bars.fiz.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
deleted file mode 100644
index 61381b747c5..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo.policy_healthcheckpolicies.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: healthcheckpolicies.foo.policy.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo_bars.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo_bars.yaml
deleted file mode 100644
index 831ad1b8164..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_foo_bars.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: bars.foo.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_krakens.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
deleted file mode 100644
index 620a12faaee..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_krakens.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: krakens.sea-creatures.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml b/testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
deleted file mode 100644
index 5cb95bc7b38..00000000000
--- a/testdata/project-v4-multigroup/config/crd/patches/webhook_in_sea-creatures_leviathans.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: leviathans.sea-creatures.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml b/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
index c4fb2e1b99b..db66694c2bb 100644
--- a/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
+++ b/testdata/project-v4-with-deploy-image/config/crd/kustomization.yaml
@@ -19,6 +19,8 @@ patches:
#- path: patches/cainjection_in_busyboxes.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
+
configurations:
- kustomizeconfig.yaml
diff --git a/testdata/project-v4-with-deploy-image/config/crd/patches/cainjection_in_busyboxes.yaml b/testdata/project-v4-with-deploy-image/config/crd/patches/cainjection_in_busyboxes.yaml
deleted file mode 100644
index 5f6b0384f48..00000000000
--- a/testdata/project-v4-with-deploy-image/config/crd/patches/cainjection_in_busyboxes.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-# The following patch adds a directive for certmanager to inject CA into the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- annotations:
- cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
- name: busyboxes.example.com.testproject.org
diff --git a/testdata/project-v4-with-deploy-image/config/crd/patches/webhook_in_busyboxes.yaml b/testdata/project-v4-with-deploy-image/config/crd/patches/webhook_in_busyboxes.yaml
deleted file mode 100644
index 5dbd9da7176..00000000000
--- a/testdata/project-v4-with-deploy-image/config/crd/patches/webhook_in_busyboxes.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-# The following patch enables a conversion webhook for the CRD
-apiVersion: apiextensions.k8s.io/v1
-kind: CustomResourceDefinition
-metadata:
- name: busyboxes.example.com.testproject.org
-spec:
- conversion:
- strategy: Webhook
- webhook:
- clientConfig:
- service:
- namespace: system
- name: webhook-service
- path: /convert
- conversionReviewVersions:
- - v1
diff --git a/testdata/project-v4/config/crd/kustomization.yaml b/testdata/project-v4/config/crd/kustomization.yaml
index 55a06bf09c9..22270f5b729 100644
--- a/testdata/project-v4/config/crd/kustomization.yaml
+++ b/testdata/project-v4/config/crd/kustomization.yaml
@@ -22,6 +22,8 @@ patches:
#- path: patches/cainjection_in_admirales.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
+# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
+
configurations:
- kustomizeconfig.yaml
From 900bf5d6537ed6595b8290b1aff6f6ae6f499c1b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 11 Oct 2023 23:19:21 +0000
Subject: [PATCH 0324/1245] Bump golang.org/x/net from 0.16.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.16.0...v0.17.0)
---
updated-dependencies:
- dependency-name: golang.org/x/net
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 83589735981..06f58666d78 100644
--- a/go.mod
+++ b/go.mod
@@ -22,7 +22,7 @@ require (
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
golang.org/x/mod v0.13.0 // indirect
- golang.org/x/net v0.16.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // 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 cbfb4bb6ba8..e6e9bd5ad5d 100644
--- a/go.sum
+++ b/go.sum
@@ -253,8 +253,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
-golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
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=
From b97244ddfdf50cd2d38426c8712c6bc7014411f6 Mon Sep 17 00:00:00 2001
From: Burak Sekili
Date: Thu, 19 Oct 2023 19:35:16 +0300
Subject: [PATCH 0325/1245] Update emptymain.go
Update deprecated manager Options fields
---
.../cronjob-tutorial/testdata/emptymain.go | 49 +++++++++++++------
1 file changed, 34 insertions(+), 15 deletions(-)
diff --git a/docs/book/src/cronjob-tutorial/testdata/emptymain.go b/docs/book/src/cronjob-tutorial/testdata/emptymain.go
index c0acd4fe633..7d59715efc0 100644
--- a/docs/book/src/cronjob-tutorial/testdata/emptymain.go
+++ b/docs/book/src/cronjob-tutorial/testdata/emptymain.go
@@ -28,9 +28,10 @@ package main
import (
"flag"
- "fmt"
"os"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
+
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
@@ -43,6 +44,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
+ "sigs.k8s.io/controller-runtime/pkg/metrics/server"
// +kubebuilder:scaffold:imports
)
@@ -104,9 +106,11 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
- Scheme: scheme,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Scheme: scheme,
+ Metrics: server.Options{
+ BindAddress: metricsAddr,
+ },
+ WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}),
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "80807133.tutorial.kubebuilder.io",
@@ -121,10 +125,16 @@ func main() {
*/
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
- Scheme: scheme,
- Namespace: namespace,
- MetricsBindAddress: metricsAddr,
- Port: 9443,
+ Scheme: scheme,
+ Cache: cache.Options{
+ DefaultNamespaces: map[string]cache.Config{
+ namespace: {},
+ },
+ },
+ Metrics: server.Options{
+ BindAddress: metricsAddr,
+ },
+ WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}),
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "80807133.tutorial.kubebuilder.io",
@@ -136,24 +146,33 @@ func main() {
`ClusterRole` and `ClusterRoleBinding` to `Role` and `RoleBinding` respectively.
For further information see the Kubernetes documentation about Using [RBAC Authorization](https://kubernetes.io/docs/reference/access-authn-authz/rbac/).
- Also, it is possible to use the [`MultiNamespacedCacheBuilder`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/cache#MultiNamespacedCacheBuilder)
- to watch a specific set of namespaces:
+ Also, it is possible to use the [`DefaultNamespaces`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/cache#Options)
+ from `cache.Options{}` to cache objects in a specific set of namespaces:
*/
var namespaces []string // List of Namespaces
+ defaultNamespaces := make(map[string]cache.Config)
+
+ for _, ns := range namespaces {
+ defaultNamespaces[ns] = cache.Config{}
+ }
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
- Scheme: scheme,
- NewCache: cache.MultiNamespacedCacheBuilder(namespaces),
- MetricsBindAddress: fmt.Sprintf("%s:%d", metricsHost, metricsPort),
- Port: 9443,
+ Scheme: scheme,
+ Cache: cache.Options{
+ DefaultNamespaces: defaultNamespaces,
+ },
+ Metrics: server.Options{
+ BindAddress: metricsAddr,
+ },
+ WebhookServer: webhook.NewServer(webhook.Options{Port: 9443}),
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "80807133.tutorial.kubebuilder.io",
})
/*
- For further information see [`MultiNamespacedCacheBuilder`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/cache?tab=doc#MultiNamespacedCacheBuilder)
+ For further information see [`cache.Options{}`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/cache#Options)
*/
// +kubebuilder:scaffold:builder
From 9427257654eb7e7676ca4f8dfdcb0c2c8f4422d3 Mon Sep 17 00:00:00 2001
From: Burak Sekili
Date: Thu, 19 Oct 2023 19:37:47 +0300
Subject: [PATCH 0326/1245] Update emptymain.go
Run goimports
---
docs/book/src/cronjob-tutorial/testdata/emptymain.go | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs/book/src/cronjob-tutorial/testdata/emptymain.go b/docs/book/src/cronjob-tutorial/testdata/emptymain.go
index 7d59715efc0..f9ab80c7f4a 100644
--- a/docs/book/src/cronjob-tutorial/testdata/emptymain.go
+++ b/docs/book/src/cronjob-tutorial/testdata/emptymain.go
@@ -30,8 +30,6 @@ import (
"flag"
"os"
- "sigs.k8s.io/controller-runtime/pkg/webhook"
-
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
@@ -45,6 +43,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
// +kubebuilder:scaffold:imports
)
From 90c857ed56c831616446363efe4f514848bddfee Mon Sep 17 00:00:00 2001
From: Varsha
Date: Sat, 21 Oct 2023 04:28:16 -0400
Subject: [PATCH 0327/1245] =?UTF-8?q?=F0=9F=90=9B=20[fix]:=20Bump=20patch?=
=?UTF-8?q?=20version=20of=20k8s=20deps=20to=20address=20CVE-2023-44487=20?=
=?UTF-8?q?(#3665)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[fix]: Bump patch version of k8s deps to address CVE-2023-44487
This PR bumps the dependencies that address the CVE-2023-44487.
For more details on the htt2 rapid reset CVE refer:
https://nvd.nist.gov/vuln/detail/CVE-2023-44487
For more details on what these bumps contain, refer:
1. Controller-runtime 0.16.3: https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.16.3
2. Kubernetes 1.28.3: https://github.com/kubernetes/apimachinery/commit/be9188050914374ee8128239e5a2e5998d7897f5
3. Kube-rbac-proxy 0.15.0: https://github.com/brancz/kube-rbac-proxy/releases/tag/v0.15.0
Signed-off-by: Varsha Prasad Narsing
---
.../default/manager_auth_proxy_patch.yaml | 2 +-
.../testdata/project/go.mod | 22 +++++-----
.../testdata/project/go.sum | 44 +++++++++----------
.../project/api/v1/webhook_suite_test.go | 2 +-
...atch.tutorial.kubebuilder.io_cronjobs.yaml | 1 -
.../default/manager_auth_proxy_patch.yaml | 2 +-
.../cronjob-tutorial/testdata/project/go.mod | 22 +++++-----
.../cronjob-tutorial/testdata/project/go.sum | 44 +++++++++----------
.../internal/controller/cronjob_controller.go | 2 +-
.../project/internal/controller/suite_test.go | 2 +-
.../kdefault/manager_auth_proxy_patch.go | 2 +-
pkg/plugins/golang/v4/scaffolds/init.go | 4 +-
.../api/crew/v1/webhook_suite_test.go | 2 +-
.../api/ship/v1/webhook_suite_test.go | 2 +-
.../api/ship/v2alpha1/webhook_suite_test.go | 2 +-
.../api/v1/webhook_suite_test.go | 2 +-
.../default/manager_auth_proxy_patch.yaml | 2 +-
.../go.mod | 22 +++++-----
.../controller/apps/deployment_controller.go | 2 +-
.../internal/controller/apps/suite_test.go | 2 +-
.../controller/crew/captain_controller.go | 2 +-
.../internal/controller/crew/suite_test.go | 2 +-
.../internal/controller/fiz/bar_controller.go | 2 +-
.../internal/controller/fiz/suite_test.go | 2 +-
.../healthcheckpolicy_controller.go | 2 +-
.../controller/foo.policy/suite_test.go | 2 +-
.../internal/controller/foo/bar_controller.go | 2 +-
.../internal/controller/foo/suite_test.go | 2 +-
.../internal/controller/lakers_controller.go | 2 +-
.../sea-creatures/kraken_controller.go | 2 +-
.../sea-creatures/leviathan_controller.go | 2 +-
.../controller/sea-creatures/suite_test.go | 2 +-
.../controller/ship/cruiser_controller.go | 2 +-
.../controller/ship/destroyer_controller.go | 2 +-
.../controller/ship/frigate_controller.go | 2 +-
.../internal/controller/ship/suite_test.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
.../api/crew/v1/webhook_suite_test.go | 2 +-
.../api/ship/v1/webhook_suite_test.go | 2 +-
.../api/ship/v2alpha1/webhook_suite_test.go | 2 +-
.../api/v1/webhook_suite_test.go | 2 +-
.../default/manager_auth_proxy_patch.yaml | 2 +-
testdata/project-v4-multigroup/go.mod | 22 +++++-----
.../controller/apps/deployment_controller.go | 2 +-
.../internal/controller/apps/suite_test.go | 2 +-
.../controller/crew/captain_controller.go | 2 +-
.../internal/controller/crew/suite_test.go | 2 +-
.../internal/controller/fiz/bar_controller.go | 2 +-
.../internal/controller/fiz/suite_test.go | 2 +-
.../healthcheckpolicy_controller.go | 2 +-
.../controller/foo.policy/suite_test.go | 2 +-
.../internal/controller/foo/bar_controller.go | 2 +-
.../internal/controller/foo/suite_test.go | 2 +-
.../internal/controller/lakers_controller.go | 2 +-
.../sea-creatures/kraken_controller.go | 2 +-
.../sea-creatures/leviathan_controller.go | 2 +-
.../controller/sea-creatures/suite_test.go | 2 +-
.../controller/ship/cruiser_controller.go | 2 +-
.../controller/ship/destroyer_controller.go | 2 +-
.../controller/ship/frigate_controller.go | 2 +-
.../internal/controller/ship/suite_test.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
.../api/v1alpha1/webhook_suite_test.go | 2 +-
.../default/manager_auth_proxy_patch.yaml | 2 +-
testdata/project-v4-with-deploy-image/go.mod | 22 +++++-----
.../internal/controller/busybox_controller.go | 2 +-
.../controller/memcached_controller.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
.../default/manager_auth_proxy_patch.yaml | 2 +-
testdata/project-v4-with-grafana/go.mod | 22 +++++-----
.../project-v4/api/v1/webhook_suite_test.go | 2 +-
.../default/manager_auth_proxy_patch.yaml | 2 +-
testdata/project-v4/go.mod | 22 +++++-----
.../internal/controller/admiral_controller.go | 2 +-
.../internal/controller/captain_controller.go | 2 +-
.../controller/firstmate_controller.go | 2 +-
.../internal/controller/laker_controller.go | 2 +-
.../internal/controller/suite_test.go | 2 +-
78 files changed, 190 insertions(+), 191 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
index 61455256f0d..6f391305524 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
@@ -15,7 +15,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod
index 33d35f0a378..acba8429ec7 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.mod
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod
@@ -3,16 +3,16 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -44,11 +44,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
@@ -56,9 +56,9 @@ require (
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.28.1 // indirect
- k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/api v0.28.3 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum
index ca8e604cd14..fb609b644a2 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.sum
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum
@@ -8,8 +8,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
-github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
+github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
@@ -129,8 +129,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY=
-golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -145,16 +145,16 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
-golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
+golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
-golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
+golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
+golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
-golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -188,24 +188,24 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108=
-k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg=
-k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E=
-k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE=
-k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY=
-k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
-k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8=
-k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE=
-k8s.io/component-base v0.28.1 h1:LA4AujMlK2mr0tZbQDZkjWbdhTV5bRyEyAFe0TJxlWg=
-k8s.io/component-base v0.28.1/go.mod h1:jI11OyhbX21Qtbav7JkhehyBsIRfnO8oEgoAR12ArIU=
+k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM=
+k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc=
+k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08=
+k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc=
+k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A=
+k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8=
+k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4=
+k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo=
+k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI=
+k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=
-sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
+sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
+sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
index e82b72c2607..9f7b51ae612 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
index ce6bc308fc7..810506cb212 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
@@ -277,7 +277,6 @@ spec:
x-kubernetes-list-type: atomic
required:
- action
- - onPodConditions
type: object
type: array
x-kubernetes-list-type: atomic
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
index 33d8c505930..d8cc449b416 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml
@@ -31,7 +31,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.mod b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
index 7943fdcae21..3881d7d0e7a 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.mod
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.mod
@@ -6,17 +6,17 @@ require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
github.com/robfig/cron v1.2.0
- k8s.io/api v0.28.1
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/api v0.28.3
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -50,11 +50,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
@@ -63,8 +63,8 @@ require (
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.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/go.sum b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
index 1fb37925fa6..feb932492cd 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/go.sum
+++ b/docs/book/src/cronjob-tutorial/testdata/project/go.sum
@@ -11,8 +11,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
-github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
+github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww=
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
@@ -141,8 +141,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.13.0 h1:Nvo8UFsZ8X3BhAC9699Z1j7XQ3rsZnUUm7jfBEk1ueY=
-golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -158,16 +158,16 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
-golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
+golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
-golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
+golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
+golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
-golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -202,24 +202,24 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108=
-k8s.io/api v0.28.1/go.mod h1:uBYwID+66wiL28Kn2tBjBYQdEU0Xk0z5qF8bIBqk/Dg=
-k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E=
-k8s.io/apiextensions-apiserver v0.28.0/go.mod h1:uRdYiwIuu0SyqJKriKmqEN2jThIJPhVmOWETm8ud1VE=
-k8s.io/apimachinery v0.28.1 h1:EJD40og3GizBSV3mkIoXQBsws32okPOy+MkRyzh6nPY=
-k8s.io/apimachinery v0.28.1/go.mod h1:X0xh/chESs2hP9koe+SdIAcXWcQ+RM5hy0ZynB+yEvw=
-k8s.io/client-go v0.28.1 h1:pRhMzB8HyLfVwpngWKE8hDcXRqifh1ga2Z/PU9SXVK8=
-k8s.io/client-go v0.28.1/go.mod h1:pEZA3FqOsVkCc07pFVzK076R+P/eXqsgx5zuuRWukNE=
-k8s.io/component-base v0.28.1 h1:LA4AujMlK2mr0tZbQDZkjWbdhTV5bRyEyAFe0TJxlWg=
-k8s.io/component-base v0.28.1/go.mod h1:jI11OyhbX21Qtbav7JkhehyBsIRfnO8oEgoAR12ArIU=
+k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM=
+k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc=
+k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08=
+k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc=
+k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A=
+k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8=
+k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4=
+k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo=
+k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI=
+k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
-sigs.k8s.io/controller-runtime v0.16.2 h1:mwXAVuEk3EQf478PQwQ48zGOXvW27UJc8NHktQVuIPU=
-sigs.k8s.io/controller-runtime v0.16.2/go.mod h1:vpMu3LpI5sYWtujJOa2uPK61nB5rbwlN7BAB8aSLvGU=
+sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
+sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
index 127c3df2bac..46dcb7903c7 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/cronjob_controller.go
@@ -95,7 +95,7 @@ var (
// the user.
//
// For more details, check Reconcile and its Result here:
-// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := log.FromContext(ctx)
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
index b12efd124d0..4af3e836a7a 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
+++ b/docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go
@@ -90,7 +90,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
/*
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go
index 2e56ab28f14..1b85deb2f42 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/manager_auth_proxy_patch.go
@@ -60,7 +60,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index 9641b0a9053..3e123c09991 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -31,11 +31,11 @@ import (
const (
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
- ControllerRuntimeVersion = "v0.16.2"
+ ControllerRuntimeVersion = "v0.16.3"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
ControllerToolsVersion = "v0.13.0"
// EnvtestK8SVersion is the k8s version used to do the scaffold
- EnvtestK8SVersion = "1.28.0"
+ EnvtestK8SVersion = "1.28.3"
imageName = "controller:latest"
)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go
index d58a13812d1..b793d583aef 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/crew/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go
index 1c6bb164c54..ed24241f4f0 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go
index 38482d55ee7..c1546d472d2 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/ship/v2alpha1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go
index 250b42b87b3..2602fe973a2 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/api/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
index 56f8e260736..70c3437f4b4 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
@@ -15,7 +15,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/testdata/project-v4-multigroup-with-deploy-image/go.mod b/testdata/project-v4-multigroup-with-deploy-image/go.mod
index 5adf8d5ec1c..58bfe7fdfa5 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/go.mod
+++ b/testdata/project-v4-multigroup-with-deploy-image/go.mod
@@ -5,17 +5,17 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.1
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/api v0.28.3
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -49,11 +49,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
@@ -62,8 +62,8 @@ require (
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.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go
index b3c6c551193..34ac4b1cb1a 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/deployment_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/apps/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go
index 78f8abdf282..6a14c2a8a8a 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/apps/suite_test.go
@@ -62,7 +62,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go
index 933d7dba70e..021245c172e 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/captain_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go
index 92de83f12c0..f9a35a196aa 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/crew/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go
index e4431b49bb9..84def33eaf2 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/bar_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/fiz/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go
index 08507362144..d9cc802c12b 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/fiz/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go
index 39e00649b0d..c7f6ea474a4 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/foo.policy/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go
index 4b54814270f..22b312e3e8c 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo.policy/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go
index f6a60424a5b..9100242bfd8 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/bar_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/foo/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go
index 0b8a1f7de20..c9a3549c0bc 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/foo/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go
index 08da8ca4d23..c70937f4496 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/lakers_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go
index a5db31bca89..144c2af14a8 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/kraken_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go
index 3f16deff8ce..83c11801e43 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/leviathan_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/sea-creatures/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go
index 9035668a10a..516d0aec30a 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/sea-creatures/suite_test.go
@@ -64,7 +64,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go
index 98b460da68a..b04285642cf 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/cruiser_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go
index 10fd8c3f6e6..34b3bcec2fe 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/destroyer_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go
index 93036286f67..22415ee9a10 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/frigate_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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-with-deploy-image/internal/controller/ship/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go
index dfd58b12897..c8ed124a81f 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/ship/suite_test.go
@@ -65,7 +65,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go
index 4d8c3984d6f..14998f97ef0 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go
+++ b/testdata/project-v4-multigroup-with-deploy-image/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
index d58a13812d1..b793d583aef 100644
--- a/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/crew/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
index 1c6bb164c54..ed24241f4f0 100644
--- a/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
index 38482d55ee7..c1546d472d2 100644
--- a/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/ship/v2alpha1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
index 250b42b87b3..2602fe973a2 100644
--- a/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4-multigroup/api/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml
index 56f8e260736..70c3437f4b4 100644
--- a/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-multigroup/config/default/manager_auth_proxy_patch.yaml
@@ -15,7 +15,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/testdata/project-v4-multigroup/go.mod b/testdata/project-v4-multigroup/go.mod
index e24f5f59e1e..ff8993bdb38 100644
--- a/testdata/project-v4-multigroup/go.mod
+++ b/testdata/project-v4-multigroup/go.mod
@@ -5,17 +5,17 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.1
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/api v0.28.3
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -49,11 +49,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
@@ -62,8 +62,8 @@ require (
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.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
index b3c6c551193..34ac4b1cb1a 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/deployment_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/apps/suite_test.go b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
index 78f8abdf282..6a14c2a8a8a 100644
--- a/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/apps/suite_test.go
@@ -62,7 +62,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
index 6e54f1a133b..e8fcf40d081 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/captain_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
index 21d0db41af5..856f8d00918 100644
--- a/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/crew/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
index d00e8917128..53cc8673bd9 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/bar_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/fiz/suite_test.go b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
index d00d49233ce..141d1536b5c 100644
--- a/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/fiz/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
index 1edbcb9c941..8fa18bf8da0 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/healthcheckpolicy_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/foo.policy/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
index c2c9a90dfe1..af8fbd4c1fd 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo.policy/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
index 36fcce98cae..8cd87a17af9 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/bar_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/foo/suite_test.go b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
index f916fad82ff..fc7c79e98ff 100644
--- a/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/foo/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
index 84f1dabc141..ca4955fb12f 100644
--- a/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/lakers_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/sea-creatures/kraken_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
index 928f08cbeab..e89a34d369d 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/kraken_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/sea-creatures/leviathan_controller.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
index 22db56aece4..1ea71ee3359 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/leviathan_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/sea-creatures/suite_test.go b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
index d078ffdcb26..5c851c64863 100644
--- a/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/sea-creatures/suite_test.go
@@ -64,7 +64,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
index e667b99d1e0..49b97ad496d 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/cruiser_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/ship/destroyer_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
index b23c16905bd..069750a0085 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/destroyer_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/ship/frigate_controller.go b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
index 504ee3be98f..2295a0e7acb 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/frigate_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/ship/suite_test.go b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
index 91cebc694ae..af4fd17dc2c 100644
--- a/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/ship/suite_test.go
@@ -65,7 +65,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-multigroup/internal/controller/suite_test.go b/testdata/project-v4-multigroup/internal/controller/suite_test.go
index d1f730181a0..a99d3cb4d6e 100644
--- a/testdata/project-v4-multigroup/internal/controller/suite_test.go
+++ b/testdata/project-v4-multigroup/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
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 d1abc45a294..3a28efa6707 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
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
diff --git a/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
index 56f8e260736..70c3437f4b4 100644
--- a/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-with-deploy-image/config/default/manager_auth_proxy_patch.yaml
@@ -15,7 +15,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/testdata/project-v4-with-deploy-image/go.mod b/testdata/project-v4-with-deploy-image/go.mod
index f544e5bcf47..5eb658ea40d 100644
--- a/testdata/project-v4-with-deploy-image/go.mod
+++ b/testdata/project-v4-with-deploy-image/go.mod
@@ -5,17 +5,17 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.1
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/api v0.28.3
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -49,11 +49,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
@@ -62,8 +62,8 @@ require (
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.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
index 9a84413ec13..4d8ea3f2a16 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/busybox_controller.go
@@ -77,7 +77,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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/memcached_controller.go b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
index 5ebb803874c..88b024998ea 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/memcached_controller.go
@@ -77,7 +77,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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/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/internal/controller/suite_test.go b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
index 174d44531f9..1a5abb2dfc2 100644
--- a/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
+++ b/testdata/project-v4-with-deploy-image/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
diff --git a/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
index 56f8e260736..70c3437f4b4 100644
--- a/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4-with-grafana/config/default/manager_auth_proxy_patch.yaml
@@ -15,7 +15,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/testdata/project-v4-with-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
index ce5cb3689f1..b3e2118aaf5 100644
--- a/testdata/project-v4-with-grafana/go.mod
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -3,16 +3,16 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
go 1.20
require (
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -44,11 +44,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
@@ -56,9 +56,9 @@ require (
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.28.1 // indirect
- k8s.io/apiextensions-apiserver v0.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/api v0.28.3 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4/api/v1/webhook_suite_test.go b/testdata/project-v4/api/v1/webhook_suite_test.go
index f15fd5f894a..c5be88dc255 100644
--- a/testdata/project-v4/api/v1/webhook_suite_test.go
+++ b/testdata/project-v4/api/v1/webhook_suite_test.go
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
WebhookInstallOptions: envtest.WebhookInstallOptions{
Paths: []string{filepath.Join("..", "..", "config", "webhook")},
diff --git a/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml b/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml
index 56f8e260736..70c3437f4b4 100644
--- a/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml
+++ b/testdata/project-v4/config/default/manager_auth_proxy_patch.yaml
@@ -15,7 +15,7 @@ spec:
capabilities:
drop:
- "ALL"
- image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
+ image: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
diff --git a/testdata/project-v4/go.mod b/testdata/project-v4/go.mod
index 2af7846c045..4143150efe8 100644
--- a/testdata/project-v4/go.mod
+++ b/testdata/project-v4/go.mod
@@ -5,17 +5,17 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.10
- k8s.io/api v0.28.1
- k8s.io/apimachinery v0.28.1
- k8s.io/client-go v0.28.1
- sigs.k8s.io/controller-runtime v0.16.2
+ k8s.io/api v0.28.3
+ k8s.io/apimachinery v0.28.3
+ k8s.io/client-go v0.28.3
+ sigs.k8s.io/controller-runtime v0.16.3
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
@@ -49,11 +49,11 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.13.0 // indirect
+ golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
- golang.org/x/term v0.10.0 // indirect
- golang.org/x/text v0.11.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/term v0.13.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
@@ -62,8 +62,8 @@ require (
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.28.0 // indirect
- k8s.io/component-base v0.28.1 // indirect
+ k8s.io/apiextensions-apiserver v0.28.3 // indirect
+ k8s.io/component-base v0.28.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
diff --git a/testdata/project-v4/internal/controller/admiral_controller.go b/testdata/project-v4/internal/controller/admiral_controller.go
index beb722fe14d..3c3177eefb0 100644
--- a/testdata/project-v4/internal/controller/admiral_controller.go
+++ b/testdata/project-v4/internal/controller/admiral_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *AdmiralReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/captain_controller.go b/testdata/project-v4/internal/controller/captain_controller.go
index fe6a9214a9a..48b614778db 100644
--- a/testdata/project-v4/internal/controller/captain_controller.go
+++ b/testdata/project-v4/internal/controller/captain_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *CaptainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/firstmate_controller.go b/testdata/project-v4/internal/controller/firstmate_controller.go
index c7a74874e85..b7ccc87d15f 100644
--- a/testdata/project-v4/internal/controller/firstmate_controller.go
+++ b/testdata/project-v4/internal/controller/firstmate_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *FirstMateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/laker_controller.go b/testdata/project-v4/internal/controller/laker_controller.go
index 2f0223c415c..9200474a6c6 100644
--- a/testdata/project-v4/internal/controller/laker_controller.go
+++ b/testdata/project-v4/internal/controller/laker_controller.go
@@ -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.16.2/pkg/reconcile
+// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.16.3/pkg/reconcile
func (r *LakerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
_ = log.FromContext(ctx)
diff --git a/testdata/project-v4/internal/controller/suite_test.go b/testdata/project-v4/internal/controller/suite_test.go
index 8d250be6ee4..1a963e01018 100644
--- a/testdata/project-v4/internal/controller/suite_test.go
+++ b/testdata/project-v4/internal/controller/suite_test.go
@@ -63,7 +63,7 @@ var _ = BeforeSuite(func() {
// Note that you must have the required binaries setup under the bin directory to perform
// the tests directly. When we run make test it will be setup and used automatically.
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
- fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
+ fmt.Sprintf("1.28.3-%s-%s", runtime.GOOS, runtime.GOARCH)),
}
var err error
From aea2e26d6d6afd4f7304311b4a71d9291b3ecb87 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 23 Oct 2023 23:40:43 +0000
Subject: [PATCH 0328/1245] Bump github.com/onsi/gomega from 1.28.0 to 1.28.1
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.28.0...v1.28.1)
---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 4 ++--
go.sum | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/go.mod b/go.mod
index 06f58666d78..82db9b2dd16 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.13.0
- github.com/onsi/gomega v1.28.0
+ github.com/onsi/gomega v1.28.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
github.com/spf13/cobra v1.7.0
@@ -18,7 +18,7 @@ require (
require (
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
- github.com/google/go-cmp v0.5.9 // indirect
+ github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
golang.org/x/mod v0.13.0 // indirect
diff --git a/go.sum b/go.sum
index e6e9bd5ad5d..c753f0825fe 100644
--- a/go.sum
+++ b/go.sum
@@ -102,8 +102,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -141,8 +141,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c=
-github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8=
+github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA=
+github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
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=
From 981dd3c6ce36e62fb497468605b3ad10c8ee576e Mon Sep 17 00:00:00 2001
From: Lauquik
Date: Tue, 24 Oct 2023 12:33:02 +0530
Subject: [PATCH 0329/1245] test added to default scaffold and added to ci
Signed-off-by: Lauquik
---
.github/workflows/lint-sample.yml | 1 -
.github/workflows/test-sample-go.yml | 51 ++++++
.../testdata/project/Makefile | 7 +-
.../testdata/project/go.mod | 5 +
.../testdata/project/go.sum | 12 ++
.../project/test/e2e/e2e_suite_test.go | 32 ++++
.../testdata/project/test/e2e/e2e_test.go | 121 +++++++++++++
.../testdata/project/test/utils/utils.go | 140 +++++++++++++++
.../testdata/project/Makefile | 7 +-
.../project/test/e2e/e2e_suite_test.go | 32 ++++
.../testdata/project/test/e2e/e2e_test.go | 121 +++++++++++++
.../testdata/project/test/utils/utils.go | 140 +++++++++++++++
pkg/plugins/golang/v4/scaffolds/init.go | 5 +
.../scaffolds/internal/templates/makefile.go | 7 +-
.../internal/templates/test/e2e/suite.go | 59 +++++++
.../internal/templates/test/e2e/test.go | 149 ++++++++++++++++
.../internal/templates/test/utils/utils.go | 166 ++++++++++++++++++
.../Makefile | 7 +-
.../test/e2e/e2e_suite_test.go | 32 ++++
.../test/e2e/e2e_test.go | 121 +++++++++++++
.../test/utils/utils.go | 140 +++++++++++++++
testdata/project-v4-multigroup/Makefile | 7 +-
.../test/e2e/e2e_suite_test.go | 32 ++++
.../test/e2e/e2e_test.go | 121 +++++++++++++
.../project-v4-multigroup/test/utils/utils.go | 140 +++++++++++++++
.../project-v4-with-deploy-image/Makefile | 7 +-
.../test/e2e/e2e_suite_test.go | 32 ++++
.../test/e2e/e2e_test.go | 121 +++++++++++++
.../test/utils/utils.go | 140 +++++++++++++++
testdata/project-v4-with-grafana/Makefile | 7 +-
testdata/project-v4-with-grafana/go.mod | 5 +
.../test/e2e/e2e_suite_test.go | 32 ++++
.../test/e2e/e2e_test.go | 121 +++++++++++++
.../test/utils/utils.go | 140 +++++++++++++++
testdata/project-v4/Makefile | 7 +-
.../project-v4/test/e2e/e2e_suite_test.go | 32 ++++
testdata/project-v4/test/e2e/e2e_test.go | 121 +++++++++++++
testdata/project-v4/test/utils/utils.go | 140 +++++++++++++++
38 files changed, 2551 insertions(+), 9 deletions(-)
create mode 100644 .github/workflows/test-sample-go.yml
create mode 100644 docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_suite_test.go
create mode 100644 docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go
create mode 100644 docs/book/src/component-config-tutorial/testdata/project/test/utils/utils.go
create mode 100644 docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go
create mode 100644 docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go
create mode 100644 docs/book/src/cronjob-tutorial/testdata/project/test/utils/utils.go
create mode 100644 pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go
create mode 100644 pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go
create mode 100644 pkg/plugins/golang/v4/scaffolds/internal/templates/test/utils/utils.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_suite_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go
create mode 100644 testdata/project-v4-multigroup-with-deploy-image/test/utils/utils.go
create mode 100644 testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go
create mode 100644 testdata/project-v4-multigroup/test/e2e/e2e_test.go
create mode 100644 testdata/project-v4-multigroup/test/utils/utils.go
create mode 100644 testdata/project-v4-with-deploy-image/test/e2e/e2e_suite_test.go
create mode 100644 testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go
create mode 100644 testdata/project-v4-with-deploy-image/test/utils/utils.go
create mode 100644 testdata/project-v4-with-grafana/test/e2e/e2e_suite_test.go
create mode 100644 testdata/project-v4-with-grafana/test/e2e/e2e_test.go
create mode 100644 testdata/project-v4-with-grafana/test/utils/utils.go
create mode 100644 testdata/project-v4/test/e2e/e2e_suite_test.go
create mode 100644 testdata/project-v4/test/e2e/e2e_test.go
create mode 100644 testdata/project-v4/test/utils/utils.go
diff --git a/.github/workflows/lint-sample.yml b/.github/workflows/lint-sample.yml
index bb63612269b..28d30c852d5 100644
--- a/.github/workflows/lint-sample.yml
+++ b/.github/workflows/lint-sample.yml
@@ -51,4 +51,3 @@ jobs:
working-directory: testdata/project-v4-multigroup-with-deploy-image
args: --config .golangci.yml ./...
skip-cache: true # first lint action will handle
-
diff --git a/.github/workflows/test-sample-go.yml b/.github/workflows/test-sample-go.yml
new file mode 100644
index 00000000000..1f33b66c8c5
--- /dev/null
+++ b/.github/workflows/test-sample-go.yml
@@ -0,0 +1,51 @@
+name: project-v4-sample
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ test:
+ name: Run on Ubuntu
+ runs-on: ubuntu-latest
+ env:
+ KIND_K8S_VERSION: v1.28.0
+ tools_k8s_version: 1.28.0
+ kind_version: 0.15.0
+ steps:
+ - name: Clone the code
+ uses: actions/checkout@v4
+
+ - name: Setup Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: '~1.20'
+
+ - name: Install Kind
+ run: go install sigs.k8s.io/kind@v$kind_version
+
+
+ - name: Install setup-envtest
+ run: go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
+
+ - name: Install e2e tools with setup-envtest
+ run: setup-envtest use $tools_k8s_version
+
+ - name: Create kind cluster
+ run: kind create cluster
+
+ - name: Prepare the environment
+ run: |
+ KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml"
+ sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
+ sed -i '27s/^#//' $KUSTOMIZATION_FILE_PATH
+ sed -i '42s/^#//' $KUSTOMIZATION_FILE_PATH
+ sed -i '46,143s/^#//' $KUSTOMIZATION_FILE_PATH
+
+ - name: Test
+ run: |
+ cd testdata/project-v4
+ go get -u ./...
+ go mod tidy
+ make test-e2e
+
\ No newline at end of file
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.mod b/docs/book/src/component-config-tutorial/testdata/project/go.mod
index acba8429ec7..a5c7dbda4f0 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.mod
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.mod
@@ -3,6 +3,8 @@ module tutorial.kubebuilder.io/project
go 1.20
require (
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
sigs.k8s.io/controller-runtime v0.16.3
@@ -20,12 +22,14 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
+ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -50,6 +54,7 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
diff --git a/docs/book/src/component-config-tutorial/testdata/project/go.sum b/docs/book/src/component-config-tutorial/testdata/project/go.sum
index fb609b644a2..8e8882fc771 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/go.sum
+++ b/docs/book/src/component-config-tutorial/testdata/project/go.sum
@@ -4,6 +4,9 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -27,6 +30,7 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
@@ -45,8 +49,10 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
+github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
@@ -75,7 +81,9 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
+github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
+github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -96,6 +104,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
@@ -122,6 +131,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
@@ -140,6 +150,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -164,6 +175,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
+golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
diff --git a/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_suite_test.go b/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..9faf89d8278
--- /dev/null
+++ b/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go b/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..f587df142fd
--- /dev/null
+++ b/docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "tutorial.kubebuilder.io/project/test/utils"
+)
+
+const namespace = "project-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/docs/book/src/component-config-tutorial/testdata/project/test/utils/utils.go b/docs/book/src/component-config-tutorial/testdata/project/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/docs/book/src/component-config-tutorial/testdata/project/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..9faf89d8278
--- /dev/null
+++ b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..f587df142fd
--- /dev/null
+++ b/docs/book/src/cronjob-tutorial/testdata/project/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "tutorial.kubebuilder.io/project/test/utils"
+)
+
+const namespace = "project-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/test/utils/utils.go b/docs/book/src/cronjob-tutorial/testdata/project/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/docs/book/src/cronjob-tutorial/testdata/project/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
diff --git a/pkg/plugins/golang/v4/scaffolds/init.go b/pkg/plugins/golang/v4/scaffolds/init.go
index 3e123c09991..e84b9c68075 100644
--- a/pkg/plugins/golang/v4/scaffolds/init.go
+++ b/pkg/plugins/golang/v4/scaffolds/init.go
@@ -27,6 +27,8 @@ import (
kustomizecommonv2alpha "sigs.k8s.io/kubebuilder/v3/pkg/plugins/common/kustomize/v2"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4/scaffolds/internal/templates"
"sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4/scaffolds/internal/templates/hack"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e"
+ "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v4/scaffolds/internal/templates/test/utils"
)
const (
@@ -139,5 +141,8 @@ func (s *initScaffolder) Scaffold() error {
&templates.DockerIgnore{},
&templates.Readme{},
&templates.Golangci{},
+ &e2e.Test{},
+ &e2e.SuiteTest{},
+ &utils.Utils{},
)
}
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 21092188151..9f63ad8237f 100644
--- a/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
@@ -126,8 +126,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go
new file mode 100644
index 00000000000..14666e681e7
--- /dev/null
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/suite.go
@@ -0,0 +1,59 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package e2e
+
+import (
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &SuiteTest{}
+
+type SuiteTest struct {
+ machinery.TemplateMixin
+ machinery.BoilerplateMixin
+ machinery.RepositoryMixin
+ machinery.ProjectNameMixin
+}
+
+func (f *SuiteTest) SetTemplateDefaults() error {
+ if f.Path == "" {
+ f.Path = "test/e2e/e2e_suite_test.go"
+ }
+
+ f.TemplateBody = suiteTestTemplate
+ return nil
+}
+
+var suiteTestTemplate = `{{ .Boilerplate }}
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting {{ .ProjectName }} suite\n")
+ RunSpecs(t, "e2e suite")
+}
+`
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go
new file mode 100644
index 00000000000..3a242614598
--- /dev/null
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/e2e/test.go
@@ -0,0 +1,149 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package e2e
+
+import (
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &SuiteTest{}
+
+type Test struct {
+ machinery.TemplateMixin
+ machinery.BoilerplateMixin
+ machinery.RepositoryMixin
+ machinery.ProjectNameMixin
+}
+
+func (f *Test) SetTemplateDefaults() error {
+ if f.Path == "" {
+ f.Path = "test/e2e/e2e_test.go"
+ }
+
+ f.TemplateBody = TestTemplate
+ return nil
+}
+
+var TestTemplate = `{{ .Boilerplate }}
+
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "{{ .Repo }}/test/utils"
+)
+
+const namespace = "{{ .ProjectName }}-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/{{ .ProjectName }}:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{"{{"}} range .items {{"}}"}}" +
+ "{{"{{"}} if not .metadata.deletionTimestamp {{"}}"}}" +
+ "{{"{{"}} .metadata.name {{"}}"}}"+
+ "{{"{{"}} \"\\n\" {{"}}"}}{{"{{"}} end {{"}}"}}{{"{{"}} end {{"}}"}}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
+`
diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/test/utils/utils.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/utils/utils.go
new file mode 100644
index 00000000000..42ae4f2fb00
--- /dev/null
+++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/test/utils/utils.go
@@ -0,0 +1,166 @@
+/*
+Copyright 2022 The 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.
+*/
+
+package utils
+
+import (
+ "sigs.k8s.io/kubebuilder/v3/pkg/machinery"
+)
+
+var _ machinery.Template = &Utils{}
+
+type Utils struct {
+ machinery.TemplateMixin
+ machinery.BoilerplateMixin
+}
+
+func (f *Utils) SetTemplateDefaults() error {
+ if f.Path == "" {
+ f.Path = "test/utils/utils.go"
+ }
+
+ f.TemplateBody = utilsTemplate
+
+ return nil
+}
+
+var utilsTemplate = `{{ .Boilerplate }}
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
+`
diff --git a/testdata/project-v4-multigroup-with-deploy-image/Makefile b/testdata/project-v4-multigroup-with-deploy-image/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/Makefile
+++ b/testdata/project-v4-multigroup-with-deploy-image/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_suite_test.go b/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..4694498221b
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project-v4-multigroup-with-deploy-image suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go b/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..8da401525d7
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup-with-deploy-image/test/utils"
+)
+
+const namespace = "project-v4-multigroup-with-deploy-image-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project-v4-multigroup-with-deploy-image:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup-with-deploy-image/test/utils/utils.go b/testdata/project-v4-multigroup-with-deploy-image/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/testdata/project-v4-multigroup-with-deploy-image/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go b/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..83dc64e77ef
--- /dev/null
+++ b/testdata/project-v4-multigroup/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project-v4-multigroup suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/testdata/project-v4-multigroup/test/e2e/e2e_test.go b/testdata/project-v4-multigroup/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..664e2822df0
--- /dev/null
+++ b/testdata/project-v4-multigroup/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-multigroup/test/utils"
+)
+
+const namespace = "project-v4-multigroup-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project-v4-multigroup:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/testdata/project-v4-multigroup/test/utils/utils.go b/testdata/project-v4-multigroup/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/testdata/project-v4-multigroup/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/testdata/project-v4-with-deploy-image/test/e2e/e2e_suite_test.go b/testdata/project-v4-with-deploy-image/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..c7f85e671db
--- /dev/null
+++ b/testdata/project-v4-with-deploy-image/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project-v4-with-deploy-image suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go b/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..c6da97455fd
--- /dev/null
+++ b/testdata/project-v4-with-deploy-image/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-with-deploy-image/test/utils"
+)
+
+const namespace = "project-v4-with-deploy-image-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project-v4-with-deploy-image:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/testdata/project-v4-with-deploy-image/test/utils/utils.go b/testdata/project-v4-with-deploy-image/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/testdata/project-v4-with-deploy-image/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/testdata/project-v4-with-grafana/go.mod b/testdata/project-v4-with-grafana/go.mod
index b3e2118aaf5..2136780a597 100644
--- a/testdata/project-v4-with-grafana/go.mod
+++ b/testdata/project-v4-with-grafana/go.mod
@@ -3,6 +3,8 @@ module sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana
go 1.20
require (
+ github.com/onsi/ginkgo/v2 v2.11.0
+ github.com/onsi/gomega v1.27.10
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
sigs.k8s.io/controller-runtime v0.16.3
@@ -20,12 +22,14 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
+ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
+ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
@@ -50,6 +54,7 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
+ golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
diff --git a/testdata/project-v4-with-grafana/test/e2e/e2e_suite_test.go b/testdata/project-v4-with-grafana/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..46ac3837ba6
--- /dev/null
+++ b/testdata/project-v4-with-grafana/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project-v4-with-grafana suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/testdata/project-v4-with-grafana/test/e2e/e2e_test.go b/testdata/project-v4-with-grafana/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..87401f3f110
--- /dev/null
+++ b/testdata/project-v4-with-grafana/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "sigs.k8s.io/kubebuilder/testdata/project-v4-with-grafana/test/utils"
+)
+
+const namespace = "project-v4-with-grafana-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project-v4-with-grafana:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/testdata/project-v4-with-grafana/test/utils/utils.go b/testdata/project-v4-with-grafana/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/testdata/project-v4-with-grafana/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index a4a190c2605..4e6f7c25492 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -62,8 +62,13 @@ vet: ## Run go vet against code.
.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
- KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
+ KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
+# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
+.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
+test-e2e:
+ go test ./test/e2e/ -v -ginkgo.v
+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
diff --git a/testdata/project-v4/test/e2e/e2e_suite_test.go b/testdata/project-v4/test/e2e/e2e_suite_test.go
new file mode 100644
index 00000000000..34db88c3116
--- /dev/null
+++ b/testdata/project-v4/test/e2e/e2e_suite_test.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "testing"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+// Run e2e tests using the Ginkgo runner.
+func TestE2E(t *testing.T) {
+ RegisterFailHandler(Fail)
+ fmt.Fprintf(GinkgoWriter, "Starting project-v4 suite\n")
+ RunSpecs(t, "e2e suite")
+}
diff --git a/testdata/project-v4/test/e2e/e2e_test.go b/testdata/project-v4/test/e2e/e2e_test.go
new file mode 100644
index 00000000000..c5df80bc183
--- /dev/null
+++ b/testdata/project-v4/test/e2e/e2e_test.go
@@ -0,0 +1,121 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package e2e
+
+import (
+ "fmt"
+ "os/exec"
+ "time"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+
+ "sigs.k8s.io/kubebuilder/testdata/project-v4/test/utils"
+)
+
+const namespace = "project-v4-system"
+
+var _ = Describe("controller", Ordered, func() {
+ BeforeAll(func() {
+ By("installing prometheus operator")
+ Expect(utils.InstallPrometheusOperator()).To(Succeed())
+
+ By("installing the cert-manager")
+ Expect(utils.InstallCertManager()).To(Succeed())
+
+ By("creating manager namespace")
+ cmd := exec.Command("kubectl", "create", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ AfterAll(func() {
+ By("uninstalling the Prometheus manager bundle")
+ utils.UninstallPrometheusOperator()
+
+ By("uninstalling the cert-manager bundle")
+ utils.UninstallCertManager()
+
+ By("removing manager namespace")
+ cmd := exec.Command("kubectl", "delete", "ns", namespace)
+ _, _ = utils.Run(cmd)
+ })
+
+ Context("Operator", func() {
+ It("should run successfully", func() {
+ var controllerPodName string
+ var err error
+
+ // projectimage stores the name of the image used in the example
+ var projectimage = "example.com/project-v4:v0.0.1"
+
+ By("building the manager(Operator) image")
+ cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("loading the the manager(Operator) image on Kind")
+ err = utils.LoadImageToKindClusterWithName(projectimage)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("installing CRDs")
+ cmd = exec.Command("make", "install")
+ _, err = utils.Run(cmd)
+
+ By("deploying the controller-manager")
+ cmd = exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectimage))
+ _, err = utils.Run(cmd)
+ ExpectWithOffset(1, err).NotTo(HaveOccurred())
+
+ By("validating that the controller-manager pod is running as expected")
+ verifyControllerUp := func() error {
+ // Get pod name
+
+ cmd = exec.Command("kubectl", "get",
+ "pods", "-l", "control-plane=controller-manager",
+ "-o", "go-template={{ range .items }}"+
+ "{{ if not .metadata.deletionTimestamp }}"+
+ "{{ .metadata.name }}"+
+ "{{ \"\\n\" }}{{ end }}{{ end }}",
+ "-n", namespace,
+ )
+
+ podOutput, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ podNames := utils.GetNonEmptyLines(string(podOutput))
+ if len(podNames) != 1 {
+ return fmt.Errorf("expect 1 controller pods running, but got %d", len(podNames))
+ }
+ controllerPodName = podNames[0]
+ ExpectWithOffset(2, controllerPodName).Should(ContainSubstring("controller-manager"))
+
+ // Validate pod status
+ cmd = exec.Command("kubectl", "get",
+ "pods", controllerPodName, "-o", "jsonpath={.status.phase}",
+ "-n", namespace,
+ )
+ status, err := utils.Run(cmd)
+ ExpectWithOffset(2, err).NotTo(HaveOccurred())
+ if string(status) != "Running" {
+ return fmt.Errorf("controller pod in %s status", status)
+ }
+ return nil
+ }
+ EventuallyWithOffset(1, verifyControllerUp, time.Minute, time.Second).Should(Succeed())
+
+ })
+ })
+})
diff --git a/testdata/project-v4/test/utils/utils.go b/testdata/project-v4/test/utils/utils.go
new file mode 100644
index 00000000000..6f021e6818a
--- /dev/null
+++ b/testdata/project-v4/test/utils/utils.go
@@ -0,0 +1,140 @@
+/*
+Copyright 2023 The 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.
+*/
+
+package utils
+
+import (
+ "fmt"
+ "os"
+ "os/exec"
+ "strings"
+
+ . "github.com/onsi/ginkgo/v2" //nolint:golint,revive
+)
+
+const (
+ prometheusOperatorVersion = "v0.68.0"
+ prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
+ "releases/download/%s/bundle.yaml"
+
+ certmanagerVersion = "v1.5.3"
+ certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
+)
+
+func warnError(err error) {
+ fmt.Fprintf(GinkgoWriter, "warning: %v\n", err)
+}
+
+// InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
+func InstallPrometheusOperator() error {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "create", "-f", url)
+ _, err := Run(cmd)
+ return err
+}
+
+// Run executes the provided command within this context
+func Run(cmd *exec.Cmd) ([]byte, error) {
+ dir, _ := GetProjectDir()
+ cmd.Dir = dir
+
+ if err := os.Chdir(cmd.Dir); err != nil {
+ fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err)
+ }
+
+ cmd.Env = append(os.Environ(), "GO111MODULE=on")
+ command := strings.Join(cmd.Args, " ")
+ fmt.Fprintf(GinkgoWriter, "running: %s\n", command)
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))
+ }
+
+ return output, nil
+}
+
+// UninstallPrometheusOperator uninstalls the prometheus
+func UninstallPrometheusOperator() {
+ url := fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// UninstallCertManager uninstalls the cert manager
+func UninstallCertManager() {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "delete", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ warnError(err)
+ }
+}
+
+// InstallCertManager installs the cert manager bundle.
+func InstallCertManager() error {
+ url := fmt.Sprintf(certmanagerURLTmpl, certmanagerVersion)
+ cmd := exec.Command("kubectl", "apply", "-f", url)
+ if _, err := Run(cmd); err != nil {
+ return err
+ }
+ // Wait for cert-manager-webhook to be ready, which can take time if cert-manager
+ // was re-installed after uninstalling on a cluster.
+ cmd = exec.Command("kubectl", "wait", "deployment.apps/cert-manager-webhook",
+ "--for", "condition=Available",
+ "--namespace", "cert-manager",
+ "--timeout", "5m",
+ )
+
+ _, err := Run(cmd)
+ return err
+}
+
+// LoadImageToKindCluster loads a local docker image to the kind cluster
+func LoadImageToKindClusterWithName(name string) error {
+ cluster := "kind"
+ if v, ok := os.LookupEnv("KIND_CLUSTER"); ok {
+ cluster = v
+ }
+ kindOptions := []string{"load", "docker-image", name, "--name", cluster}
+ cmd := exec.Command("kind", kindOptions...)
+ _, err := Run(cmd)
+ return err
+}
+
+// GetNonEmptyLines converts given command output string into individual objects
+// according to line breakers, and ignores the empty elements in it.
+func GetNonEmptyLines(output string) []string {
+ var res []string
+ elements := strings.Split(output, "\n")
+ for _, element := range elements {
+ if element != "" {
+ res = append(res, element)
+ }
+ }
+
+ return res
+}
+
+// GetProjectDir will return the directory where the project is
+func GetProjectDir() (string, error) {
+ wd, err := os.Getwd()
+ if err != nil {
+ return wd, err
+ }
+ wd = strings.Replace(wd, "/test/e2e", "", -1)
+ return wd, nil
+}
From 19c0caa4f8ba6a22ae35722d53d43b39048a349f Mon Sep 17 00:00:00 2001
From: Majid Garoosi
Date: Mon, 30 Oct 2023 13:18:26 +0330
Subject: [PATCH 0330/1245] =?UTF-8?q?=F0=9F=90=9B=20(kustomize/v2,go/v4):?=
=?UTF-8?q?=20Remove=20use=20of=20deprecated=20patchesStrategicMerge=20/?=
=?UTF-8?q?=20=E2=9C=A8=20Upgrade=20kustomize=20version=20from=20v5.1.1=20?=
=?UTF-8?q?to=20v5.2.1=20(#3661)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Remove use of deprecated patchesStrategicMerge
It also needed to bump version of kustomize to
v5.2.1 in order to support multiple patches in a
single file. (config/default/webhookcainjection_-
patch.yaml)
---
.../testdata/project/Makefile | 2 +-
.../testdata/project/config/default/kustomization.yaml | 10 +++++-----
.../src/cronjob-tutorial/testdata/project/Makefile | 2 +-
.../testdata/project/config/default/kustomization.yaml | 8 ++++----
.../docs/internal/cronjob-tutorial/generate_cronjob.go | 2 +-
pkg/plugins/common/kustomize/v2/plugin.go | 2 +-
.../templates/config/kdefault/kustomization.go | 10 +++++-----
pkg/plugins/common/kustomize/v2/scaffolds/webhook.go | 6 +++---
test/e2e/v4/generate_test.go | 2 +-
.../project-v4-multigroup-with-deploy-image/Makefile | 2 +-
.../config/default/kustomization.yaml | 8 ++++----
testdata/project-v4-multigroup/Makefile | 2 +-
.../config/default/kustomization.yaml | 8 ++++----
testdata/project-v4-with-deploy-image/Makefile | 2 +-
.../config/default/kustomization.yaml | 8 ++++----
testdata/project-v4-with-grafana/Makefile | 2 +-
.../config/default/kustomization.yaml | 8 ++++----
testdata/project-v4/Makefile | 2 +-
testdata/project-v4/config/default/kustomization.yaml | 8 ++++----
19 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/Makefile
+++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml b/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml
index 742fea61830..e0e588792cf 100644
--- a/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml
+++ b/docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml
@@ -26,24 +26,24 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
-- manager_config_patch.yaml
+- path: manager_config_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+#- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml b/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
index 7f7f7cefb8c..e445fec445d 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
+++ b/docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml
@@ -26,20 +26,20 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-- manager_webhook_patch.yaml
+- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-- webhookcainjection_patch.yaml
+- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
index c14fbaed488..119c8526f88 100644
--- a/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
+++ b/hack/docs/internal/cronjob-tutorial/generate_cronjob.go
@@ -549,7 +549,7 @@ func updateKustomization(sp *Sample) {
err = pluginutil.UncommentCode(
filepath.Join(sp.ctx.Dir, "config/default/kustomization.yaml"),
- `#- webhookcainjection`, `#`)
+ `#- path: webhookcainjection`, `#`)
CheckError("fixing default/kustomization", err)
err = pluginutil.UncommentCode(
diff --git a/pkg/plugins/common/kustomize/v2/plugin.go b/pkg/plugins/common/kustomize/v2/plugin.go
index da61ac59fd8..c4364fef9f2 100644
--- a/pkg/plugins/common/kustomize/v2/plugin.go
+++ b/pkg/plugins/common/kustomize/v2/plugin.go
@@ -25,7 +25,7 @@ import (
)
// KustomizeVersion is the kubernetes-sigs/kustomize version to be used in the project
-const KustomizeVersion = "v5.1.1"
+const KustomizeVersion = "v5.2.1"
const pluginName = "kustomize.common." + plugins.DefaultNameQualifier
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
index e9ae8a5560b..319bcf1a6b3 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/internal/templates/config/kdefault/kustomization.go
@@ -72,27 +72,27 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
{{ if .ComponentConfig -}}
# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
-- manager_config_patch.yaml
+- path: manager_config_patch.yaml
{{ end -}}
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+#- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
index 5ca84c75f4c..53e1fae1535 100644
--- a/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
+++ b/pkg/plugins/common/kustomize/v2/scaffolds/webhook.go
@@ -96,11 +96,11 @@ func (s *webhookScaffolder) Scaffold() error {
}
}
- err = pluginutil.UncommentCode(kustomizeFilePath, "#- manager_webhook_patch.yaml", `#`)
+ err = pluginutil.UncommentCode(kustomizeFilePath, "#- path: manager_webhook_patch.yaml", `#`)
if err != nil {
- hasWebHookUncommented, err := pluginutil.HasFragment(kustomizeFilePath, "- manager_webhook_patch.yaml")
+ hasWebHookUncommented, err := pluginutil.HasFragment(kustomizeFilePath, "- path: manager_webhook_patch.yaml")
if !hasWebHookUncommented || err != nil {
- log.Errorf("Unable to find the target #- manager_webhook_patch.yaml to uncomment in the file "+
+ log.Errorf("Unable to find the target #- path: manager_webhook_patch.yaml to uncomment in the file "+
"%s.", kustomizeFilePath)
}
}
diff --git a/test/e2e/v4/generate_test.go b/test/e2e/v4/generate_test.go
index 7fc05c73f95..11ccbff8a00 100644
--- a/test/e2e/v4/generate_test.go
+++ b/test/e2e/v4/generate_test.go
@@ -62,7 +62,7 @@ func GenerateV4(kbc *utils.TestContext) {
"#- ../prometheus", "#")).To(Succeed())
ExpectWithOffset(1, pluginutil.UncommentCode(
filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
- "#- webhookcainjection_patch.yaml", "#")).To(Succeed())
+ "#- path: webhookcainjection_patch.yaml", "#")).To(Succeed())
ExpectWithOffset(1, pluginutil.UncommentCode(filepath.Join(kbc.Dir, "config", "default", "kustomization.yaml"),
certManagerTarget, "#")).To(Succeed())
diff --git a/testdata/project-v4-multigroup-with-deploy-image/Makefile b/testdata/project-v4-multigroup-with-deploy-image/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/Makefile
+++ b/testdata/project-v4-multigroup-with-deploy-image/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
index 8027afebe13..2f78dfb54aa 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup-with-deploy-image/config/default/kustomization.yaml
@@ -26,20 +26,20 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-- manager_webhook_patch.yaml
+- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/testdata/project-v4-multigroup/Makefile
+++ b/testdata/project-v4-multigroup/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4-multigroup/config/default/kustomization.yaml b/testdata/project-v4-multigroup/config/default/kustomization.yaml
index e6d46950c0e..9fe6e3630df 100644
--- a/testdata/project-v4-multigroup/config/default/kustomization.yaml
+++ b/testdata/project-v4-multigroup/config/default/kustomization.yaml
@@ -26,20 +26,20 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-- manager_webhook_patch.yaml
+- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/testdata/project-v4-with-deploy-image/Makefile
+++ b/testdata/project-v4-with-deploy-image/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml b/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
index 88913b74d0b..62e78ccdbbe 100644
--- a/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-deploy-image/config/default/kustomization.yaml
@@ -26,20 +26,20 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-- manager_webhook_patch.yaml
+- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/testdata/project-v4-with-grafana/Makefile
+++ b/testdata/project-v4-with-grafana/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4-with-grafana/config/default/kustomization.yaml b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
index 4cac74bd765..7fca0820b0c 100644
--- a/testdata/project-v4-with-grafana/config/default/kustomization.yaml
+++ b/testdata/project-v4-with-grafana/config/default/kustomization.yaml
@@ -26,20 +26,20 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-#- manager_webhook_patch.yaml
+#- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index a4a190c2605..3e9011d2b8f 100644
--- a/testdata/project-v4/Makefile
+++ b/testdata/project-v4/Makefile
@@ -155,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
## Tool Versions
-KUSTOMIZE_VERSION ?= v5.1.1
+KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0
.PHONY: kustomize
diff --git a/testdata/project-v4/config/default/kustomization.yaml b/testdata/project-v4/config/default/kustomization.yaml
index ee54697b34d..ae7fc170730 100644
--- a/testdata/project-v4/config/default/kustomization.yaml
+++ b/testdata/project-v4/config/default/kustomization.yaml
@@ -26,20 +26,20 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
-patchesStrategicMerge:
+patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
-- manager_auth_proxy_patch.yaml
+- path: manager_auth_proxy_patch.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
-- manager_webhook_patch.yaml
+- path: manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
# 'CERTMANAGER' needs to be enabled to use ca injection
-#- webhookcainjection_patch.yaml
+#- path: webhookcainjection_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# Uncomment the following replacements to add the cert-manager CA injection annotations
From 3de41b8bb4498317e76dcfb9e3a582a0cb007634 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 30 Oct 2023 23:27:10 +0000
Subject: [PATCH 0331/1245] Bump github.com/onsi/gomega from 1.28.1 to 1.29.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.28.1 to 1.29.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.28.1...v1.29.0)
---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 82db9b2dd16..5f9a0cac332 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.13.0
- github.com/onsi/gomega v1.28.1
+ github.com/onsi/gomega v1.29.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
github.com/spf13/cobra v1.7.0
diff --git a/go.sum b/go.sum
index c753f0825fe..b933468d217 100644
--- a/go.sum
+++ b/go.sum
@@ -141,8 +141,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA=
-github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
+github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
+github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
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=
From 33c484c6cdff3ffa24476b4c4602f03cec4affc3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 30 Oct 2023 23:27:17 +0000
Subject: [PATCH 0332/1245] Bump sigs.k8s.io/yaml from 1.3.0 to 1.4.0
Bumps [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/kubernetes-sigs/yaml/releases)
- [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/yaml/compare/v1.3.0...v1.4.0)
---
updated-dependencies:
- dependency-name: sigs.k8s.io/yaml
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 3 +--
go.sum | 7 +++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/go.mod b/go.mod
index 82db9b2dd16..6e2e45a39e9 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.13.0
golang.org/x/tools v0.14.0
- sigs.k8s.io/yaml v1.3.0
+ sigs.k8s.io/yaml v1.4.0
)
require (
@@ -24,6 +24,5 @@ require (
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // 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 c753f0825fe..e54fe0390f6 100644
--- a/go.sum
+++ b/go.sum
@@ -102,6 +102,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@@ -474,8 +475,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
-gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -489,5 +488,5 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
-sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
+sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
+sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
From b598be8253fc99b55a33aaed7906cc265f6ac660 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Thu, 2 Nov 2023 18:27:34 +0000
Subject: [PATCH 0333/1245] readme: update meeting
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index c1dc36984fa..92e0d225f2c 100644
--- a/README.md
+++ b/README.md
@@ -136,6 +136,7 @@ The following meetings happen biweekly:
- Kubebuilder Meeting
You are more than welcome to attend. For further info join to [kubebuilder@googlegroups.com](https://groups.google.com/g/kubebuilder).
+Every month, our team meets on the first Thursday at 11:00 PT (Pacific Time) to discuss our progress and plan for the upcoming weeks.
[operator-sdk]: https://github.com/operator-framework/operator-sdk
[plugin-section]: https://book.kubebuilder.io/plugins/plugins.html
From 439b886954a2ee51cea8ce26e92bbc995ef09841 Mon Sep 17 00:00:00 2001
From: pingjiang
Date: Fri, 3 Nov 2023 21:49:48 +0800
Subject: [PATCH 0334/1245] Doc: Getting Started fix code examples indentation
Signed-off-by: pingjiang
---
docs/book/src/getting-started.md | 544 +++++++++++++++----------------
1 file changed, 272 insertions(+), 272 deletions(-)
diff --git a/docs/book/src/getting-started.md b/docs/book/src/getting-started.md
index ab11b7aa77c..6af3298e229 100644
--- a/docs/book/src/getting-started.md
+++ b/docs/book/src/getting-started.md
@@ -64,33 +64,33 @@ From: `api/v1alpha1/memcached_types.go`
```go
// MemcachedSpec defines the desired state of Memcached
type MemcachedSpec struct {
-// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
-// Important: Run "make" to regenerate code after modifying this file
-
-// Size defines the number of Memcached instances
-// The following markers will use OpenAPI v3 schema to validate the value
-// More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
-// +kubebuilder:validation:Minimum=1
-// +kubebuilder:validation:Maximum=3
-// +kubebuilder:validation:ExclusiveMaximum=false
-Size int32 `json:"size,omitempty"`
-
-// Port defines the port that will be used to init the container with the image
-ContainerPort int32 `json:"containerPort,omitempty"`
+ // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+ // Important: Run "make" to regenerate code after modifying this file
+
+ // Size defines the number of Memcached instances
+ // The following markers will use OpenAPI v3 schema to validate the value
+ // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
+ // +kubebuilder:validation:Minimum=1
+ // +kubebuilder:validation:Maximum=3
+ // +kubebuilder:validation:ExclusiveMaximum=false
+ Size int32 `json:"size,omitempty"`
+
+ // Port defines the port that will be used to init the container with the image
+ ContainerPort int32 `json:"containerPort,omitempty"`
}
// MemcachedStatus defines the observed state of Memcached
type MemcachedStatus struct {
-// Represents the observations of a Memcached's current state.
-// Memcached.status.conditions.type are: "Available", "Progressing", and "Degraded"
-// Memcached.status.conditions.status are one of True, False, Unknown.
-// Memcached.status.conditions.reason the value should be a CamelCase string and producers of specific
-// condition types may define expected values and meanings for this field, and whether the values
-// are considered a guaranteed API.
-// Memcached.status.conditions.Message is a human readable message indicating details about the transition.
-// For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
-
-Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
+ // Represents the observations of a Memcached's current state.
+ // Memcached.status.conditions.type are: "Available", "Progressing", and "Degraded"
+ // Memcached.status.conditions.status are one of True, False, Unknown.
+ // Memcached.status.conditions.reason the value should be a CamelCase string and producers of specific
+ // condition types may define expected values and meanings for this field, and whether the values
+ // are considered a guaranteed API.
+ // Memcached.status.conditions.Message is a human readable message indicating details about the transition.
+ // For further information see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
+
+ Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}
```
@@ -149,30 +149,30 @@ The reconciliation function plays a pivotal role in ensuring synchronization bet
```go
reconcile App {
-// Check if a Deployment for the app exists, if not, create one
-// If there's an error, then restart from the beginning of the reconcile
-if err != nil {
-return reconcile.Result{}, err
-}
+ // Check if a Deployment for the app exists, if not, create one
+ // If there's an error, then restart from the beginning of the reconcile
+ if err != nil {
+ return reconcile.Result{}, err
+ }
-// Check if a Service for the app exists, if not, create one
-// If there's an error, then restart from the beginning of the reconcile
-if err != nil {
-return reconcile.Result{}, err
-}
+ // Check if a Service for the app exists, if not, create one
+ // If there's an error, then restart from the beginning of the reconcile
+ if err != nil {
+ return reconcile.Result{}, err
+ }
-// Look for Database CR/CRD
-// Check the Database Deployment's replicas size
-// If deployment.replicas size doesn't match cr.size, then update it
-// Then, restart from the beginning of the reconcile. For example, by returning `reconcile.Result{Requeue: true}, nil`.
-if err != nil {
-return reconcile.Result{Requeue: true}, nil
-}
-...
+ // Look for Database CR/CRD
+ // Check the Database Deployment's replicas size
+ // If deployment.replicas size doesn't match cr.size, then update it
+ // Then, restart from the beginning of the reconcile. For example, by returning `reconcile.Result{Requeue: true}, nil`.
+ if err != nil {
+ return reconcile.Result{Requeue: true}, nil
+ }
+ ...
-// If at the end of the loop:
-// Everything was executed successfully, and the reconcile can stop
-return reconcile.Result{}, nil
+ // If at the end of the loop:
+ // Everything was executed successfully, and the reconcile can stop
+ return reconcile.Result{}, nil
}
```
@@ -212,207 +212,207 @@ From `testdata/project-v4-with-deploy-image/internal/controller/memcached_contro
```go
func (r *MemcachedReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
-log := log.FromContext(ctx)
-
-// Fetch the Memcached instance
-// The purpose is to check if the Custom Resource for the Kind Memcached
-// is applied on the cluster if not we return nil to stop the reconciliation
-memcached := &examplecomv1alpha1.Memcached{}
-err := r.Get(ctx, req.NamespacedName, memcached)
-if err != nil {
-if apierrors.IsNotFound(err) {
-// If the custom resource is not found then, it usually means that it was deleted or not created
-// In this way, we will stop the reconciliation
-log.Info("memcached resource not found. Ignoring since object must be deleted")
-return ctrl.Result{}, nil
-}
-// Error reading the object - requeue the request.
-log.Error(err, "Failed to get memcached")
-return ctrl.Result{}, err
-}
-
-// Let's just set the status as Unknown when no status are available
-if memcached.Status.Conditions == nil || len(memcached.Status.Conditions) == 0 {
-meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
-if err = r.Status().Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update Memcached status")
-return ctrl.Result{}, err
-}
-
-// Let's re-fetch the memcached Custom Resource after update the status
-// so that we have the latest state of the resource on the cluster and we will avoid
-// raise the issue "the object has been modified, please apply
-// your changes to the latest version and try again" which would re-trigger the reconciliation
-// if we try to update it again in the following operations
-if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
-log.Error(err, "Failed to re-fetch memcached")
-return ctrl.Result{}, err
-}
-}
-
-// Let's add a finalizer. Then, we can define some operations which should
-// occurs before the custom resource to be deleted.
-// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
-if !controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
-log.Info("Adding Finalizer for Memcached")
-if ok := controllerutil.AddFinalizer(memcached, memcachedFinalizer); !ok {
-log.Error(err, "Failed to add finalizer into the custom resource")
-return ctrl.Result{Requeue: true}, nil
-}
-
-if err = r.Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update custom resource to add finalizer")
-return ctrl.Result{}, err
-}
-}
-
-// Check if the Memcached instance is marked to be deleted, which is
-// indicated by the deletion timestamp being set.
-isMemcachedMarkedToBeDeleted := memcached.GetDeletionTimestamp() != nil
-if isMemcachedMarkedToBeDeleted {
-if controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
-log.Info("Performing Finalizer Operations for Memcached before delete CR")
-
-// Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
-meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
-Status: metav1.ConditionUnknown, Reason: "Finalizing",
-Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", memcached.Name)})
-
-if err := r.Status().Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update Memcached status")
-return ctrl.Result{}, err
-}
-
-// Perform all operations required before remove the finalizer and allow
-// the Kubernetes API to remove the custom resource.
-r.doFinalizerOperationsForMemcached(memcached)
-
-// TODO(user): If you add operations to the doFinalizerOperationsForMemcached method
-// then you need to ensure that all worked fine before deleting and updating the Downgrade status
-// otherwise, you should requeue here.
-
-// Re-fetch the memcached Custom Resource before update the status
-// so that we have the latest state of the resource on the cluster and we will avoid
-// raise the issue "the object has been modified, please apply
-// your changes to the latest version and try again" which would re-trigger the reconciliation
-if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
-log.Error(err, "Failed to re-fetch memcached")
-return ctrl.Result{}, err
-}
-
-meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
-Status: metav1.ConditionTrue, Reason: "Finalizing",
-Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", memcached.Name)})
-
-if err := r.Status().Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update Memcached status")
-return ctrl.Result{}, err
-}
-
-log.Info("Removing Finalizer for Memcached after successfully perform the operations")
-if ok := controllerutil.RemoveFinalizer(memcached, memcachedFinalizer); !ok {
-log.Error(err, "Failed to remove finalizer for Memcached")
-return ctrl.Result{Requeue: true}, nil
-}
-
-if err := r.Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to remove finalizer for Memcached")
-return ctrl.Result{}, err
-}
-}
-return ctrl.Result{}, nil
-}
-
-// Check if the deployment already exists, if not create a new one
-found := &appsv1.Deployment{}
-err = r.Get(ctx, types.NamespacedName{Name: memcached.Name, Namespace: memcached.Namespace}, found)
-if err != nil && apierrors.IsNotFound(err) {
-// Define a new deployment
-dep, err := r.deploymentForMemcached(memcached)
-if err != nil {
-log.Error(err, "Failed to define new Deployment resource for Memcached")
-
-// The following implementation will update the status
-meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
-Status: metav1.ConditionFalse, Reason: "Reconciling",
-Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", memcached.Name, err)})
-
-if err := r.Status().Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update Memcached status")
-return ctrl.Result{}, err
-}
-
-return ctrl.Result{}, err
-}
-
-log.Info("Creating a new Deployment",
-"Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
-if err = r.Create(ctx, dep); err != nil {
-log.Error(err, "Failed to create new Deployment",
-"Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
-return ctrl.Result{}, err
-}
-
-// Deployment created successfully
-// We will requeue the reconciliation so that we can ensure the state
-// and move forward for the next operations
-return ctrl.Result{RequeueAfter: time.Minute}, nil
-} else if err != nil {
-log.Error(err, "Failed to get Deployment")
-// Let's return the error for the reconciliation be re-trigged again
-return ctrl.Result{}, err
-}
-
-// The CRD API is defining that the Memcached type, have a MemcachedSpec.Size field
-// to set the quantity of Deployment instances is the desired state on the cluster.
-// Therefore, the following code will ensure the Deployment size is the same as defined
-// via the Size spec of the Custom Resource which we are reconciling.
-size := memcached.Spec.Size
-if *found.Spec.Replicas != size {
-found.Spec.Replicas = &size
-if err = r.Update(ctx, found); err != nil {
-log.Error(err, "Failed to update Deployment",
-"Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
-
-// Re-fetch the memcached Custom Resource before update the status
-// so that we have the latest state of the resource on the cluster and we will avoid
-// raise the issue "the object has been modified, please apply
-// your changes to the latest version and try again" which would re-trigger the reconciliation
-if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
-log.Error(err, "Failed to re-fetch memcached")
-return ctrl.Result{}, err
-}
-
-// The following implementation will update the status
-meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
-Status: metav1.ConditionFalse, Reason: "Resizing",
-Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", memcached.Name, err)})
-
-if err := r.Status().Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update Memcached status")
-return ctrl.Result{}, err
-}
-
-return ctrl.Result{}, err
-}
-
-// Now, that we update the size we want to requeue the reconciliation
-// so that we can ensure that we have the latest state of the resource before
-// update. Also, it will help ensure the desired state on the cluster
-return ctrl.Result{Requeue: true}, nil
-}
-
-// The following implementation will update the status
-meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
-Status: metav1.ConditionTrue, Reason: "Reconciling",
-Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, size)})
-
-if err := r.Status().Update(ctx, memcached); err != nil {
-log.Error(err, "Failed to update Memcached status")
-return ctrl.Result{}, err
-}
-
-return ctrl.Result{}, nil
+ log := log.FromContext(ctx)
+
+ // Fetch the Memcached instance
+ // The purpose is check if the Custom Resource for the Kind Memcached
+ // is applied on the cluster if not we return nil to stop the reconciliation
+ memcached := &examplecomv1alpha1.Memcached{}
+ err := r.Get(ctx, req.NamespacedName, memcached)
+ if err != nil {
+ if apierrors.IsNotFound(err) {
+ // If the custom resource is not found then, it usually means that it was deleted or not created
+ // In this way, we will stop the reconciliation
+ log.Info("memcached resource not found. Ignoring since object must be deleted")
+ return ctrl.Result{}, nil
+ }
+ // Error reading the object - requeue the request.
+ log.Error(err, "Failed to get memcached")
+ return ctrl.Result{}, err
+ }
+
+ // Let's just set the status as Unknown when no status are available
+ if memcached.Status.Conditions == nil || len(memcached.Status.Conditions) == 0 {
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached, Status: metav1.ConditionUnknown, Reason: "Reconciling", Message: "Starting reconciliation"})
+ if err = r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ // Let's re-fetch the memcached Custom Resource after update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ // if we try to update it again in the following operations
+ if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+ log.Error(err, "Failed to re-fetch memcached")
+ return ctrl.Result{}, err
+ }
+ }
+
+ // Let's add a finalizer. Then, we can define some operations which should
+ // occurs before the custom resource to be deleted.
+ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers
+ if !controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
+ log.Info("Adding Finalizer for Memcached")
+ if ok := controllerutil.AddFinalizer(memcached, memcachedFinalizer); !ok {
+ log.Error(err, "Failed to add finalizer into the custom resource")
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ if err = r.Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update custom resource to add finalizer")
+ return ctrl.Result{}, err
+ }
+ }
+
+ // Check if the Memcached instance is marked to be deleted, which is
+ // indicated by the deletion timestamp being set.
+ isMemcachedMarkedToBeDeleted := memcached.GetDeletionTimestamp() != nil
+ if isMemcachedMarkedToBeDeleted {
+ if controllerutil.ContainsFinalizer(memcached, memcachedFinalizer) {
+ log.Info("Performing Finalizer Operations for Memcached before delete CR")
+
+ // Let's add here an status "Downgrade" to define that this resource begin its process to be terminated.
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
+ Status: metav1.ConditionUnknown, Reason: "Finalizing",
+ Message: fmt.Sprintf("Performing finalizer operations for the custom resource: %s ", memcached.Name)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ // Perform all operations required before remove the finalizer and allow
+ // the Kubernetes API to remove the custom resource.
+ r.doFinalizerOperationsForMemcached(memcached)
+
+ // TODO(user): If you add operations to the doFinalizerOperationsForMemcached method
+ // then you need to ensure that all worked fine before deleting and updating the Downgrade status
+ // otherwise, you should requeue here.
+
+ // Re-fetch the memcached Custom Resource before update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+ log.Error(err, "Failed to re-fetch memcached")
+ return ctrl.Result{}, err
+ }
+
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeDegradedMemcached,
+ Status: metav1.ConditionTrue, Reason: "Finalizing",
+ Message: fmt.Sprintf("Finalizer operations for custom resource %s name were successfully accomplished", memcached.Name)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ log.Info("Removing Finalizer for Memcached after successfully perform the operations")
+ if ok := controllerutil.RemoveFinalizer(memcached, memcachedFinalizer); !ok {
+ log.Error(err, "Failed to remove finalizer for Memcached")
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ if err := r.Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to remove finalizer for Memcached")
+ return ctrl.Result{}, err
+ }
+ }
+ return ctrl.Result{}, nil
+ }
+
+ // Check if the deployment already exists, if not create a new one
+ found := &appsv1.Deployment{}
+ err = r.Get(ctx, types.NamespacedName{Name: memcached.Name, Namespace: memcached.Namespace}, found)
+ if err != nil && apierrors.IsNotFound(err) {
+ // Define a new deployment
+ dep, err := r.deploymentForMemcached(memcached)
+ if err != nil {
+ log.Error(err, "Failed to define new Deployment resource for Memcached")
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionFalse, Reason: "Reconciling",
+ Message: fmt.Sprintf("Failed to create Deployment for the custom resource (%s): (%s)", memcached.Name, err)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, err
+ }
+
+ log.Info("Creating a new Deployment",
+ "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+ if err = r.Create(ctx, dep); err != nil {
+ log.Error(err, "Failed to create new Deployment",
+ "Deployment.Namespace", dep.Namespace, "Deployment.Name", dep.Name)
+ return ctrl.Result{}, err
+ }
+
+ // Deployment created successfully
+ // We will requeue the reconciliation so that we can ensure the state
+ // and move forward for the next operations
+ return ctrl.Result{RequeueAfter: time.Minute}, nil
+ } else if err != nil {
+ log.Error(err, "Failed to get Deployment")
+ // Let's return the error for the reconciliation be re-trigged again
+ return ctrl.Result{}, err
+ }
+
+ // The CRD API is defining that the Memcached type, have a MemcachedSpec.Size field
+ // to set the quantity of Deployment instances is the desired state on the cluster.
+ // Therefore, the following code will ensure the Deployment size is the same as defined
+ // via the Size spec of the Custom Resource which we are reconciling.
+ size := memcached.Spec.Size
+ if *found.Spec.Replicas != size {
+ found.Spec.Replicas = &size
+ if err = r.Update(ctx, found); err != nil {
+ log.Error(err, "Failed to update Deployment",
+ "Deployment.Namespace", found.Namespace, "Deployment.Name", found.Name)
+
+ // Re-fetch the memcached Custom Resource before update the status
+ // so that we have the latest state of the resource on the cluster and we will avoid
+ // raise the issue "the object has been modified, please apply
+ // your changes to the latest version and try again" which would re-trigger the reconciliation
+ if err := r.Get(ctx, req.NamespacedName, memcached); err != nil {
+ log.Error(err, "Failed to re-fetch memcached")
+ return ctrl.Result{}, err
+ }
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionFalse, Reason: "Resizing",
+ Message: fmt.Sprintf("Failed to update the size for the custom resource (%s): (%s)", memcached.Name, err)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, err
+ }
+
+ // Now, that we update the size we want to requeue the reconciliation
+ // so that we can ensure that we have the latest state of the resource before
+ // update. Also, it will help ensure the desired state on the cluster
+ return ctrl.Result{Requeue: true}, nil
+ }
+
+ // The following implementation will update the status
+ meta.SetStatusCondition(&memcached.Status.Conditions, metav1.Condition{Type: typeAvailableMemcached,
+ Status: metav1.ConditionTrue, Reason: "Reconciling",
+ Message: fmt.Sprintf("Deployment for custom resource (%s) with %d replicas created successfully", memcached.Name, size)})
+
+ if err := r.Status().Update(ctx, memcached); err != nil {
+ log.Error(err, "Failed to update Memcached status")
+ return ctrl.Result{}, err
+ }
+
+ return ctrl.Result{}, nil
}
```
@@ -428,10 +428,10 @@ which is orchestrated and owned by its respective controller. Observe:
// Note that the Deployment will be also watched in order to ensure its
// desirable state on the cluster
func (r *MemcachedReconciler) SetupWithManager(mgr ctrl.Manager) error {
-return ctrl.NewControllerManagedBy(mgr).
-For(&examplecomv1alpha1.Memcached{}). ## Create watches for the Memcached Kind
-Owns(&appsv1.Deployment{}). ## Create watches for the Deployment which has its controller owned reference
-Complete(r)
+ return ctrl.NewControllerManagedBy(mgr).
+ For(&examplecomv1alpha1.Memcached{}). ## Create watches for the Memcached Kind
+ Owns(&appsv1.Deployment{}). ## Create watches for the Deployment which has its controller owned reference
+ Complete(r)
}
```
@@ -444,7 +444,7 @@ See that when we create the Deployment to run the Memcached image we are setting
// Set the ownerRef for the Deployment
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
if err := ctrl.SetControllerReference(memcached, dep, r.Scheme); err != nil {
-return nil, err
+ return nil, err
}
```
@@ -486,28 +486,28 @@ If you inspect the `cmd/main.go` file, you'll come across the following:
```go
...
-mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
-Scheme: scheme,
-Metrics: metricsserver.Options{BindAddress: metricsAddr},
-HealthProbeBindAddress: probeAddr,
-LeaderElection: enableLeaderElection,
-LeaderElectionID: "1836d577.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
-// speeds up voluntary leader transitions as the new leader don't have to wait
-// LeaseDuration time first.
-//
-// In the default scaffold provided, the program ends immediately after
-// the manager stops, so would be fine to enable this option. However,
-// if you are doing or is intended to do any operation such as perform cleanups
-// after the manager stops then its usage might be unsafe.
-// LeaderElectionReleaseOnCancel: true,
-})
-if err != nil {
-setupLog.Error(err, "unable to start manager")
-os.Exit(1)
-}
+ mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
+ Scheme: scheme,
+ Metrics: metricsserver.Options{BindAddress: metricsAddr},
+ HealthProbeBindAddress: probeAddr,
+ LeaderElection: enableLeaderElection,
+ LeaderElectionID: "1836d577.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
+ // speeds up voluntary leader transitions as the new leader don't have to wait
+ // LeaseDuration time first.
+ //
+ // In the default scaffold provided, the program ends immediately after
+ // the manager stops, so would be fine to enable this option. However,
+ // if you are doing or is intended to do any operation such as perform cleanups
+ // after the manager stops then its usage might be unsafe.
+ // LeaderElectionReleaseOnCancel: true,
+ })
+ if err != nil {
+ setupLog.Error(err, "unable to start manager")
+ os.Exit(1)
+ }
```
The code snippet above outlines the configuration [options][options-manager] for the Manager. While we won't be altering this in our current example,
From 83999d1e07d9485dafe88ca956852e4abacb2da0 Mon Sep 17 00:00:00 2001
From: Saketh Kalaga <51327242+renormalize@users.noreply.github.com>
Date: Mon, 6 Nov 2023 13:38:16 +0530
Subject: [PATCH 0335/1245] :book: README.md: Fix first subheading under the
Kubebuilder heading * Heading `Kubebuilder` starts off with explaining
Kubebuilder is a framework * Subheading which explains Kubebuilder can also
be used as a library was previously `Kubebuilder is also a framework`, now
changed to `Kubebuilder is also a library` making it more coherent.
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c1dc36984fa..544b16a30e5 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ and features. To learn more about this see the [Plugin section][plugin-section].
Kubebuilder is developed on top of the [controller-runtime][controller-runtime] and [controller-tools][controller-tools] libraries.
-### Kubebuilder is also a framework
+### Kubebuilder is also a library
Kubebuilder is extensible and can be used as a library in other projects.
[Operator-SDK][operator-sdk] is a good example of a project that uses Kubebuilder as a library.
@@ -54,7 +54,7 @@ Check out the Kubebuilder [book](https://book.kubebuilder.io).
- GitHub Repo: [kubernetes-sigs/kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)
- Slack channel: [#kubebuilder](https://slack.k8s.io/#kubebuilder)
- Google Group: [kubebuilder@googlegroups.com](https://groups.google.com/forum/#!forum/kubebuilder)
-- Design Documents: [designs](designs/).
+- Design Documents: [designs](designs/)
- Plugin: [plugins][plugin-section]
## Motivation
From 7b0f699335601334e77a893dad2aa2a12355cabb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 6 Nov 2023 23:19:20 +0000
Subject: [PATCH 0336/1245] Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0)
---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/go.mod b/go.mod
index f247f52e6d2..730cfda925a 100644
--- a/go.mod
+++ b/go.mod
@@ -8,7 +8,7 @@ require (
github.com/onsi/gomega v1.29.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
- github.com/spf13/cobra v1.7.0
+ github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.13.0
golang.org/x/tools v0.14.0
diff --git a/go.sum b/go.sum
index f477f57ff62..a9556f9c58d 100644
--- a/go.sum
+++ b/go.sum
@@ -46,7 +46,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
-github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -155,8 +155,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
-github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
+github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
+github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.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=
From d38c6e48261eb0cc574753406c686976d4db7123 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 6 Nov 2023 23:19:31 +0000
Subject: [PATCH 0337/1245] Bump golang.org/x/text from 0.13.0 to 0.14.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.13.0...v0.14.0)
---
updated-dependencies:
- dependency-name: golang.org/x/text
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index f247f52e6d2..295cde6ef88 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
github.com/spf13/afero v1.10.0
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
- golang.org/x/text v0.13.0
+ golang.org/x/text v0.14.0
golang.org/x/tools v0.14.0
sigs.k8s.io/yaml v1.4.0
)
diff --git a/go.sum b/go.sum
index f477f57ff62..8bf64fd90db 100644
--- a/go.sum
+++ b/go.sum
@@ -323,8 +323,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
-golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
+golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
From 0c56866b8a2a1c7b63e53ba92fad75fe23d8e000 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 6 Nov 2023 23:35:30 +0000
Subject: [PATCH 0338/1245] :seedling: Bump
kubernetes-sigs/kubebuilder-release-tools
Bumps [kubernetes-sigs/kubebuilder-release-tools](https://github.com/kubernetes-sigs/kubebuilder-release-tools) from 0.4.0 to 0.4.2.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder-release-tools/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder-release-tools/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder-release-tools/compare/v0.4.0...v0.4.2)
---
updated-dependencies:
- dependency-name: kubernetes-sigs/kubebuilder-release-tools
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
.github/workflows/verify.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
index f423bfa67f3..ee668cd69f5 100644
--- a/.github/workflows/verify.yml
+++ b/.github/workflows/verify.yml
@@ -13,6 +13,6 @@ jobs:
steps:
- name: Verifier action
id: verifier
- uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.0
+ uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
From 3d84225ecfcd56b4fe6f3661f3c95b75df2215a6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 6 Nov 2023 23:48:47 +0000
Subject: [PATCH 0339/1245] Bump sigs.k8s.io/kubebuilder/v3
Bumps [sigs.k8s.io/kubebuilder/v3](https://github.com/kubernetes-sigs/kubebuilder) from 3.12.0 to 3.13.0.
- [Release notes](https://github.com/kubernetes-sigs/kubebuilder/releases)
- [Changelog](https://github.com/kubernetes-sigs/kubebuilder/blob/master/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/kubebuilder/compare/v3.12.0...v3.13.0)
---
updated-dependencies:
- dependency-name: sigs.k8s.io/kubebuilder/v3
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
.../testdata/sampleexternalplugin/v1/go.mod | 10 +++---
.../testdata/sampleexternalplugin/v1/go.sum | 33 +++++++++----------
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
index 14f2dc50aff..7614023d7ab 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.mod
@@ -4,14 +4,14 @@ go 1.20
require (
github.com/spf13/pflag v1.0.5
- sigs.k8s.io/kubebuilder/v3 v3.12.0
+ sigs.k8s.io/kubebuilder/v3 v3.13.0
)
require (
github.com/gobuffalo/flect v1.0.2 // indirect
- github.com/spf13/afero v1.9.5 // indirect
- golang.org/x/mod v0.12.0 // indirect
- golang.org/x/sys v0.11.0 // indirect
+ github.com/spf13/afero v1.10.0 // indirect
+ golang.org/x/mod v0.13.0 // indirect
+ golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
- golang.org/x/tools v0.12.0 // indirect
+ golang.org/x/tools v0.14.0 // indirect
)
diff --git a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
index d13d78f9029..0efa1b83175 100644
--- a/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
+++ b/docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1/go.sum
@@ -98,7 +98,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -112,7 +112,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
+github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb h1:LCMfzVg3sflxTs4UvuP4D8CkoZnfHLe2qzqgDn/4OHs=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
@@ -129,16 +129,16 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
-github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
+github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
+github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
-github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
+github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
+github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/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=
@@ -201,8 +201,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
+golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -235,7 +235,7 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
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=
@@ -290,8 +290,8 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
-golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
+golang.org/x/sys v0.13.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=
@@ -353,8 +353,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.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
-golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
+golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
+golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -451,7 +451,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
@@ -465,6 +464,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/kubebuilder/v3 v3.12.0 h1:POh46v+T2wPGzAzcIE/eKlwZr17nn+R49elJg2Wz2qU=
-sigs.k8s.io/kubebuilder/v3 v3.12.0/go.mod h1:ZJZ6jpjhh0skfehrYl7b8X/SCozhfLAU7IYV8ZN/f3s=
-sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
+sigs.k8s.io/kubebuilder/v3 v3.13.0 h1:ft1r2HdI29hEgtbuk3AEjOGX5A0N3jjbSA54oZzXH5I=
+sigs.k8s.io/kubebuilder/v3 v3.13.0/go.mod h1:BA3wwWd7P31jNLH9x+l5TzK6Of61SwY469ChO1+G2Cc=
+sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
From d7819ee55a5038e12c5b4c33ca91d7c2ced168e8 Mon Sep 17 00:00:00 2001
From: Tony Jin
Date: Wed, 8 Nov 2023 17:22:12 -0500
Subject: [PATCH 0340/1245] :book: Update metrics reference to the latest
version
Refer to controller-runtime v0.16.3 as many metrics were deprecated since v0.11.0.
Signed-off-by: tonyjin
---
docs/book/src/reference/metrics-reference.md | 37 ++++++++++----------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/docs/book/src/reference/metrics-reference.md b/docs/book/src/reference/metrics-reference.md
index 43ce4015394..4e437a17658 100644
--- a/docs/book/src/reference/metrics-reference.md
+++ b/docs/book/src/reference/metrics-reference.md
@@ -2,21 +2,22 @@
Following the metrics which are exported and provided by [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) by default:
-| Metrics name | Type | Description |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [workqueue_depth](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L41) | Gauge | Current depth of workqueue. |
-| [workqueue_adds_total](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L47) | Counter | Total number of adds handled by workqueue. |
-| [workqueue_queue_duration_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L53) | Histogram | How long in seconds an item stays in workqueue before being requested. |
-| [workqueue_work_duration_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L60) | Histogram | How long in seconds processing an item from workqueue takes. |
-| [workqueue_unfinished_work_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L67) | Gauge | How many seconds of work has been done that is in progress and hasn't been observed by work_duration. Large values indicate stuck threads. One can deduce the number of stuck threads by observing the rate at which this increases. |
-| [workqueue_longest_running_processor_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L76) | Gauge | How many seconds has the longest running processor for workqueue been running. |
-| [workqueue_retries_total](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/workqueue.go#L83) | Counter | Total number of retries handled by workqueue. |
-| [rest_client_requests_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/metrics/client_go_adapter.go#L79) | Counter | Number of HTTP requests, partitioned by status code, method, and host. |
-| [controller_runtime_reconcile_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/internal/controller/metrics/metrics.go#L30) | Counter | Total number of reconciliations per controller. |
-| [controller_runtime_reconcile_errors_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/internal/controller/metrics/metrics.go#L37) | Counter | Total number of reconciliation errors per controller. |
-| [controller_runtime_reconcile_time_seconds ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/internal/controller/metrics/metrics.go#L44) | Histogram | Length of time per reconciliation per controller. |
-| [controller_runtime_max_concurrent_reconciles ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/internal/controller/metrics/metrics.go#L53) | Gauge | Maximum number of concurrent reconciles per controller. |
-| [controller_runtime_active_workers ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/internal/controller/metrics/metrics.go#L60) | Gauge | Number of currently used workers per controller. |
-| [controller_runtime_webhook_latency_seconds ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/webhook/internal/metrics/metrics.go#L31) | Histogram | Histogram of the latency of processing admission requests. |
-| [controller_runtime_webhook_requests_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/webhook/internal/metrics/metrics.go#L40) | Counter | Total number of admission requests by HTTP status code. |
-| [controller_runtime_webhook_requests_in_flight](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.0/pkg/webhook/internal/metrics/metrics.go#L51) | Gauge | Current number of admission requests being served. |
+| Metrics name | Type | Description |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [workqueue_depth](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L41) | Gauge | Current depth of workqueue. |
+| [workqueue_adds_total](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L47) | Counter | Total number of adds handled by workqueue. |
+| [workqueue_queue_duration_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L53) | Histogram | How long in seconds an item stays in workqueue before being requested. |
+| [workqueue_work_duration_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L60) | Histogram | How long in seconds processing an item from workqueue takes. |
+| [workqueue_unfinished_work_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L67) | Gauge | How many seconds of work has been done that is in progress and hasn't been observed by work_duration. Large values indicate stuck threads. One can deduce the number of stuck threads by observing the rate at which this increases. |
+| [workqueue_longest_running_processor_seconds](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L76) | Gauge | How many seconds has the longest running processor for workqueue been running. |
+| [workqueue_retries_total](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/workqueue.go#L83) | Counter | Total number of retries handled by workqueue. |
+| [rest_client_requests_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/metrics/client_go_adapter.go#L33) | Counter | Number of HTTP requests, partitioned by status code, method, and host. |
+| [controller_runtime_reconcile_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/internal/controller/metrics/metrics.go#L30) | Counter | Total number of reconciliations per controller. |
+| [controller_runtime_reconcile_errors_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/internal/controller/metrics/metrics.go#L37) | Counter | Total number of reconciliation errors per controller. |
+| [controller_runtime_terminal_reconcile_errors_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/internal/controller/metrics/metrics.go#L44) | Counter | Total number of terminal errors from the reconciler. |
+| [controller_runtime_reconcile_time_seconds ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/internal/controller/metrics/metrics.go#L51) | Histogram | Length of time per reconciliation per controller. |
+| [controller_runtime_max_concurrent_reconciles ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/internal/controller/metrics/metrics.go#L60) | Gauge | Maximum number of concurrent reconciles per controller. |
+| [controller_runtime_active_workers ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/internal/controller/metrics/metrics.go#L67) | Gauge | Number of currently used workers per controller. |
+| [controller_runtime_webhook_latency_seconds ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/webhook/internal/metrics/metrics.go#L31) | Histogram | Histogram of the latency of processing admission requests. |
+| [controller_runtime_webhook_requests_total ](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/webhook/internal/metrics/metrics.go#L40) | Counter | Total number of admission requests by HTTP status code. |
+| [controller_runtime_webhook_requests_in_flight](https://github.com/kubernetes-sigs/controller-runtime/blob/v0.16.3/pkg/webhook/internal/metrics/metrics.go#L51) | Gauge | Current number of admission requests being served. |
From 3ffcdfb519af1db222887d0717ec34bc6be717f4 Mon Sep 17 00:00:00 2001
From: Camila Macedo
Date: Fri, 3 Nov 2023 05:18:57 +0000
Subject: [PATCH 0341/1245] :bug: bump envtest from 0.28.0 to 1.28.3 to ensure
that versions used are aligned
---
.../src/component-config-tutorial/testdata/project/Makefile | 2 +-
docs/book/src/cronjob-tutorial/testdata/project/Makefile | 2 +-
pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go | 2 +-
test/common.sh | 2 +-
testdata/project-v4-multigroup-with-deploy-image/Makefile | 2 +-
testdata/project-v4-multigroup/Makefile | 2 +-
testdata/project-v4-with-deploy-image/Makefile | 2 +-
testdata/project-v4-with-grafana/Makefile | 2 +-
testdata/project-v4/Makefile | 2 +-
9 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile
index 3e9011d2b8f..aba5047833e 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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# 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/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile
index 3e9011d2b8f..aba5047833e 100644
--- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile
+++ b/docs/book/src/cronjob-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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# 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/v4/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go
index 21092188151..ec5cceabed6 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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/test/common.sh b/test/common.sh
index 053c8a12f6e..5f4ecbea58c 100644
--- a/test/common.sh
+++ b/test/common.sh
@@ -30,7 +30,7 @@ function convert_to_tools_ver {
"1.25") echo "1.25.0";;
"1.26") echo "1.26.0";;
"1.27") echo "1.27.1";;
- "1.28") echo "1.28.0";;
+ "1.28") echo "1.28.3";;
*)
echo "k8s version $k8s_ver not supported"
exit 1
diff --git a/testdata/project-v4-multigroup-with-deploy-image/Makefile b/testdata/project-v4-multigroup-with-deploy-image/Makefile
index 3e9011d2b8f..aba5047833e 100644
--- a/testdata/project-v4-multigroup-with-deploy-image/Makefile
+++ b/testdata/project-v4-multigroup-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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4-multigroup/Makefile b/testdata/project-v4-multigroup/Makefile
index 3e9011d2b8f..aba5047833e 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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile
index 3e9011d2b8f..aba5047833e 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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4-with-grafana/Makefile b/testdata/project-v4-with-grafana/Makefile
index 3e9011d2b8f..aba5047833e 100644
--- a/testdata/project-v4-with-grafana/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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile
index 3e9011d2b8f..aba5047833e 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.28.0
+ENVTEST_K8S_VERSION = 1.28.3
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
From 4e7a814e5b22fef91b4ff524fe5029c6a9254e24 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 13 Nov 2023 23:38:40 +0000
Subject: [PATCH 0342/1245] Bump github.com/onsi/ginkgo/v2 from 2.13.0 to
2.13.1
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.13.0 to 2.13.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.13.0...v2.13.1)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 6 +++---
go.sum | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/go.mod b/go.mod
index 63e43730ce8..6566aaf7ef8 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.13.0
+ github.com/onsi/ginkgo/v2 v2.13.1
github.com/onsi/gomega v1.29.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
@@ -16,13 +16,13 @@ require (
)
require (
- github.com/go-logr/logr v1.2.4 // indirect
+ github.com/go-logr/logr v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
- golang.org/x/sys v0.13.0 // indirect
+ golang.org/x/sys v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index 8d7f7d6cbda..58a27d4eb4e 100644
--- a/go.sum
+++ b/go.sum
@@ -59,8 +59,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
-github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
+github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
@@ -140,8 +140,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
-github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
+github.com/onsi/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU=
+github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -312,8 +312,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
+golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
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=
From 6d7a6fbf77563f08f0694bd9bea1840a164b736a Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 14 Nov 2023 08:07:02 +0000
Subject: [PATCH 0343/1245] Bump golang.org/x/tools from 0.14.0 to 0.15.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.14.0 to 0.15.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.14.0...v0.15.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 6 +++---
go.sum | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/go.mod b/go.mod
index 6566aaf7ef8..b83e12fbb24 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.14.0
- golang.org/x/tools v0.14.0
+ golang.org/x/tools v0.15.0
sigs.k8s.io/yaml v1.4.0
)
@@ -21,8 +21,8 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
- golang.org/x/mod v0.13.0 // indirect
- golang.org/x/net v0.17.0 // indirect
+ golang.org/x/mod v0.14.0 // indirect
+ golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index 58a27d4eb4e..48e1bbf1fbf 100644
--- a/go.sum
+++ b/go.sum
@@ -220,8 +220,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
-golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
+golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -254,8 +254,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
+golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
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=
@@ -275,7 +275,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
+golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -375,8 +375,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.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
-golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
+golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
+golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
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=
From 5a9aef4c9af14cec01e97174928774456efc72ac Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 14 Nov 2023 08:07:10 +0000
Subject: [PATCH 0344/1245] Bump github.com/onsi/gomega from 1.29.0 to 1.30.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.29.0...v1.30.0)
---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 6566aaf7ef8..db4df717598 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
github.com/onsi/ginkgo/v2 v2.13.1
- github.com/onsi/gomega v1.29.0
+ github.com/onsi/gomega v1.30.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.10.0
github.com/spf13/cobra v1.8.0
diff --git a/go.sum b/go.sum
index 58a27d4eb4e..f47b832b6ed 100644
--- a/go.sum
+++ b/go.sum
@@ -142,8 +142,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/onsi/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU=
github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
-github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
-github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
+github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
+github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
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=
From 65b1201a83c5b48fd532140e43ed555a8deeb025 Mon Sep 17 00:00:00 2001
From: Tony Jin
Date: Wed, 8 Nov 2023 17:12:33 -0500
Subject: [PATCH 0345/1245] :sparkles: Enrich Grafana plugin panels
Add panels to show work queue depth, number of workers in use, and unfinished seconds
Signed-off-by: tonyjin
---
docs/book/src/plugins/grafana-v1-alpha.md | 44 ++-
.../scaffolds/internal/templates/runtime.go | 256 +++++++++++++++---
.../grafana/controller-runtime-metrics.json | 256 +++++++++++++++---
3 files changed, 481 insertions(+), 75 deletions(-)
diff --git a/docs/book/src/plugins/grafana-v1-alpha.md b/docs/book/src/plugins/grafana-v1-alpha.md
index 92ca74e5c27..9f8c277be0b 100644
--- a/docs/book/src/plugins/grafana-v1-alpha.md
+++ b/docs/book/src/plugins/grafana-v1-alpha.md
@@ -59,9 +59,9 @@ See an example of how to use the plugin in your project:
1. Copy the JSON file
2. Visit `/dashboard/import` to [import a new dashboard](https://grafana.com/docs/grafana/latest/dashboards/export-import/#import-dashboard).
3. Paste the JSON content to `Import via panel json`, then press `Load` button
-
+
4. Select the data source for Prometheus metrics
-
+
5. Once the json is imported in Grafana, the dashboard is ready.
### Grafana Dashboard
@@ -77,7 +77,7 @@ See an example of how to use the plugin in your project:
- Description:
- Per-second rate of total reconciliation as measured over the last 5 minutes
- Per-second rate of reconciliation errors as measured over the last 5 minutes
-- Sample:
+- Sample:
#### Controller CPU & Memory Usage
@@ -90,7 +90,7 @@ See an example of how to use the plugin in your project:
- Description:
- Per-second rate of CPU usage as measured over the last 5 minutes
- Allocated Memory for the running controller
-- Sample:
+- Sample:
#### Seconds of P50/90/99 Items Stay in Work Queue
@@ -100,7 +100,7 @@ See an example of how to use the plugin in your project:
- histogram_quantile(0.50, sum(rate(workqueue_queue_duration_seconds_bucket{job="$job", namespace="$namespace"}[5m])) by (instance, name, le))
- Description
- Seconds an item stays in workqueue before being requested.
-- Sample:
+- Sample:
#### Seconds of P50/90/99 Items Processed in Work Queue
@@ -120,7 +120,7 @@ See an example of how to use the plugin in your project:
- sum(rate(workqueue_adds_total{job="$job", namespace="$namespace"}[5m])) by (instance, name)
- Description
- Per-second rate of items added to work queue
-- Sample:
+- Sample:
#### Retries Rate in Work Queue
@@ -130,7 +130,37 @@ See an example of how to use the plugin in your project:
- sum(rate(workqueue_retries_total{job="$job", namespace="$namespace"}[5m])) by (instance, name)
- Description
- Per-second rate of retries handled by workqueue
-- Sample:
+- Sample:
+
+#### Number of Workers in Use
+
+- Metrics
+ - controller_runtime_active_workers
+- Query:
+ - controller_runtime_active_workers{job="$job", namespace="$namespace"}
+- Description
+ - The number of active controller workers
+- Sample:
+
+#### WorkQueue Depth
+
+- Metrics
+ - workqueue_depth
+- Query:
+ - workqueue_depth{job="$job", namespace="$namespace"}
+- Description
+ - Current depth of workqueue
+- Sample:
+
+#### Unfinished Seconds
+
+- Metrics
+ - workqueue_unfinished_work_seconds
+- Query:
+ - rate(workqueue_unfinished_work_seconds{job="$job", namespace="$namespace"}[5m])
+- Description
+ - How many seconds of work has done that is in progress and hasn't been observed by work_duration.
+- Sample:
### Visualize Custom Metrics
diff --git a/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates/runtime.go b/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates/runtime.go
index 85321d63005..01c2e856fe2 100644
--- a/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates/runtime.go
+++ b/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates/runtime.go
@@ -105,6 +105,62 @@ const controllerRuntimeTemplate = `{
"title": "Reconciliation Metrics",
"type": "row"
},
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "orange",
+ "value": 70
+ },
+ {
+ "color": "red",
+ "value": 85
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 3,
+ "x": 0,
+ "y": 1
+ },
+ "id": 24,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": ["lastNotNull"],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "9.5.3",
+ "targets": [
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "exemplar": true,
+ "expr": "controller_runtime_active_workers{job=\"$job\", namespace=\"$namespace\"}",
+ "interval": "",
+ "legendFormat": "{{controller}} {{instance}}",
+ "refId": "A"
+ }
+ ],
+ "title": "Number of workers in use",
+ "type": "gauge"
+ },
{
"datasource": "${DS_PROMETHEUS}",
"description": "Total number of reconciliations per controller",
@@ -114,6 +170,8 @@ const controllerRuntimeTemplate = `{
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -160,17 +218,18 @@ const controllerRuntimeTemplate = `{
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
+ "h": 8,
+ "w": 11,
+ "x": 3,
"y": 1
},
"id": 7,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -201,6 +260,8 @@ const controllerRuntimeTemplate = `{
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -247,17 +308,18 @@ const controllerRuntimeTemplate = `{
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
+ "h": 8,
+ "w": 10,
+ "x": 14,
"y": 1
},
"id": 6,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -285,13 +347,69 @@ const controllerRuntimeTemplate = `{
"h": 1,
"w": 24,
"x": 0,
- "y": 8
+ "y": 9
},
"id": 11,
"panels": [],
"title": "Work Queue Metrics",
"type": "row"
},
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "orange",
+ "value": 70
+ },
+ {
+ "color": "red",
+ "value": 85
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 3,
+ "x": 0,
+ "y": 10
+ },
+ "id": 22,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": ["lastNotNull"],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "9.5.3",
+ "targets": [
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "exemplar": true,
+ "expr": "workqueue_depth{job=\"$job\", namespace=\"$namespace\"}",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "WorkQueue Depth",
+ "type": "gauge"
+ },
{
"datasource": "${DS_PROMETHEUS}",
"description": "How long in seconds an item stays in workqueue before being requested",
@@ -301,6 +419,8 @@ const controllerRuntimeTemplate = `{
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -347,10 +467,10 @@ const controllerRuntimeTemplate = `{
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 9
+ "h": 8,
+ "w": 11,
+ "x": 3,
+ "y": 10
},
"id": 13,
"options": {
@@ -359,8 +479,9 @@ const controllerRuntimeTemplate = `{
"max",
"mean"
],
- "displayMode": "list",
- "placement": "right"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -406,6 +527,8 @@ const controllerRuntimeTemplate = `{
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -452,17 +575,18 @@ const controllerRuntimeTemplate = `{
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 9
+ "h": 8,
+ "w": 10,
+ "x": 14,
+ "y": 10
},
"id": 15,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -483,6 +607,64 @@ const controllerRuntimeTemplate = `{
"title": "Work Queue Add Rate",
"type": "timeseries"
},
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "description": "How many seconds of work has done that is in progress and hasn't been observed by work_duration.\nLarge values indicate stuck threads.\nOne can deduce the number of stuck threads by observing the rate at which this increases.",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "orange",
+ "value": 70
+ },
+ {
+ "color": "red",
+ "value": 85
+ }
+ ]
+ },
+ "unit": "s"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 3,
+ "x": 0,
+ "y": 18
+ },
+ "id": 23,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": ["lastNotNull"],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "9.5.3",
+ "targets": [
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "exemplar": true,
+ "expr": "rate(workqueue_unfinished_work_seconds{job=\"$job\", namespace=\"$namespace\"}[5m])",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "Unfinished Seconds",
+ "type": "gauge"
+ },
{
"datasource": "${DS_PROMETHEUS}",
"description": "How long in seconds processing an item from workqueue takes.",
@@ -492,6 +674,8 @@ const controllerRuntimeTemplate = `{
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -538,10 +722,10 @@ const controllerRuntimeTemplate = `{
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 16
+ "h": 9,
+ "w": 11,
+ "x": 3,
+ "y": 18
},
"id": 19,
"options": {
@@ -551,7 +735,8 @@ const controllerRuntimeTemplate = `{
"mean"
],
"displayMode": "table",
- "placement": "right"
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -598,6 +783,8 @@ const controllerRuntimeTemplate = `{
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -644,17 +831,18 @@ const controllerRuntimeTemplate = `{
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 16
+ "h": 9,
+ "w": 10,
+ "x": 14,
+ "y": 18
},
"id": 17,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
diff --git a/testdata/project-v4-with-grafana/grafana/controller-runtime-metrics.json b/testdata/project-v4-with-grafana/grafana/controller-runtime-metrics.json
index 70023a42d82..c8eea4cb434 100644
--- a/testdata/project-v4-with-grafana/grafana/controller-runtime-metrics.json
+++ b/testdata/project-v4-with-grafana/grafana/controller-runtime-metrics.json
@@ -58,6 +58,62 @@
"title": "Reconciliation Metrics",
"type": "row"
},
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "orange",
+ "value": 70
+ },
+ {
+ "color": "red",
+ "value": 85
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 3,
+ "x": 0,
+ "y": 1
+ },
+ "id": 24,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": ["lastNotNull"],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "9.5.3",
+ "targets": [
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "exemplar": true,
+ "expr": "controller_runtime_active_workers{job=\"$job\", namespace=\"$namespace\"}",
+ "interval": "",
+ "legendFormat": "{{controller}} {{instance}}",
+ "refId": "A"
+ }
+ ],
+ "title": "Number of workers in use",
+ "type": "gauge"
+ },
{
"datasource": "${DS_PROMETHEUS}",
"description": "Total number of reconciliations per controller",
@@ -67,6 +123,8 @@
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -113,17 +171,18 @@
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
+ "h": 8,
+ "w": 11,
+ "x": 3,
"y": 1
},
"id": 7,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -154,6 +213,8 @@
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -200,17 +261,18 @@
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
+ "h": 8,
+ "w": 10,
+ "x": 14,
"y": 1
},
"id": 6,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -238,13 +300,69 @@
"h": 1,
"w": 24,
"x": 0,
- "y": 8
+ "y": 9
},
"id": 11,
"panels": [],
"title": "Work Queue Metrics",
"type": "row"
},
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "orange",
+ "value": 70
+ },
+ {
+ "color": "red",
+ "value": 85
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 3,
+ "x": 0,
+ "y": 10
+ },
+ "id": 22,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": ["lastNotNull"],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "9.5.3",
+ "targets": [
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "exemplar": true,
+ "expr": "workqueue_depth{job=\"$job\", namespace=\"$namespace\"}",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "WorkQueue Depth",
+ "type": "gauge"
+ },
{
"datasource": "${DS_PROMETHEUS}",
"description": "How long in seconds an item stays in workqueue before being requested",
@@ -254,6 +372,8 @@
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -300,10 +420,10 @@
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 9
+ "h": 8,
+ "w": 11,
+ "x": 3,
+ "y": 10
},
"id": 13,
"options": {
@@ -312,8 +432,9 @@
"max",
"mean"
],
- "displayMode": "list",
- "placement": "right"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -359,6 +480,8 @@
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -405,17 +528,18 @@
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 9
+ "h": 8,
+ "w": 10,
+ "x": 14,
+ "y": 10
},
"id": 15,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -436,6 +560,64 @@
"title": "Work Queue Add Rate",
"type": "timeseries"
},
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "description": "How many seconds of work has done that is in progress and hasn't been observed by work_duration.\nLarge values indicate stuck threads.\nOne can deduce the number of stuck threads by observing the rate at which this increases.",
+ "fieldConfig": {
+ "defaults": {
+ "mappings": [],
+ "thresholds": {
+ "mode": "percentage",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "orange",
+ "value": 70
+ },
+ {
+ "color": "red",
+ "value": 85
+ }
+ ]
+ },
+ "unit": "s"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 9,
+ "w": 3,
+ "x": 0,
+ "y": 18
+ },
+ "id": 23,
+ "options": {
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": ["lastNotNull"],
+ "fields": "",
+ "values": false
+ },
+ "showThresholdLabels": false,
+ "showThresholdMarkers": true
+ },
+ "pluginVersion": "9.5.3",
+ "targets": [
+ {
+ "datasource": "${DS_PROMETHEUS}",
+ "exemplar": true,
+ "expr": "rate(workqueue_unfinished_work_seconds{job=\"$job\", namespace=\"$namespace\"}[5m])",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "title": "Unfinished Seconds",
+ "type": "gauge"
+ },
{
"datasource": "${DS_PROMETHEUS}",
"description": "How long in seconds processing an item from workqueue takes.",
@@ -445,6 +627,8 @@
"mode": "palette-classic"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -491,10 +675,10 @@
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 0,
- "y": 16
+ "h": 9,
+ "w": 11,
+ "x": 3,
+ "y": 18
},
"id": 19,
"options": {
@@ -504,7 +688,8 @@
"mean"
],
"displayMode": "table",
- "placement": "right"
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
@@ -551,6 +736,8 @@
"mode": "continuous-GrYlRd"
},
"custom": {
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
@@ -597,17 +784,18 @@
"overrides": []
},
"gridPos": {
- "h": 7,
- "w": 12,
- "x": 12,
- "y": 16
+ "h": 9,
+ "w": 10,
+ "x": 14,
+ "y": 18
},
"id": 17,
"options": {
"legend": {
"calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
},
"tooltip": {
"mode": "single",
From f2621cdff22d9117b0d473ab013529c1c01b9a20 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 27 Nov 2023 23:08:10 +0000
Subject: [PATCH 0346/1245] Bump golang.org/x/tools from 0.15.0 to 0.16.0
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.15.0...v0.16.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 6 +++---
go.sum | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/go.mod b/go.mod
index bd06f3746d2..69c3d224490 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.14.0
- golang.org/x/tools v0.15.0
+ golang.org/x/tools v0.16.0
sigs.k8s.io/yaml v1.4.0
)
@@ -22,7 +22,7 @@ require (
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
golang.org/x/mod v0.14.0 // indirect
- golang.org/x/net v0.18.0 // indirect
- golang.org/x/sys v0.14.0 // indirect
+ golang.org/x/net v0.19.0 // indirect
+ golang.org/x/sys v0.15.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index 3bea8500009..d2fb002cd59 100644
--- a/go.sum
+++ b/go.sum
@@ -254,8 +254,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
-golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
+golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
+golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
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=
@@ -312,8 +312,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
-golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
+golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
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=
@@ -375,8 +375,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.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
-golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
+golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
+golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
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=
From 57cfaf87386d7de3736e62cf751ba66a2f5d447a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakob=20M=C3=B6ller?=
Date: Fri, 1 Dec 2023 14:33:19 +0100
Subject: [PATCH 0347/1245] =?UTF-8?q?=F0=9F=93=96=20docs=20updates=20for?=
=?UTF-8?q?=20external=20types=20and=20submodule-layouts?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Steven E. Harris
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
---
docs/book/src/SUMMARY.md | 4 +
docs/book/src/reference/reference.md | 8 +-
docs/book/src/reference/submodule-layouts.md | 248 ++++++++++++++++++
.../src/reference}/using_an_external_type.md | 55 ++--
4 files changed, 289 insertions(+), 26 deletions(-)
create mode 100644 docs/book/src/reference/submodule-layouts.md
rename docs/{ => book/src/reference}/using_an_external_type.md (71%)
diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md
index 6ddbcdbab51..cb389867449 100644
--- a/docs/book/src/SUMMARY.md
+++ b/docs/book/src/SUMMARY.md
@@ -106,6 +106,10 @@
- [completion](./reference/completion.md)
- [Artifacts](./reference/artifacts.md)
- [Platform Support](./reference/platform.md)
+
+ - [Sub-Module Layouts](./reference/submodule-layouts.md)
+ - [Using an external Type / API](./reference/using_an_external_type.md)
+
- [Configuring EnvTest](./reference/envtest.md)
- [Metrics](./reference/metrics.md)
diff --git a/docs/book/src/reference/reference.md b/docs/book/src/reference/reference.md
index cbd05bb62bc..1d9026777d8 100644
--- a/docs/book/src/reference/reference.md
+++ b/docs/book/src/reference/reference.md
@@ -31,10 +31,12 @@
- [completion](completion.md)
- [Artifacts](artifacts.md)
- [Platform Support](platform.md)
- - [Writing controller tests](writing-tests.md)
- - [Metrics](metrics.md)
+ - [Sub-Module Layouts](submodule-layouts.md)
+ - [Using an external Type / API](using_an_external_type.md)
+
+ - [Metrics](metrics.md)
- [Reference](metrics-reference.md)
- [Makefile Helpers](makefile-helpers.md)
- - [CLI plugins](../plugins/cli-plugins.md)
+ - [CLI plugins](../plugins/plugins.md)
diff --git a/docs/book/src/reference/submodule-layouts.md b/docs/book/src/reference/submodule-layouts.md
new file mode 100644
index 00000000000..7407f1a431a
--- /dev/null
+++ b/docs/book/src/reference/submodule-layouts.md
@@ -0,0 +1,248 @@
+# Sub-Module Layouts
+
+This part describes how to modify a scaffolded project for use with multiple `go.mod` files for APIs and Controllers.
+
+Sub-Module Layouts (in a way you could call them a special form of [Monorepo's][monorepo]) are a special use case and can help in scenarios that involve reuse of APIs without introducing indirect dependencies that should not be available in the project consuming the API externally.
+
+
+Using external Types
+
+If you are looking to do operations and reconcile via a controller a Type(CRD) which are owned by another project then, please see [Using an external Type](/reference/using_an_external_type.md) for more info.
+
+
+
+## Overview
+
+Separate `go.mod` modules for APIs and Controllers can help for the following cases:
+
+- There is an enterprise version of an operator available that wants to reuse APIs from the Community Version
+- There are many (possibly external) modules depending on the API and you want to have a more strict separation of transitive dependencies
+- If you want to reduce impact of transitive dependencies on your API being included in other projects
+- If you are looking to separately manage the lifecycle of your API release process from your controller release process.
+- If you are looking to modularize your codebase without splitting your code between multiple repositories.
+
+They introduce however multiple caveats into typical projects which is one of the main factors that makes them hard to recommend in a generic use-case or plugin:
+
+- Multiple `go.mod` modules are not recommended as a go best practice and [multiple modules are mostly discouraged][multi-module-repositories]
+- There is always the possibility to extract your APIs into a new repository and arguably also have more control over the release process in a project spanning multiple repos relying on the same API types.
+- It requires at least one [replace directive][replace-directives] either through `go.work` which is at least 2 more files plus an environment variable for build environments without GO_WORK or through `go.mod` replace, which has to be manually dropped and added for every release.
+
+
+Implications on Maintenance efforts
+
+When deciding to deviate from the standard kubebuilder `PROJECT` setup or the extended layouts offered by its plugins, it can result in increased maintenance overhead as there can be breaking changes in upstream that could break with the custom module structure described here.
+
+Splitting your codebase to multiple repos and/or multiple modules incurs costs that will grow over time. You'll need to define clear version dependencies between your own modules, do phased upgrades carefully, etc. Especially for small-to-medium projects, one repo and one module is the best way to go.
+
+Bear in mind, that it is not recommended to deviate from the proposed layout unless you know what you are doing.
+You may also lose the ability to use some of the CLI features and helpers. For further information on the project layout, see the doc [What's in a basic project?][basic-project-doc]
+
+
+
+## Adjusting your Project
+
+For a proper Sub-Module layout, we will use the generated APIs as a starting point.
+
+For the steps below, we will assume you created your project in your `GOPATH` with
+
+```shell
+kubebuilder init
+```
+
+and created an API & controller with
+
+```shell
+kubebuilder create api --group operator --version v1alpha1 --kind Sample --resource --controller --make
+```
+
+### Creating a second module for your API
+
+Now that we have a base layout in place, we will enable you for multiple modules.
+
+1. Navigate to `api/v1alpha1`
+2. Run `go mod init` to create a new submodule
+3. Run `go mod tidy` to resolve the dependencies
+
+Your api go.mod file could now look like this:
+
+```go.mod
+module YOUR_GO_PATH/test-operator/api/v1alpha1
+
+go 1.21.0
+
+require (
+ k8s.io/apimachinery v0.28.4
+ sigs.k8s.io/controller-runtime v0.16.3
+)
+
+require (
+ github.com/go-logr/logr v1.2.4 // indirect
+ github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/google/gofuzz v1.2.0 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ golang.org/x/net v0.17.0 // indirect
+ golang.org/x/text v0.13.0 // indirect
+ gopkg.in/inf.v0 v0.9.1 // indirect
+ gopkg.in/yaml.v2 v2.4.0 // indirect
+ k8s.io/klog/v2 v2.100.1 // indirect
+ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
+ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
+ sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
+)
+```
+
+As you can see it only includes apimachinery and controller-runtime as dependencies and any dependencies you have
+declared in your controller are not taken over into the indirect imports.
+
+### Using replace directives for development
+
+When trying to resolve your main module in the root folder of the operator, you will notice an error if you use a VCS path:
+
+```shell
+go mod tidy
+go: finding module for package YOUR_GO_PATH/test-operator/api/v1alpha1
+YOUR_GO_PATH/test-operator imports
+ YOUR_GO_PATH/test-operator/api/v1alpha1: cannot find module providing package YOUR_GO_PATH/test-operator/api/v1alpha1: module YOUR_GO_PATH/test-operator/api/v1alpha1: git ls-remote -q origin in LOCALVCSPATH: exit status 128:
+ remote: Repository not found.
+ fatal: repository 'https://YOUR_GO_PATH/test-operator/' not found
+```
+
+The reason for this is that you may have not pushed your modules into the VCS yet and resolving the main module will fail as it can no longer
+directly access the API types as package but only as module.
+
+To solve this issue, we will have to tell the go tooling to properly `replace` the API module with a local reference to your path.
+
+You can do this with 2 different approaches: go modules and go workspaces.
+
+#### Using go modules
+
+For go modules, you will edit the main `go.mod` file of your project and issue a replace directive.
+
+You can do this by editing the go.mod with
+
+```shell
+go mod edit -require YOUR_GO_PATH/test-operator/api/v1alpha1@v0.0.0 # Only if you didn't already resolve the module
+go mod edit -replace YOUR_GO_PATH/test-operator/api/v1alpha1@v0.0.0=./api/v1alpha1
+go mod tidy
+```
+
+Note that we used the placeholder version `v0.0.0` of the API Module. In case you already released your API module once,
+you can use the real version as well. However this will only work if the API Module is already available in the VCS.
+
+
+Implications on controller releases
+
+Since the main `go.mod` file now has a replace directive, it is important to drop it again before releasing your controller module.
+To achieve this you can simply run
+
+```shell
+go mod edit -dropreplace YOUR_GO_PATH/test-operator/api/v1alpha1
+go mod tidy
+```
+
+
+
+#### Using go workspaces
+
+For go workspaces, you will not edit the `go.mod` files yourself, but rely on the workspace support in go.
+
+To initialize a workspace for your project, run ´go work init` in the project root.
+
+Now let us include both modules in our workspace:
+```shell
+go work use . # This includes the main module with the controller
+go work use api/v1alpha1 # This is the API submodule
+go work sync
+```
+
+This will lead to commands such as `go run` or `go build` to respect the workspace and make sure that local resolution is used.
+
+You will be able to work with this locally without having to build your module.
+
+When using `go.work` files, it is recommended to not commit them into the repository and add them to `.gitignore`.
+
+```gitignore
+go.work
+go.work.sum
+```
+
+When releasing with a present `go.work` file, make sure to set the environment variable `GOWORK=off` (verifiable with `go env GOWORK`) to make sure the release process does not get impeded by a potentially commited `go.work` file.
+
+#### Adjusting the Dockerfile
+
+When building your controller image, kubebuilder by default is not able to work with multiple modules.
+You will have to manually add the new API module into the download of dependencies:
+
+```dockerfile
+# Build the manager binary
+FROM golang:1.20 as builder
+ARG TARGETOS
+ARG TARGETARCH
+
+WORKDIR /workspace
+# Copy the Go Modules manifests
+COPY go.mod go.mod
+COPY go.sum go.sum
+# Copy the Go Sub-Module manifests
+COPY api/v1alpha1/go.mod api/go.mod
+COPY api/v1alpha1/go.sum api/go.sum
+# cache deps before building and copying source so that we don't need to re-download as much
+# and so that source changes don't invalidate our downloaded layer
+RUN go mod download
+
+# Copy the go source
+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 cmd/main.go
+
+# Use distroless as minimal base image to package the manager binary
+# Refer to https://github.com/GoogleContainerTools/distroless for more details
+FROM gcr.io/distroless/static:nonroot
+WORKDIR /
+COPY --from=builder /workspace/manager .
+USER 65532:65532
+
+ENTRYPOINT ["/manager"]
+```
+
+### Creating a new API and controller release
+
+Because you adjusted the default layout, before releasing your first version of your operator, make sure to [familiarize yourself with mono-repo/multi-module releases][multi-module-repositories] with multiple `go.mod` files in different subdirectories.
+
+Assuming a single API was created, the release process could look like this:
+
+```sh
+git commit
+git tag v1.0.0 # this is your main module release
+git tag api/v1.0.0 # this is your api release
+go mod edit -require YOUR_GO_PATH/test-operator/api@v1.0.0 # now we depend on the api module in the main module
+go mod edit -dropreplace YOUR_GO_PATH/test-operator/api/v1alpha1 # this will drop the replace directive for local development in case you use go modules, meaning the sources from the VCS will be used instead of the ones in your monorepo checked out locally.
+git push origin main v1.0.0 api/v1.0.0
+```
+
+After this, your modules will be available in VCS and you do not need a local replacement anymore. However if youre making local changes,
+make sure to adopt your behavior with `replace` directives accordingly.
+
+### Reusing your extracted API module
+
+Whenever you want to reuse your API module with a separate kubebuilder, we will assume you follow the guide for [using an external Type](/reference/using_an_external_type.md).
+When you get to the step `Edit the API files` simply import the dependency with
+
+```shell
+go get YOUR_GO_PATH/test-operator/api@v1.0.0
+```
+
+and then use it as explained in the guide.
+
+[monorepo]: https://en.wikipedia.org/wiki/Monorepo
+[replace-directives]: https://go.dev/ref/mod#go-mod-file-replace
+[multi-module-repositories]: https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories
\ No newline at end of file
diff --git a/docs/using_an_external_type.md b/docs/book/src/reference/using_an_external_type.md
similarity index 71%
rename from docs/using_an_external_type.md
rename to docs/book/src/reference/using_an_external_type.md
index 13f0044d500..bdf475d0e69 100644
--- a/docs/using_an_external_type.md
+++ b/docs/book/src/reference/using_an_external_type.md
@@ -1,15 +1,12 @@
# Using an External Type
-
-# Introduction
-
There are several different external types that may be referenced when writing a controller.
-* A Custom Resource Definition (CRD) that is defined in the current project `kubebuilder create api`.
-* A Core Kubernetes Resources eg. `kubebuilder create api --group apps --version v1 --kind Deployment`.
-* A CRD that is created and installed in another project.
-* A CR defined via an API Aggregation (AA). Aggregated APIs are subordinate APIServers that sit behind the primary API server, which acts as a proxy.
+* Custom Resource Definitions (CRDs) that are defined in the current project (such as via `kubebuilder create api`).
+* Core Kubernetes Resources (e.g. Deployments or Pods).
+* CRDs that are created and installed in another project.
+* A custom API defined via the aggregation layer, served by an extension API server for which the primary API server acts as a proxy.
-Currently Kubebuilder handles the first two, CRDs and Core Resources, seamlessly. External CRDs and CRs created via Aggregation must be scaffolded manually.
+Currently Kubebuilder handles the first two—CRDs and Core Resources—seamlessly. You must scaffold the latter two—External CRDs and APIs created via aggregation—manually.
In order to use a Kubernetes Custom Resource that has been defined in another project
you will need to have several items of information.
@@ -20,6 +17,7 @@ you will need to have several items of information.
The Domain and Group variables have been discussed in other parts of the documentation. The import path would be located in the project that installs the CR.
This document uses `my` and `their` prefixes as a naming convention for repos, groups, and types to clearly distinguish between your own project and the external one you are referencing.
+Note that by default, multigroup APIs are no longer included. To enable them again, see [the guide on multigroup API migration](https://book.kubebuilder.io/migration/multi-group.html).
Example external API Aggregation directory structure
```
@@ -28,7 +26,7 @@ github.com
├── theirproject
├── apis
├── theirgroup
- ├── doc.go
+ ├── doc.go`
├── install
│ ├── install.go
├── v1alpha1
@@ -40,18 +38,12 @@ github.com
In the case above the import path would be `github.com/theiruser/theirproject/apis/theirgroup/v1alpha1`
-### Create a project
-
-```
-kubebuilder init --domain $APIDOMAIN --owner "MyCompany"
-```
### Add a controller
be sure to answer no when it asks if you would like to create an api? [Y/n]
-```
+```shell
kubebuilder create api --group mygroup --version $APIVERSION --kind MyKind
-
```
## Edit the API files.
@@ -61,7 +53,7 @@ kubebuilder create api --group mygroup --version $APIVERSION --kind MyKind
Edit the following file to the pkg/apis directory to append their `AddToScheme` to your `AddToSchemes`:
file: pkg/apis/mytype_addtoscheme.go
-```
+```go
package apis
import (
@@ -86,27 +78,45 @@ func init() {
### Use the correct imports for your API
file: pkg/controllers/mytype_controller.go
-```
+```go
+package controllers
+
import (
mygroupv1alpha1 "github.com/myuser/myrepo/apis/mygroup/v1alpha1"
theirgroupv1alpha1 "github.com/theiruser/theirproject/apis/theirgroup/v1alpha1"
)
```
+Note that core resources may simply be imported by depending on the API's from upstream Kubernetes:
+
+```go
+package controllers
+// contains core resources like Deployment
+import (
+ v1 "k8s.io/api/apps/v1"
+)
+```
+
### Update dependencies
```
-dep ensure --add
+go mod tidy
```
+
+### Verifying API Availability in the Cluster
+
+Since we are now using external types, it is best-practice to verify the existance of the API in the cluster.
+You can use the manager's client to verify API Existance before starting the controllers through the manager.
+
## Prepare for testing
-#### Register your resource
+#### Register your resource in the Scheme
Edit the `CRDDirectoryPaths` in your test suite by appending the path to their CRDs:
file pkg/controllers/my_kind_controller_suite_test.go
-```
+```go
var cfg *rest.Config
func TestMain(m *testing.M) {
@@ -140,9 +150,8 @@ func TestMain(m *testing.M) {
The following kubectl commands may be useful
-```
+```shell
kubectl api-resources --verbs=list -o name
-
kubectl api-resources --verbs=list -o name | grep mydomain.com
```
From d0e914c3171a63e75ac95b72e8eb6885aa296c2d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 4 Dec 2023 23:12:27 +0000
Subject: [PATCH 0348/1245] Bump github.com/spf13/afero from 1.10.0 to 1.11.0
Bumps [github.com/spf13/afero](https://github.com/spf13/afero) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/spf13/afero/releases)
- [Commits](https://github.com/spf13/afero/compare/v1.10.0...v1.11.0)
---
updated-dependencies:
- dependency-name: github.com/spf13/afero
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 438 +--------------------------------------------------------
2 files changed, 5 insertions(+), 435 deletions(-)
diff --git a/go.mod b/go.mod
index 69c3d224490..f8b6a3a3b2f 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,7 @@ require (
github.com/onsi/ginkgo/v2 v2.13.1
github.com/onsi/gomega v1.30.0
github.com/sirupsen/logrus v1.9.3
- github.com/spf13/afero v1.10.0
+ github.com/spf13/afero v1.11.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
golang.org/x/text v0.14.0
diff --git a/go.sum b/go.sum
index d2fb002cd59..1bee19e4301 100644
--- a/go.sum
+++ b/go.sum
@@ -1,160 +1,32 @@
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
-cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
-cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
-cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
-cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
-cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
-cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
-cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
-cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
-cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
-cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
-cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
-cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
-cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
-cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
-cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
-cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
-cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
-cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
-cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
-cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
-cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
-cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
-cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
-cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
-cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
-cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
-cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
-cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
-cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
-cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
-cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
-cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
-cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
-dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
-github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
-github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
-github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
-github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
-github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
-github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
-github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
-github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
-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=
-github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
-github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
-github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
-github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
-github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
-github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
-github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
-github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
-github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb h1:LCMfzVg3sflxTs4UvuP4D8CkoZnfHLe2qzqgDn/4OHs=
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
-github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
-github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
-github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
-github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
-github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
-github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
-github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/onsi/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU=
github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
-github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
-github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
+github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
+github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -162,331 +34,29 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.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=
-github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
-go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
-go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
-go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
-golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
-golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
-golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
-golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
-golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
-golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
-golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
-golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
-golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
-golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
-golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
-golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
-golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
-golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
-golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
-golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
-golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
-golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-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.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
-golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
-golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-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=
-golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
-golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
-golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
-golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
-golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-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.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
-google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
-google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
-google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
-google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
-google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
-google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
-google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
-google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
-google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
-google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
-google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
-google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
-google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
-google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
-google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
-google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
-google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
-google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
-google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
-google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
-google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
-google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
-google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
-google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
-google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
+google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
-honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
-honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
-rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
-rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
From 0757a962d89aba6fd3780e00103b647386d0d335 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 5 Dec 2023 08:08:19 +0000
Subject: [PATCH 0349/1245] Bump github.com/onsi/ginkgo/v2 from 2.13.1 to
2.13.2
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.13.1 to 2.13.2.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.13.1...v2.13.2)
---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
go.mod | 2 +-
go.sum | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index f8b6a3a3b2f..1bba0e6c1a7 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.20
require (
github.com/gobuffalo/flect v1.0.2
- github.com/onsi/ginkgo/v2 v2.13.1
+ github.com/onsi/ginkgo/v2 v2.13.2
github.com/onsi/gomega v1.30.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.11.0
diff --git a/go.sum b/go.sum
index 1bee19e4301..708aac133b0 100644
--- a/go.sum
+++ b/go.sum
@@ -16,8 +16,8 @@ github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb h1:LCMfzVg3sflxTs4Uvu
github.com/google/pprof v0.0.0-20230907193218-d3ddc7976beb/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
-github.com/onsi/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU=
-github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
+github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
+github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8=
github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
From 79cec87ec5d2e0a594a15caac1fe5693d1225e66 Mon Sep 17 00:00:00 2001
From: Harsh