Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ jobs:
- archlinux.yaml
- opensuse.yaml
- docker.yaml
- k8s.yaml
- ../hack/test-templates/alpine-iso-9p-writable.yaml # Covers alpine-iso.yaml
- ../hack/test-templates/net-user-v2.yaml
- ../hack/test-templates/test-misc.yaml # TODO: merge net-user-v2 into test-misc
Expand Down
26 changes: 23 additions & 3 deletions hack/test-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ declare -A CHECKS=(
["systemd-strict"]="1"
["mount-home"]="1"
["container-engine"]="1"
["k8s"]=""
["restart"]="1"
# snapshot tests are too flaky (especially with archlinux)
["snapshot-online"]=""
Expand All @@ -63,6 +64,12 @@ declare -A CHECKS=(
["ssh-over-vsock"]=""
)

clear_checks() {
for k in "${!CHECKS[@]}"; do
CHECKS["$k"]=""
done
}

case "$NAME" in
"default")
# CI failure:
Expand All @@ -76,9 +83,10 @@ case "$NAME" in
CHECKS["container-engine"]=
[ "$NAME" = "alpine-iso-9p-writable" ] && CHECKS["mount-path-with-spaces"]="1"
;;
"k3s")
ERROR "File \"$FILE\" is not testable with this script"
exit 1
"k0s" | "k3s" | "k8s")
# Disable all checks except k8s
clear_checks
CHECKS["k8s"]="1"
;;
"fedora")
WARNING "Relaxing systemd tests for fedora (For avoiding CI failure)"
Expand Down Expand Up @@ -431,6 +439,18 @@ if [[ -n ${CHECKS["container-engine"]} ]]; then
fi
fi

if [[ -n ${CHECKS["k8s"]} ]]; then
INFO "Testing Kubernetes"
set -x
limactl shell "$NAME" kubectl get nodes -o wide
limactl shell "$NAME" kubectl create deployment nginx --image="${nginx_image}"
limactl shell "$NAME" kubectl create service nodeport nginx --node-port=31080 --tcp=80:80
timeout 3m bash -euxc "until curl -f --retry 30 --retry-connrefused http://127.0.0.1:31080; do sleep 3; done"
limactl shell "$NAME" kubectl delete service nginx
limactl shell "$NAME" kubectl delete deployment nginx
set +x
fi

if [[ -n ${CHECKS["port-forwards"]} ]]; then
INFO "Testing port forwarding rules using netcat"
set -x
Expand Down
2 changes: 1 addition & 1 deletion templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Container orchestration:
- [`faasd`](./faasd.yaml): [Faasd](https://docs.openfaas.com/deployment/edge/)
- [`k0s`](./k0s.yaml): [k0s](https://k0sproject.io/) Zero Friction Kubernetes
- [`k3s`](./k3s.yaml): Kubernetes via k3s
- [`k8s`](./k8s.yaml): Kubernetes via kubeadm
- [`k8s`](./k8s.yaml): Kubernetes via kubeadm
- [`experimental/u7s`](./experimental/u7s.yaml): [Usernetes](https://github.com/rootless-containers/usernetes): Rootless Kubernetes

Optional feature enablers:
Expand Down