talos/hack/test/e2e-docker.sh
Orzelius ea8289f550
feat: add a user facing docker command
Add a user facing cluster create docker command with the following changes:
* renamed flags for simplicity and uniformity
* removed the bulk of the unnecessary flags

Other changes:
* split internal logic such that it's separate from the qemu cluster create logic
* refactor internal code aiming for simplicity
Ä change drives flag behavior in anticipation of the user facing create-qemu command
* extract code into separate functions
* add some unit tests
* remove the docker support from the cluster create command (docker is only supported via the user-facing create-docker command)

Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
2025-08-15 19:45:21 +09:00

35 lines
809 B
Bash
Executable File

#!/usr/bin/env bash
set -eou pipefail
source ./hack/test/e2e.sh
PROVISIONER=docker
CLUSTER_NAME=e2e-${PROVISIONER}
function create_cluster {
build_registry_mirrors
"${TALOSCTL}" cluster create docker \
--name="${CLUSTER_NAME}" \
--kubernetes-version=${KUBERNETES_VERSION} \
--image="${IMAGE}" \
--workers=1 \
--mtu=1430 \
"${REGISTRY_MIRROR_FLAGS[@]}"
"${TALOSCTL}" config node 10.5.0.2
}
function destroy_cluster() {
"${TALOSCTL}" cluster destroy --name "${CLUSTER_NAME}" --provisioner "${PROVISIONER}" --save-support-archive-path=/tmp/support-${CLUSTER_NAME}.zip
}
trap destroy_cluster SIGINT EXIT
create_cluster
get_kubeconfig
${KUBECTL} config set-cluster e2e-docker --server https://10.5.0.2:6443
run_talos_integration_test_docker
run_kubernetes_integration_test