Skip to content

Commit

Permalink
Fix ENABLE_IPV6 flag value for dualstack test case
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Chodor <[email protected]>
Change-Id: Idae0ea87fc7d0b74e288cea1ef2857152e3c54a0
  • Loading branch information
marqc committed Feb 8, 2024
1 parent 5ef8eef commit 8e56a82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion scripts/install-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,15 @@ function fillSubnetsInCniSpec {
local SUBNETS_REPLACEMENT=()
local ROUTES_REPLACEMENT=()

local ipv6_subnet_configured="false"

for subnet in $(jq -r '.spec.podCIDRs[]' <<<"$node") ; do
if is_ipv4_range "$subnet" ; then
SUBNETS_REPLACEMENT+=("[{\"subnet\": \"${subnet}\"}]")
ROUTES_REPLACEMENT+=("{\"dst\": \"0.0.0.0/0\"}")
elif is_ipv6_range "$subnet" ; then
POPULATE_IP6TABLES="true"
ipv6_subnet_configured="true"
SUBNETS_REPLACEMENT+=("[{\"subnet\": \"${subnet}\"}]")
ROUTES_REPLACEMENT+=("{\"dst\": \"::/0\"}")
else
Expand All @@ -190,7 +193,7 @@ function fillSubnetsInCniSpec {
done

# Directpath use case
if [ "$ENABLE_IPV6" == "true" ] ; then
if [ "$ENABLE_IPV6" == "true" ] && [ "$ipv6_subnet_configured" == "false" ] ; then
# Directpath adds IPv6 subnet and route derived from host with fixed range
# of /112 even when it is not specified in node's .spec.podCIDRs
if [ -n "${node_ipv6_addr:-}" ] && [ "${node_ipv6_addr}" != "null" ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/testcase/testcase-dualstack-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export ENABLE_CALICO_NETWORK_POLICY=false
export ENABLE_BANDWIDTH_PLUGIN=false
export ENABLE_CILIUM_PLUGIN=false
export ENABLE_MASQUERADE=false
export ENABLE_IPV6=false
export ENABLE_IPV6=true

CNI_SPEC_TEMPLATE=$(cat testdata/spec-template-v2.json)
export CNI_SPEC_TEMPLATE
Expand Down
2 changes: 1 addition & 1 deletion scripts/testcase/testcase-dualstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export ENABLE_CALICO_NETWORK_POLICY=false
export ENABLE_BANDWIDTH_PLUGIN=false
export ENABLE_CILIUM_PLUGIN=false
export ENABLE_MASQUERADE=false
export ENABLE_IPV6=false
export ENABLE_IPV6=true

CNI_SPEC_TEMPLATE=$(cat testdata/spec-template.json)
export CNI_SPEC_TEMPLATE
Expand Down

0 comments on commit 8e56a82

Please sign in to comment.