From 51a690660aaf9f446013125b14543d84c12cdc09 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Thu, 19 Jun 2025 16:23:27 +0900 Subject: [PATCH 01/10] =?UTF-8?q?=E2=9A=A0=20=20Split=20Helm=20chart=20int?= =?UTF-8?q?o=20operator=20and=20providers=20charts=20with=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate cluster-api-operator into two charts to fix webhook timing issues: - cluster-api-operator: operator deployment only - cluster-api-operator-providers: provider Custom Resources with optional operator dependency This ensures webhook readiness before applying provider CRs, preventing "no endpoints available" errors during installation. The providers chart includes cluster-api-operator as a conditional dependency (install: true by default), maintaining backward compatibility while allowing flexible deployment scenarios: **Recommended: Two-step installation (no errors):** ```sh helm install capi-operator capi-operator/cluster-api-operator \ --create-namespace -n capi-operator-system --wait helm install capi-providers capi-operator/cluster-api-operator-providers \ -n capi-operator-system --set cluster-api-operator.install=false \ --set infrastructure.docker.enabled=true ``` **Backward compatibility: Single-step installation (may require retry):** ```sh helm install capi-providers capi-operator/cluster-api-operator-providers \ --create-namespace -n capi-operator-system \ --set infrastructure.docker.enabled=true helm upgrade --install capi-providers capi-operator/cluster-api-operator-providers \ -n capi-operator-system --set infrastructure.docker.enabled=true ``` Signed-off-by: kahirokunn --- .gitignore | 2 + Makefile | 16 +- .../.helmignore | 23 +++ .../cluster-api-operator-providers/Chart.yaml | 11 ++ .../templates/_helpers.tpl | 24 +++ .../templates/addon.yaml | 0 .../templates/bootstrap.yaml | 0 .../templates/control-plane.yaml | 0 .../templates/core-conditions.yaml | 0 .../templates/core.yaml | 0 .../templates/infra-conditions.yaml | 0 .../templates/infra.yaml | 0 .../templates/ipam.yaml | 0 .../values.schema.json | 74 ++++++++ .../values.yaml | 54 ++++++ .../cluster-api-operator/values.schema.json | 164 ++++++++++++++---- hack/charts/cluster-api-operator/values.yaml | 48 ----- test/e2e/helm_test.go | 2 +- .../all-providers-custom-ns-versions.yaml | 26 +-- .../all-providers-custom-versions.yaml | 26 +-- .../all-providers-latest-versions.yaml | 26 +-- ...ders-manager-defined-no-feature-gates.yaml | 26 +-- test/e2e/resources/feature-gates.yaml | 26 +-- test/e2e/resources/full-chart-install.yaml | 48 ++--- .../resources/kubeadm-manager-defined.yaml | 26 +-- ...ager-defined-missing-other-infra-spec.yaml | 26 +-- ...multiple-bootstrap-custom-ns-versions.yaml | 14 +- ...iple-control-plane-custom-ns-versions.yaml | 14 +- .../multiple-infra-custom-ns-versions.yaml | 22 +-- test/e2e/resources/only-addon.yaml | 10 +- test/e2e/resources/only-bootstrap.yaml | 10 +- test/e2e/resources/only-control-plane.yaml | 10 +- test/e2e/resources/only-infra-and-addon.yaml | 22 +-- test/e2e/resources/only-infra-and-ipam.yaml | 22 +-- test/e2e/resources/only-infra.yaml | 18 +- test/e2e/resources/only-ipam.yaml | 10 +- values.yaml | 35 ++++ 37 files changed, 562 insertions(+), 273 deletions(-) create mode 100644 hack/charts/cluster-api-operator-providers/.helmignore create mode 100644 hack/charts/cluster-api-operator-providers/Chart.yaml create mode 100644 hack/charts/cluster-api-operator-providers/templates/_helpers.tpl rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/addon.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/bootstrap.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/control-plane.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/core-conditions.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/core.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/infra-conditions.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/infra.yaml (100%) rename hack/charts/{cluster-api-operator => cluster-api-operator-providers}/templates/ipam.yaml (100%) create mode 100644 hack/charts/cluster-api-operator-providers/values.schema.json create mode 100644 hack/charts/cluster-api-operator-providers/values.yaml create mode 100644 values.yaml diff --git a/.gitignore b/.gitignore index 0b5cb6c04..ac24f7cd2 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,5 @@ _releasenotes # Helm .helm +Chart.lock +hack/charts/cluster-api-operator-providers/charts diff --git a/Makefile b/Makefile index a0eb31393..135f36681 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,7 @@ PROD_REGISTRY ?= registry.k8s.io/capi-operator # Image name IMAGE_NAME ?= cluster-api-operator -PACKAGE_NAME = cluster-api-operator +PACKAGE_NAME = cluster-api-operator-providers CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME) CONTROLLER_IMG_TAG ?= $(CONTROLLER_IMG)-$(ARCH):$(TAG) @@ -180,6 +180,7 @@ endif RELEASE_ALIAS_TAG ?= $(PULL_BASE_REF) RELEASE_DIR := $(ROOT)/out CHART_DIR := $(RELEASE_DIR)/charts/cluster-api-operator +CHART_PROVIDERS_DIR := $(RELEASE_DIR)/charts/cluster-api-operator-providers CHART_PACKAGE_DIR := $(RELEASE_DIR)/package # Set --output-base for conversion-gen if we are not within GOPATH @@ -455,6 +456,9 @@ $(CHART_DIR): $(CHART_PACKAGE_DIR): mkdir -p $(CHART_PACKAGE_DIR) +$(CHART_PROVIDERS_DIR): + mkdir -p $(CHART_PROVIDERS_DIR)/templates + .PHONY: release release: clean-release $(RELEASE_DIR) ## Builds and push container images using the latest git tag for the commit. @if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi @@ -485,11 +489,17 @@ release-manifests: $(KUSTOMIZE) $(RELEASE_DIR) ## Builds the manifests to publis $(KUSTOMIZE) build ./config/default > $(RELEASE_DIR)/operator-components.yaml .PHONY: release-chart -release-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_DIR) $(CHART_PACKAGE_DIR) ## Builds the chart to publish with a release +release-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_DIR) $(CHART_PROVIDERS_DIR) $(CHART_PACKAGE_DIR) ## Builds the chart to publish with a release + # Processing the cluster-api-operator chart cp -rf $(ROOT)/hack/charts/cluster-api-operator/. $(CHART_DIR) $(KUSTOMIZE) build ./config/chart > $(CHART_DIR)/templates/operator-components.yaml $(HELM) package $(CHART_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR) + # Processing the cluster-api-operator-providers chart + cp -rf $(ROOT)/hack/charts/cluster-api-operator-providers/. $(CHART_PROVIDERS_DIR) + $(HELM) dependency update $(CHART_PROVIDERS_DIR) + $(HELM) package $(CHART_PROVIDERS_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR) + .PHONY: release-staging release-staging: ## Builds and push container images and manifests to the staging bucket. $(MAKE) docker-build-all @@ -561,7 +571,7 @@ test-e2e-run: $(GINKGO) $(ENVSUBST) $(HELM) ## Run e2e tests -e2e.artifacts-folder="$(ARTIFACTS)" \ -e2e.config="$(E2E_CONF_FILE_ENVSUBST)" -e2e.components=$(RELEASE_DIR)/operator-components.yaml \ -e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) \ - -e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-$(HELM_CHART_TAG).tgz $(E2E_ARGS) + -e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-providers-$(HELM_CHART_TAG).tgz $(E2E_ARGS) go-version: ## Print the go version we use to compile our binaries and images @echo $(GO_VERSION) diff --git a/hack/charts/cluster-api-operator-providers/.helmignore b/hack/charts/cluster-api-operator-providers/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/hack/charts/cluster-api-operator-providers/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/hack/charts/cluster-api-operator-providers/Chart.yaml b/hack/charts/cluster-api-operator-providers/Chart.yaml new file mode 100644 index 000000000..1f56f95a5 --- /dev/null +++ b/hack/charts/cluster-api-operator-providers/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +name: cluster-api-operator-providers +description: Cluster API Provider Custom Resources +type: application +version: 0.0.0 +appVersion: "0.0.0" +dependencies: + - name: cluster-api-operator + repository: file://../cluster-api-operator + version: 0.0.0 + condition: cluster-api-operator.install diff --git a/hack/charts/cluster-api-operator-providers/templates/_helpers.tpl b/hack/charts/cluster-api-operator-providers/templates/_helpers.tpl new file mode 100644 index 000000000..a4c8b733d --- /dev/null +++ b/hack/charts/cluster-api-operator-providers/templates/_helpers.tpl @@ -0,0 +1,24 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "capi-operator.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "capi-operator.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/hack/charts/cluster-api-operator/templates/addon.yaml b/hack/charts/cluster-api-operator-providers/templates/addon.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/addon.yaml rename to hack/charts/cluster-api-operator-providers/templates/addon.yaml diff --git a/hack/charts/cluster-api-operator/templates/bootstrap.yaml b/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/bootstrap.yaml rename to hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml diff --git a/hack/charts/cluster-api-operator/templates/control-plane.yaml b/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/control-plane.yaml rename to hack/charts/cluster-api-operator-providers/templates/control-plane.yaml diff --git a/hack/charts/cluster-api-operator/templates/core-conditions.yaml b/hack/charts/cluster-api-operator-providers/templates/core-conditions.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/core-conditions.yaml rename to hack/charts/cluster-api-operator-providers/templates/core-conditions.yaml diff --git a/hack/charts/cluster-api-operator/templates/core.yaml b/hack/charts/cluster-api-operator-providers/templates/core.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/core.yaml rename to hack/charts/cluster-api-operator-providers/templates/core.yaml diff --git a/hack/charts/cluster-api-operator/templates/infra-conditions.yaml b/hack/charts/cluster-api-operator-providers/templates/infra-conditions.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/infra-conditions.yaml rename to hack/charts/cluster-api-operator-providers/templates/infra-conditions.yaml diff --git a/hack/charts/cluster-api-operator/templates/infra.yaml b/hack/charts/cluster-api-operator-providers/templates/infra.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/infra.yaml rename to hack/charts/cluster-api-operator-providers/templates/infra.yaml diff --git a/hack/charts/cluster-api-operator/templates/ipam.yaml b/hack/charts/cluster-api-operator-providers/templates/ipam.yaml similarity index 100% rename from hack/charts/cluster-api-operator/templates/ipam.yaml rename to hack/charts/cluster-api-operator-providers/templates/ipam.yaml diff --git a/hack/charts/cluster-api-operator-providers/values.schema.json b/hack/charts/cluster-api-operator-providers/values.schema.json new file mode 100644 index 000000000..757955212 --- /dev/null +++ b/hack/charts/cluster-api-operator-providers/values.schema.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "cluster-api-operator": { + "type": "object", + "properties": { + "install": { + "type": "boolean", + "default": true + } + } + }, + "core": { + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] + }, + "bootstrap": { + "type": "object", + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] + }, + "controlPlane": { + "type": "object", + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] + }, + "infrastructure": { + "type": "object", + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] + }, + "addon": { + "type": "object", + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] + }, + "ipam": { + "type": "object", + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] + }, + "manager": { + "type": "object", + "properties": { + "featureGates": { + "type": "object" + } + } + }, + "fetchConfig": { + "type": "object" + }, + "configSecret": { + "type": "object" + }, + "enableHelmHook": { + "type": "boolean", + "default": false + } + } +} diff --git a/hack/charts/cluster-api-operator-providers/values.yaml b/hack/charts/cluster-api-operator-providers/values.yaml new file mode 100644 index 000000000..f126d5164 --- /dev/null +++ b/hack/charts/cluster-api-operator-providers/values.yaml @@ -0,0 +1,54 @@ +--- +# Cluster API Operator installation control +cluster-api-operator: + install: true + +# Cluster API provider options +core: {} +# cluster-api: {} # Name, required +# namespace: "" # Optional +# version: "" # Optional +# createNamespace: true # Optional +bootstrap: {} +# kubeadm: {} # Name, required +# namespace: "" # Optional +# version: "" # Optional +# createNamespace: true # Optional +controlPlane: {} +# kubeadm: {} # Name, required +# namespace: "" # Optional +# version: "" # Optional +# createNamespace: true # Optional +infrastructure: {} +# docker: {} # Name, required +# namespace: "" # Optional +# version: "" # Optional +# createNamespace: true # Optional +addon: {} +# helm: {} # Name, required +# namespace: "" # Optional +# version: "" # Optional +# createNamespace: true # Optional +ipam: {} +# in-cluster: {} # Name, required +# namespace: "" # Optional +# version: "" # Optional +# createNamespace: true # Optional +manager: + featureGates: {} +# Configuration for enabling feature gates in different providers +# manager: +# featureGates: +# proxmox: # Name of the provider +# ClusterTopology: true +# core: +# ClusterTopology: true +# kubeadm: +# ClusterTopology: true +fetchConfig: {} +# --- +# Common configuration secret options +configSecret: {} +# name: global-secret # Required +# namespace: default # Optional +enableHelmHook: true # Workaround to avoid ensuring CRDs are installed first diff --git a/hack/charts/cluster-api-operator/values.schema.json b/hack/charts/cluster-api-operator/values.schema.json index d22038fce..b39e7d9dd 100644 --- a/hack/charts/cluster-api-operator/values.schema.json +++ b/hack/charts/cluster-api-operator/values.schema.json @@ -2,46 +2,150 @@ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { - "core": { - "oneOf": [ - { "type": "object" }, - { "type": "null" } - ] + "logLevel": { + "type": "integer", + "default": 2 }, - "bootstrap": { + "replicaCount": { + "type": "integer", + "default": 1 + }, + "leaderElection": { "type": "object", - "oneOf": [ - { "type": "object" }, - { "type": "null" } - ] + "properties": { + "enabled": { + "type": "boolean", + "default": true + }, + "leaseDuration": { + "type": "string" + }, + "renewDeadline": { + "type": "string" + }, + "retryPeriod": { + "type": "string" + } + } }, - "controlPlane": { + "image": { "type": "object", - "oneOf": [ - { "type": "object" }, - { "type": "null" } - ] + "properties": { + "manager": { + "type": "object", + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "pullPolicy": { + "type": "string", + "enum": ["Always", "IfNotPresent", "Never"] + }, + "registry": { + "type": "string" + }, + "digest": { + "type": "string" + } + } + } + } }, - "infrastructure": { + "env": { "type": "object", - "oneOf": [ - { "type": "object" }, - { "type": "null" } - ] + "properties": { + "manager": { + "type": "array" + } + } + }, + "diagnosticsAddress": { + "type": "string", + "default": ":8443" + }, + "healthAddr": { + "type": "string", + "default": ":9440" + }, + "profilerAddress": { + "type": "string", + "default": ":6060" + }, + "contentionProfiling": { + "type": "boolean", + "default": false + }, + "insecureDiagnostics": { + "type": "boolean", + "default": false }, - "addon": { + "watchConfigSecret": { + "type": "boolean", + "default": false + }, + "imagePullSecrets": { + "type": "object" + }, + "resources": { "type": "object", - "oneOf": [ - { "type": "object" }, - { "type": "null" } - ] + "properties": { + "manager": { + "type": "object" + } + } + }, + "containerSecurityContext": { + "type": "object" + }, + "affinity": { + "type": "object" + }, + "tolerations": { + "type": "array" }, - "ipam": { + "volumes": { + "type": "array" + }, + "volumeMounts": { "type": "object", - "oneOf": [ - { "type": "object" }, - { "type": "null" } - ] + "properties": { + "manager": { + "type": "array" + } + } + }, + "deploymentLabels": { + "type": "object" + }, + "deploymentAnnotations": { + "type": "object" + }, + "podLabels": { + "type": "object" + }, + "podAnnotations": { + "type": "object" + }, + "securityContext": { + "type": "object" + }, + "strategy": { + "type": "object" + }, + "nodeSelector": { + "type": "object" + }, + "topologySpreadConstraints": { + "type": "array" + }, + "podDnsPolicy": { + "type": "string" + }, + "podDnsConfig": { + "type": "object" } } } diff --git a/hack/charts/cluster-api-operator/values.yaml b/hack/charts/cluster-api-operator/values.yaml index 745ff9e99..87d80b812 100644 --- a/hack/charts/cluster-api-operator/values.yaml +++ b/hack/charts/cluster-api-operator/values.yaml @@ -1,51 +1,4 @@ --- -# --- -# Cluster API provider options -core: {} -# cluster-api: {} # Name, required -# namespace: "" # Optional -# version: "" # Optional -# createNamespace: true # Optional -bootstrap: {} -# kubeadm: {} # Name, required -# namespace: "" # Optional -# version: "" # Optional -# createNamespace: true # Optional -controlPlane: {} -# kubeadm: {} # Name, required -# namespace: "" # Optional -# version: "" # Optional -# createNamespace: true # Optional -infrastructure: {} -# docker: {} # Name, required -# namespace: "" # Optional -# version: "" # Optional -# createNamespace: true # Optional -addon: {} -# helm: {} # Name, required -# namespace: "" # Optional -# version: "" # Optional -# createNamespace: true # Optional -ipam: {} -# in-cluster: {} # Name, required -# namespace: "" # Optional -# version: "" # Optional -# createNamespace: true # Optional -manager.featureGates: {} -# Configuration for enabling feature gates in different providers -# manager: -# featureGates: -# proxmox: # Name of the provider -# ClusterTopology: true -# core: -# ClusterTopology: true -# kubeadm: -# ClusterTopology: true -fetchConfig: {} -# --- -# Common configuration secret options -configSecret: {} -# --- # CAPI operator deployment options logLevel: 2 replicaCount: 1 @@ -105,4 +58,3 @@ volumeMounts: - mountPath: /tmp/k8s-webhook-server/serving-certs name: cert readOnly: true -enableHelmHook: true diff --git a/test/e2e/helm_test.go b/test/e2e/helm_test.go index a6178f654..a9345b022 100644 --- a/test/e2e/helm_test.go +++ b/test/e2e/helm_test.go @@ -42,7 +42,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func deleteClusterAPICRDs(helmClusterProxy) }) - It("should deploy a quick-start cluster-api-operator chart", func() { + It("should deploy a quick-start cluster-api-operator-providers chart", func() { clusterProxy := helmClusterProxy.GetClient() fullHelmChart := &HelmChart{ diff --git a/test/e2e/resources/all-providers-custom-ns-versions.yaml b/test/e2e/resources/all-providers-custom-ns-versions.yaml index 71e38b203..315c60518 100644 --- a/test/e2e/resources/all-providers-custom-ns-versions.yaml +++ b/test/e2e/resources/all-providers-custom-ns-versions.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-custom-ns --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-custom-ns --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-custom-ns --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-custom-ns --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capd-custom-ns --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-custom-ns --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -72,7 +72,7 @@ metadata: spec: version: v0.2.6 --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -88,7 +88,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -104,7 +104,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -120,7 +120,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -136,7 +136,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -150,4 +150,4 @@ spec: version: v1.7.7 configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/all-providers-custom-versions.yaml b/test/e2e/resources/all-providers-custom-versions.yaml index 02bcae0a8..1f77c8713 100644 --- a/test/e2e/resources/all-providers-custom-versions.yaml +++ b/test/e2e/resources/all-providers-custom-versions.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -72,7 +72,7 @@ metadata: spec: version: v0.2.6 --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -88,7 +88,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -104,7 +104,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -120,7 +120,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -136,7 +136,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -150,4 +150,4 @@ spec: version: v1.7.7 configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/all-providers-latest-versions.yaml b/test/e2e/resources/all-providers-latest-versions.yaml index cd845d028..825bd92e7 100644 --- a/test/e2e/resources/all-providers-latest-versions.yaml +++ b/test/e2e/resources/all-providers-latest-versions.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -70,7 +70,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -85,7 +85,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -100,7 +100,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -115,7 +115,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -130,7 +130,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -143,4 +143,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/all-providers-manager-defined-no-feature-gates.yaml b/test/e2e/resources/all-providers-manager-defined-no-feature-gates.yaml index 0042c6889..fdd2a7e84 100644 --- a/test/e2e/resources/all-providers-manager-defined-no-feature-gates.yaml +++ b/test/e2e/resources/all-providers-manager-defined-no-feature-gates.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: azure-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -70,7 +70,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -85,7 +85,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -100,7 +100,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -115,7 +115,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -130,7 +130,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -143,4 +143,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/feature-gates.yaml b/test/e2e/resources/feature-gates.yaml index 1fd336ce5..0b3d62ae1 100644 --- a/test/e2e/resources/feature-gates.yaml +++ b/test/e2e/resources/feature-gates.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: aws-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -70,7 +70,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -85,7 +85,7 @@ spec: name: aws-variables namespace: default --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -100,7 +100,7 @@ spec: name: aws-variables namespace: default --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -120,7 +120,7 @@ spec: name: aws-variables namespace: default --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -135,7 +135,7 @@ spec: name: aws-variables namespace: default --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -155,4 +155,4 @@ spec: MachinePool: true configSecret: name: aws-variables - namespace: default \ No newline at end of file + namespace: default diff --git a/test/e2e/resources/full-chart-install.yaml b/test/e2e/resources/full-chart-install.yaml index f094ff605..b813771b2 100644 --- a/test/e2e/resources/full-chart-install.yaml +++ b/test/e2e/resources/full-chart-install.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: v1 kind: ServiceAccount metadata: @@ -8,7 +8,7 @@ metadata: name: capi-operator-manager namespace: 'default' --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -3127,7 +3127,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -6246,7 +6246,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -9367,7 +9367,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -12486,7 +12486,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -15607,7 +15607,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -18726,7 +18726,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -21848,7 +21848,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -21863,7 +21863,7 @@ rules: verbs: - '*' --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -21879,7 +21879,7 @@ subjects: name: capi-operator-manager namespace: 'default' --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -21927,7 +21927,7 @@ rules: - patch - delete --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -21944,7 +21944,7 @@ subjects: name: capi-operator-manager namespace: 'default' --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: v1 kind: Service metadata: @@ -21960,7 +21960,7 @@ spec: clusterctl.cluster.x-k8s.io/core: capi-operator control-plane: controller-manager --- -# Source: cluster-api-operator/templates/deployment.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: @@ -22075,25 +22075,25 @@ spec: - effect: NoSchedule key: node-role.kubernetes.io/control-plane --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml # Addon provider --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml # Bootstrap provider --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml # Control plane provider --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml # Core provider --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml # Infrastructure providers --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml # IPAM providers --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: cert-manager.io/v1 kind: Certificate metadata: @@ -22110,7 +22110,7 @@ spec: name: capi-operator-selfsigned-issuer secretName: capi-operator-webhook-service-cert --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: cert-manager.io/v1 kind: Issuer metadata: @@ -22121,7 +22121,7 @@ metadata: spec: selfSigned: {} --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: @@ -22286,7 +22286,7 @@ webhooks: - runtimeextensionproviders sideEffects: None --- -# Source: cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: diff --git a/test/e2e/resources/kubeadm-manager-defined.yaml b/test/e2e/resources/kubeadm-manager-defined.yaml index 9719171e7..41d5bdde4 100644 --- a/test/e2e/resources/kubeadm-manager-defined.yaml +++ b/test/e2e/resources/kubeadm-manager-defined.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -70,7 +70,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -81,7 +81,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -97,7 +97,7 @@ spec: ClusterTopology: true MachinePool: true --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -109,7 +109,7 @@ metadata: "argocd.argoproj.io/sync-wave": "2" spec: --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -121,7 +121,7 @@ metadata: "argocd.argoproj.io/sync-wave": "2" spec: --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -131,4 +131,4 @@ metadata: "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" -spec: \ No newline at end of file +spec: diff --git a/test/e2e/resources/manager-defined-missing-other-infra-spec.yaml b/test/e2e/resources/manager-defined-missing-other-infra-spec.yaml index af8db65c4..7ab76f74b 100644 --- a/test/e2e/resources/manager-defined-missing-other-infra-spec.yaml +++ b/test/e2e/resources/manager-defined-missing-other-infra-spec.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -59,7 +59,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -70,7 +70,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -81,7 +81,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -93,7 +93,7 @@ metadata: "argocd.argoproj.io/sync-wave": "2" spec: --- -# Source: cluster-api-operator/templates/core.yaml +# Source: cluster-api-operator-providers/templates/core.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -109,7 +109,7 @@ spec: ClusterTopology: true MachinePool: true --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -121,7 +121,7 @@ metadata: "argocd.argoproj.io/sync-wave": "2" spec: --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -131,4 +131,4 @@ metadata: "helm.sh/hook": "post-install,post-upgrade" "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" -spec: \ No newline at end of file +spec: diff --git a/test/e2e/resources/multiple-bootstrap-custom-ns-versions.yaml b/test/e2e/resources/multiple-bootstrap-custom-ns-versions.yaml index b95424c64..6d960f5de 100644 --- a/test/e2e/resources/multiple-bootstrap-custom-ns-versions.yaml +++ b/test/e2e/resources/multiple-bootstrap-custom-ns-versions.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-custom-ns --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: rke2-bootstrap-custom-ns --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -45,7 +45,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -61,7 +61,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -74,4 +74,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/multiple-control-plane-custom-ns-versions.yaml b/test/e2e/resources/multiple-control-plane-custom-ns-versions.yaml index 3ad73a632..4d5a9b932 100644 --- a/test/e2e/resources/multiple-control-plane-custom-ns-versions.yaml +++ b/test/e2e/resources/multiple-control-plane-custom-ns-versions.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-custom-ns --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: rke2-control-plane-custom-ns --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -45,7 +45,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -61,7 +61,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -74,4 +74,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/multiple-infra-custom-ns-versions.yaml b/test/e2e/resources/multiple-infra-custom-ns-versions.yaml index 38c7656bc..25fbf6ae6 100644 --- a/test/e2e/resources/multiple-infra-custom-ns-versions.yaml +++ b/test/e2e/resources/multiple-infra-custom-ns-versions.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capz-custom-ns --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capd-custom-ns --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -64,7 +64,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -79,7 +79,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -94,7 +94,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -110,7 +110,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -124,4 +124,4 @@ spec: version: v1.7.7 configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-addon.yaml b/test/e2e/resources/only-addon.yaml index 3b5e62dea..6a0324545 100644 --- a/test/e2e/resources/only-addon.yaml +++ b/test/e2e/resources/only-addon.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -30,7 +30,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -43,4 +43,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-bootstrap.yaml b/test/e2e/resources/only-bootstrap.yaml index b7e062c71..b011ddb40 100644 --- a/test/e2e/resources/only-bootstrap.yaml +++ b/test/e2e/resources/only-bootstrap.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/bootstrap.yaml +# Source: cluster-api-operator-providers/templates/bootstrap.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -34,7 +34,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -47,4 +47,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-control-plane.yaml b/test/e2e/resources/only-control-plane.yaml index 1e4b84e5b..27e9e2668 100644 --- a/test/e2e/resources/only-control-plane.yaml +++ b/test/e2e/resources/only-control-plane.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/control-plane.yaml +# Source: cluster-api-operator-providers/templates/control-plane.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -34,7 +34,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -47,4 +47,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-infra-and-addon.yaml b/test/e2e/resources/only-infra-and-addon.yaml index d505efa3f..8575993f3 100644 --- a/test/e2e/resources/only-infra-and-addon.yaml +++ b/test/e2e/resources/only-infra-and-addon.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: helm-addon-system --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/addon.yaml +# Source: cluster-api-operator-providers/templates/addon.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: AddonProvider metadata: @@ -60,7 +60,7 @@ metadata: "helm.sh/hook-weight": "2" "argocd.argoproj.io/sync-wave": "2" --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -75,7 +75,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -90,7 +90,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -105,7 +105,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -118,4 +118,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-infra-and-ipam.yaml b/test/e2e/resources/only-infra-and-ipam.yaml index 2d0a92f03..127e4059d 100644 --- a/test/e2e/resources/only-infra-and-ipam.yaml +++ b/test/e2e/resources/only-infra-and-ipam.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -49,7 +49,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -64,7 +64,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -79,7 +79,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -94,7 +94,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -109,7 +109,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -122,4 +122,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-infra.yaml b/test/e2e/resources/only-infra.yaml index 001da084d..f53f6e8db 100644 --- a/test/e2e/resources/only-infra.yaml +++ b/test/e2e/resources/only-infra.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-bootstrap-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -29,7 +29,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-kubeadm-control-plane-system --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: v1 kind: Namespace metadata: @@ -39,7 +39,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: docker-infrastructure-system --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: BootstrapProvider metadata: @@ -54,7 +54,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra-conditions.yaml +# Source: cluster-api-operator-providers/templates/infra-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: ControlPlaneProvider metadata: @@ -69,7 +69,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -84,7 +84,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/infra.yaml +# Source: cluster-api-operator-providers/templates/infra.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: InfrastructureProvider metadata: @@ -97,4 +97,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/test/e2e/resources/only-ipam.yaml b/test/e2e/resources/only-ipam.yaml index 5f298c60e..a927578ca 100644 --- a/test/e2e/resources/only-ipam.yaml +++ b/test/e2e/resources/only-ipam.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: v1 kind: Namespace metadata: @@ -9,7 +9,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: capi-system --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: v1 kind: Namespace metadata: @@ -19,7 +19,7 @@ metadata: "argocd.argoproj.io/sync-wave": "1" name: in-cluster-ipam-system --- -# Source: cluster-api-operator/templates/core-conditions.yaml +# Source: cluster-api-operator-providers/templates/core-conditions.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: CoreProvider metadata: @@ -34,7 +34,7 @@ spec: name: test-secret-name namespace: test-secret-namespace --- -# Source: cluster-api-operator/templates/ipam.yaml +# Source: cluster-api-operator-providers/templates/ipam.yaml apiVersion: operator.cluster.x-k8s.io/v1alpha2 kind: IPAMProvider metadata: @@ -47,4 +47,4 @@ metadata: spec: configSecret: name: test-secret-name - namespace: test-secret-namespace \ No newline at end of file + namespace: test-secret-namespace diff --git a/values.yaml b/values.yaml new file mode 100644 index 000000000..899913de6 --- /dev/null +++ b/values.yaml @@ -0,0 +1,35 @@ +core: + cluster-api: + enabled: true +bootstrap: + k0sproject-k0smotron: + enabled: true +controlPlane: + k0sproject-k0smotron: + enabled: true +infrastructure: + k0sproject-k0smotron: + enabled: true + kubevirt: + enabled: true + aws: + enabled: true + namespace: capa-system + createNamespace: false + configSecret: + name: aws-variables + namespace: capa-system +manager: + featureGates: + core: + ClusterTopology: true + MachinePool: true + RuntimeSDK: true + aws: + ClusterTopology: true + MachinePool: true + RuntimeSDK: true + kubevirt: + ClusterTopology: true + MachinePool: true + RuntimeSDK: true From a897ffdd54946bb0329f5974d5f573f0d8b50b0d Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Mon, 23 Jun 2025 15:59:35 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20multipl?= =?UTF-8?q?e=20helm=20charts=20in=20chart-update=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update hack/chart-update/main.go to process both cluster-api-operator and cluster-api-operator-providers charts when updating index.yaml. This ensures all charts are properly registered in the helm repository index during the release process. Signed-off-by: kahirokunn --- hack/chart-update/main.go | 94 +++++++++++++++++++++++++++------------ 1 file changed, 65 insertions(+), 29 deletions(-) diff --git a/hack/chart-update/main.go b/hack/chart-update/main.go index 3d55138ef..7cb6901fa 100644 --- a/hack/chart-update/main.go +++ b/hack/chart-update/main.go @@ -24,6 +24,24 @@ const ( repoName = "cluster-api-operator" ) +// chartInfo represents information about a chart to be processed +type chartInfo struct { + name string + description string +} + +// List of charts to process +var charts = []chartInfo{ + { + name: "cluster-api-operator", + description: "Cluster API Operator", + }, + { + name: "cluster-api-operator-providers", + description: "Cluster API Provider Custom Resources", + }, +} + func main() { fmt.Println("🚀 Starting index.yaml update tool") @@ -38,45 +56,66 @@ func main() { fmt.Println("⚙️ Loading index.yaml file from repo root directory") - indexFile := loadIndexFile(tag) + indexFile := loadIndexFile() + + fmt.Println("🔎 Finding chart archives in release assets") - fmt.Println("🔎 Finding chart archive in release assets") + // Get all release assets once + releaseAssets := getReleaseAssets(tag) - chartAsset := findChartReleaseAsset(tag) + // Process each chart + processedCharts := 0 + for _, chartInfo := range charts { + fmt.Printf("\n📊 Processing chart: %s\n", chartInfo.name) - fmt.Println("📦 Downloading chart archive to a temp directory") + // Check if chart already exists in index + if _, err := indexFile.Get(chartInfo.name, tag[1:]); err == nil { + fmt.Printf("✅ Chart %s already exists in index file, skipping\n", chartInfo.name) + continue + } - archivePath, chart := downloadChart(chartAsset) + // Find chart asset + chartAsset := findChartAsset(releaseAssets, chartInfo.name, tag) + if chartAsset == nil { + fmt.Printf("⚠️ Chart archive for %s not found in release assets, skipping\n", chartInfo.name) + continue + } + + fmt.Printf("📦 Downloading %s chart archive to a temp directory\n", chartInfo.name) + archivePath, chart := downloadChart(chartAsset) + + fmt.Printf("👉🏻 Adding %s entry to index.yaml\n", chartInfo.name) + addEntryToIndexFile(indexFile, chartAsset, archivePath, chart) + + processedCharts++ + } - fmt.Println("👉🏻 Adding entry to index.yaml") - addEntryToIndexFile(indexFile, chartAsset, archivePath, chart) + if processedCharts == 0 { + fmt.Println("\n⚠️ No new charts were added to index.yaml") + os.Exit(0) + } - fmt.Println("📝 Writing index.yaml file to repo root directory") + fmt.Println("\n📝 Writing index.yaml file to repo root directory") if err := indexFile.WriteFile(indexFilePath, 0644); err != nil { fmt.Println("❌ Error writing index file: ", err) os.Exit(1) } - fmt.Println("✅ Done updating index.yaml file") + fmt.Printf("\n✅ Done updating index.yaml file. Added %d chart(s)\n", processedCharts) } -func loadIndexFile(tag string) *repo.IndexFile { +func loadIndexFile() *repo.IndexFile { indexFile, err := repo.LoadIndexFile(indexFilePath) if err != nil { fmt.Println("❌ Error loading index file: ", err) os.Exit(1) } - if _, err := indexFile.Get(repoName, tag[1:]); err == nil { - fmt.Println("✅ Chart already exists in index file, no need to update") - os.Exit(0) - } - return indexFile } -func findChartReleaseAsset(tag string) *github.ReleaseAsset { +func getReleaseAssets(tag string) []*github.ReleaseAsset { ghClient := github.NewClient(nil) release, _, err := ghClient.Repositories.GetReleaseByTag(context.TODO(), gitHubOrgName, repoName, tag) @@ -85,22 +124,19 @@ func findChartReleaseAsset(tag string) *github.ReleaseAsset { os.Exit(1) } - chartAsset := &github.ReleaseAsset{} - found := false - for _, asset := range release.Assets { - if *asset.Name == fmt.Sprintf("%s-%s.tgz", repoName, tag[1:]) { - chartAsset = asset - found = true - break - } - } + return release.Assets +} - if !found { - fmt.Printf("❌ Chart archive not found in release assets for release %s, please check if release was published correctly\n", tag) - os.Exit(1) +func findChartAsset(assets []*github.ReleaseAsset, chartName, tag string) *github.ReleaseAsset { + expectedFileName := fmt.Sprintf("%s-%s.tgz", chartName, tag[1:]) + + for _, asset := range assets { + if *asset.Name == expectedFileName { + return asset + } } - return chartAsset + return nil } func downloadChart(chartAsset *github.ReleaseAsset) (string, *chart.Chart) { From 270d1ee065dbc519133da7317f8f551bb8a3309e Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Tue, 24 Jun 2025 15:32:25 +0900 Subject: [PATCH 03/10] =?UTF-8?q?=E2=9C=A8=20Add=20provider-specific=20con?= =?UTF-8?q?figSecret=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Providers can now define their own configSecret: core: cluster-api: configSecret: name: core-secret namespace: capi-system If not specified, providers will use the global configSecret. Signed-off-by: kahirokunn --- .../templates/bootstrap.yaml | 11 ++++++----- .../templates/control-plane.yaml | 11 ++++++----- .../templates/core.yaml | 11 ++++++----- .../templates/infra.yaml | 11 ++++++----- .../templates/ipam.yaml | 11 ++++++----- .../charts/cluster-api-operator-providers/values.yaml | 3 +++ 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml b/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml index 65378bedc..1fc8832eb 100644 --- a/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml @@ -28,17 +28,18 @@ metadata: "helm.sh/hook-weight": "2" {{- end }} "argocd.argoproj.io/sync-wave": "2" -{{- if or $bootstrapVersion $.Values.configSecret.name }} +{{- if or $bootstrapVersion $bootstrap.configSecret $.Values.configSecret.name }} spec: {{- end}} {{- if $bootstrapVersion }} version: {{ $bootstrapVersion }} {{- end }} -{{- if $.Values.configSecret.name }} +{{- $configSecret := default $.Values.configSecret $bootstrap.configSecret }} +{{- if $configSecret.name }} configSecret: - name: {{ $.Values.configSecret.name }} - {{- if $.Values.configSecret.namespace }} - namespace: {{ $.Values.configSecret.namespace }} + name: {{ $configSecret.name }} + {{- if $configSecret.namespace }} + namespace: {{ $configSecret.namespace }} {{- end }} {{- end }} {{- if $bootstrap.manifestPatches }} diff --git a/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml b/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml index 33794af9a..05e7243a6 100644 --- a/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml @@ -28,7 +28,7 @@ metadata: "helm.sh/hook-weight": "2" {{- end }} "argocd.argoproj.io/sync-wave": "2" -{{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager }} +{{- if or $controlPlaneVersion $controlPlane.configSecret $.Values.configSecret.name $.Values.manager }} spec: {{- end}} {{- if $controlPlaneVersion }} @@ -47,11 +47,12 @@ spec: {{- end }} {{- end }} {{- end }} -{{- if $.Values.configSecret.name }} +{{- $configSecret := default $.Values.configSecret $controlPlane.configSecret }} +{{- if $configSecret.name }} configSecret: - name: {{ $.Values.configSecret.name }} - {{- if $.Values.configSecret.namespace }} - namespace: {{ $.Values.configSecret.namespace }} + name: {{ $configSecret.name }} + {{- if $configSecret.namespace }} + namespace: {{ $configSecret.namespace }} {{- end }} {{- end }} {{- if $controlPlane.manifestPatches }} diff --git a/hack/charts/cluster-api-operator-providers/templates/core.yaml b/hack/charts/cluster-api-operator-providers/templates/core.yaml index 57629497d..66d87bc4a 100644 --- a/hack/charts/cluster-api-operator-providers/templates/core.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/core.yaml @@ -28,7 +28,7 @@ metadata: "helm.sh/hook-weight": "2" {{- end }} "argocd.argoproj.io/sync-wave": "2" -{{- if or $coreVersion $.Values.configSecret.name $.Values.manager }} +{{- if or $coreVersion $core.configSecret $.Values.configSecret.name $.Values.manager }} spec: {{- end}} {{- if $coreVersion }} @@ -43,11 +43,12 @@ spec: {{- end }} {{- end }} {{- end }} -{{- if $.Values.configSecret.name }} +{{- $configSecret := default $.Values.configSecret $core.configSecret }} +{{- if $configSecret.name }} configSecret: - name: {{ $.Values.configSecret.name }} - {{- if $.Values.configSecret.namespace }} - namespace: {{ $.Values.configSecret.namespace }} + name: {{ $configSecret.name }} + {{- if $configSecret.namespace }} + namespace: {{ $configSecret.namespace }} {{- end }} {{- end }} {{- if $core.manifestPatches }} diff --git a/hack/charts/cluster-api-operator-providers/templates/infra.yaml b/hack/charts/cluster-api-operator-providers/templates/infra.yaml index 8e68b3bf8..04f7a5f5d 100644 --- a/hack/charts/cluster-api-operator-providers/templates/infra.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/infra.yaml @@ -28,7 +28,7 @@ metadata: "helm.sh/hook-weight": "2" {{- end }} "argocd.argoproj.io/sync-wave": "2" -{{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }} +{{- if or $infrastructureVersion $infra.configSecret $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }} spec: {{- end }} {{- if $infrastructureVersion }} @@ -57,11 +57,12 @@ spec: {{- end }} {{- end }} {{- end }} -{{- if $.Values.configSecret.name }} +{{- $configSecret := default $.Values.configSecret $infra.configSecret }} +{{- if $configSecret.name }} configSecret: - name: {{ $.Values.configSecret.name }} - {{- if $.Values.configSecret.namespace }} - namespace: {{ $.Values.configSecret.namespace }} + name: {{ $configSecret.name }} + {{- if $configSecret.namespace }} + namespace: {{ $configSecret.namespace }} {{- end }} {{- end }} {{- if $.Values.additionalDeployments }} diff --git a/hack/charts/cluster-api-operator-providers/templates/ipam.yaml b/hack/charts/cluster-api-operator-providers/templates/ipam.yaml index 314306ffc..7b9c23f29 100644 --- a/hack/charts/cluster-api-operator-providers/templates/ipam.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/ipam.yaml @@ -28,7 +28,7 @@ metadata: "helm.sh/hook-weight": "2" {{- end }} "argocd.argoproj.io/sync-wave": "2" -{{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }} +{{- if or $ipamVersion $ipam.configSecret $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }} spec: {{- end }} {{- if $ipamVersion }} @@ -57,11 +57,12 @@ spec: {{- end }} {{- end }} {{- end }} -{{- if $.Values.configSecret.name }} +{{- $configSecret := default $.Values.configSecret $ipam.configSecret }} +{{- if $configSecret.name }} configSecret: - name: {{ $.Values.configSecret.name }} - {{- if $.Values.configSecret.namespace }} - namespace: {{ $.Values.configSecret.namespace }} + name: {{ $configSecret.name }} + {{- if $configSecret.namespace }} + namespace: {{ $configSecret.namespace }} {{- end }} {{- end }} {{- if $ipam.manifestPatches }} diff --git a/hack/charts/cluster-api-operator-providers/values.yaml b/hack/charts/cluster-api-operator-providers/values.yaml index f126d5164..0d1415da8 100644 --- a/hack/charts/cluster-api-operator-providers/values.yaml +++ b/hack/charts/cluster-api-operator-providers/values.yaml @@ -24,6 +24,9 @@ infrastructure: {} # namespace: "" # Optional # version: "" # Optional # createNamespace: true # Optional +# configSecret: # Optional +# name: some-secret # Optional +# namespace: default # Optional addon: {} # helm: {} # Name, required # namespace: "" # Optional From 6b54e7e1ec50f506c6aa60a51f01b29b32c89fe9 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Fri, 20 Jun 2025 09:12:23 +0900 Subject: [PATCH 04/10] =?UTF-8?q?=F0=9F=8C=B1=20Add=20smoke=20test=20workf?= =?UTF-8?q?low?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new GitHub Actions workflow for smoke testing. Signed-off-by: kahirokunn --- .github/workflows/smoke-test.yaml | 262 ++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 .github/workflows/smoke-test.yaml diff --git a/.github/workflows/smoke-test.yaml b/.github/workflows/smoke-test.yaml new file mode 100644 index 000000000..816c6314c --- /dev/null +++ b/.github/workflows/smoke-test.yaml @@ -0,0 +1,262 @@ +name: Smoke Test + +on: + pull_request: + branches: [main, 'release-*'] + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +env: + CLUSTER_NAME: capi-quickstart + KIND_CLUSTER_NAME: capi-operator-smoke-test + KUBERNETES_VERSION: v1.33.0 + CONTROLLER_IMG: cluster-api-operator + TAG: smoke-test + +jobs: + smoke-test: + name: Smoke Test (${{ matrix.install-method }}) + runs-on: ubuntu-latest + strategy: + matrix: + install-method: [legacy, recommended] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Install tools + run: | + # kubectl + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + chmod +x kubectl && sudo mv kubectl /usr/local/bin/ + + # yq + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq + chmod +x yq && sudo mv yq /usr/local/bin/ + + # helm + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + + # clusterctl + curl -L https://github.com/kubernetes-sigs/cluster-api/releases/latest/download/clusterctl-linux-amd64 -o clusterctl + chmod +x clusterctl && sudo mv clusterctl /usr/local/bin/ + + - name: Build Docker image + run: | + make docker-build + docker tag ${CONTROLLER_IMG}-amd64:${TAG} ${CONTROLLER_IMG}:${TAG} + + - name: Build charts + run: | + make release-chart + echo "HELM_CHART_TAG=$(make -s -f Makefile -p | grep '^HELM_CHART_TAG :=' | cut -d' ' -f3)" >> $GITHUB_ENV + + - name: Create kind cluster + run: | + chmod +x ./hack/ensure-kind.sh + ./hack/ensure-kind.sh + + cat < /tmp/kind-config.yaml + kind: Cluster + apiVersion: kind.x-k8s.io/v1alpha4 + networking: + ipFamily: ipv4 + nodes: + - role: control-plane + extraMounts: + - hostPath: /var/run/docker.sock + containerPath: /var/run/docker.sock + containerdConfigPatches: + - |- + [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] + endpoint = ["https://mirror.gcr.io", "https://registry-1.docker.io"] + EOF + + kind create cluster --name ${KIND_CLUSTER_NAME} --config /tmp/kind-config.yaml --wait 5m + kind load docker-image ${CONTROLLER_IMG}:${TAG} --name ${KIND_CLUSTER_NAME} + + - name: Install cert-manager + run: | + helm repo add jetstack https://charts.jetstack.io + helm repo update + helm install cert-manager jetstack/cert-manager \ + --namespace cert-manager \ + --create-namespace \ + --set installCRDs=true \ + --wait \ + --timeout 5m + + - name: Install Cluster API Operator (Recommended) + if: matrix.install-method == 'recommended' + run: | + CHART_PACKAGE="out/package/cluster-api-operator-${HELM_CHART_TAG}.tgz" + helm install capi-operator "$CHART_PACKAGE" \ + --create-namespace \ + -n capi-operator-system \ + --set image.manager.repository=${CONTROLLER_IMG} \ + --set image.manager.tag=${TAG} \ + --set image.manager.pullPolicy=IfNotPresent \ + --wait \ + --timeout 90s + + - name: Prepare providers values + run: | + cat < /tmp/providers-values.yaml + core: + cluster-api: + namespace: capi-system + bootstrap: + kubeadm: + namespace: capi-kubeadm-bootstrap-system + controlPlane: + kubeadm: + namespace: capi-kubeadm-control-plane-system + infrastructure: + docker: + namespace: capd-system + manager: + featureGates: + core: + ClusterTopology: true + ClusterResourceSet: true + MachinePool: true + kubeadm: + ClusterTopology: true + MachinePool: true + docker: + ClusterTopology: true + EOF + + # Add cluster-api-operator configuration for legacy installation + if [ "${{ matrix.install-method }}" = "legacy" ]; then + cat <> /tmp/providers-values.yaml + cluster-api-operator: + install: true + image: + manager: + repository: ${CONTROLLER_IMG} + tag: ${TAG} + pullPolicy: IfNotPresent + EOF + fi + + - name: Deploy providers (Recommended) + if: matrix.install-method == 'recommended' + run: | + PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz" + helm install capi-providers "$PROVIDERS_CHART_PACKAGE" \ + -f /tmp/providers-values.yaml \ + --set cluster-api-operator.install=false \ + --set enableHelmHook=false \ + --wait + + - name: Deploy providers (Legacy) + if: matrix.install-method == 'legacy' + run: | + PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz" + helm install capi-providers "$PROVIDERS_CHART_PACKAGE" \ + --create-namespace \ + -n capi-operator-system \ + -f /tmp/providers-values.yaml \ + --wait \ + --timeout 300s + + - name: Wait for providers + run: | + kubectl wait --for=condition=Ready --timeout=300s -n capi-system coreprovider/cluster-api + kubectl wait --for=condition=Ready --timeout=300s -n capi-kubeadm-bootstrap-system bootstrapprovider/kubeadm + kubectl wait --for=condition=Ready --timeout=300s -n capi-kubeadm-control-plane-system controlplaneprovider/kubeadm + kubectl wait --for=condition=Ready --timeout=300s -n capd-system infrastructureprovider/docker + + kubectl wait --for=condition=Available --timeout=300s -n capi-system deployment/capi-controller-manager + kubectl wait --for=condition=Available --timeout=300s -n capi-kubeadm-bootstrap-system deployment/capi-kubeadm-bootstrap-controller-manager + kubectl wait --for=condition=Available --timeout=300s -n capi-kubeadm-control-plane-system deployment/capi-kubeadm-control-plane-controller-manager + kubectl wait --for=condition=Available --timeout=300s -n capd-system deployment/capd-controller-manager + + - name: Verify providers + run: | + kubectl get coreprovider,bootstrapprovider,controlplaneprovider,infrastructureprovider -A + kubectl get pods -A | grep -E "(capi-|capd-)" + + - name: Create workload cluster + run: | + clusterctl generate cluster ${CLUSTER_NAME} \ + --infrastructure docker:v1.10.0 \ + --flavor development \ + --kubernetes-version ${KUBERNETES_VERSION} \ + --control-plane-machine-count=1 \ + --worker-machine-count=2 \ + > capi-quickstart.yaml + + kubectl apply -f capi-quickstart.yaml + + - name: Get workload cluster kubeconfig + run: | + timeout 300s bash -c "until kubectl get secret ${CLUSTER_NAME}-kubeconfig -n default &>/dev/null; do sleep 2; done" + clusterctl get kubeconfig ${CLUSTER_NAME} --namespace default > ${CLUSTER_NAME}.kubeconfig + echo "KUBECONFIG=$(pwd)/${CLUSTER_NAME}.kubeconfig" >> $GITHUB_ENV + + - name: Wait for workload cluster API server + run: | + timeout 300s bash -c "until kubectl cluster-info &>/dev/null; do sleep 5; done" + + - name: Install CNI + run: | + kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/calico.yaml + kubectl wait --for=condition=Ready --timeout=300s pods -n tigera-operator -l app.kubernetes.io/name=tigera-operator || true + kubectl wait --for=condition=Ready --timeout=300s pods -n calico-system --all || true + + - name: Wait for nodes + run: | + kubectl wait --for=condition=Ready --timeout=300s nodes --all + kubectl get nodes -o wide + + - name: Verify cluster + run: | + kubectl get po -A + kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l k8s-app=kube-proxy + kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l component=kube-apiserver + kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l component=kube-controller-manager + kubectl wait --for=condition=Ready --timeout=300s pods -n kube-system -l component=kube-scheduler + + - name: Collect logs on failure + if: failure() + run: | + echo "=== Installation Method: ${{ matrix.install-method }} ===" + echo "=== Recent Events ===" + kubectl get events -A --sort-by='.lastTimestamp' | tail -50 + + echo -e "\n=== Provider Logs ===" + kubectl logs -n capi-operator-system deployment/capi-operator-cluster-api-operator --tail=50 || true + kubectl logs -n capi-system deployment/capi-controller-manager --tail=50 || true + kubectl logs -n capd-system deployment/capd-controller-manager --tail=50 || true + + echo -e "\n=== Cluster Resources ===" + kubectl get cluster,dockercluster,kubeadmcontrolplane,machine,dockermachine -A -o wide || true + + echo -e "\n=== Failed Pods ===" + kubectl get pods -A | grep -v Running | grep -v Completed || true + + if [ -f "${CLUSTER_NAME}.kubeconfig" ]; then + export KUBECONFIG=$(pwd)/${CLUSTER_NAME}.kubeconfig + echo -e "\n=== Workload Cluster Status ===" + kubectl get nodes -o wide || true + kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded || true + fi + + - name: Cleanup + if: always() + run: | + kind delete cluster --name ${CLUSTER_NAME} || true + kind delete cluster --name ${KIND_CLUSTER_NAME} || true From 167689f917e80c55732311528252eafe42bb4b5d Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Thu, 24 Jul 2025 18:05:23 +0900 Subject: [PATCH 05/10] fix: resolve flaky helm test failures due to whitespace comparison issues This commit fixes intermittent test failures in the helm e2e tests caused by inconsistent whitespace handling between Helm output and expected manifest files. Signed-off-by: kahirokunn --- test/e2e/helm_test.go | 37 +-- test/e2e/helm_test.go.bak | 422 +++++++++++++++++++++++++++++ test/framework/all_type_helpers.go | 1 + 3 files changed, 442 insertions(+), 18 deletions(-) create mode 100644 test/e2e/helm_test.go.bak diff --git a/test/e2e/helm_test.go b/test/e2e/helm_test.go index a9345b022..e043d6988 100644 --- a/test/e2e/helm_test.go +++ b/test/e2e/helm_test.go @@ -21,6 +21,7 @@ package e2e import ( "os" "path/filepath" + "strings" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -143,7 +144,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(err).ToNot(HaveOccurred()) fullChartInstall, err := os.ReadFile(filepath.Join(customManifestsFolder, "full-chart-install.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(fullChartInstall))) + Expect(manifests).To(Equal(strings.TrimSpace(string(fullChartInstall)))) }) It("should not deploy providers when none specified", func() { @@ -173,7 +174,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-ns-versions.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy all providers with custom versions", func() { @@ -191,7 +192,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-versions.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy all providers with latest version", func() { @@ -209,7 +210,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-latest-versions.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core, bootstrap, control plane when only infra is specified", func() { @@ -222,7 +223,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core when only bootstrap is specified", func() { @@ -235,7 +236,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-bootstrap.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core when only control plane is specified", func() { @@ -248,7 +249,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-control-plane.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core when only ipam is specified", func() { @@ -261,7 +262,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-ipam.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core, bootstrap, control plane when only infra and ipam is specified", func() { @@ -275,7 +276,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-ipam.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy multiple infra providers with custom namespace and versions", func() { @@ -291,7 +292,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-infra-custom-ns-versions.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy multiple control plane providers with custom namespace and versions", func() { @@ -307,7 +308,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-control-plane-custom-ns-versions.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy multiple bootstrap providers with custom namespace and versions", func() { @@ -323,7 +324,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-bootstrap-custom-ns-versions.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core when only addon is specified", func() { @@ -336,7 +337,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-addon.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core, bootstrap, control plane when only infra and addon is specified", func() { @@ -350,7 +351,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-addon.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy core and infra with feature gates enabled", func() { manifests, err := helmChart.Run(map[string]string{ @@ -372,7 +373,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "feature-gates.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy all providers with manager defined but no feature gates enabled", func() { manifests, err := helmChart.Run(map[string]string{ @@ -387,7 +388,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-manager-defined-no-feature-gates.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy all providers when manager is defined but another infrastructure spec field is defined", func() { manifests, err := helmChart.Run(map[string]string{ @@ -404,7 +405,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "manager-defined-missing-other-infra-spec.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) It("should deploy kubeadm control plane with manager specified", func() { manifests, err := helmChart.Run(map[string]string{ @@ -421,6 +422,6 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(manifests).ToNot(BeEmpty()) expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "kubeadm-manager-defined.yaml")) Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) }) }) diff --git a/test/e2e/helm_test.go.bak b/test/e2e/helm_test.go.bak new file mode 100644 index 000000000..5a8224a56 --- /dev/null +++ b/test/e2e/helm_test.go.bak @@ -0,0 +1,422 @@ +//go:build e2e + +/* +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 ( + "os" + "path/filepath" + "strings" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + appsv1 "k8s.io/api/apps/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" + "sigs.k8s.io/cluster-api/test/framework" + "sigs.k8s.io/controller-runtime/pkg/client" + + . "sigs.k8s.io/cluster-api-operator/test/framework" +) + +var _ = Describe("Create a proper set of manifests when using helm charts", func() { + It("should deploy a quick-start cluster-api-operator-providers chart", func() { + clusterProxy := helmClusterProxy.GetClient() + + fullHelmChart := &HelmChart{ + BinaryPath: helmBinaryPath, + Path: chartPath, + Name: capiOperatorRelease, + Kubeconfig: helmClusterProxy.GetKubeconfigPath(), + Wait: true, + Output: Full, + AdditionalFlags: Flags("--create-namespace", "--namespace", operatorNamespace), + } + + defer func() { + fullHelmChart.Commands = Commands(Uninstall) + fullHelmChart.AdditionalFlags = Flags("--namespace", operatorNamespace) + _, err := fullHelmChart.Run(nil) + Expect(err).ToNot(HaveOccurred()) + + err = clusterProxy.DeleteAllOf(ctx, &apiextensionsv1.CustomResourceDefinition{}, client.MatchingLabels{ + clusterctlv1.ClusterctlCoreLabel: capiOperatorRelease, + }) + Expect(err).ToNot(HaveOccurred()) + }() + + _, err := fullHelmChart.Run(nil) + Expect(err).ToNot(HaveOccurred()) + + coreProvider := &operatorv1.CoreProvider{ + ObjectMeta: metav1.ObjectMeta{ + Name: coreProviderName, + Namespace: operatorNamespace, + }, + } + Expect(clusterProxy.Create(ctx, coreProvider)).To(Succeed()) + + By("Waiting for the core provider deployment to be ready") + framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{ + Getter: clusterProxy, + Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: coreProviderDeploymentName, Namespace: operatorNamespace}}, + }, e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + + By("Waiting for core provider to be ready") + WaitFor(ctx, For(coreProvider).In(clusterProxy).ToSatisfy( + HaveStatusConditionsTrue(coreProvider, operatorv1.ProviderInstalledCondition), + ), e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + + By("Waiting for status.InstalledVersion to be set") + WaitFor(ctx, For(coreProvider).In(clusterProxy).ToSatisfy(func() bool { + return ptr.Equal(coreProvider.Status.InstalledVersion, ptr.To(coreProvider.Spec.Version)) + }), e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + + bootstrapProvider := &operatorv1.BootstrapProvider{ObjectMeta: metav1.ObjectMeta{ + Name: bootstrapProviderName, + Namespace: operatorNamespace, + }} + deployment := &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{ + Name: bootstrapProviderDeploymentName, + Namespace: operatorNamespace, + }} + + Expect(clusterProxy.Create(ctx, bootstrapProvider)).To(Succeed()) + + By("Waiting for the bootstrap provider deployment to be ready") + framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{ + Getter: clusterProxy, + Deployment: deployment, + }, e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + + By("Waiting for bootstrap provider to be ready") + WaitFor(ctx, For(bootstrapProvider).In(clusterProxy).ToSatisfy( + HaveStatusConditionsTrue(bootstrapProvider, operatorv1.ProviderInstalledCondition)), + e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + + By("Waiting for status.InstalledVersion to be set") + WaitFor(ctx, For(bootstrapProvider).In(clusterProxy).ToSatisfy(func() bool { + return ptr.Equal(bootstrapProvider.Status.InstalledVersion, &bootstrapProvider.Spec.Version) + }), e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + Expect(clusterProxy.Delete(ctx, bootstrapProvider)).To(Succeed()) + + By("Waiting for the bootstrap provider deployment to be deleted") + WaitForDelete(ctx, For(deployment).In(clusterProxy), + e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) + + Expect(clusterProxy.Delete(ctx, coreProvider)).To(Succeed()) + }) + + It("should deploy default manifest set for quick-start process", func() { + fullRun := &HelmChart{ + BinaryPath: helmChart.BinaryPath, + Path: helmChart.Path, + Name: helmChart.Name, + Kubeconfig: helmChart.Kubeconfig, + DryRun: helmChart.DryRun, + Output: Manifests, + } + fullRun.Output = Manifests + manifests, err := fullRun.Run(nil) + Expect(err).ToNot(HaveOccurred()) + fullChartInstall, err := os.ReadFile(filepath.Join(customManifestsFolder, "full-chart-install.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(strings.TrimSpace(string(fullChartInstall)))) + }) + + It("should not deploy providers when none specified", func() { + manifests, err := helmChart.Run(nil) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(BeEmpty()) + }) + + It("should deploy all providers with custom namespace and versions", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "core.cluster-api.namespace": "capi-custom-ns", + "core.cluster-api.version": "v1.7.7", + "controlPlane.kubeadm.namespace": "kubeadm-control-plane-custom-ns", + "controlPlane.kubeadm.version": "v1.7.7", + "bootstrap.kubeadm.namespace": "kubeadm-bootstrap-custom-ns", + "bootstrap.kubeadm.version": "v1.7.7", + "infrastructure.docker.namespace": "capd-custom-ns", + "infrastructure.docker.version": "v1.7.7", + "ipam.in-cluster.namespace": "in-cluster-custom-ns", + "ipam.in-cluster.version": "v1.0.0", + "addon.helm.namespace": "helm-custom-ns", + "addon.helm.version": "v0.2.6", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-ns-versions.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) + }) + + It("should deploy all providers with custom versions", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "core.cluster-api.version": "v1.7.7", + "controlPlane.kubeadm.version": "v1.7.7", + "bootstrap.kubeadm.version": "v1.7.7", + "infrastructure.docker.version": "v1.7.7", + "ipam.in-cluster.version": "v1.0.0", + "addon.helm.version": "v0.2.6", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-versions.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) + }) + + It("should deploy all providers with latest version", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "core.cluster-api.enabled": "true", + "controlPlane.kubeadm.enabled": "true", + "bootstrap.kubeadm.enabled": "true", + "infrastructure.docker.enabled": "true", + "ipam.in-cluster.enabled": "true", + "addon.helm.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-latest-versions.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core, bootstrap, control plane when only infra is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "infrastructure.docker.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core when only bootstrap is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "bootstrap.kubeadm.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-bootstrap.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core when only control plane is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "controlPlane.kubeadm.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-control-plane.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core when only ipam is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "ipam.in-cluster.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-ipam.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core, bootstrap, control plane when only infra and ipam is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "infrastructure.docker.enabled": "true", + "ipam.in-cluster.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-ipam.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy multiple infra providers with custom namespace and versions", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "infrastructure.docker.namespace": "capd-custom-ns", + "infrastructure.docker.version": "v1.7.7", + "infrastructure.azure.namespace": "capz-custom-ns", + "infrastructure.azure.version": "v1.10.0", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-infra-custom-ns-versions.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy multiple control plane providers with custom namespace and versions", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "controlPlane.kubeadm.namespace": "kubeadm-control-plane-custom-ns", + "controlPlane.kubeadm.version": "v1.7.7", + "controlPlane.rke2.namespace": "rke2-control-plane-custom-ns", + "controlPlane.rke2.version": "v0.8.0", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-control-plane-custom-ns-versions.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy multiple bootstrap providers with custom namespace and versions", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "bootstrap.kubeadm.namespace": "kubeadm-bootstrap-custom-ns", + "bootstrap.kubeadm.version": "v1.7.7", + "bootstrap.rke2.namespace": "rke2-bootstrap-custom-ns", + "bootstrap.rke2.version": "v0.8.0", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-bootstrap-custom-ns-versions.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core when only addon is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "addon.helm.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-addon.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + + It("should deploy core, bootstrap, control plane when only infra and addon is specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "infrastructure.docker.enabled": "true", + "addon.helm.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-addon.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + It("should deploy core and infra with feature gates enabled", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "aws-variables", + "configSecret.namespace": "default", + "infrastructure.aws.version": "v2.4.0", + "ipam.in-cluster.enabled": "true", + "addon.helm.enabled": "true", + "image.manager.tag": "v0.9.1", + "core.cluster-api.version": "v1.6.2", + "manager.featureGates.core.ClusterTopology": "true", + "manager.featureGates.core.MachinePool": "true", + "manager.featureGates.aws.ClusterTopology": "true", + "manager.featureGates.aws.MachinePool": "true", + "manager.featureGates.aws.EKSEnableIAM": "true", + "manager.featureGates.aws.EKSAllowAddRoles": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "feature-gates.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + It("should deploy all providers with manager defined but no feature gates enabled", func() { + manifests, err := helmChart.Run(map[string]string{ + "configSecret.name": "test-secret-name", + "configSecret.namespace": "test-secret-namespace", + "core.cluster-api.enabled": "true", + "infrastructure.azure.enabled": "true", + "ipam.in-cluster.enabled": "true", + "addon.helm.enabled": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-manager-defined-no-feature-gates.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + It("should deploy all providers when manager is defined but another infrastructure spec field is defined", func() { + manifests, err := helmChart.Run(map[string]string{ + "core.cluster-api.enabled": "true", + "controlPlane.kubeadm.enabled": "true", + "bootstrap.kubeadm.enabled": "true", + "infrastructure.docker.enabled": "true", + "ipam.in-cluster.enabled": "true", + "addon.helm.enabled": "true", + "manager.featureGates.core.ClusterTopology": "true", + "manager.featureGates.core.MachinePool": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "manager-defined-missing-other-infra-spec.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) + It("should deploy kubeadm control plane with manager specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "core.cluster-api.enabled": "true", + "controlPlane.kubeadm.enabled": "true", + "bootstrap.kubeadm.enabled": "true", + "infrastructure.docker.enabled": "true", + "ipam.in-cluster.enabled": "true", + "addon.helm.enabled": "true", + "manager.featureGates.kubeadm.ClusterTopology": "true", + "manager.featureGates.kubeadm.MachinePool": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "kubeadm-manager-defined.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(Equal(string(expectedManifests))) + }) +}) diff --git a/test/framework/all_type_helpers.go b/test/framework/all_type_helpers.go index f38304509..f87677485 100644 --- a/test/framework/all_type_helpers.go +++ b/test/framework/all_type_helpers.go @@ -252,6 +252,7 @@ func (h *HelmChart) Run(values map[string]string) (string, error) { res := outString[startIndex+len("MANIFEST:"):] res = strings.TrimPrefix(res, "\n") res = strings.TrimSuffix(res, "\n") + res = strings.TrimSpace(res) return res, nil } From f15726c06e8258409b2abd102dea444381e410f7 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Tue, 26 Aug 2025 10:26:42 +0900 Subject: [PATCH 06/10] fix: Remove providers dependency and verify E2E only with operator chart Signed-off-by: kahirokunn --- .github/workflows/smoke-test.yaml | 50 +-- Makefile | 5 +- .../cluster-api-operator-providers/Chart.yaml | 5 - test/e2e/helm_test.go | 286 +----------- test/e2e/helm_test.go.bak | 422 ------------------ test/e2e/resources/full-chart-install.yaml | 54 +-- 6 files changed, 33 insertions(+), 789 deletions(-) delete mode 100644 test/e2e/helm_test.go.bak diff --git a/.github/workflows/smoke-test.yaml b/.github/workflows/smoke-test.yaml index 816c6314c..d380d2e98 100644 --- a/.github/workflows/smoke-test.yaml +++ b/.github/workflows/smoke-test.yaml @@ -16,14 +16,11 @@ env: KUBERNETES_VERSION: v1.33.0 CONTROLLER_IMG: cluster-api-operator TAG: smoke-test + ARCH: amd64 jobs: smoke-test: - name: Smoke Test (${{ matrix.install-method }}) runs-on: ubuntu-latest - strategy: - matrix: - install-method: [legacy, recommended] steps: - name: Checkout code uses: actions/checkout@v4 @@ -38,24 +35,26 @@ jobs: - name: Install tools run: | # kubectl - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl" chmod +x kubectl && sudo mv kubectl /usr/local/bin/ # yq - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${ARCH} -O yq chmod +x yq && sudo mv yq /usr/local/bin/ # helm curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash # clusterctl - curl -L https://github.com/kubernetes-sigs/cluster-api/releases/latest/download/clusterctl-linux-amd64 -o clusterctl - chmod +x clusterctl && sudo mv clusterctl /usr/local/bin/ + VERSION=v1.10.5 + curl -L "https://github.com/kubernetes-sigs/cluster-api/releases/download/${VERSION}/clusterctl-linux-${ARCH}" -o clusterctl + sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl + clusterctl version - name: Build Docker image run: | make docker-build - docker tag ${CONTROLLER_IMG}-amd64:${TAG} ${CONTROLLER_IMG}:${TAG} + docker tag ${CONTROLLER_IMG}-${ARCH}:${TAG} ${CONTROLLER_IMG}:${TAG} - name: Build charts run: | @@ -97,8 +96,7 @@ jobs: --wait \ --timeout 5m - - name: Install Cluster API Operator (Recommended) - if: matrix.install-method == 'recommended' + - name: Install Cluster API Operator run: | CHART_PACKAGE="out/package/cluster-api-operator-${HELM_CHART_TAG}.tgz" helm install capi-operator "$CHART_PACKAGE" \ @@ -110,7 +108,7 @@ jobs: --wait \ --timeout 90s - - name: Prepare providers values + - name: Deploy providers run: | cat < /tmp/providers-values.yaml core: @@ -138,22 +136,6 @@ jobs: ClusterTopology: true EOF - # Add cluster-api-operator configuration for legacy installation - if [ "${{ matrix.install-method }}" = "legacy" ]; then - cat <> /tmp/providers-values.yaml - cluster-api-operator: - install: true - image: - manager: - repository: ${CONTROLLER_IMG} - tag: ${TAG} - pullPolicy: IfNotPresent - EOF - fi - - - name: Deploy providers (Recommended) - if: matrix.install-method == 'recommended' - run: | PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz" helm install capi-providers "$PROVIDERS_CHART_PACKAGE" \ -f /tmp/providers-values.yaml \ @@ -161,17 +143,6 @@ jobs: --set enableHelmHook=false \ --wait - - name: Deploy providers (Legacy) - if: matrix.install-method == 'legacy' - run: | - PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz" - helm install capi-providers "$PROVIDERS_CHART_PACKAGE" \ - --create-namespace \ - -n capi-operator-system \ - -f /tmp/providers-values.yaml \ - --wait \ - --timeout 300s - - name: Wait for providers run: | kubectl wait --for=condition=Ready --timeout=300s -n capi-system coreprovider/cluster-api @@ -233,7 +204,6 @@ jobs: - name: Collect logs on failure if: failure() run: | - echo "=== Installation Method: ${{ matrix.install-method }} ===" echo "=== Recent Events ===" kubectl get events -A --sort-by='.lastTimestamp' | tail -50 diff --git a/Makefile b/Makefile index 135f36681..37dc46445 100644 --- a/Makefile +++ b/Makefile @@ -149,7 +149,7 @@ PROD_REGISTRY ?= registry.k8s.io/capi-operator # Image name IMAGE_NAME ?= cluster-api-operator -PACKAGE_NAME = cluster-api-operator-providers +PACKAGE_NAME = cluster-api-operator CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME) CONTROLLER_IMG_TAG ?= $(CONTROLLER_IMG)-$(ARCH):$(TAG) @@ -497,7 +497,6 @@ release-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_DIR) $(CHART_PROVIDER # Processing the cluster-api-operator-providers chart cp -rf $(ROOT)/hack/charts/cluster-api-operator-providers/. $(CHART_PROVIDERS_DIR) - $(HELM) dependency update $(CHART_PROVIDERS_DIR) $(HELM) package $(CHART_PROVIDERS_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR) .PHONY: release-staging @@ -571,7 +570,7 @@ test-e2e-run: $(GINKGO) $(ENVSUBST) $(HELM) ## Run e2e tests -e2e.artifacts-folder="$(ARTIFACTS)" \ -e2e.config="$(E2E_CONF_FILE_ENVSUBST)" -e2e.components=$(RELEASE_DIR)/operator-components.yaml \ -e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) \ - -e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-providers-$(HELM_CHART_TAG).tgz $(E2E_ARGS) + -e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-$(HELM_CHART_TAG).tgz $(E2E_ARGS) go-version: ## Print the go version we use to compile our binaries and images @echo $(GO_VERSION) diff --git a/hack/charts/cluster-api-operator-providers/Chart.yaml b/hack/charts/cluster-api-operator-providers/Chart.yaml index 1f56f95a5..994567bb0 100644 --- a/hack/charts/cluster-api-operator-providers/Chart.yaml +++ b/hack/charts/cluster-api-operator-providers/Chart.yaml @@ -4,8 +4,3 @@ description: Cluster API Provider Custom Resources type: application version: 0.0.0 appVersion: "0.0.0" -dependencies: - - name: cluster-api-operator - repository: file://../cluster-api-operator - version: 0.0.0 - condition: cluster-api-operator.install diff --git a/test/e2e/helm_test.go b/test/e2e/helm_test.go index e043d6988..07d910d28 100644 --- a/test/e2e/helm_test.go +++ b/test/e2e/helm_test.go @@ -26,15 +26,13 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" + operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2" - clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" + . "sigs.k8s.io/cluster-api-operator/test/framework" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/controller-runtime/pkg/client" - - . "sigs.k8s.io/cluster-api-operator/test/framework" ) var _ = Describe("Create a proper set of manifests when using helm charts", func() { @@ -130,7 +128,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(clusterProxy.Delete(ctx, coreProvider)).To(Succeed()) }) - It("should deploy default manifest set for quick-start process", func() { + It("should render operator chart manifests matching expected output", func() { fullRun := &HelmChart{ BinaryPath: helmChart.BinaryPath, Path: helmChart.Path, @@ -146,282 +144,4 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(err).ToNot(HaveOccurred()) Expect(manifests).To(Equal(strings.TrimSpace(string(fullChartInstall)))) }) - - It("should not deploy providers when none specified", func() { - manifests, err := helmChart.Run(nil) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(BeEmpty()) - }) - - It("should deploy all providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.namespace": "capi-custom-ns", - "core.cluster-api.version": "v1.7.7", - "controlPlane.kubeadm.namespace": "kubeadm-control-plane-custom-ns", - "controlPlane.kubeadm.version": "v1.7.7", - "bootstrap.kubeadm.namespace": "kubeadm-bootstrap-custom-ns", - "bootstrap.kubeadm.version": "v1.7.7", - "infrastructure.docker.namespace": "capd-custom-ns", - "infrastructure.docker.version": "v1.7.7", - "ipam.in-cluster.namespace": "in-cluster-custom-ns", - "ipam.in-cluster.version": "v1.0.0", - "addon.helm.namespace": "helm-custom-ns", - "addon.helm.version": "v0.2.6", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy all providers with custom versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.version": "v1.7.7", - "controlPlane.kubeadm.version": "v1.7.7", - "bootstrap.kubeadm.version": "v1.7.7", - "infrastructure.docker.version": "v1.7.7", - "ipam.in-cluster.version": "v1.0.0", - "addon.helm.version": "v0.2.6", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy all providers with latest version", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.enabled": "true", - "controlPlane.kubeadm.enabled": "true", - "bootstrap.kubeadm.enabled": "true", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-latest-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core, bootstrap, control plane when only infra is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core when only bootstrap is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "bootstrap.kubeadm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-bootstrap.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core when only control plane is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "controlPlane.kubeadm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-control-plane.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core when only ipam is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "ipam.in-cluster.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-ipam.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core, bootstrap, control plane when only infra and ipam is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-ipam.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy multiple infra providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.namespace": "capd-custom-ns", - "infrastructure.docker.version": "v1.7.7", - "infrastructure.azure.namespace": "capz-custom-ns", - "infrastructure.azure.version": "v1.10.0", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-infra-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy multiple control plane providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "controlPlane.kubeadm.namespace": "kubeadm-control-plane-custom-ns", - "controlPlane.kubeadm.version": "v1.7.7", - "controlPlane.rke2.namespace": "rke2-control-plane-custom-ns", - "controlPlane.rke2.version": "v0.8.0", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-control-plane-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy multiple bootstrap providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "bootstrap.kubeadm.namespace": "kubeadm-bootstrap-custom-ns", - "bootstrap.kubeadm.version": "v1.7.7", - "bootstrap.rke2.namespace": "rke2-bootstrap-custom-ns", - "bootstrap.rke2.version": "v0.8.0", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-bootstrap-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core when only addon is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-addon.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy core, bootstrap, control plane when only infra and addon is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.enabled": "true", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-addon.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - It("should deploy core and infra with feature gates enabled", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "aws-variables", - "configSecret.namespace": "default", - "infrastructure.aws.version": "v2.4.0", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - "image.manager.tag": "v0.9.1", - "core.cluster-api.version": "v1.6.2", - "manager.featureGates.core.ClusterTopology": "true", - "manager.featureGates.core.MachinePool": "true", - "manager.featureGates.aws.ClusterTopology": "true", - "manager.featureGates.aws.MachinePool": "true", - "manager.featureGates.aws.EKSEnableIAM": "true", - "manager.featureGates.aws.EKSAllowAddRoles": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "feature-gates.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - It("should deploy all providers with manager defined but no feature gates enabled", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.enabled": "true", - "infrastructure.azure.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-manager-defined-no-feature-gates.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - It("should deploy all providers when manager is defined but another infrastructure spec field is defined", func() { - manifests, err := helmChart.Run(map[string]string{ - "core.cluster-api.enabled": "true", - "controlPlane.kubeadm.enabled": "true", - "bootstrap.kubeadm.enabled": "true", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - "manager.featureGates.core.ClusterTopology": "true", - "manager.featureGates.core.MachinePool": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "manager-defined-missing-other-infra-spec.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - It("should deploy kubeadm control plane with manager specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "core.cluster-api.enabled": "true", - "controlPlane.kubeadm.enabled": "true", - "bootstrap.kubeadm.enabled": "true", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - "manager.featureGates.kubeadm.ClusterTopology": "true", - "manager.featureGates.kubeadm.MachinePool": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "kubeadm-manager-defined.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) }) diff --git a/test/e2e/helm_test.go.bak b/test/e2e/helm_test.go.bak deleted file mode 100644 index 5a8224a56..000000000 --- a/test/e2e/helm_test.go.bak +++ /dev/null @@ -1,422 +0,0 @@ -//go:build e2e - -/* -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 ( - "os" - "path/filepath" - "strings" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - appsv1 "k8s.io/api/apps/v1" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" - operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2" - clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" - "sigs.k8s.io/cluster-api/test/framework" - "sigs.k8s.io/controller-runtime/pkg/client" - - . "sigs.k8s.io/cluster-api-operator/test/framework" -) - -var _ = Describe("Create a proper set of manifests when using helm charts", func() { - It("should deploy a quick-start cluster-api-operator-providers chart", func() { - clusterProxy := helmClusterProxy.GetClient() - - fullHelmChart := &HelmChart{ - BinaryPath: helmBinaryPath, - Path: chartPath, - Name: capiOperatorRelease, - Kubeconfig: helmClusterProxy.GetKubeconfigPath(), - Wait: true, - Output: Full, - AdditionalFlags: Flags("--create-namespace", "--namespace", operatorNamespace), - } - - defer func() { - fullHelmChart.Commands = Commands(Uninstall) - fullHelmChart.AdditionalFlags = Flags("--namespace", operatorNamespace) - _, err := fullHelmChart.Run(nil) - Expect(err).ToNot(HaveOccurred()) - - err = clusterProxy.DeleteAllOf(ctx, &apiextensionsv1.CustomResourceDefinition{}, client.MatchingLabels{ - clusterctlv1.ClusterctlCoreLabel: capiOperatorRelease, - }) - Expect(err).ToNot(HaveOccurred()) - }() - - _, err := fullHelmChart.Run(nil) - Expect(err).ToNot(HaveOccurred()) - - coreProvider := &operatorv1.CoreProvider{ - ObjectMeta: metav1.ObjectMeta{ - Name: coreProviderName, - Namespace: operatorNamespace, - }, - } - Expect(clusterProxy.Create(ctx, coreProvider)).To(Succeed()) - - By("Waiting for the core provider deployment to be ready") - framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{ - Getter: clusterProxy, - Deployment: &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{Name: coreProviderDeploymentName, Namespace: operatorNamespace}}, - }, e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - - By("Waiting for core provider to be ready") - WaitFor(ctx, For(coreProvider).In(clusterProxy).ToSatisfy( - HaveStatusConditionsTrue(coreProvider, operatorv1.ProviderInstalledCondition), - ), e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - - By("Waiting for status.InstalledVersion to be set") - WaitFor(ctx, For(coreProvider).In(clusterProxy).ToSatisfy(func() bool { - return ptr.Equal(coreProvider.Status.InstalledVersion, ptr.To(coreProvider.Spec.Version)) - }), e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - - bootstrapProvider := &operatorv1.BootstrapProvider{ObjectMeta: metav1.ObjectMeta{ - Name: bootstrapProviderName, - Namespace: operatorNamespace, - }} - deployment := &appsv1.Deployment{ObjectMeta: metav1.ObjectMeta{ - Name: bootstrapProviderDeploymentName, - Namespace: operatorNamespace, - }} - - Expect(clusterProxy.Create(ctx, bootstrapProvider)).To(Succeed()) - - By("Waiting for the bootstrap provider deployment to be ready") - framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{ - Getter: clusterProxy, - Deployment: deployment, - }, e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - - By("Waiting for bootstrap provider to be ready") - WaitFor(ctx, For(bootstrapProvider).In(clusterProxy).ToSatisfy( - HaveStatusConditionsTrue(bootstrapProvider, operatorv1.ProviderInstalledCondition)), - e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - - By("Waiting for status.InstalledVersion to be set") - WaitFor(ctx, For(bootstrapProvider).In(clusterProxy).ToSatisfy(func() bool { - return ptr.Equal(bootstrapProvider.Status.InstalledVersion, &bootstrapProvider.Spec.Version) - }), e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - Expect(clusterProxy.Delete(ctx, bootstrapProvider)).To(Succeed()) - - By("Waiting for the bootstrap provider deployment to be deleted") - WaitForDelete(ctx, For(deployment).In(clusterProxy), - e2eConfig.GetIntervals(helmClusterProxy.GetName(), "wait-controllers")...) - - Expect(clusterProxy.Delete(ctx, coreProvider)).To(Succeed()) - }) - - It("should deploy default manifest set for quick-start process", func() { - fullRun := &HelmChart{ - BinaryPath: helmChart.BinaryPath, - Path: helmChart.Path, - Name: helmChart.Name, - Kubeconfig: helmChart.Kubeconfig, - DryRun: helmChart.DryRun, - Output: Manifests, - } - fullRun.Output = Manifests - manifests, err := fullRun.Run(nil) - Expect(err).ToNot(HaveOccurred()) - fullChartInstall, err := os.ReadFile(filepath.Join(customManifestsFolder, "full-chart-install.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(fullChartInstall)))) - }) - - It("should not deploy providers when none specified", func() { - manifests, err := helmChart.Run(nil) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(BeEmpty()) - }) - - It("should deploy all providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.namespace": "capi-custom-ns", - "core.cluster-api.version": "v1.7.7", - "controlPlane.kubeadm.namespace": "kubeadm-control-plane-custom-ns", - "controlPlane.kubeadm.version": "v1.7.7", - "bootstrap.kubeadm.namespace": "kubeadm-bootstrap-custom-ns", - "bootstrap.kubeadm.version": "v1.7.7", - "infrastructure.docker.namespace": "capd-custom-ns", - "infrastructure.docker.version": "v1.7.7", - "ipam.in-cluster.namespace": "in-cluster-custom-ns", - "ipam.in-cluster.version": "v1.0.0", - "addon.helm.namespace": "helm-custom-ns", - "addon.helm.version": "v0.2.6", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy all providers with custom versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.version": "v1.7.7", - "controlPlane.kubeadm.version": "v1.7.7", - "bootstrap.kubeadm.version": "v1.7.7", - "infrastructure.docker.version": "v1.7.7", - "ipam.in-cluster.version": "v1.0.0", - "addon.helm.version": "v0.2.6", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-custom-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(strings.TrimSpace(string(expectedManifests)))) - }) - - It("should deploy all providers with latest version", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.enabled": "true", - "controlPlane.kubeadm.enabled": "true", - "bootstrap.kubeadm.enabled": "true", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-latest-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core, bootstrap, control plane when only infra is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core when only bootstrap is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "bootstrap.kubeadm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-bootstrap.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core when only control plane is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "controlPlane.kubeadm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-control-plane.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core when only ipam is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "ipam.in-cluster.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-ipam.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core, bootstrap, control plane when only infra and ipam is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-ipam.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy multiple infra providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.namespace": "capd-custom-ns", - "infrastructure.docker.version": "v1.7.7", - "infrastructure.azure.namespace": "capz-custom-ns", - "infrastructure.azure.version": "v1.10.0", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-infra-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy multiple control plane providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "controlPlane.kubeadm.namespace": "kubeadm-control-plane-custom-ns", - "controlPlane.kubeadm.version": "v1.7.7", - "controlPlane.rke2.namespace": "rke2-control-plane-custom-ns", - "controlPlane.rke2.version": "v0.8.0", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-control-plane-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy multiple bootstrap providers with custom namespace and versions", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "bootstrap.kubeadm.namespace": "kubeadm-bootstrap-custom-ns", - "bootstrap.kubeadm.version": "v1.7.7", - "bootstrap.rke2.namespace": "rke2-bootstrap-custom-ns", - "bootstrap.rke2.version": "v0.8.0", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "multiple-bootstrap-custom-ns-versions.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core when only addon is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-addon.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - - It("should deploy core, bootstrap, control plane when only infra and addon is specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "infrastructure.docker.enabled": "true", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "only-infra-and-addon.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - It("should deploy core and infra with feature gates enabled", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "aws-variables", - "configSecret.namespace": "default", - "infrastructure.aws.version": "v2.4.0", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - "image.manager.tag": "v0.9.1", - "core.cluster-api.version": "v1.6.2", - "manager.featureGates.core.ClusterTopology": "true", - "manager.featureGates.core.MachinePool": "true", - "manager.featureGates.aws.ClusterTopology": "true", - "manager.featureGates.aws.MachinePool": "true", - "manager.featureGates.aws.EKSEnableIAM": "true", - "manager.featureGates.aws.EKSAllowAddRoles": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "feature-gates.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - It("should deploy all providers with manager defined but no feature gates enabled", func() { - manifests, err := helmChart.Run(map[string]string{ - "configSecret.name": "test-secret-name", - "configSecret.namespace": "test-secret-namespace", - "core.cluster-api.enabled": "true", - "infrastructure.azure.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "all-providers-manager-defined-no-feature-gates.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - It("should deploy all providers when manager is defined but another infrastructure spec field is defined", func() { - manifests, err := helmChart.Run(map[string]string{ - "core.cluster-api.enabled": "true", - "controlPlane.kubeadm.enabled": "true", - "bootstrap.kubeadm.enabled": "true", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - "manager.featureGates.core.ClusterTopology": "true", - "manager.featureGates.core.MachinePool": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "manager-defined-missing-other-infra-spec.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) - It("should deploy kubeadm control plane with manager specified", func() { - manifests, err := helmChart.Run(map[string]string{ - "core.cluster-api.enabled": "true", - "controlPlane.kubeadm.enabled": "true", - "bootstrap.kubeadm.enabled": "true", - "infrastructure.docker.enabled": "true", - "ipam.in-cluster.enabled": "true", - "addon.helm.enabled": "true", - "manager.featureGates.kubeadm.ClusterTopology": "true", - "manager.featureGates.kubeadm.MachinePool": "true", - }) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).ToNot(BeEmpty()) - expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "kubeadm-manager-defined.yaml")) - Expect(err).ToNot(HaveOccurred()) - Expect(manifests).To(Equal(string(expectedManifests))) - }) -}) diff --git a/test/e2e/resources/full-chart-install.yaml b/test/e2e/resources/full-chart-install.yaml index b813771b2..9fdefab6f 100644 --- a/test/e2e/resources/full-chart-install.yaml +++ b/test/e2e/resources/full-chart-install.yaml @@ -1,5 +1,5 @@ --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: v1 kind: ServiceAccount metadata: @@ -8,7 +8,7 @@ metadata: name: capi-operator-manager namespace: 'default' --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -3127,7 +3127,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -6246,7 +6246,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -9367,7 +9367,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -12486,7 +12486,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -15607,7 +15607,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -18726,7 +18726,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -21848,7 +21848,7 @@ spec: subresources: status: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -21863,7 +21863,7 @@ rules: verbs: - '*' --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -21879,7 +21879,7 @@ subjects: name: capi-operator-manager namespace: 'default' --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -21927,7 +21927,7 @@ rules: - patch - delete --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -21944,7 +21944,7 @@ subjects: name: capi-operator-manager namespace: 'default' --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: v1 kind: Service metadata: @@ -21960,7 +21960,7 @@ spec: clusterctl.cluster.x-k8s.io/core: capi-operator control-plane: controller-manager --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/deployment.yaml +# Source: cluster-api-operator/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: @@ -22075,25 +22075,7 @@ spec: - effect: NoSchedule key: node-role.kubernetes.io/control-plane --- -# Source: cluster-api-operator-providers/templates/addon.yaml -# Addon provider ---- -# Source: cluster-api-operator-providers/templates/bootstrap.yaml -# Bootstrap provider ---- -# Source: cluster-api-operator-providers/templates/control-plane.yaml -# Control plane provider ---- -# Source: cluster-api-operator-providers/templates/core.yaml -# Core provider ---- -# Source: cluster-api-operator-providers/templates/infra.yaml -# Infrastructure providers ---- -# Source: cluster-api-operator-providers/templates/ipam.yaml -# IPAM providers ---- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: cert-manager.io/v1 kind: Certificate metadata: @@ -22110,7 +22092,7 @@ spec: name: capi-operator-selfsigned-issuer secretName: capi-operator-webhook-service-cert --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: cert-manager.io/v1 kind: Issuer metadata: @@ -22121,7 +22103,7 @@ metadata: spec: selfSigned: {} --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: @@ -22286,7 +22268,7 @@ webhooks: - runtimeextensionproviders sideEffects: None --- -# Source: cluster-api-operator-providers/charts/cluster-api-operator/templates/operator-components.yaml +# Source: cluster-api-operator/templates/operator-components.yaml apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: From c76171f75e8da98056deaf8e3a55a379929dc95b Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Thu, 25 Sep 2025 09:48:29 +0900 Subject: [PATCH 07/10] chore: Update JSON schema to 2020-12 version Signed-off-by: kahirokunn --- hack/charts/cluster-api-operator-providers/values.schema.json | 2 +- hack/charts/cluster-api-operator/values.schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/charts/cluster-api-operator-providers/values.schema.json b/hack/charts/cluster-api-operator-providers/values.schema.json index 757955212..101fc5823 100644 --- a/hack/charts/cluster-api-operator-providers/values.schema.json +++ b/hack/charts/cluster-api-operator-providers/values.schema.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema#", "type": "object", "properties": { "cluster-api-operator": { diff --git a/hack/charts/cluster-api-operator/values.schema.json b/hack/charts/cluster-api-operator/values.schema.json index b39e7d9dd..1cc67b9da 100644 --- a/hack/charts/cluster-api-operator/values.schema.json +++ b/hack/charts/cluster-api-operator/values.schema.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema#", "type": "object", "properties": { "logLevel": { From 0fa06ebd5e399184fbb4e6f5d4e1e25cc4f9aac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Bj=C3=B6rklin?= Date: Tue, 9 Sep 2025 16:27:02 -0700 Subject: [PATCH 08/10] feat: make it possible to define fetchConfig per component Signed-off-by: kahirokunn --- .../templates/addon.yaml | 3 + .../templates/bootstrap.yaml | 3 + .../templates/control-plane.yaml | 3 + .../templates/core.yaml | 3 + .../templates/infra.yaml | 3 + .../templates/ipam.yaml | 3 + .../cluster-api-operator/values.schema.json | 167 ++++-------------- 7 files changed, 52 insertions(+), 133 deletions(-) diff --git a/hack/charts/cluster-api-operator-providers/templates/addon.yaml b/hack/charts/cluster-api-operator-providers/templates/addon.yaml index 43a705c3f..076d3b322 100644 --- a/hack/charts/cluster-api-operator-providers/templates/addon.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/addon.yaml @@ -43,6 +43,9 @@ spec: {{- if $addon.manifestPatches }} manifestPatches: {{ toYaml $addon.manifestPatches | nindent 4 }} {{- end }} +{{- if $addon.fetchConfig }} + fetchConfig: {{ toYaml $addon.fetchConfig | nindent 4 }} +{{- end }} {{- if $addon.additionalManifests }} additionalManifests: name: {{ $addon.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml b/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml index 1fc8832eb..5b78cfb5e 100644 --- a/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/bootstrap.yaml @@ -45,6 +45,9 @@ spec: {{- if $bootstrap.manifestPatches }} manifestPatches: {{ toYaml $bootstrap.manifestPatches | nindent 4 }} {{- end }} +{{- if $bootstrap.fetchConfig }} + fetchConfig: {{ toYaml $bootstrap.fetchConfig | nindent 4 }} +{{- end }} {{- if $bootstrap.additionalManifests }} additionalManifests: name: {{ $bootstrap.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml b/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml index 05e7243a6..30d5cd44b 100644 --- a/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/control-plane.yaml @@ -58,6 +58,9 @@ spec: {{- if $controlPlane.manifestPatches }} manifestPatches: {{ toYaml $controlPlane.manifestPatches | nindent 4 }} {{- end }} +{{- if $controlPlane.fetchConfig }} + fetchConfig: {{ toYaml $controlPlane.fetchConfig | nindent 4 }} +{{- end }} {{- if $controlPlane.additionalManifests }} additionalManifests: name: {{ $controlPlane.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator-providers/templates/core.yaml b/hack/charts/cluster-api-operator-providers/templates/core.yaml index 66d87bc4a..d805e7127 100644 --- a/hack/charts/cluster-api-operator-providers/templates/core.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/core.yaml @@ -54,6 +54,9 @@ spec: {{- if $core.manifestPatches }} manifestPatches: {{ toYaml $core.manifestPatches | nindent 4 }} {{- end }} +{{- if $core.fetchConfig }} + fetchConfig: {{ toYaml $core.fetchConfig | nindent 4 }} +{{- end }} {{- if $core.additionalManifests }} additionalManifests: name: {{ $core.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator-providers/templates/infra.yaml b/hack/charts/cluster-api-operator-providers/templates/infra.yaml index 04f7a5f5d..735532a63 100644 --- a/hack/charts/cluster-api-operator-providers/templates/infra.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/infra.yaml @@ -71,6 +71,9 @@ spec: {{- if $infra.manifestPatches }} manifestPatches: {{- toYaml $infra.manifestPatches | nindent 4 }} {{- end }} {{/* if $infra.manifestPatches */}} +{{- if $infra.fetchConfig }} + fetchConfig: {{ toYaml $infra.fetchConfig | nindent 4 }} +{{- end }} {{- if $infra.additionalManifests }} additionalManifests: name: {{ $infra.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator-providers/templates/ipam.yaml b/hack/charts/cluster-api-operator-providers/templates/ipam.yaml index 7b9c23f29..b4e1d8500 100644 --- a/hack/charts/cluster-api-operator-providers/templates/ipam.yaml +++ b/hack/charts/cluster-api-operator-providers/templates/ipam.yaml @@ -68,6 +68,9 @@ spec: {{- if $ipam.manifestPatches }} manifestPatches: {{ toYaml $ipam.manifestPatches | nindent 4 }} {{- end }} +{{- if $ipam.fetchConfig }} + fetchConfig: {{ toYaml $ipam.fetchConfig | nindent 4 }} +{{- end }} {{- if $.Values.additionalDeployments }} additionalDeployments: {{ toYaml $.Values.additionalDeployments | nindent 4 }} {{- end }} diff --git a/hack/charts/cluster-api-operator/values.schema.json b/hack/charts/cluster-api-operator/values.schema.json index 1cc67b9da..0107bc0c8 100644 --- a/hack/charts/cluster-api-operator/values.schema.json +++ b/hack/charts/cluster-api-operator/values.schema.json @@ -2,150 +2,51 @@ "$schema": "https://json-schema.org/draft/2020-12/schema#", "type": "object", "properties": { - "logLevel": { - "type": "integer", - "default": 2 + "fetchConfig": { + "type": "object", + "deprecated": true, + "description": "This field is deprecated and will be removed in future versions. Prefer declaring fetchConfig under the individual providers instead." }, - "replicaCount": { - "type": "integer", - "default": 1 + "core": { + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] }, - "leaderElection": { + "bootstrap": { "type": "object", - "properties": { - "enabled": { - "type": "boolean", - "default": true - }, - "leaseDuration": { - "type": "string" - }, - "renewDeadline": { - "type": "string" - }, - "retryPeriod": { - "type": "string" - } - } + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] }, - "image": { + "controlPlane": { "type": "object", - "properties": { - "manager": { - "type": "object", - "properties": { - "repository": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "pullPolicy": { - "type": "string", - "enum": ["Always", "IfNotPresent", "Never"] - }, - "registry": { - "type": "string" - }, - "digest": { - "type": "string" - } - } - } - } + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] }, - "env": { + "infrastructure": { "type": "object", - "properties": { - "manager": { - "type": "array" - } - } - }, - "diagnosticsAddress": { - "type": "string", - "default": ":8443" - }, - "healthAddr": { - "type": "string", - "default": ":9440" - }, - "profilerAddress": { - "type": "string", - "default": ":6060" - }, - "contentionProfiling": { - "type": "boolean", - "default": false - }, - "insecureDiagnostics": { - "type": "boolean", - "default": false + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] }, - "watchConfigSecret": { - "type": "boolean", - "default": false - }, - "imagePullSecrets": { - "type": "object" - }, - "resources": { + "addon": { "type": "object", - "properties": { - "manager": { - "type": "object" - } - } - }, - "containerSecurityContext": { - "type": "object" - }, - "affinity": { - "type": "object" - }, - "tolerations": { - "type": "array" + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] }, - "volumes": { - "type": "array" - }, - "volumeMounts": { + "ipam": { "type": "object", - "properties": { - "manager": { - "type": "array" - } - } - }, - "deploymentLabels": { - "type": "object" - }, - "deploymentAnnotations": { - "type": "object" - }, - "podLabels": { - "type": "object" - }, - "podAnnotations": { - "type": "object" - }, - "securityContext": { - "type": "object" - }, - "strategy": { - "type": "object" - }, - "nodeSelector": { - "type": "object" - }, - "topologySpreadConstraints": { - "type": "array" - }, - "podDnsPolicy": { - "type": "string" - }, - "podDnsConfig": { - "type": "object" + "oneOf": [ + { "type": "object" }, + { "type": "null" } + ] } } } From 0ac1bcf4a41320048a1c31fde804003c240c855c Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Thu, 25 Sep 2025 11:22:38 +0900 Subject: [PATCH 09/10] Add new API imports to e2e test file --- test/e2e/helm_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/helm_test.go b/test/e2e/helm_test.go index 07d910d28..49673724d 100644 --- a/test/e2e/helm_test.go +++ b/test/e2e/helm_test.go @@ -26,11 +26,13 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/ptr" operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2" . "sigs.k8s.io/cluster-api-operator/test/framework" + clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/controller-runtime/pkg/client" ) From aa5f7bcc18ac6a03ae56784ecd25ee1fdc16c947 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Thu, 25 Sep 2025 12:40:58 +0900 Subject: [PATCH 10/10] chore: Bump up clusterctl version Signed-off-by: kahirokunn --- .github/workflows/smoke-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yaml b/.github/workflows/smoke-test.yaml index d380d2e98..67806b0d4 100644 --- a/.github/workflows/smoke-test.yaml +++ b/.github/workflows/smoke-test.yaml @@ -46,7 +46,7 @@ jobs: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash # clusterctl - VERSION=v1.10.5 + VERSION=v1.11.1 curl -L "https://github.com/kubernetes-sigs/cluster-api/releases/download/${VERSION}/clusterctl-linux-${ARCH}" -o clusterctl sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl clusterctl version