Skip to content

Commit 91a043e

Browse files
authored
ci: re-enable caprke2 import test (#411)
* ci: re-enable caprke2 import test Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com> * ci: adjust GitRepo initialization Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com> --------- Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
1 parent efbf5b1 commit 91a043e

3 files changed

Lines changed: 57 additions & 56 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
merge_group:
77
workflow_dispatch:
88

9+
env:
10+
SOURCE_REPO: https://github.com/${{ github.event.pull_request.head.repo.full_name || 'rancher/cluster-api-addon-provider-fleet' }}
11+
SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }}
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
@@ -90,41 +94,39 @@ jobs:
9094
with:
9195
name: artifacts-import-${{ matrix.display_name }}
9296
path: _out/gather
93-
#
94-
# CAPRKE2 missing CAPI v1.12 support
95-
#
96-
# test-e2e-import-rke2:
97-
# name: test-e2e-import-rke2 ${{ matrix.display_name }}
98-
# runs-on: ubuntu-latest
99-
# strategy:
100-
# matrix:
101-
# include:
102-
# - kube_version: "1.32.0"
103-
# display_name: "stable"
104-
# - kube_version: "1.34.0"
105-
# display_name: "latest"
106-
# env:
107-
# KUBE_VERSION: ${{ matrix.kube_version }}
108-
# steps:
109-
# - name: Install just
110-
# run: cargo install just
111-
# - name: Install kind
112-
# uses: helm/kind-action@v1
113-
# with:
114-
# install_only: true
115-
# version: v0.29.0
116-
# - uses: actions/checkout@v4
117-
# - name: Test (Import RKE2) - ${{ matrix.display_name }}
118-
# run: just test-import-rke2
119-
# - name: Collect artifacts
120-
# if: always()
121-
# run: just collect-test-import
122-
# - name: Store run artifacts
123-
# uses: actions/upload-artifact@v4
124-
# if: always()
125-
# with:
126-
# name: artifacts-import-rke2-${{ matrix.display_name }}
127-
# path: _out/gather
97+
98+
test-e2e-import-rke2:
99+
name: test-e2e-import-rke2 ${{ matrix.display_name }}
100+
runs-on: ubuntu-latest
101+
strategy:
102+
matrix:
103+
include:
104+
- kube_version: "1.34.0"
105+
display_name: "stable"
106+
- kube_version: "1.35.0"
107+
display_name: "latest"
108+
env:
109+
KUBE_VERSION: ${{ matrix.kube_version }}
110+
steps:
111+
- name: Install just
112+
run: cargo install just
113+
- name: Install kind
114+
uses: helm/kind-action@v1
115+
with:
116+
install_only: true
117+
version: v0.29.0
118+
- uses: actions/checkout@v4
119+
- name: Test (Import RKE2) - ${{ matrix.display_name }}
120+
run: just test-import-rke2
121+
- name: Collect artifacts
122+
if: always()
123+
run: just collect-test-import
124+
- name: Store run artifacts
125+
uses: actions/upload-artifact@v4
126+
if: always()
127+
with:
128+
name: artifacts-import-rke2-${{ matrix.display_name }}
129+
path: _out/gather
128130

129131
clippy:
130132
runs-on: ubuntu-latest

justfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ ARCH := if arch() == "aarch64" { "arm64"} else { "amd64" }
1111
DIST := os()
1212
REFRESH_BIN := env_var_or_default('REFRESH_BIN', '1')
1313

14+
GIT_REPO := env_var_or_default('SOURCE_REPO', `git remote get-url origin`)
15+
GIT_BRANCH := env_var_or_default('SOURCE_BRANCH', `git branch --show-current`)
16+
1417
# Test providers
1518
CLUSTER_API_VERSION := "v1.12.2"
19+
CAPRKE2_VERSION := "v0.23.0"
1620

1721
export PATH := "_out:_out/bin:" + env_var('PATH')
1822

@@ -126,11 +130,9 @@ deploy-calico:
126130
deploy-calico-gitrepo: _download-yq
127131
#!/usr/bin/env bash
128132
set -euxo pipefail
129-
repo=`git remote get-url origin`
130-
branch=`git branch --show-current`
131133
cp testdata/gitrepo-calico.yaml {{OUT_DIR}}/gitrepo-calico.yaml
132-
yq -i ".spec.repo = \"${repo}\"" {{OUT_DIR}}/gitrepo-calico.yaml
133-
yq -i ".spec.branch = \"${branch}\"" {{OUT_DIR}}/gitrepo-calico.yaml
134+
yq -i ".spec.repo = \"{{GIT_REPO}}\"" {{OUT_DIR}}/gitrepo-calico.yaml
135+
yq -i ".spec.branch = \"{{GIT_BRANCH}}\"" {{OUT_DIR}}/gitrepo-calico.yaml
134136
kubectl apply -f {{OUT_DIR}}/gitrepo-calico.yaml
135137

136138
# Deploy an example app bundle to the cluster
@@ -166,7 +168,7 @@ install-fleet: _create-out-dir
166168

167169
# Install cluster api and any providers
168170
install-capi: _download-clusterctl
169-
EXP_CLUSTER_RESOURCE_SET=true CLUSTER_TOPOLOGY=true clusterctl init --core cluster-api:{{CLUSTER_API_VERSION}} -i docker:{{CLUSTER_API_VERSION}} -b rke2 -c rke2 -b kubeadm:{{CLUSTER_API_VERSION}} -c kubeadm:{{CLUSTER_API_VERSION}}
171+
EXP_CLUSTER_RESOURCE_SET=true CLUSTER_TOPOLOGY=true clusterctl init --core cluster-api:{{CLUSTER_API_VERSION}} -i docker:{{CLUSTER_API_VERSION}} -b rke2:{{CAPRKE2_VERSION}} -c rke2:{{CAPRKE2_VERSION}} -b kubeadm:{{CLUSTER_API_VERSION}} -c kubeadm:{{CLUSTER_API_VERSION}}
170172

171173
# Deploy will deploy the operator
172174
deploy features="": _download-kustomize

testdata/cluster_docker_rke2.yaml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ metadata:
3939
spec:
4040
template:
4141
spec:
42-
customImage: kindest/node:v1.34.0
42+
customImage: kindest/node:v1.35.0
4343
bootstrapTimeout: 15m
4444
---
45-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
45+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
4646
kind: RKE2ControlPlane
4747
metadata:
4848
name: docker-demo-control-plane
4949
spec:
5050
replicas: 1
51-
version: v1.34.0+rke2r1
51+
version: v1.35.0+rke2r1
5252
rolloutStrategy:
5353
rollingUpdate:
5454
maxSurge: 1
@@ -65,16 +65,13 @@ spec:
6565
kubernetesComponents:
6666
- cloudController
6767
machineTemplate:
68-
infrastructureRef:
69-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
70-
kind: DockerMachineTemplate
71-
name: docker-demo-control-plane
72-
nodeDrainTimeout: 30s
73-
infrastructureRef:
74-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
75-
kind: DockerMachineTemplate
76-
name: docker-demo-control-plane
77-
nodeDrainTimeout: 30s
68+
spec:
69+
infrastructureRef:
70+
apiGroup: infrastructure.cluster.x-k8s.io
71+
kind: DockerMachineTemplate
72+
name: docker-demo-control-plane
73+
deletion:
74+
nodeDrainTimeoutSeconds: 30
7875
---
7976
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
8077
kind: DockerMachineTemplate
@@ -83,10 +80,10 @@ metadata:
8380
spec:
8481
template:
8582
spec:
86-
customImage: kindest/node:v1.34.0
83+
customImage: kindest/node:v1.35.0
8784
bootstrapTimeout: 15m
8885
---
89-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
86+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
9087
kind: RKE2ConfigTemplate
9188
metadata:
9289
name: docker-demo-md-0
@@ -104,7 +101,7 @@ spec:
104101
cluster.x-k8s.io/cluster-name: docker-demo
105102
template:
106103
spec:
107-
version: v1.34.0+rke2r1
104+
version: v1.35.0+rke2r1
108105
clusterName: docker-demo
109106
bootstrap:
110107
configRef:

0 commit comments

Comments
 (0)