Skip to content

Run go mod edit -replace golang.org/x/net=golang.org/x/[email protected] (#67) #6443

Run go mod edit -replace golang.org/x/net=golang.org/x/[email protected] (#67)

Run go mod edit -replace golang.org/x/net=golang.org/x/[email protected] (#67) #6443

Workflow file for this run

name: KinD e2e tests
on:
pull_request:
branches: [ 'main', 'release-*' ]
push:
branches: [ 'main', 'release-*' ]
defaults:
run:
shell: bash
working-directory: ./src/knative.dev/net-istio
jobs:
e2e-tests:
name: e2e tests
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.24.7
- v1.25.3
test-suite:
- ./test/conformance
- ./test/e2e
istio-version:
- latest
# Map between K8s and KinD versions.
# This is attempting to make it a bit clearer what's being tested.
# See: https://github.com/kubernetes-sigs/kind/releases
include:
- k8s-version: v1.24.7
kind-version: v0.17.0
kind-image-sha: sha256:577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315
- k8s-version: v1.25.3
kind-version: v0.17.0
kind-image-sha: sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1
env:
GOPATH: ${{ github.workspace }}
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:
- name: Set up Go 1.18.x
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Install Dependencies
working-directory: ./
run: |
echo '::group:: install ko'
curl -L https://github.com/google/ko/releases/download/v0.12.0/ko_0.12.0_Linux_x86_64.tar.gz | tar xzf - ko
chmod +x ./ko
sudo mv ko /usr/local/bin
echo '::endgroup::'
- name: Check out code onto GOPATH
uses: actions/checkout@v3
with:
path: ./src/knative.dev/net-istio
- name: Install KinD
run: |
set -x
# Disable swap otherwise memory enforcement doesn't work
# See: https://kubernetes.slack.com/archives/CEKK1KTN2/p1600009955324200
sudo swapoff -a
sudo rm -f /swapfile
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${{ matrix.kind-version }}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Create KinD Cluster
run: |
set -x
# KinD configuration.
cat > kind.yaml <<EOF
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
- role: worker
image: kindest/node:${{ matrix.k8s-version }}@${{ matrix.kind-image-sha }}
# This is needed in order to
# (1) support projected volumes with service account tokens. See
# https://kubernetes.slack.com/archives/CEKK1KTN2/p1600268272383600
# (2) use a random cluster suffix
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
metadata:
name: config
apiServer:
extraArgs:
"service-account-issuer": "kubernetes.default.svc"
"service-account-signing-key-file": "/etc/kubernetes/pki/sa.key"
networking:
dnsDomain: "${CLUSTER_SUFFIX}"
EOF
# Create a cluster!
kind create cluster --config kind.yaml
- 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-no-mesh/istio.yaml
# Deploy Istio
./third_party/istio-${{ matrix.istio-version }}/install-istio.sh istio-kind-no-mesh
# 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-no-mesh/config-istio.yaml"
if [[ -f "${CONFIG_ISTIO}" ]]; then
kubectl apply -f "${CONFIG_ISTIO}"
fi
echo "GATEWAY_NAMESPACE_OVERRIDE=istio-system" >> $GITHUB_ENV
- 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
- name: Post failure notice to Slack
uses: rtCamp/[email protected]
if: ${{ failure() && github.event_name != 'pull_request' }}
env:
SLACK_ICON: http://github.com/knative.png?size=48
SLACK_USERNAME: github-actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'net-istio'
SLACK_COLOR: '#8E1600'
MSG_MINIMAL: 'true'
SLACK_TITLE: Periodic ${{ matrix.k8s-version }} failed.
SLACK_MESSAGE: |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}