From a76fe6bd5db0d0191525631250d3445cd6495f46 Mon Sep 17 00:00:00 2001 From: Utku Ozdemir Date: Wed, 3 Jul 2024 22:35:04 +0200 Subject: [PATCH] fix(ci): skip ipv6 subnets when detecting kind cidr for metallb Signed-off-by: Utku Ozdemir --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fca53def5..cd95f83c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,7 +113,8 @@ jobs: run: | MANIFESTS_PATH=/tmp/metallb-manifests.yaml - ADDRESS_RANGE_PREFIX=$(docker network inspect -f '{{(index .IPAM.Config 0).Subnet}}' kind | cut -d. -f1-3) + # Find the first IPv4 subnet of kind, e.g., 172.18.0.0/16, then trim it to remove last octet, e.g., 172.18.0 + ADDRESS_RANGE_PREFIX=$(docker network inspect -f json kind | jq -r '.[0].IPAM.Config | map(select(.Subnet | test("^[0-9]+\\."))) | .[0].Subnet | split("/")[0] | split(".")[:3] | join(".")') export ADDRESS_RANGE=${ADDRESS_RANGE_PREFIX}.240-${ADDRESS_RANGE_PREFIX}.255 envsubst < test/metallb-manifests.yaml > $MANIFESTS_PATH