From afc5c840a50a17f66d073eb2a388113d570125eb Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 29 Jul 2022 12:21:50 -0400 Subject: [PATCH 1/6] :seedling: Correct title and description syntax --- .../grafana/v1alpha/scaffolds/internal/templates/runtime.go | 4 ++-- .../grafana/controller-runtime-metrics.json | 4 ++-- .../grafana/controller-runtime-metrics.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 2710dc42040..69afac41aa0 100644 --- a/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates/runtime.go +++ b/pkg/plugins/optional/grafana/v1alpha/scaffolds/internal/templates/runtime.go @@ -105,7 +105,7 @@ const controllerRuntimeTemplate = `{ }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of reconciliation per controller", + "description": "Total number of reconciliations per controller", "fieldConfig": { "defaults": { "color": { @@ -187,7 +187,7 @@ const controllerRuntimeTemplate = `{ "refId": "A" } ], - "title": "Reconciliation Total Count Per Controller", + "title": "Total Reconciliation Count Per Controller", "type": "timeseries" }, { diff --git a/testdata/project-v3-addon-and-grafana/grafana/controller-runtime-metrics.json b/testdata/project-v3-addon-and-grafana/grafana/controller-runtime-metrics.json index b40ae62442b..70023a42d82 100644 --- a/testdata/project-v3-addon-and-grafana/grafana/controller-runtime-metrics.json +++ b/testdata/project-v3-addon-and-grafana/grafana/controller-runtime-metrics.json @@ -60,7 +60,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of reconciliation per controller", + "description": "Total number of reconciliations per controller", "fieldConfig": { "defaults": { "color": { @@ -142,7 +142,7 @@ "refId": "A" } ], - "title": "Reconciliation Total Count Per Controller", + "title": "Total Reconciliation Count Per Controller", "type": "timeseries" }, { diff --git a/testdata/project-v4-addon-and-grafana/grafana/controller-runtime-metrics.json b/testdata/project-v4-addon-and-grafana/grafana/controller-runtime-metrics.json index b40ae62442b..70023a42d82 100644 --- a/testdata/project-v4-addon-and-grafana/grafana/controller-runtime-metrics.json +++ b/testdata/project-v4-addon-and-grafana/grafana/controller-runtime-metrics.json @@ -60,7 +60,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "Total number of reconciliation per controller", + "description": "Total number of reconciliations per controller", "fieldConfig": { "defaults": { "color": { @@ -142,7 +142,7 @@ "refId": "A" } ], - "title": "Reconciliation Total Count Per Controller", + "title": "Total Reconciliation Count Per Controller", "type": "timeseries" }, { From 3c4e3b2870666277c5cb774942169a28522f8621 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Sat, 30 Jul 2022 06:41:11 +0100 Subject: [PATCH 2/6] :seedling: fix readme --- README.md | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/README.md b/README.md index 07e68323c3d..27064e190ba 100644 --- a/README.md +++ b/README.md @@ -119,19 +119,6 @@ Currently, Kubebuilder officially supports OSX and Linux platforms. So, if you are using a Windows OS you may find issues. Contributions towards supporting Windows are welcome. -### Apple Silicon - -Apple Silicon (`darwin/arm64`) is supported using the `go/v4-alpha` plugin which provides support for this platform. - -```bash -kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4-alpha -``` - -**Note**: The `go/v4-alpha` plugin is an unstable version and can have breaking changes in future releases. The previous kustomize -version (`v3.Y.Z`) used in the `go/v3` has no available binaries for this -platform [kubernetes-sigs/kustomize/issues/4612](https://github.com/kubernetes-sigs/kustomize/issues/4612) -Because of this, we cannot support this `darwin/arm64` on the stable scaffold done by default with the Kubebuilder with the `go/v3` plugin. - ## Community Meetings The following meetings happen biweekly: From a9bf7b940fba55e47ed523c96e79d6e3f8f3d66e Mon Sep 17 00:00:00 2001 From: Fotiadis Michail Date: Thu, 28 Jul 2022 13:36:01 +0300 Subject: [PATCH 3/6] fix: makefile prerequisite of $(LOCALBIN) --- .../src/component-config-tutorial/testdata/project/Makefile | 4 ++-- docs/book/src/cronjob-tutorial/testdata/project/Makefile | 4 ++-- docs/book/src/migration/manually_migration_guide_v2_v3.md | 4 ++-- docs/book/src/multiversion-tutorial/testdata/project/Makefile | 4 ++-- .../golang/v2/scaffolds/internal/templates/makefile.go | 2 +- .../golang/v3/scaffolds/internal/templates/makefile.go | 4 ++-- testdata/project-v2/Makefile | 2 +- testdata/project-v3-addon-and-grafana/Makefile | 4 ++-- testdata/project-v3-config/Makefile | 4 ++-- testdata/project-v3-multigroup/Makefile | 4 ++-- testdata/project-v3-with-deploy-image/Makefile | 4 ++-- testdata/project-v3/Makefile | 4 ++-- testdata/project-v4-addon-and-grafana/Makefile | 4 ++-- testdata/project-v4-config/Makefile | 4 ++-- testdata/project-v4-multigroup/Makefile | 4 ++-- testdata/project-v4-with-deploy-image/Makefile | 4 ++-- testdata/project-v4/Makefile | 4 ++-- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/book/src/component-config-tutorial/testdata/project/Makefile b/docs/book/src/component-config-tutorial/testdata/project/Makefile index 7bf29d116b8..2e4f1bc78d7 100644 --- a/docs/book/src/component-config-tutorial/testdata/project/Makefile +++ b/docs/book/src/component-config-tutorial/testdata/project/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/docs/book/src/cronjob-tutorial/testdata/project/Makefile b/docs/book/src/cronjob-tutorial/testdata/project/Makefile index 7bf29d116b8..2e4f1bc78d7 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/Makefile +++ b/docs/book/src/cronjob-tutorial/testdata/project/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/docs/book/src/migration/manually_migration_guide_v2_v3.md b/docs/book/src/migration/manually_migration_guide_v2_v3.md index 1f579374fae..35219a6747b 100644 --- a/docs/book/src/migration/manually_migration_guide_v2_v3.md +++ b/docs/book/src/migration/manually_migration_guide_v2_v3.md @@ -481,12 +481,12 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest ``` And then, to make your project use the `kustomize` version defined in the Makefile, replace all usage of `kustomize` with `$(KUSTOMIZE)` diff --git a/docs/book/src/multiversion-tutorial/testdata/project/Makefile b/docs/book/src/multiversion-tutorial/testdata/project/Makefile index 2b5767c929a..2f37d524f28 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/Makefile +++ b/docs/book/src/multiversion-tutorial/testdata/project/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go index 401fab6a993..f13be855624 100644 --- a/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/golang/v2/scaffolds/internal/templates/makefile.go @@ -178,5 +178,5 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) ` diff --git a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go index b69158510a3..ba7c6d296d8 100644 --- a/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/golang/v3/scaffolds/internal/templates/makefile.go @@ -183,10 +183,10 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest ` diff --git a/testdata/project-v2/Makefile b/testdata/project-v2/Makefile index 94f5b741ed3..4ea76b34b66 100644 --- a/testdata/project-v2/Makefile +++ b/testdata/project-v2/Makefile @@ -122,4 +122,4 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) diff --git a/testdata/project-v3-addon-and-grafana/Makefile b/testdata/project-v3-addon-and-grafana/Makefile index 02fe3e23a30..17b18a4a140 100644 --- a/testdata/project-v3-addon-and-grafana/Makefile +++ b/testdata/project-v3-addon-and-grafana/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v3-config/Makefile b/testdata/project-v3-config/Makefile index 02fe3e23a30..17b18a4a140 100644 --- a/testdata/project-v3-config/Makefile +++ b/testdata/project-v3-config/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v3-multigroup/Makefile b/testdata/project-v3-multigroup/Makefile index 02fe3e23a30..17b18a4a140 100644 --- a/testdata/project-v3-multigroup/Makefile +++ b/testdata/project-v3-multigroup/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v3-with-deploy-image/Makefile b/testdata/project-v3-with-deploy-image/Makefile index 02fe3e23a30..17b18a4a140 100644 --- a/testdata/project-v3-with-deploy-image/Makefile +++ b/testdata/project-v3-with-deploy-image/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v3/Makefile b/testdata/project-v3/Makefile index 02fe3e23a30..17b18a4a140 100644 --- a/testdata/project-v3/Makefile +++ b/testdata/project-v3/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v4-addon-and-grafana/Makefile b/testdata/project-v4-addon-and-grafana/Makefile index 4010d8d8308..173ce295782 100644 --- a/testdata/project-v4-addon-and-grafana/Makefile +++ b/testdata/project-v4-addon-and-grafana/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v4-config/Makefile b/testdata/project-v4-config/Makefile index 4010d8d8308..173ce295782 100644 --- a/testdata/project-v4-config/Makefile +++ b/testdata/project-v4-config/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + 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/Makefile b/testdata/project-v4-multigroup/Makefile index 4010d8d8308..173ce295782 100644 --- a/testdata/project-v4-multigroup/Makefile +++ b/testdata/project-v4-multigroup/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v4-with-deploy-image/Makefile b/testdata/project-v4-with-deploy-image/Makefile index 4010d8d8308..173ce295782 100644 --- a/testdata/project-v4-with-deploy-image/Makefile +++ b/testdata/project-v4-with-deploy-image/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest diff --git a/testdata/project-v4/Makefile b/testdata/project-v4/Makefile index 4010d8d8308..173ce295782 100644 --- a/testdata/project-v4/Makefile +++ b/testdata/project-v4/Makefile @@ -124,9 +124,9 @@ $(KUSTOMIZE): $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) + test -s $(LOCALBIN)/controller-gen || 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) - GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest From 4c1a2d00e399366df2a3f26aa6dbc1797b6fe2fc Mon Sep 17 00:00:00 2001 From: Nandakumar Date: Mon, 1 Aug 2022 15:30:50 +0530 Subject: [PATCH 4/6] Fix typo in Multi-Version API tutorial fix typo in kubebuilder book --- docs/book/src/multiversion-tutorial/deployment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/src/multiversion-tutorial/deployment.md b/docs/book/src/multiversion-tutorial/deployment.md index 1f481535098..ef5ffc00975 100644 --- a/docs/book/src/multiversion-tutorial/deployment.md +++ b/docs/book/src/multiversion-tutorial/deployment.md @@ -43,7 +43,7 @@ controller-manager deployment) onto the cluster. ## Testing -Once all of the bits are up an running on the cluster with conversion enabled, we can test out our +Once all of the bits are up and running on the cluster with conversion enabled, we can test out our conversion by requesting different versions. We'll make a v2 version based on our v1 version (put it under `config/samples`) From c592e6c36fc8d5e53c848d48685c23952f5cccad Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Tue, 2 Aug 2022 20:55:20 +0900 Subject: [PATCH 5/6] fix: remove unnecessary if check in the controller tests --- .../templates/controllers/controller-test.go | 16 +++------------- .../controllers/busybox_controller_test.go | 16 +++------------- .../controllers/memcached_controller_test.go | 16 +++------------- .../controllers/busybox_controller_test.go | 16 +++------------- .../controllers/memcached_controller_test.go | 16 +++------------- 5 files changed, 15 insertions(+), 65 deletions(-) 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 01b05ddd810..525e6c50c6c 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 @@ -135,19 +135,13 @@ var _ = Describe("{{ .Resource.Kind }} controller", func() { } err = k8sClient.Create(ctx, {{ lower .Resource.Kind }}) - if err != nil { - Expect(err).To(Not(HaveOccurred())) - } + Expect(err).To(Not(HaveOccurred())) } By("Checking if the custom resource was successfully created") Eventually(func() error { found := &{{ .Resource.ImportAlias }}.{{ .Resource.Kind }}{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) By("Reconciling the custom resource created") @@ -164,11 +158,7 @@ var _ = Describe("{{ .Resource.Kind }} controller", func() { By("Checking if Deployment was successfully created in the reconciliation") Eventually(func() error { found := &appsv1.Deployment{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) }) }) diff --git a/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go b/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go index c7d5b8708f4..c6f557882c7 100644 --- a/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go +++ b/testdata/project-v3-with-deploy-image/controllers/busybox_controller_test.go @@ -85,19 +85,13 @@ var _ = Describe("Busybox controller", func() { } err = k8sClient.Create(ctx, busybox) - if err != nil { - Expect(err).To(Not(HaveOccurred())) - } + Expect(err).To(Not(HaveOccurred())) } By("Checking if the custom resource was successfully created") Eventually(func() error { found := &examplecomv1alpha1.Busybox{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) By("Reconciling the custom resource created") @@ -114,11 +108,7 @@ var _ = Describe("Busybox controller", func() { By("Checking if Deployment was successfully created in the reconciliation") Eventually(func() error { found := &appsv1.Deployment{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) }) }) diff --git a/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go b/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go index 04efd851789..3ecc092c162 100644 --- a/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go +++ b/testdata/project-v3-with-deploy-image/controllers/memcached_controller_test.go @@ -86,19 +86,13 @@ var _ = Describe("Memcached controller", func() { } err = k8sClient.Create(ctx, memcached) - if err != nil { - Expect(err).To(Not(HaveOccurred())) - } + Expect(err).To(Not(HaveOccurred())) } By("Checking if the custom resource was successfully created") Eventually(func() error { found := &examplecomv1alpha1.Memcached{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) By("Reconciling the custom resource created") @@ -115,11 +109,7 @@ var _ = Describe("Memcached controller", func() { By("Checking if Deployment was successfully created in the reconciliation") Eventually(func() error { found := &appsv1.Deployment{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) }) }) diff --git a/testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go b/testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go index 1ce159ebf78..e7ee6d936dc 100644 --- a/testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go +++ b/testdata/project-v4-with-deploy-image/controllers/busybox_controller_test.go @@ -85,19 +85,13 @@ var _ = Describe("Busybox controller", func() { } err = k8sClient.Create(ctx, busybox) - if err != nil { - Expect(err).To(Not(HaveOccurred())) - } + Expect(err).To(Not(HaveOccurred())) } By("Checking if the custom resource was successfully created") Eventually(func() error { found := &examplecomv1alpha1.Busybox{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) By("Reconciling the custom resource created") @@ -114,11 +108,7 @@ var _ = Describe("Busybox controller", func() { By("Checking if Deployment was successfully created in the reconciliation") Eventually(func() error { found := &appsv1.Deployment{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) }) }) diff --git a/testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go b/testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go index 6599ab7142d..738c0c48b8f 100644 --- a/testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go +++ b/testdata/project-v4-with-deploy-image/controllers/memcached_controller_test.go @@ -86,19 +86,13 @@ var _ = Describe("Memcached controller", func() { } err = k8sClient.Create(ctx, memcached) - if err != nil { - Expect(err).To(Not(HaveOccurred())) - } + Expect(err).To(Not(HaveOccurred())) } By("Checking if the custom resource was successfully created") Eventually(func() error { found := &examplecomv1alpha1.Memcached{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) By("Reconciling the custom resource created") @@ -115,11 +109,7 @@ var _ = Describe("Memcached controller", func() { By("Checking if Deployment was successfully created in the reconciliation") Eventually(func() error { found := &appsv1.Deployment{} - err = k8sClient.Get(ctx, typeNamespaceName, found) - if err != nil { - return err - } - return nil + return k8sClient.Get(ctx, typeNamespaceName, found) }, time.Minute, time.Second).Should(Succeed()) }) }) From abe54166d02e92b0e75929fc2150bda76a9f2dfe Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Wed, 3 Aug 2022 09:14:46 +0100 Subject: [PATCH 6/6] Revert ":seedling: fix readme" --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 27064e190ba..07e68323c3d 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,19 @@ Currently, Kubebuilder officially supports OSX and Linux platforms. So, if you are using a Windows OS you may find issues. Contributions towards supporting Windows are welcome. +### Apple Silicon + +Apple Silicon (`darwin/arm64`) is supported using the `go/v4-alpha` plugin which provides support for this platform. + +```bash +kubebuilder init --domain my.domain --repo my.domain/guestbook --plugins=go/v4-alpha +``` + +**Note**: The `go/v4-alpha` plugin is an unstable version and can have breaking changes in future releases. The previous kustomize +version (`v3.Y.Z`) used in the `go/v3` has no available binaries for this +platform [kubernetes-sigs/kustomize/issues/4612](https://github.com/kubernetes-sigs/kustomize/issues/4612) +Because of this, we cannot support this `darwin/arm64` on the stable scaffold done by default with the Kubebuilder with the `go/v3` plugin. + ## Community Meetings The following meetings happen biweekly: