Skip to content

Commit 50f54f3

Browse files
ktsakalozosHomayoonAlimohammadi
authored andcommitted
Strict patch
1 parent 11ccb72 commit 50f54f3

File tree

14 files changed

+557
-20
lines changed

14 files changed

+557
-20
lines changed

.github/workflows/build-snap.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Build and test MicroK8s snap
22

33
on:
4-
pull_request:
5-
branches: [1.33]
4+
- push
5+
- pull_request
66

77
jobs:
88
build:
@@ -53,7 +53,7 @@ jobs:
5353
uses: ./.github/actions/test-prep
5454
- name: Running upgrade path test
5555
run: |
56-
sudo -E UPGRADE_MICROK8S_FROM=1.33/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade-path.py
56+
sudo -E STRICT=yes UPGRADE_MICROK8S_FROM=1.33-strict/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade-path.py
5757
5858
test-addons-core:
5959
name: Test core addons
@@ -74,7 +74,10 @@ jobs:
7474
run: |
7575
set -x
7676
sudo snap install build/microk8s.snap --classic --dangerous
77+
sudo /snap/microk8s/current/connect-all-interfaces.sh
78+
sudo microk8s status --wait-ready --timeout 300
7779
./tests/smoke-test.sh
80+
export STRICT="yes"
7881
# The GitHub runner is using the 10.1.0.0/16 CIDR, which would conflict with
7982
# kube-ovn's default POD_CIDR. They have to be different.
8083
export POD_CIDR="10.200.0.0/16"
@@ -99,8 +102,11 @@ jobs:
99102
run: |
100103
set -x
101104
sudo snap install build/microk8s.snap --classic --dangerous
105+
sudo /snap/microk8s/current/connect-all-interfaces.sh
106+
sudo microk8s status --wait-ready --timeout 300
102107
sudo microk8s enable community
103108
export UNDER_TIME_PRESSURE=${UNDER_TIME_PRESSURE@u}
109+
export STRICT="yes"
104110
sudo -E bash -c "cd /var/snap/microk8s/common/addons/community/; pytest -s -ra ./tests/"
105111
106112
test-addons-core-upgrade:
@@ -119,7 +125,8 @@ jobs:
119125
run: |
120126
set -x
121127
export UNDER_TIME_PRESSURE=${UNDER_TIME_PRESSURE@u}
122-
sudo -E bash -c "UPGRADE_MICROK8S_FROM=1.33/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade.py"
128+
export STRICT="yes"
129+
sudo -E bash -c "UPGRADE_MICROK8S_FROM=1.33-strict/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade.py"
123130
124131
test-cluster-agent:
125132
name: Cluster agent health check
@@ -135,6 +142,7 @@ jobs:
135142
run: |
136143
set -x
137144
sudo snap install build/microk8s.snap --classic --dangerous
145+
sudo /snap/microk8s/current/connect-all-interfaces.sh
138146
sudo -E bash -c "pytest -s ./tests/test-cluster-agent.py"
139147
140148
test-airgap:

docs/build.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,16 @@ lxc file pull test-build/root/microk8s/microk8s_v1.9.6_amd64.snap .
8383
After copying it, you can install it with:
8484

8585
```shell
86-
snap install microk8s_*_amd64.snap --classic --dangerous
86+
snap install microk8s_*_amd64.snap --dangerous
8787
```
8888

89+
Finally, you need to connect the interfaces. To this end you can use the `connect-all-interfaces.sh`:
90+
91+
```shell
92+
sudo /snap/microk8s/current/connect-all-interfaces.sh
93+
```
94+
95+
8996
## Assembling the Calico CNI manifest
9097

9198
The calico CNI manifest can be found under `upgrade-scripts/000-switch-to-calico/resources/calico.yaml`.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -u
4+
5+
if [ "$EUID" -ne 0 ]
6+
then echo "Please run this script as root."
7+
exit 1
8+
fi
9+
10+
for i in account-control \
11+
docker-privileged \
12+
kubernetes-support \
13+
k8s-journald \
14+
k8s-kubelet \
15+
k8s-kubeproxy \
16+
dot-kube \
17+
network \
18+
network-bind \
19+
network-control \
20+
network-observe \
21+
firewall-control \
22+
process-control \
23+
kernel-module-observe \
24+
mount-observe \
25+
hardware-observe \
26+
system-observe \
27+
home \
28+
opengl \
29+
home-read-all \
30+
login-session-observe \
31+
log-observe \
32+
dot-config-helm
33+
do
34+
snap connect microk8s:$i
35+
done
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
cp "$SNAP/content-interface/launcher/configuration/"*.yaml "$SNAP_COMMON/etc/launcher/" || true
6+
cp "$SNAP/content-interface/launcher/sideload/"*.tar "$SNAP_COMMON/etc/sideload/" || true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux

snap/hooks/install

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ if ! is_strict && cat /proc/1/environ | grep "container=lxc" &> /dev/null
2525
fi
2626
fi
2727

28-
cp -r --preserve=mode ${SNAP}/default-args ${SNAP_DATA}/args
28+
mkdir -p ${SNAP_DATA}/args
29+
cp -r --preserve=mode ${SNAP}/default-args/* ${SNAP_DATA}/args
2930
mv ${SNAP_DATA}/args/certs.d/localhost__32000 ${SNAP_DATA}/args/certs.d/localhost:32000
3031

3132
SNAP_DATA_CURRENT=`echo "${SNAP_DATA}" | sed -e "s,${SNAP_REVISION},current,"`

0 commit comments

Comments
 (0)