Skip to content

Commit 8217db9

Browse files
📖 update doc samples within the latest changes (#3392)
1 parent d0a1806 commit 8217db9

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
22
# Ignore build and test binaries.
33
bin/
4-
testbin/

docs/book/src/cronjob-tutorial/testdata/project/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
*.dll
66
*.so
77
*.dylib
8-
bin
9-
testbin/*
8+
bin/*
109
Dockerfile.cross
1110

1211
# Test binary, build with `go test -c`

docs/book/src/cronjob-tutorial/testdata/project/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.19 as builder
2+
FROM golang:1.20 as builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ else
1111
GOBIN=$(shell go env GOBIN)
1212
endif
1313

14+
# CONTAINER_TOOL defines the container tool to be used for building images.
15+
# Be aware that the target commands are only tested with Docker which is
16+
# scaffolded by default. However, you might want to replace it to use other
17+
# tools. (i.e. podman)
18+
CONTAINER_TOOL ?= docker
19+
1420
# Setting SHELL to bash allows bash commands to be executed by recipes.
1521
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
1622
SHELL = /usr/bin/env bash -o pipefail
@@ -73,11 +79,11 @@ run: manifests generate fmt vet ## Run a controller from your host.
7379
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
7480
.PHONY: docker-build
7581
docker-build: test ## Build docker image with the manager.
76-
docker build -t ${IMG} .
82+
$(CONTAINER_TOOL) build -t ${IMG} .
7783

7884
.PHONY: docker-push
7985
docker-push: ## Push docker image with the manager.
80-
docker push ${IMG}
86+
$(CONTAINER_TOOL) push ${IMG}
8187

8288
# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
8389
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
@@ -90,10 +96,10 @@ PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
9096
docker-buildx: test ## Build and push docker image for the manager for cross-platform support
9197
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
9298
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
93-
- docker buildx create --name project-v3-builder
94-
docker buildx use project-v3-builder
95-
- docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
96-
- docker buildx rm project-v3-builder
99+
- $(CONTAINER_TOOL) buildx create --name project-v3-builder
100+
$(CONTAINER_TOOL) buildx use project-v3-builder
101+
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
102+
- $(CONTAINER_TOOL) buildx rm project-v3-builder
97103
rm Dockerfile.cross
98104

99105
##@ Deployment
@@ -132,7 +138,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
132138
ENVTEST ?= $(LOCALBIN)/setup-envtest
133139

134140
## Tool Versions
135-
KUSTOMIZE_VERSION ?= v5.0.0
141+
KUSTOMIZE_VERSION ?= v5.0.1
136142
CONTROLLER_TOOLS_VERSION ?= v0.12.0
137143

138144
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"

docs/book/src/cronjob-tutorial/testdata/project/config/crd/bases/batch.tutorial.kubebuilder.io_cronjobs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.12.0
7-
creationTimestamp: null
87
name: cronjobs.batch.tutorial.kubebuilder.io
98
spec:
109
group: batch.tutorial.kubebuilder.io

docs/book/src/cronjob-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
capabilities:
3232
drop:
3333
- "ALL"
34-
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
34+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1
3535
args:
3636
- "--secure-listen-address=0.0.0.0:8443"
3737
- "--upstream=http://127.0.0.1:8080/"

docs/book/src/cronjob-tutorial/testdata/project/config/rbac/role.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
5-
creationTimestamp: null
65
name: manager-role
76
rules:
87
- apiGroups:

docs/book/src/cronjob-tutorial/testdata/project/config/webhook/manifests.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
apiVersion: admissionregistration.k8s.io/v1
33
kind: MutatingWebhookConfiguration
44
metadata:
5-
creationTimestamp: null
65
name: mutating-webhook-configuration
76
webhooks:
87
- admissionReviewVersions:
@@ -29,7 +28,6 @@ webhooks:
2928
apiVersion: admissionregistration.k8s.io/v1
3029
kind: ValidatingWebhookConfiguration
3130
metadata:
32-
creationTimestamp: null
3331
name: validating-webhook-configuration
3432
webhooks:
3533
- admissionReviewVersions:

docs/book/src/cronjob-tutorial/testdata/project/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module tutorial.kubebuilder.io/project
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/onsi/ginkgo/v2 v2.6.0

docs/book/src/cronjob-tutorial/testdata/project/internal/controller/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var (
6363
cancel context.CancelFunc
6464
)
6565

66-
func TestAPIs(t *testing.T) {
66+
func TestControllers(t *testing.T) {
6767
RegisterFailHandler(Fail)
6868

6969
RunSpecs(t, "Controller Suite")

0 commit comments

Comments
 (0)