talos/hack/test/e2e-iso.sh
Florian Klink a50c42980f
fix: use #!/usr/bin/env bash as shebang instead of #!/bin/bash
This will fix running these scripts on distros without /bin/bash, but
where bash is in $PATH, such as NixOS.

Currently, `make fmt` otherwise fails to run:

```
make[3]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos'
sh: ./hack/fix-artifacts.sh: /bin/bash: bad interpreter: No such file or directory
make[2]: *** [Makefile:163: local-fmt-protobuf] Error 126
make[2]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos'
make[1]: *** [Makefile:274: fmt-protobuf] Error 2
make[1]: Leaving directory '/home/flokli/dev/numtide/manifoldfinance/talos'
make: *** [Makefile:277: fmt] Error 2
```

Signed-off-by: Florian Klink <flokli@flokli.de>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-01-25 23:11:39 +03:00

41 lines
894 B
Bash
Executable File

#!/usr/bin/env bash
set -eoux pipefail
source ./hack/test/e2e.sh
PROVISIONER=qemu
CLUSTER_NAME=e2e-iso
NODE="172.20.2.2"
function create_cluster {
build_registry_mirrors
"${TALOSCTL}" cluster create \
--provisioner="${PROVISIONER}" \
--name="${CLUSTER_NAME}" \
--kubernetes-version=${KUBERNETES_VERSION} \
--iso-path=${ARTIFACTS}/talos-amd64.iso \
--masters=1 \
--workers=0 \
--mtu=1450 \
--memory=2048 \
--cpus=2.0 \
--cidr=172.20.2.0/24 \
--with-apply-config \
--install-image=${REGISTRY:-ghcr.io}/talos-systems/installer:${TAG} \
--cni-bundle-url=${ARTIFACTS}/talosctl-cni-bundle-'${ARCH}'.tar.gz \
${REGISTRY_MIRROR_FLAGS}
"${TALOSCTL}" config node "${NODE}"
}
function destroy_cluster() {
"${TALOSCTL}" cluster destroy --name "${CLUSTER_NAME}" --provisioner "${PROVISIONER}"
}
create_cluster
sleep 5
destroy_cluster