Skip to content

chore(dependabot): bump sigs.k8s.io/controller-runtime from 0.17.2 to 0.17.3 in /listener #287

chore(dependabot): bump sigs.k8s.io/controller-runtime from 0.17.2 to 0.17.3 in /listener

chore(dependabot): bump sigs.k8s.io/controller-runtime from 0.17.2 to 0.17.3 in /listener #287

name: TestSuite E2E
on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
k8s_version:
description: "With Kubernetes version"
required: false
jobs:
wait-for-img:
name: "Wait for image build"
runs-on: ubuntu-latest
steps:
- uses: autotelic/action-wait-for-status-check@v1
id: wait-for-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
statusName: ${{ (github.event_name == 'pull_request') && 'pull-runtime-watcher-img-build' || 'main-runtime-watcher-build' }}
timeoutSeconds: 900
intervalSeconds: 10
- name: Exit if build failed
if: steps.wait-for-build.outputs.state != 'success'
run: |
echo "Image build did not succeed, skipping E2E Test!"
exit 1
e2e-integration:
strategy:
matrix:
e2e-test: ["watcher-enqueue", "watcher-metrics"]
name: "E2E"
needs: [wait-for-img]
runs-on: ubuntu-latest
timeout-minutes: 10
env:
K3D_VERSION: v5.6.0
K8S_VERSION: ${{ github.event.inputs.k8s_version || '1.28.7' }}
ISTIO_VERSION: 1.20.3
CM_VERSION: v1.13.3
GOSUMDB: off
steps:
- name: Install kubectl
run: |
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt update -y
sudo apt install kubectl -y
- name: Install istioctl
run: |
curl -L https://istio.io/downloadIstio | TARGET_ARCH=x86_64 sh -
chmod +x istio-$ISTIO_VERSION/bin/istioctl
mv istio-$ISTIO_VERSION/bin/istioctl /usr/local/bin
- name: Install kyma-cli
run: |
wget https://storage.googleapis.com/kyma-cli-unstable/kyma-linux
chmod +x kyma-linux && mv kyma-linux /usr/local/bin/kyma-unstable
echo "PATH=/usr/local/bin/kyma-unstable" >> $GITHUB_OUTPUT
ln -s /usr/local/bin/kyma-unstable /usr/local/bin/kyma
- name: Install cmctl
run: |
OS=$(go env GOOS); ARCH=$(go env GOARCH); curl -fsSL -o cmctl.tar.gz https://github.com/cert-manager/cert-manager/releases/latest/download/cmctl-$OS-$ARCH.tar.gz
tar xzf cmctl.tar.gz
sudo mv cmctl /usr/local/bin
- name: Install k3d
run: |
wget -qO - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=$K3D_VERSION bash
FILE=/etc/hosts
if [ -f "$FILE" ]; then
sudo echo "127.0.0.1 k3d-kcp-registry" | sudo tee -a $FILE
else
echo "$FILE does not exist."
exit 1
fi
echo "/etc/hosts file patched"
- name: Create SKR cluster
run: |
k3d cluster create skr \
-p 10080:80@loadbalancer \
-p 10443:443@loadbalancer \
-p 9090:9090@loadbalancer \
-p 2112:2112@loadbalancer \
--image rancher/k3s:v$K8S_VERSION-k3s1 \
--k3s-arg '--disable=traefik@server:*' \
--k3s-arg '--tls-san=host.k3d.internal@server:*'
- name: Create KCP cluster
run: |
k3d cluster create kcp \
-p 9443:443@loadbalancer \
-p 9080:80@loadbalancer \
-p 9081:8080@loadbalancer \
--registry-create k3d-kcp-registry:5111 \
--image rancher/k3s:v$K8S_VERSION-k3s1 \
--k3s-arg '--disable=traefik@server:*' \
--k3s-arg '--tls-san=host.k3d.internal@server:*'
- name: Export kubeconfigs
run: |
k3d kubeconfig merge -a -d
echo "KCP_KUBECONFIG=$(k3d kubeconfig write kcp)" >> $GITHUB_ENV
echo "SKR_KUBECONFIG=$(k3d kubeconfig write skr)" >> $GITHUB_ENV
- name: Switch context to KCP
run: kubectl config use-context k3d-kcp
- name: Deploy istio
run: |
istioctl install --set profile=demo -y
- name: Deploy cert-manager
run: |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/$CM_VERSION/cert-manager.yaml
cmctl check api --wait=2m
- name: Checkout runtime-watcher
uses: actions/checkout@v4
- name: Checkout lifecycle-manager
uses: actions/checkout@v4
with:
repository: kyma-project/lifecycle-manager
path: lifecycle-manager
- name: Checkout template-operator
uses: actions/checkout@v4
with:
repository: kyma-project/template-operator
path: template-operator
- name: Set up go environment
uses: actions/setup-go@v4
with:
go-version-file: 'runtime-watcher/go.mod'
cache-dependency-path: 'runtime-watcher/go.sum'
- name: Add kustomize patch with PR image
if: ${{ github.event_name == 'pull_request' }}
working-directory: lifecycle-manager
run: |
IMAGE_TAG=PR-${{ github.event.pull_request.number }}
pushd config/watcher_local_test
echo \
"- op: add
path: /spec/template/spec/containers/0/args/-
value: --watcher-dev-registry=true
- op: add
path: /spec/template/spec/containers/0/args/-
value: --skr-watcher-image-tag=$IMAGE_TAG" >> patch_watcher_img.yaml
kustomize edit add patch --path patch_watcher_img.yaml --kind Deployment
popd
kustomize build config/watcher_local_test
- name: Deploy lifecycle-manager
working-directory: lifecycle-manager
run: |
maxRetry=5
for retry in $(seq 1 $maxRetry)
do
if make local-deploy-with-watcher IMG=europe-docker.pkg.dev/kyma-project/prod/lifecycle-manager:latest; then
echo "KLM deployed successfully"
exit 0
elif [[ $retry -lt $maxRetry ]]; then
echo "Deploy encountered some error, will retry after 20 seconds"
sleep 20
else
echo "KLM deployment failed"
exit 1
fi
done
- name: Cluster info
run: |
kubectl get pods -A
kubectl get deploy klm-controller-manager -n kcp-system -oyaml
- name: Run tests
working-directory: runtime-watcher
run: |
make -C tests/e2e ${{ matrix.e2e-test }}