-
Notifications
You must be signed in to change notification settings - Fork 30
113 lines (93 loc) · 3.36 KB
/
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
name: "End-to-end tests"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
e2e-tests:
name: End-to-end tests
runs-on: ubuntu-22.04
strategy:
matrix:
# The e2e tests are run on the lowest and highest supported k8s version.
# All Kubernetes version in between expose the same APIs, hence the operator
# should be compatible with them.
kube-version:
- "1.21"
- "1.28"
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: "install kuttl"
run: ./hack/install/install-kuttl.sh
- name: "run tests"
env:
KUBE_VERSION: ${{ matrix.kube-version }}
run: make prepare-e2e e2e KUBE_VERSION=$KUBE_VERSION
upgrade-tests:
name: Upgrade tests
runs-on: ubuntu-22.04
strategy:
matrix:
kube-version:
- "1.28"
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Start kind
run: kind create cluster --config kind-${{ matrix.kube-version }}.yaml --wait 5m
- name: Start a local container registry with TLS
run: |
# install mkcert
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
# create and install root CA in system store
sudo mkcert -install
sudo systemctl restart docker
# copy root CA in kind's system store
sudo docker cp $(sudo mkcert -CAROOT)/rootCA.pem kind-control-plane:/usr/local/share/ca-certificates/mkcert.crt
docker exec kind-control-plane update-ca-certificates
docker exec kind-control-plane systemctl restart containerd
# generate cert for registry
mkdir -p /tmp/localregistry/certs
sudo mkcert -cert-file /tmp/localregistry/certs/tls.crt -key-file /tmp/localregistry/certs/tls.key localregistry
# make registry reachable
echo $(dig +short $(hostname) | head -n1) localregistry | sudo tee -a /etc/hosts
# start registry
docker run -d \
--restart=always \
--name registry \
-v /tmp/localregistry/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/tls.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/tls.key \
-p 5000:5000 \
registry:2
- name: Install kuttl, OLM and minio
run: |
./hack/install/install-kuttl.sh
make olm-install deploy-minio
- name: Build and push operator and bundle image to local container registry
run: |
export LATEST_TAG=$(git describe --tags --abbrev=0)
export BUNDLE_IMGS=ghcr.io/grafana/tempo-operator/tempo-operator-bundle:${LATEST_TAG},localregistry:5000/tempo-operator-bundle:v100.0.0
make bundle docker-build docker-push bundle-build bundle-push catalog-build catalog-push
env:
IMG_PREFIX: localregistry:5000
OPERATOR_VERSION: 100.0.0
- name: Run tests
run: make e2e-upgrade