Skip to content

Commit

Permalink
ci: use pr based image and manifest files
Browse files Browse the repository at this point in the history
  • Loading branch information
dineshba committed Oct 19, 2024
1 parent e520ac8 commit 2a4ab8c
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ jobs:
- uses: actions/checkout@v4
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6
with:
push: false
load: true
tags: docker.io/clastix/cluster-api-control-plane-provider-kamaji:${{ github.sha }}
- name: "Load image into kind cluster"
run: |
kind load docker-image --name chart-testing docker.io/clastix/cluster-api-control-plane-provider-kamaji:$GITHUB_SHA
- name: "Setup Kubevirt Infrastructure Stack"
run: |
# Install Metal LB for exposing Kubevirt based Workload Cluster's Api server
Expand Down Expand Up @@ -79,18 +92,31 @@ jobs:
run: |
mkdir ~/.cluster-api
touch ~/.cluster-api/clusterctl.yaml
sed -i "s/docker.io\/clastix\/cluster-api-control-plane-provider-kamaji:.*/docker.io\/clastix\/cluster-api-control-plane-provider-kamaji:$GITHUB_SHA/g" config/control-plane-components.yaml
cat config/control-plane-components.yaml | grep image
mkdir -p ${HOME}/control-plane-kamaji/v0.11.0/
cp config/control-plane-components.yaml ${HOME}/control-plane-kamaji/v0.11.0/
cp config/metadata.yaml ${HOME}/control-plane-kamaji/v0.11.0/
cat <<EOF > ~/.cluster-api/clusterctl.yaml
providers:
- name: "kamaji"
url: "https://github.com/clastix/cluster-api-control-plane-provider-kamaji/releases/v0.11.0/control-plane-components.yaml"
url: "${HOME}/control-plane-kamaji/v0.11.0/control-plane-components.yaml"
type: "ControlPlaneProvider"
EOF
cat ~/.cluster-api/clusterctl.yaml
clusterctl init --infrastructure kubevirt --control-plane kamaji
kubectl wait deploy -n kamaji-system capi-kamaji-controller-manager --for=condition=Available --timeout=10m
kubectl wait deploy -n capi-kubeadm-bootstrap-system capi-kubeadm-bootstrap-controller-manager --for=condition=Available --timeout=10m
kubectl wait deploy -n capi-system capi-controller-manager --for=condition=Available --timeout=10m
IMAGE=$(kubectl get deploy -n kamaji-system capi-kamaji-controller-manager -o yaml | grep image | grep $GITHUB_SHA)
if [[ $IMAGE != *"$GITHUB_SHA"* ]]; then
echo "Not using the expected PR image"
exit 1
fi
- name: "Deploy target cluster"
run: |
Expand Down

0 comments on commit 2a4ab8c

Please sign in to comment.