Skip to content

Extracting common action framework functinalities in operator-actions… #3852

Extracting common action framework functinalities in operator-actions…

Extracting common action framework functinalities in operator-actions… #3852

name: Cloud Manager E2E Tests
on:
pull_request_target:
types: [opened, labeled, synchronize, reopened]
branches:
- main
permissions:
contents: read
env:
IMAGE_BUILDER: podman
IMG: localhost/odh-operator:e2e
jobs:
get-merge-commit:
if: >-
github.event.action == 'labeled' && github.event.label.name == 'run-xks-e2e'
|| github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'run-xks-e2e')
name: Get merge commit
uses: ./.github/workflows/get-merge-commit.yaml
cloud-manager-e2e:
needs: get-merge-commit
name: Cloud Manager E2E (${{ matrix.provider }})
# Label gate: only runs when a maintainer adds this label, preventing
# untrusted fork PRs from executing arbitrary code with repo secrets.
if: >-
github.event.action == 'labeled' && github.event.label.name == 'run-xks-e2e'
|| github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'run-xks-e2e')
runs-on: ubuntu-latest
env:
KIND_CLUSTER_NAME: kind-${{ matrix.provider }}
strategy:
fail-fast: false
matrix:
provider: [azure, coreweave, aws]
steps:
- name: Checkout PR code
if: ${{ !env.ACT }}
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
ref: ${{ needs.get-merge-commit.outputs.mergedSha }}
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- name: Create kind cluster
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
with:
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
- name: Configure Pull Secrets for operator dependencies in the KinD Cluster
if: env.PULL_SECRET != ''
run: |
pull_secret_file="$RUNNER_TEMP/pull-secret.json"
echo "$PULL_SECRET" > "$pull_secret_file"
make kind-setup-pull-secrets PULL_SECRET="$pull_secret_file" PULL_SECRET_NAMESPACES="cert-manager cert-manager-operator test-lws-operator test-istio-system"
rm -f "$pull_secret_file"
env:
PULL_SECRET: ${{ secrets.CCM_PULL_SECRET }}
- name: Build operator image
run: make image-build
- name: Load image into kind
run: make image-kind-load
- name: Deploy cloud manager
run: make deploy-ccm-local-${{ matrix.provider }}
- name: Wait for cloud manager to be ready
run: |
kubectl rollout status deployment -n opendatahub-cloudmanager-system \
-l control-plane=controller-manager \
--timeout=120s
- name: Run e2e tests
env:
CLOUD_MANAGER_PROVIDER: ${{ matrix.provider }}
run: |
set -o pipefail
make e2e-test-ccm 2>&1 | tee test.log
- name: Collect operator logs on failure
if: failure()
env:
PROVIDER: ${{ matrix.provider }}
run: |
kubectl get "${PROVIDER}kubernetesengine" -o yaml || true
kubectl logs -n opendatahub-cloudmanager-system \
-l control-plane=controller-manager \
--tail=500 || true
- name: Upload test log
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-log-${{ matrix.provider }}
path: test.log
retention-days: 7