-
Notifications
You must be signed in to change notification settings - Fork 36
108 lines (103 loc) · 3.13 KB
/
operator.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
name: Operator workflow
permissions:
pull-requests: write
deployments: write
id-token: write
contents: read
defaults:
run:
shell: bash
working-directory: ./tembo-operator/
on:
pull_request:
branches:
- main
paths:
- ".github/workflows/operator.yaml"
- "tembo-operator/**"
push:
branches:
- main
paths:
- ".github/workflows/operator.yaml"
- "tembo-operator/**"
jobs:
functional_test:
name: Run functional testing
runs-on:
- self-hosted
- dind
- xlarge-16x16
strategy:
# fail-fast means to cancel all jobs if one fails
fail-fast: false
matrix:
# Go here for a list of versions:
# https://github.com/kubernetes-sigs/kind/releases
kube_version:
- "1.29.8"
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
set -xe
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev git wget build-essential
- uses: azure/setup-helm@v4
- uses: extractions/setup-just@v2
- name: Install kind
uses: helm/kind-action@v1
with:
install_only: true
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "tembo-operator-functional-test"
workspaces: |
tembo-operator
- name: Check CRD is updated in the charts directory
run: |
set -xe
cargo run --bin crdgen > ../charts/tembo-operator/templates/crd.yaml
git diff --exit-code ../charts/tembo-operator/templates/crd.yaml
- name: Setup local test cluster
run: |
set -xe
export KUBE_VERSION=${{ matrix.kube_version }}
just start-kind
- name: Pre-load docker images into cluster
run: |
set -xe
just run-load-images
- name: Run functional / integration tests
run: |
set -xe
export DATA_PLANE_BASEDOMAIN=localhost
export USE_SHARED_CA=1
# Start the operator in the background
cargo run > operator-output.txt 2>&1 &
# Run the tests
cargo test -- --ignored --nocapture
- name: Debugging information
if: always()
run: |
set +e
set -x
echo "=========="
cat operator-output.txt
echo "=========="
# Get list of namespaces that start with 'test-coredb-'
namespaces=$(kubectl get ns -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep '^test-coredb-')
for ns in $namespaces; do
echo "==== Namespace: $ns ===="
kubectl -n $ns get pods $ns-1 -o yaml
echo "=============================="
kubectl -n $ns get svc -o yaml
echo "=============================="
kubectl -n $ns get coredb $ns -o yaml
echo "=============================="
kubectl -n $ns get clusters $ns -o yaml
echo "=============================="
done