Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 37 additions & 35 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
merge_group:
workflow_dispatch:

env:
SOURCE_REPO: https://github.com/${{ github.event.pull_request.head.repo.full_name || 'rancher/cluster-api-addon-provider-fleet' }}
SOURCE_BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -90,41 +94,39 @@ jobs:
with:
name: artifacts-import-${{ matrix.display_name }}
path: _out/gather
#
# CAPRKE2 missing CAPI v1.12 support
#
# test-e2e-import-rke2:
# name: test-e2e-import-rke2 ${{ matrix.display_name }}
# runs-on: ubuntu-latest
# strategy:
# matrix:
# include:
# - kube_version: "1.32.0"
# display_name: "stable"
# - kube_version: "1.34.0"
# display_name: "latest"
# env:
# KUBE_VERSION: ${{ matrix.kube_version }}
# steps:
# - name: Install just
# run: cargo install just
# - name: Install kind
# uses: helm/kind-action@v1
# with:
# install_only: true
# version: v0.29.0
# - uses: actions/checkout@v4
# - name: Test (Import RKE2) - ${{ matrix.display_name }}
# run: just test-import-rke2
# - name: Collect artifacts
# if: always()
# run: just collect-test-import
# - name: Store run artifacts
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: artifacts-import-rke2-${{ matrix.display_name }}
# path: _out/gather

test-e2e-import-rke2:
name: test-e2e-import-rke2 ${{ matrix.display_name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- kube_version: "1.34.0"
display_name: "stable"
- kube_version: "1.35.0"
display_name: "latest"
env:
KUBE_VERSION: ${{ matrix.kube_version }}
steps:
- name: Install just
run: cargo install just
- name: Install kind
uses: helm/kind-action@v1
with:
install_only: true
version: v0.29.0
- uses: actions/checkout@v4
- name: Test (Import RKE2) - ${{ matrix.display_name }}
run: just test-import-rke2
- name: Collect artifacts
if: always()
run: just collect-test-import
- name: Store run artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: artifacts-import-rke2-${{ matrix.display_name }}
path: _out/gather

clippy:
runs-on: ubuntu-latest
Expand Down
12 changes: 7 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ ARCH := if arch() == "aarch64" { "arm64"} else { "amd64" }
DIST := os()
REFRESH_BIN := env_var_or_default('REFRESH_BIN', '1')

GIT_REPO := env_var_or_default('SOURCE_REPO', `git remote get-url origin`)
GIT_BRANCH := env_var_or_default('SOURCE_BRANCH', `git branch --show-current`)

# Test providers
CLUSTER_API_VERSION := "v1.12.2"
CAPRKE2_VERSION := "v0.23.0"

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

Expand Down Expand Up @@ -126,11 +130,9 @@ deploy-calico:
deploy-calico-gitrepo: _download-yq
#!/usr/bin/env bash
set -euxo pipefail
repo=`git remote get-url origin`
branch=`git branch --show-current`
cp testdata/gitrepo-calico.yaml {{OUT_DIR}}/gitrepo-calico.yaml
yq -i ".spec.repo = \"${repo}\"" {{OUT_DIR}}/gitrepo-calico.yaml
yq -i ".spec.branch = \"${branch}\"" {{OUT_DIR}}/gitrepo-calico.yaml
yq -i ".spec.repo = \"{{GIT_REPO}}\"" {{OUT_DIR}}/gitrepo-calico.yaml
yq -i ".spec.branch = \"{{GIT_BRANCH}}\"" {{OUT_DIR}}/gitrepo-calico.yaml
kubectl apply -f {{OUT_DIR}}/gitrepo-calico.yaml

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

# Install cluster api and any providers
install-capi: _download-clusterctl
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}}
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}}

# Deploy will deploy the operator
deploy features="": _download-kustomize
Expand Down
29 changes: 13 additions & 16 deletions testdata/cluster_docker_rke2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ metadata:
spec:
template:
spec:
customImage: kindest/node:v1.34.0
customImage: kindest/node:v1.35.0
bootstrapTimeout: 15m
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
kind: RKE2ControlPlane
metadata:
name: docker-demo-control-plane
spec:
replicas: 1
version: v1.34.0+rke2r1
version: v1.35.0+rke2r1
rolloutStrategy:
rollingUpdate:
maxSurge: 1
Expand All @@ -65,16 +65,13 @@ spec:
kubernetesComponents:
- cloudController
machineTemplate:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
name: docker-demo-control-plane
nodeDrainTimeout: 30s
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
name: docker-demo-control-plane
nodeDrainTimeout: 30s
spec:
infrastructureRef:
apiGroup: infrastructure.cluster.x-k8s.io
kind: DockerMachineTemplate
name: docker-demo-control-plane
deletion:
nodeDrainTimeoutSeconds: 30
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
Expand All @@ -83,10 +80,10 @@ metadata:
spec:
template:
spec:
customImage: kindest/node:v1.34.0
customImage: kindest/node:v1.35.0
bootstrapTimeout: 15m
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: RKE2ConfigTemplate
metadata:
name: docker-demo-md-0
Expand All @@ -104,7 +101,7 @@ spec:
cluster.x-k8s.io/cluster-name: docker-demo
template:
spec:
version: v1.34.0+rke2r1
version: v1.35.0+rke2r1
clusterName: docker-demo
bootstrap:
configRef:
Expand Down
Loading