Skip to content

Remove all Kyma finalizers when Kyma is under deletion and no secret … #24

Remove all Kyma finalizers when Kyma is under deletion and no secret …

Remove all Kyma finalizers when Kyma is under deletion and no secret … #24

Workflow file for this run

name: Smoke Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
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 }}
# Context for which we should look for the matching status
statusName: ${{ (github.event_name == 'pull_request') && 'pull-lifecycle-mgr-build' || 'main-lifecycle-mgr-build' }}
timeoutSeconds: 600
intervalSeconds: 10
- name: Exit If Failing Build Requirement
if: steps.wait-for-build.outputs.state != 'success'
run: |
echo "Image build did not succeed, skipping Smoke Test!"
exit 1
kustomize:
strategy:
matrix:
flavor: ["", "-control-plane"]
name: "Kustomize (dry-run${{ matrix.flavor }})"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- run: make dry-run${{ matrix.flavor }} IMG='*:latest'
- name: Archive Manifests
uses: actions/upload-artifact@v3
with:
retention-days: 5
name: dry-run${{ matrix.flavor }}
path: |
dry-run/*.yaml
cli-integration:
strategy:
matrix:
cli-stability: ["unstable"]
target: ["default", "control-plane"]
needs: [kustomize,wait-for-img]
name: "kyma (${{ matrix.cli-stability }}) alpha deploy -k config/${{ matrix.target }}"
runs-on: ubuntu-latest
env:
LIFECYCLE_MANAGER: ${{ github.repository }}
K3D_VERSION: v5.4.7
KUSTOMIZE_VERSION: 4.5.7
ISTIO_VERSION: 1.17.1
steps:
- name: Checkout Lifecycle-Manager
uses: actions/checkout@v3
- name: Setup kustomize
run: |
wget --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-qO - "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s "$KUSTOMIZE_VERSION"
mv kustomize /usr/local/bin/
- name: Override Kustomize Controller Image TAG in Pull Request to PR Image
if: ${{ github.event_name == 'pull_request' }}
run: |
cd config/manager && kustomize edit set image controller="europe-docker.pkg.dev/kyma-project/dev/lifecycle-manager:PR-${{ github.event.pull_request.number }}"
- name: Set up k3d
run: wget -qO - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | TAG=$K3D_VERSION bash
- id: kyma
run: |
wget -q https://storage.googleapis.com/kyma-cli-${{ matrix.cli-stability }}/kyma-linux
chmod +x kyma-linux && mv kyma-linux /usr/local/bin/kyma-${{ matrix.cli-stability }}
echo "PATH=/usr/local/bin/kyma-${{ matrix.cli-stability }}" >> $GITHUB_OUTPUT
- run: ln -s /usr/local/bin/kyma-${{ matrix.cli-stability }} /usr/local/bin/kyma
- name: Run Provision
run: |
kyma --ci provision k3d \
-p 8083:80@loadbalancer \
-p 8443:443@loadbalancer \
--timeout 1m \
--k3d-arg --no-rollback \
--name kyma
- name: Update Kubeconfigs
run: k3d kubeconfig merge -a -d
- name: Setup Control-Plane requirements
if: ${{ matrix.target == 'control-plane' }}
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /usr/local/bin
kubectl label node k3d-kyma-server-0 iam.gke.io/gke-metadata-server-enabled=true
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
istioctl install --set profile=demo -y
kubectl create namespace kyma-system
kubectl create namespace kcp-system
kubectl apply -f https://raw.githubusercontent.com/prometheus-community/helm-charts/kube-prometheus-stack-47.0.0/charts/kube-prometheus-stack/crds/crd-servicemonitors.yaml
- run: kyma --ci alpha deploy -k config/${{ matrix.target }}
- name: Deploy template operator module template and enable module
if: ${{ matrix.target == 'default' }}
run: |
cat << EOF | kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyma-cli-provisioned-wildcard
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: lifecycle-manager-wildcard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kyma-cli-provisioned-wildcard
subjects:
- kind: ServiceAccount
name: lifecycle-manager-controller-manager
namespace: kcp-system
EOF
kubectl apply -f tests/smoke_test/module_upgrade/moduletemplate_template_operator_fast.yaml
kubectl apply -f tests/smoke_test/module_upgrade/moduletemplate_template_operator_regular.yaml
kyma alpha enable module template-operator -c regular -n kyma-system -k default-kyma
- run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
- name: Set up Go for ${{ github.repository }}
uses: actions/setup-go@v3
with:
cache: true
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Run Smoke Tests for ${{ matrix.target }}
run: go test --tags=smoke tests/smoke_test/smoke_test.go -v -feature="${{ matrix.target }}"
- name: Run Smoke Tests for module upgrade
if: ${{ matrix.target == 'default' }}
run: go test --tags=smoke tests/smoke_test/smoke_test.go -v -feature="module upgrade"
- name: Run Smoke Tests for kyma delete
if: ${{ matrix.target == 'default' }}
run: go test --tags=smoke tests/smoke_test/smoke_test.go -v -feature="kyma delete"