Skip to content

Commit 6ee8dda

Browse files
committed
fix: Remove providers dependency and verify E2E only with operator chart
Signed-off-by: kahirokunn <[email protected]>
1 parent 9d87313 commit 6ee8dda

File tree

6 files changed

+31
-880
lines changed

6 files changed

+31
-880
lines changed

.github/workflows/smoke-test.yaml

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ env:
1616
KUBERNETES_VERSION: v1.33.0
1717
CONTROLLER_IMG: cluster-api-operator
1818
TAG: smoke-test
19+
ARCH: amd64
1920

2021
jobs:
2122
smoke-test:
22-
name: Smoke Test (${{ matrix.install-method }})
2323
runs-on: ubuntu-latest
24-
strategy:
25-
matrix:
26-
install-method: [legacy, recommended]
2724
steps:
2825
- name: Checkout code
2926
uses: actions/checkout@v4
@@ -38,24 +35,26 @@ jobs:
3835
- name: Install tools
3936
run: |
4037
# kubectl
41-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
38+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl"
4239
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
4340
4441
# yq
45-
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
42+
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${ARCH} -O yq
4643
chmod +x yq && sudo mv yq /usr/local/bin/
4744
4845
# helm
4946
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
5047
5148
# clusterctl
52-
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/latest/download/clusterctl-linux-amd64 -o clusterctl
53-
chmod +x clusterctl && sudo mv clusterctl /usr/local/bin/
49+
VERSION=v1.10.5
50+
curl -L "https://github.com/kubernetes-sigs/cluster-api/releases/download/${VERSION}/clusterctl-linux-${ARCH}" -o clusterctl
51+
sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl
52+
clusterctl version
5453
5554
- name: Build Docker image
5655
run: |
5756
make docker-build
58-
docker tag ${CONTROLLER_IMG}-amd64:${TAG} ${CONTROLLER_IMG}:${TAG}
57+
docker tag ${CONTROLLER_IMG}-${ARCH}:${TAG} ${CONTROLLER_IMG}:${TAG}
5958
6059
- name: Build charts
6160
run: |
@@ -97,8 +96,7 @@ jobs:
9796
--wait \
9897
--timeout 5m
9998
100-
- name: Install Cluster API Operator (Recommended)
101-
if: matrix.install-method == 'recommended'
99+
- name: Install Cluster API Operator
102100
run: |
103101
CHART_PACKAGE="out/package/cluster-api-operator-${HELM_CHART_TAG}.tgz"
104102
helm install capi-operator "$CHART_PACKAGE" \
@@ -110,7 +108,7 @@ jobs:
110108
--wait \
111109
--timeout 90s
112110
113-
- name: Prepare providers values
111+
- name: Deploy providers
114112
run: |
115113
cat <<EOF > /tmp/providers-values.yaml
116114
core:
@@ -138,40 +136,13 @@ jobs:
138136
ClusterTopology: true
139137
EOF
140138
141-
# Add cluster-api-operator configuration for legacy installation
142-
if [ "${{ matrix.install-method }}" = "legacy" ]; then
143-
cat <<EOF >> /tmp/providers-values.yaml
144-
cluster-api-operator:
145-
install: true
146-
image:
147-
manager:
148-
repository: ${CONTROLLER_IMG}
149-
tag: ${TAG}
150-
pullPolicy: IfNotPresent
151-
EOF
152-
fi
153-
154-
- name: Deploy providers (Recommended)
155-
if: matrix.install-method == 'recommended'
156-
run: |
157139
PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz"
158140
helm install capi-providers "$PROVIDERS_CHART_PACKAGE" \
159141
-f /tmp/providers-values.yaml \
160142
--set cluster-api-operator.install=false \
161143
--set enableHelmHook=false \
162144
--wait
163145
164-
- name: Deploy providers (Legacy)
165-
if: matrix.install-method == 'legacy'
166-
run: |
167-
PROVIDERS_CHART_PACKAGE="out/package/cluster-api-operator-providers-${HELM_CHART_TAG}.tgz"
168-
helm install capi-providers "$PROVIDERS_CHART_PACKAGE" \
169-
--create-namespace \
170-
-n capi-operator-system \
171-
-f /tmp/providers-values.yaml \
172-
--wait \
173-
--timeout 300s
174-
175146
- name: Wait for providers
176147
run: |
177148
kubectl wait --for=condition=Ready --timeout=300s -n capi-system coreprovider/cluster-api
@@ -233,7 +204,6 @@ jobs:
233204
- name: Collect logs on failure
234205
if: failure()
235206
run: |
236-
echo "=== Installation Method: ${{ matrix.install-method }} ==="
237207
echo "=== Recent Events ==="
238208
kubectl get events -A --sort-by='.lastTimestamp' | tail -50
239209

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ PROD_REGISTRY ?= registry.k8s.io/capi-operator
149149

150150
# Image name
151151
IMAGE_NAME ?= cluster-api-operator
152-
PACKAGE_NAME = cluster-api-operator-providers
152+
PACKAGE_NAME = cluster-api-operator
153153
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
154154
CONTROLLER_IMG_TAG ?= $(CONTROLLER_IMG)-$(ARCH):$(TAG)
155155

@@ -497,7 +497,6 @@ release-chart: $(HELM) $(KUSTOMIZE) $(RELEASE_DIR) $(CHART_DIR) $(CHART_PROVIDER
497497

498498
# Processing the cluster-api-operator-providers chart
499499
cp -rf $(ROOT)/hack/charts/cluster-api-operator-providers/. $(CHART_PROVIDERS_DIR)
500-
$(HELM) dependency update $(CHART_PROVIDERS_DIR)
501500
$(HELM) package $(CHART_PROVIDERS_DIR) --app-version=$(HELM_CHART_TAG) --version=$(HELM_CHART_TAG) --destination=$(CHART_PACKAGE_DIR)
502501

503502
.PHONY: release-staging
@@ -571,7 +570,7 @@ test-e2e-run: $(GINKGO) $(ENVSUBST) $(HELM) ## Run e2e tests
571570
-e2e.artifacts-folder="$(ARTIFACTS)" \
572571
-e2e.config="$(E2E_CONF_FILE_ENVSUBST)" -e2e.components=$(RELEASE_DIR)/operator-components.yaml \
573572
-e2e.skip-resource-cleanup=$(SKIP_CLEANUP) -e2e.use-existing-cluster=$(SKIP_CREATE_MGMT_CLUSTER) \
574-
-e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-providers-$(HELM_CHART_TAG).tgz $(E2E_ARGS)
573+
-e2e.helm-binary-path=$(HELM) -e2e.chart-path=$(CHART_PACKAGE_DIR)/cluster-api-operator-$(HELM_CHART_TAG).tgz $(E2E_ARGS)
575574

576575
go-version: ## Print the go version we use to compile our binaries and images
577576
@echo $(GO_VERSION)

hack/charts/cluster-api-operator-providers/Chart.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ description: Cluster API Provider Custom Resources
44
type: application
55
version: 0.0.0
66
appVersion: "0.0.0"
7-
dependencies:
8-
- name: cluster-api-operator
9-
repository: file://../cluster-api-operator
10-
version: 0.0.0
11-
condition: cluster-api-operator.install

0 commit comments

Comments
 (0)