Skip to content

[main] Upgrade to latest dependencies #9242

[main] Upgrade to latest dependencies

[main] Upgrade to latest dependencies #9242

Workflow file for this run

name: e2e
on:
pull_request:
branches: [ 'main', 'release-*' ]
defaults:
run:
shell: bash
jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.28.x
- v1.29.x
test-suite:
- ./test/conformance
- ./test/e2e
istio-version:
- latest
encryption:
- disabled
- system-internal-tls
istio-profile:
- no-mesh
- ambient
env:
KO_DOCKER_REPO: kind.local
# Use a semi-random cluster suffix, but somewhat predictable
# so reruns don't just give us a completely new value.
CLUSTER_SUFFIX: c${{ github.run_id }}.local
steps:
- uses: knative/actions/setup-go@main
- uses: ko-build/setup-ko@v0.6
- uses: actions/checkout@v4
- uses: chainguard-dev/actions/setup-kind@main
id: kind
with:
k8s-version: ${{ matrix.k8s-version }}
kind-worker-count: 1
cluster-suffix: "${CLUSTER_SUFFIX}"
- name: Install Knative net-istio
run: |
set -o pipefail
# Replace cluster.local with random suffix.
sed -ie "s/cluster\.local/${CLUSTER_SUFFIX}/g" third_party/istio-${{ matrix.istio-version }}/istio-kind-${{ matrix.istio-profile }}/istio.yaml
# Deploy Istio
./third_party/istio-${{ matrix.istio-version }}/install-istio.sh istio-kind-${{ matrix.istio-profile }}
# Remove Knative Certificate as we are running without Serving CRs
rm -f config/700-istio-knative-certificate.yaml
# Build and Publish our containers to the docker daemon (including test assets)
ko resolve --platform=linux/amd64 -f test/config/ -f config/ | kubectl apply -f -
CONFIG_ISTIO="./third_party/istio-${{ matrix.istio-version }}/istio-kind-${{ matrix.istio-profile }}/config-istio.yaml"
if [[ -f "${CONFIG_ISTIO}" ]]; then
kubectl apply -f "${CONFIG_ISTIO}"
fi
echo "GATEWAY_NAMESPACE_OVERRIDE=istio-system" >> $GITHUB_ENV
- name: Generate certificates and enable system-internal-tls
if: matrix.encryption == 'system-internal-tls' && matrix.istio-profile == 'no-mesh'
run: |
set -o pipefail
echo ">> Deploy certificate for upstream traffic"
./test/generate-upstream-cert.sh
echo ">> Setting environment variables for upstream tls"
echo "UPSTREAM_TLS_CERT=serving-certs" >> $GITHUB_ENV
echo "SERVER_NAME=kn-user-serving-tests" >> $GITHUB_ENV
echo ">> Enabling system-internal-tls in config-network"
kubectl apply -f test/config/system-internal-tls
- name: Upload Test Images
run: |
# Build and Publish our test images to the docker daemon.
./test/upload-test-images.sh
- name: Wait for Ready
run: |
echo Waiting for Pods to become ready.
# # TODO: Find a good way to do this with chaos enabled.
# kubectl wait pod --for=condition=Ready -n knative-serving -l '!job-name'
kubectl wait pod --for=condition=Ready -n ${GATEWAY_NAMESPACE_OVERRIDE} -l '!job-name'
# For debugging.
kubectl get pods --all-namespaces
- name: Run e2e Tests
run: |
set -x
# Exclude the control-plane node, which doesn't seem to expose the nodeport service.
IPS=( $(kubectl get nodes -lkubernetes.io/hostname!=kind-control-plane -ojsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}') )
# Run the tests tagged as e2e on the KinD cluster.
go test -race -count=1 -short -timeout=20m -tags=e2e ${{ matrix.test-suite }} \
--enable-alpha --enable-beta \
--ingressendpoint="${IPS[0]}" \
--ingressClass=istio.ingress.networking.knative.dev \
--cluster-suffix=$CLUSTER_SUFFIX