fix: propagate errors from known_hosts setup instead of silently ignoring #631
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests | |
| on: | |
| push: | |
| branches: | |
| - 'release-*' # for main branch we have the merge queue | |
| pull_request: | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-e2e: | |
| name: E2E Tests (${{ matrix.builder }}/${{ matrix.deployer }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| builder: [pack, s2i] | |
| deployer: [knative, raw, keda] | |
| steps: | |
| - name: Free up disk space | |
| run: | | |
| # Remove large pre-installed toolchains not needed for K8s operator testing | |
| sudo rm -rf \ | |
| /usr/share/dotnet \ | |
| /usr/local/lib/android \ | |
| /opt/ghc \ | |
| /opt/hostedtoolcache \ | |
| /usr/local/share/powershell \ | |
| /usr/share/swift \ | |
| /usr/local/.ghcup \ | |
| /usr/local/share/chromium \ | |
| /usr/local/lib/heroku | |
| # Clean up Docker to start fresh | |
| docker system prune -af --volumes | |
| df -h | |
| - name: Clone the code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install the latest version of kind | |
| run: | | |
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 | |
| chmod +x ./kind | |
| sudo mv ./kind /usr/local/bin/kind | |
| - name: Verify kind installation | |
| run: kind version | |
| - name: Install helm | |
| uses: azure/setup-helm@v5.0.0 | |
| # func CLI is needed in some e2e tests ATM | |
| - name: Install func cli | |
| uses: functions-dev/action@main | |
| with: | |
| version: nightly # use nightly as long as we use the latest in the operator too | |
| - name: Setup KinD cluster | |
| run: make create-kind-cluster | |
| - name: Install func-operator | |
| run: make docker-build docker-push deploy | |
| - name: Pre-pull builder images to avoid parallel pull contention | |
| run: | | |
| # Pre-pull builder images before tests run in parallel to avoid: | |
| # - Network bandwidth saturation (multiple 1-3GB pulls) | |
| # - Disk I/O contention | |
| # - Container runtime lock contention | |
| if [ "${{ matrix.builder }}" = "s2i" ]; then | |
| echo "Pre-pulling S2I builder images..." | |
| docker pull registry.access.redhat.com/ubi8/go-toolset:latest || true | |
| # for now we only download the go image, as we only use this in the e2e tests | |
| kind load docker-image registry.access.redhat.com/ubi8/go-toolset:latest || true | |
| elif [ "${{ matrix.builder }}" = "pack" ]; then | |
| echo "Pre-pulling pack builder images..." | |
| docker pull ghcr.io/knative/builder-jammy-base:v2 || true | |
| docker pull ghcr.io/knative/builder-jammy-tiny:v2 || true | |
| kind load docker-image ghcr.io/knative/builder-jammy-base:v2 || true | |
| kind load docker-image ghcr.io/knative/builder-jammy-tiny:v2 || true | |
| fi | |
| echo "Builder images cached in KinD cluster" | |
| - name: Running e2e Tests | |
| env: | |
| REGISTRY_INSECURE: true | |
| REGISTRY: kind-registry:5000 | |
| DEFAULT_BUILDER: ${{ matrix.builder }} | |
| DEFAULT_DEPLOYER: ${{ matrix.deployer }} | |
| run: make test-e2e | |
| - name: Collect Kubernetes artifacts | |
| if: failure() | |
| run: | | |
| mkdir -p /tmp/k8s-artifacts | |
| kubectl logs -n func-operator-system -l control-plane=controller-manager --tail=-1 --all-containers --prefix --timestamps > /tmp/k8s-artifacts/func-operator.log || true | |
| for resource in functions deployments configmaps pipelineruns roles rolebindings; do | |
| kubectl get ${resource} -A -o yaml > /tmp/k8s-artifacts/${resource}.yaml || true | |
| done | |
| # Install Tekton CLI for better PipelineRun log collection | |
| curl -LO https://github.com/tektoncd/cli/releases/download/v0.44.1/tkn_0.44.1_Linux_x86_64.tar.gz | |
| tar xvzf tkn_0.44.1_Linux_x86_64.tar.gz -C /tmp | |
| chmod +x /tmp/tkn | |
| # Collect logs from all pipelineruns using Tekton CLI | |
| /tmp/tkn pipelinerun list -A > /tmp/k8s-artifacts/pipelinerun-list.txt 2>&1 || true | |
| kubectl get pipelineruns -A -o json | jq -r '.items[] | "\(.metadata.namespace) \(.metadata.name)"' | while read ns name; do | |
| /tmp/tkn pipelinerun logs $name -n $ns > /tmp/k8s-artifacts/pipelinerun-logs-${ns}-${name}.log 2>&1 || true | |
| done | |
| - name: Upload Kubernetes artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: func-operator-logs-${{ matrix.builder }}-${{ matrix.deployer }} | |
| path: /tmp/k8s-artifacts/ | |
| retention-days: 7 |