Skip to content

Commit 8fa2544

Browse files
authored
test: fix k3s images detection method (cloudnative-pg#2053)
Also fix the order of arguments in setup-cluster.sh call to support *BSD getopt. Closes: cloudnative-pg#2020 Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent 4f39fae commit 8fa2544

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

hack/e2e/run-e2e-k3d.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ cleanup() {
5353

5454
main() {
5555
# Call to setup-cluster.sh script
56-
"${HACK_DIR}/setup-cluster.sh" create -r
56+
"${HACK_DIR}/setup-cluster.sh" -r create
5757

5858
trap cleanup EXIT
5959

hack/e2e/run-e2e-kind.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ cleanup() {
5353

5454
main() {
5555
# Call to setup-cluster.sh script
56-
"${HACK_DIR}/setup-cluster.sh" create -r
56+
"${HACK_DIR}/setup-cluster.sh" -r create
5757

5858
trap cleanup EXIT
5959

hack/setup-cluster.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ create_cluster_k3d() {
198198
local cluster_name=$2
199199

200200
local latest_k3s_tag
201-
latest_k3s_tag=$(curl -sL "https://registry.hub.docker.com/v1/repositories/rancher/k3s/tags" |
202-
jq -r '.[].name' | grep -- "^${k8s_version//./\\.}"'\+-k3s[0-9]$' | tail -n 1)
201+
latest_k3s_tag=$(k3d version list k3s | grep -- "^${k8s_version//./\\.}"'\+-k3s[0-9]$' | tail -n 1)
203202

204203
local volumes=()
205204
if [ -n "${DOCKER_REGISTRY_MIRROR:-}" ] || [ -n "${ENABLE_REGISTRY:-}" ]; then

0 commit comments

Comments
 (0)