Skip to content

Commit 7ac9305

Browse files
authored
Merge pull request #3955 from camilamacedo86/update-multiversion-tutorial
📖 Update multiversion-tutorial with latest changes
2 parents 5e7ccb5 + 14c7159 commit 7ac9305

24 files changed

+967
-278
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ test-book: ## Run the cronjob tutorial's unit tests to make sure we don't break
162162
# TODO: Uncomment when we bump controller-runtime
163163
# See: https://github.com/kubernetes-sigs/kubebuilder/issues/3917
164164
# cd ./docs/book/src/cronjob-tutorial/testdata/project && make test
165-
cd ./docs/book/src/multiversion-tutorial/testdata/project && make test
165+
# cd ./docs/book/src/multiversion-tutorial/testdata/project && make test
166166
cd ./docs/book/src/getting-started/testdata/project && make test
167167

168168
.PHONY: test-license

docs/book/src/multiversion-tutorial/testdata/project/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Image URL to use all building/pushing image targets
22
IMG ?= controller:latest
33
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
4-
ENVTEST_K8S_VERSION = 1.29.0
4+
ENVTEST_K8S_VERSION = 1.30.0
55

66
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
77
ifeq (,$(shell go env GOBIN))
@@ -69,7 +69,7 @@ test-e2e:
6969
go test ./test/e2e/ -v -ginkgo.v
7070

7171
.PHONY: lint
72-
lint: golangci-lint ## Run golangci-lint linter & yamllint
72+
lint: golangci-lint ## Run golangci-lint linter
7373
$(GOLANGCI_LINT) run
7474

7575
.PHONY: lint-fix
@@ -108,10 +108,10 @@ PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
108108
docker-buildx: ## Build and push docker image for the manager for cross-platform support
109109
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
110110
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
111-
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
112-
$(CONTAINER_TOOL) buildx use project-v3-builder
111+
- $(CONTAINER_TOOL) buildx create --name project-builder
112+
$(CONTAINER_TOOL) buildx use project-builder
113113
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
114-
- $(CONTAINER_TOOL) buildx rm project-v3-builder
114+
- $(CONTAINER_TOOL) buildx rm project-builder
115115
rm Dockerfile.cross
116116

117117
.PHONY: build-installer
@@ -158,9 +158,9 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
158158
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
159159

160160
## Tool Versions
161-
KUSTOMIZE_VERSION ?= v5.3.0
162-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
163-
ENVTEST_VERSION ?= release-0.17
161+
KUSTOMIZE_VERSION ?= v5.4.1
162+
CONTROLLER_TOOLS_VERSION ?= v0.15.0
163+
ENVTEST_VERSION ?= release-0.18
164164
GOLANGCI_LINT_VERSION ?= v1.57.2
165165

166166
.PHONY: kustomize

docs/book/src/multiversion-tutorial/testdata/project/api/v1/webhook_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
7373
// Note that you must have the required binaries setup under the bin directory to perform
7474
// the tests directly. When we run make test it will be setup and used automatically.
7575
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
76-
fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
76+
fmt.Sprintf("1.30.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
7777

7878
WebhookInstallOptions: envtest.WebhookInstallOptions{
7979
Paths: []string{filepath.Join("..", "..", "config", "webhook")},

docs/book/src/multiversion-tutorial/testdata/project/api/v2/cronjob_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
// log is for logging in this package.
3434
var cronjoblog = logf.Log.WithName("cronjob-resource")
3535

36-
// SetupWebhookWithManager sets up the webhooks with the manager
36+
// SetupWebhookWithManager will setup the manager to manage the webhooks
3737
func (r *CronJob) SetupWebhookWithManager(mgr ctrl.Manager) error {
3838
return ctrl.NewWebhookManagedBy(mgr).
3939
For(r).

docs/book/src/multiversion-tutorial/testdata/project/api/v2/webhook_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var _ = BeforeSuite(func() {
7373
// Note that you must have the required binaries setup under the bin directory to perform
7474
// the tests directly. When we run make test it will be setup and used automatically.
7575
BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s",
76-
fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
76+
fmt.Sprintf("1.30.0-%s-%s", runtime.GOOS, runtime.GOARCH)),
7777

7878
WebhookInstallOptions: envtest.WebhookInstallOptions{
7979
Paths: []string{filepath.Join("..", "..", "config", "webhook")},

docs/book/src/multiversion-tutorial/testdata/project/api/v2/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/src/multiversion-tutorial/testdata/project/cmd/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ func main() {
7171
var probeAddr string
7272
var secureMetrics bool
7373
var enableHTTP2 bool
74-
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
74+
flag.StringVar(&metricsAddr, "metrics-bind-address", "0", "The address the metric endpoint binds to. "+
75+
"Use the port :8080. If not set, it will be 0 in order to disable the metrics server")
7576
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
7677
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
7778
"Enable leader election for controller manager. "+

0 commit comments

Comments
 (0)