This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
generated from knative-extensions/sample-controller
-
Notifications
You must be signed in to change notification settings - Fork 8
114 lines (94 loc) · 3.4 KB
/
kind-e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Copyright 2022 Chainguard, Inc.
# SPDX-License-Identifier: Apache-2.0
name: KinD E2E
on:
pull_request:
branches: [ main ]
defaults:
run:
shell: bash
working-directory: ./src/github.com/chainguard-dev/hakn
concurrency:
group: kind-e2e-${{ github.head_ref }}
cancel-in-progress: true
jobs:
kind-test:
name: E2E Test
# Due to https://github.com/knative/serving/issues/13529,
# pin to 20.04 until conformance test updated to work with cgroupv2 on ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
test-env:
- ingress-conformance
- serving-runtime-conformance
- serving-api-conformance
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: on
GOFLAGS: -ldflags=-s -ldflags=-w
KO_DOCKER_REPO: registry.local:5000/chainguard
KOCACHE: ~/ko
steps:
- name: Check out hakn
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3
with:
path: ./src/github.com/chainguard-dev/hakn
- uses: chainguard-dev/actions/setup-mirror@main
# https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
- uses: actions/cache@v3
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
~/ko
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: "1.21"
check-latest: true
- uses: imjasonh/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6
- name: Setup Cluster
uses: chainguard-dev/actions/setup-kind@main
id: kind
with:
k8s-version: v1.27.x
registry-authority: registry.local:5000
- name: Install hakn
timeout-minutes: 10
run: |
# Eliminates the resources blocks in a release yaml
function resource_blaster() {
local REPO="${1}"
local FILE="${2}"
curl -L -s "https://github.com/knative/${REPO}/releases/download/knative-v1.8.0/${FILE}" \
| yq e 'del(.spec.template.spec.containers[]?.resources)' - \
`# Filter out empty objects that come out as {} b/c kubectl barfs` \
| grep -v '^{}$'
}
# Without going through resource_blaster, Istio consumes 75%
# of the action's resources
resource_blaster net-istio istio.yaml | ko resolve -l knative.dev/crd-install=true -f - | kubectl apply -f -
sleep 5
resource_blaster net-istio istio.yaml | kubectl apply -f -
ko apply -BRf config
kubectl patch configmap/config-autoscaler \
--namespace knative-serving \
--type merge \
--patch '{"data":{"min-scale": "1", "target-burst-capacity": "0"}}'
# Wait for the controlplane to be up.
kubectl rollout status --timeout=5m -n knative-serving statefulsets/controlplane
- uses: chainguard-dev/actions/setup-monitoring@main
- uses: ./src/github.com/chainguard-dev/hakn/.github/actions/tests/dispatcher
with:
test-env: ${{ matrix.test-env }}
- name: Collect diagnostics and upload
if: ${{ failure() }}
uses: chainguard-dev/actions/kind-diag@main