forked from openshift-psap/special-resource-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (77 loc) · 3.25 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
name: e2e
on: [pull_request]
jobs:
e2e:
name: Prebuilt kernel module
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Save the kernel version
run: echo "KERNEL_VERSION=$(uname -r)" >> $GITHUB_ENV
- name: Build the kernel module
run: make KERNEL_SRC_DIR="/usr/src/linux-headers-${KERNEL_VERSION}"
working-directory: ci/sro-kmod
- name: Download and install minikube
run: |
wget https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i ./minikube_latest_amd64.deb
- name: Start minikube and wait until CoreDNS is available
run: |
minikube start --driver=docker
kubectl wait --for=condition=available deployment coredns -n kube-system
- name: Build sro-kmod
run: minikube image build -t sro-kmod:local --build-opt build-arg=KERNEL_VERSION=${KERNEL_VERSION} ci/sro-kmod
- name: Build SRO
run: minikube image build -t sro:local .
- uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Install NFD
run: kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.10.1
- name: Deploy SRO
run: make deploy
env:
IMG: sro:local
- name: Set the SRO manager's pull policy to Never
run: kubectl patch deployments.apps -n special-resource-operator special-resource-controller-manager --patch-file ci/patch-sro-manager-pullpolicy.yml
- name: Setup Helm
uses: azure/setup-helm@v1
- name: Create a ConfigMap containing the test chart
run: scripts/make-cm-recipe ci/chart-sro-ci sro-ci
- name: Check that the sro_ci module is not loaded on the node
run: |
if minikube ssh -- lsmod | grep sro_ci; then
echo "Unexpected lsmod output - the module should not be loaded"
exit 1
fi
- name: Create the SpecialResource
run: kubectl apply -f ci/sr-sro-ci.yml
- name: Check that the module gets loaded on the node
run: |
until minikube ssh -- lsmod | grep sro_ci; do
sleep 3
done
timeout-minutes: 1
- name: Remove the SpecialResource
run: kubectl delete -f ci/sr-sro-ci.yml
- name: Check that the module gets unloaded from the node
run: |
until ! minikube ssh -- lsmod | grep sro_ci; do
sleep 3
done
timeout-minutes: 1
- name: Describe the DaemonSet
run: kubectl describe daemonset -n sro-ci sro-ci-driver-container
continue-on-error: true # if the job succeeded, there might not be an sro-ci namespace anymore
if: ${{ always() }}
- name: Describe the Pod
run: kubectl describe pod -n sro-ci sro-ci-driver-container
continue-on-error: true # if the job succeeded, there might not be an sro-ci namespace anymore
if: ${{ always() }}
- name: Collect dmesg
run: sudo dmesg
if: ${{ always() }}
- name: Get all operator logs
run: kubectl logs deployment.apps/special-resource-controller-manager -n special-resource-operator
if: ${{ always() }}