Skip to content

Commit e9732a4

Browse files
Merge pull request #203 from damdo/rebase-atop-v1.6.4
OCPBUGS-30480: Merge https://github.com/kubernetes-sigs/cluster-api:v1.6.4 (36c0e55) into master
2 parents bb7f378 + 4b824fe commit e9732a4

File tree

471 files changed

+19373
-5109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

471 files changed

+19373
-5109
lines changed

.github/workflows/pr-md-link-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
use-quiet-mode: 'yes'
2121
config-file: .markdownlinkcheck.json
2222
check-modified-files-only: 'yes'
23-
base-branch: main
23+
base-branch: release-1.6

Makefile

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ SHELL:=/usr/bin/env bash
2323
#
2424
# Go.
2525
#
26-
GO_VERSION ?= 1.21.5
26+
GO_VERSION ?= 1.21.9
27+
GO_DIRECTIVE_VERSION ?= 1.20
2728
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)
2829

2930
# Use GOPROXY environment variable if set
@@ -670,11 +671,15 @@ APIDIFF_OLD_COMMIT ?= $(shell git rev-parse origin/main)
670671
apidiff: $(GO_APIDIFF) ## Check for API differences
671672
$(GO_APIDIFF) $(APIDIFF_OLD_COMMIT) --print-compatible
672673

673-
ALL_VERIFY_CHECKS = licenses boilerplate shellcheck tiltfile modules gen conversions doctoc capi-book-summary diagrams import-restrictions
674+
ALL_VERIFY_CHECKS = licenses boilerplate shellcheck tiltfile modules gen conversions doctoc capi-book-summary diagrams import-restrictions go-directive
674675

675676
.PHONY: verify
676677
verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS)) lint-dockerfiles ## Run all verify-* targets
677678

679+
.PHONY: verify-go-directive
680+
verify-go-directive:
681+
TRACE=$(TRACE) ./hack/verify-go-directive.sh -g $(GO_DIRECTIVE_VERSION)
682+
678683
.PHONY: verify-modules
679684
verify-modules: generate-modules ## Verify go modules are up to date
680685
@if !(git diff --quiet HEAD -- go.sum go.mod $(TOOLS_DIR)/go.mod $(TOOLS_DIR)/go.sum $(TEST_DIR)/go.mod $(TEST_DIR)/go.sum); then \
@@ -821,41 +826,48 @@ docker-build-e2e: ## Run docker-build-* targets for all the images with settings
821826

822827
.PHONY: docker-build-core
823828
docker-build-core: ## Build the docker image for core controller manager
824-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG)
829+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
830+
cat ./Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG) --file -
825831
$(MAKE) set-manifest-image MANIFEST_IMG=$(CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="./config/default/manager_image_patch.yaml"
826832
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./config/default/manager_pull_policy.yaml"
827833

828834
.PHONY: docker-build-kubeadm-bootstrap
829835
docker-build-kubeadm-bootstrap: ## Build the docker image for kubeadm bootstrap controller manager
830-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg package=./bootstrap/kubeadm --build-arg ldflags="$(LDFLAGS)" . -t $(KUBEADM_BOOTSTRAP_CONTROLLER_IMG)-$(ARCH):$(TAG)
836+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
837+
cat ./Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg package=./bootstrap/kubeadm --build-arg ldflags="$(LDFLAGS)" . -t $(KUBEADM_BOOTSTRAP_CONTROLLER_IMG)-$(ARCH):$(TAG) --file -
831838
$(MAKE) set-manifest-image MANIFEST_IMG=$(KUBEADM_BOOTSTRAP_CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="./bootstrap/kubeadm/config/default/manager_image_patch.yaml"
832839
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./bootstrap/kubeadm/config/default/manager_pull_policy.yaml"
833840

834841
.PHONY: docker-build-kubeadm-control-plane
835842
docker-build-kubeadm-control-plane: ## Build the docker image for kubeadm control plane controller manager
836-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg package=./controlplane/kubeadm --build-arg ldflags="$(LDFLAGS)" . -t $(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG)-$(ARCH):$(TAG)
843+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
844+
cat ./Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg package=./controlplane/kubeadm --build-arg ldflags="$(LDFLAGS)" . -t $(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG)-$(ARCH):$(TAG) --file -
837845
$(MAKE) set-manifest-image MANIFEST_IMG=$(KUBEADM_CONTROL_PLANE_CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="./controlplane/kubeadm/config/default/manager_image_patch.yaml"
838846
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./controlplane/kubeadm/config/default/manager_pull_policy.yaml"
839847

840848
.PHONY: docker-build-docker-infrastructure
841849
docker-build-docker-infrastructure: ## Build the docker image for docker infrastructure controller manager
842-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CAPD_CONTROLLER_IMG)-$(ARCH):$(TAG) --file $(CAPD_DIR)/Dockerfile
850+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
851+
cat $(CAPD_DIR)/Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CAPD_CONTROLLER_IMG)-$(ARCH):$(TAG) --file -
843852
$(MAKE) set-manifest-image MANIFEST_IMG=$(CAPD_CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="$(CAPD_DIR)/config/default/manager_image_patch.yaml"
844853
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="$(CAPD_DIR)/config/default/manager_pull_policy.yaml"
845854

846855
.PHONY: docker-build-in-memory-infrastructure
847856
docker-build-in-memory-infrastructure: ## Build the docker image for in-memory infrastructure controller manager
848-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CAPIM_CONTROLLER_IMG)-$(ARCH):$(TAG) --file $(CAPIM_DIR)/Dockerfile
857+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
858+
cat $(CAPIM_DIR)/Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CAPIM_CONTROLLER_IMG)-$(ARCH):$(TAG) --file -
849859
$(MAKE) set-manifest-image MANIFEST_IMG=$(CAPIM_CONTROLLER_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="$(CAPIM_DIR)/config/default/manager_image_patch.yaml"
850860
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="$(CAPIM_DIR)/config/default/manager_pull_policy.yaml"
851861

852862
.PHONY: docker-build-clusterctl
853863
docker-build-clusterctl: ## Build the docker image for clusterctl
854-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg package=./cmd/clusterctl --build-arg ldflags="$(LDFLAGS)" -f ./cmd/clusterctl/Dockerfile . -t $(CLUSTERCTL_IMG)-$(ARCH):$(TAG)
864+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
865+
cat ./Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg package=./cmd/clusterctl --build-arg ldflags="$(LDFLAGS)" -f ./cmd/clusterctl/Dockerfile . -t $(CLUSTERCTL_IMG)-$(ARCH):$(TAG) --file -
855866

856867
.PHONY: docker-build-test-extension
857868
docker-build-test-extension: ## Build the docker image for core controller manager
858-
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(TEST_EXTENSION_IMG)-$(ARCH):$(TAG) --file ./test/extension/Dockerfile
869+
## reads Dockerfile from stdin to avoid an incorrectly cached Dockerfile (https://github.com/moby/buildkit/issues/1368)
870+
cat ./test/extension/Dockerfile | DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(TEST_EXTENSION_IMG)-$(ARCH):$(TAG) --file -
859871
$(MAKE) set-manifest-image MANIFEST_IMG=$(TEST_EXTENSION_IMG)-$(ARCH) MANIFEST_TAG=$(TAG) TARGET_RESOURCE="./test/extension/config/default/manager_image_patch.yaml"
860872
$(MAKE) set-manifest-pull-policy TARGET_RESOURCE="./test/extension/config/default/manager_pull_policy.yaml"
861873

@@ -1106,7 +1118,9 @@ release-binary: $(RELEASE_DIR)
11061118

11071119
.PHONY: release-staging
11081120
release-staging: ## Build and push container images to the staging bucket
1109-
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all docker-push-all release-alias-tag
1121+
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all
1122+
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-push-all
1123+
REGISTRY=$(STAGING_REGISTRY) $(MAKE) release-alias-tag
11101124

11111125
.PHONY: release-staging-nightly
11121126
release-staging-nightly: ## Tag and push container images to the staging bucket. Example image tag: cluster-api-controller:nightly_main_20210121

Tiltfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def load_provider_tiltfiles():
184184

185185
tilt_helper_dockerfile_header = """
186186
# Tilt image
187-
FROM golang:1.21.5 as tilt-helper
187+
FROM golang:1.21.9 as tilt-helper
188188
# Install delve. Note this should be kept in step with the Go release minor version.
189189
RUN go install github.com/go-delve/delve/cmd/[email protected]
190190
# Support live reloading with Tilt
@@ -195,7 +195,7 @@ RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com
195195
"""
196196

197197
tilt_dockerfile_header = """
198-
FROM golang:1.21.5 as tilt
198+
FROM golang:1.21.9 as tilt
199199
WORKDIR /
200200
COPY --from=tilt-helper /process.txt .
201201
COPY --from=tilt-helper /start.sh .

api/v1beta1/clusterclass_types.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,32 @@ type ClusterClassVariable struct {
382382
// required, this will be specified inside the schema.
383383
Required bool `json:"required"`
384384

385+
// Metadata is the metadata of a variable.
386+
// It can be used to add additional data for higher level tools to
387+
// a ClusterClassVariable.
388+
// +optional
389+
Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"`
390+
385391
// Schema defines the schema of the variable.
386392
Schema VariableSchema `json:"schema"`
387393
}
388394

395+
// ClusterClassVariableMetadata is the metadata of a variable.
396+
// It can be used to add additional data for higher level tools to
397+
// a ClusterClassVariable.
398+
type ClusterClassVariableMetadata struct {
399+
// Map of string keys and values that can be used to organize and categorize
400+
// (scope and select) variables.
401+
// +optional
402+
Labels map[string]string `json:"labels,omitempty"`
403+
404+
// Annotations is an unstructured key value map that can be used to store and
405+
// retrieve arbitrary metadata.
406+
// They are not queryable.
407+
// +optional
408+
Annotations map[string]string `json:"annotations,omitempty"`
409+
}
410+
389411
// VariableSchema defines the schema of a variable.
390412
type VariableSchema struct {
391413
// OpenAPIV3Schema defines the schema of a variable via OpenAPI v3
@@ -733,6 +755,12 @@ type ClusterClassStatusVariableDefinition struct {
733755
// required, this will be specified inside the schema.
734756
Required bool `json:"required"`
735757

758+
// Metadata is the metadata of a variable.
759+
// It can be used to add additional data for higher level tools to
760+
// a ClusterClassVariable.
761+
// +optional
762+
Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"`
763+
736764
// Schema defines the schema of the variable.
737765
Schema VariableSchema `json:"schema"`
738766
}

api/v1beta1/common_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ const (
6868
// update that disallows a pre-existing Cluster to be populated with Topology information and Class.
6969
ClusterTopologyUnsafeUpdateClassNameAnnotation = "unsafe.topology.cluster.x-k8s.io/disable-update-class-name-check"
7070

71+
// ClusterTopologyUnsafeUpdateVersionAnnotation can be used to disable the webhook checks on
72+
// update that disallows updating the .topology.spec.version on certain conditions.
73+
ClusterTopologyUnsafeUpdateVersionAnnotation = "unsafe.topology.cluster.x-k8s.io/disable-update-version-check"
74+
7175
// ProviderNameLabel is the label set on components in the provider manifest.
7276
// This label allows to easily identify all the components belonging to a provider; the clusterctl
7377
// tool uses this label for implementing provider's lifecycle operations.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.openapi.go

Lines changed: 62 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/config/manager/manager.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ spec:
2626
- "--bootstrap-token-ttl=${KUBEADM_BOOTSTRAP_TOKEN_TTL:=15m}"
2727
image: controller:latest
2828
name: manager
29+
env:
30+
- name: POD_NAMESPACE
31+
valueFrom:
32+
fieldRef:
33+
fieldPath: metadata.namespace
34+
- name: POD_NAME
35+
valueFrom:
36+
fieldRef:
37+
fieldPath: metadata.name
38+
- name: POD_UID
39+
valueFrom:
40+
fieldRef:
41+
fieldPath: metadata.uid
2942
ports:
3043
- containerPort: 9440
3144
name: healthz

cloudbuild.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ steps:
1212
- TAG=$_GIT_TAG
1313
- PULL_BASE_REF=$_PULL_BASE_REF
1414
- DOCKER_BUILDKIT=1
15-
args:
16-
- release-staging
15+
args: ['release-staging', '-j', '8', '-O']
1716
substitutions:
1817
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
1918
# can be used as a substitution
2019
_GIT_TAG: '12345'
21-
_PULL_BASE_REF: 'dev'
20+
_PULL_BASE_REF: 'dev'

0 commit comments

Comments
 (0)