Skip to content

Commit

Permalink
Strict patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsakalozos authored and neoaggelos committed Sep 23, 2022
1 parent c7a7188 commit befc4a4
Show file tree
Hide file tree
Showing 10 changed files with 598 additions and 67 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/build-snap.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: Build and test MicroK8s snap

on:
push:
branches:
- master
pull_request:
branches:
- master
- pull_request
- push

jobs:
build:
Expand Down Expand Up @@ -60,7 +56,7 @@ jobs:
path: build
- name: Running upgrade path test
run: |
sudo -E UPGRADE_MICROK8S_FROM=latest/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade-path.py
sudo -E UPGRADE_MICROK8S_FROM=latest/edge/strict UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade-path.py
test-addons-core:
name: Test core addons
Expand All @@ -83,13 +79,15 @@ jobs:
with:
name: microk8s.snap
path: build
- name: Running addons tests
- name: Running addons tests in strict mode
run: |
set -x
sudo snap install build/microk8s.snap --classic --dangerous
sudo snap install build/microk8s.snap --dangerous
sudo ./tests/connect-all-interfaces.sh
sudo microk8s status --wait-ready --timeout 300
./tests/smoke-test.sh
export UNDER_TIME_PRESSURE="True"
export SKIP_PROMETHEUS="False"
export STRICT="yes"
sudo -E bash -c "cd /var/snap/microk8s/common/addons/core/tests; pytest -s -ra test-addons.py"
test-addons-community:
Expand Down Expand Up @@ -117,7 +115,11 @@ jobs:
run: |
set -x
sudo snap install build/microk8s.snap --classic --dangerous
sudo ./tests/connect-all-interfaces.sh
sudo microk8s status --wait-ready --timeout 300
sudo microk8s enable community
export UNDER_TIME_PRESSURE="True"
export STRICT="yes"
sudo -E bash -c "cd /var/snap/microk8s/common/addons/community/tests; pytest -s -ra test-addons.py"
test-addons-core-upgrade:
Expand Down Expand Up @@ -145,4 +147,5 @@ jobs:
run: |
set -x
export UNDER_TIME_PRESSURE="True"
sudo -E bash -c "UPGRADE_MICROK8S_FROM=latest/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade.py"
export STRICT="yes"
sudo -E bash -c "UPGRADE_MICROK8S_FROM=latest/edge/strict UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade.py"
9 changes: 8 additions & 1 deletion docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ lxc file pull test-build/root/microk8s/microk8s_v1.9.6_amd64.snap .
After copying it, you can install it with:

```shell
snap install microk8s_*_amd64.snap --classic --dangerous
sudo snap install microk8s_latest_amd64.snap --dangerous
```

Finally, you need to connect the interfaces. To this end you can use the `connect-all-interfaces.sh` under the `tests` directory:

```shell
sudo tests/connect-all-interfaces.sh
```


## Assembling the Calico CNI manifest

The calico CNI manifest can be found under `upgrade-scripts/000-switch-to-calico/resources/calico.yaml`.
Expand Down
2 changes: 1 addition & 1 deletion scripts/wrappers/common/cluster/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def try_set_file_permissions(file):

os.chmod(file, 0o660)
try:
shutil.chown(file, group="microk8s")
shutil.chown(file, group="snap_microk8s")
except LookupError:
# not setting the group means only the current user can access the file
pass
Expand Down
Loading

0 comments on commit befc4a4

Please sign in to comment.