Skip to content

fix: always use ipv4 address from docker kind network#1290

Merged
EItanya merged 1 commit intomainfrom
eitanya/fix-e2e-test
Feb 12, 2026
Merged

fix: always use ipv4 address from docker kind network#1290
EItanya merged 1 commit intomainfrom
eitanya/fix-e2e-test

Conversation

@EItanya
Copy link
Contributor

@EItanya EItanya commented Feb 12, 2026

No description provided.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Copilot AI review requested due to automatic review settings February 12, 2026 18:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the extraction of IPv4 addresses from the Docker Kind network in the CI workflow. The issue occurs when Docker Kind networks have both IPv4 and IPv6 gateway configurations, and the previous command would concatenate all gateway values without proper filtering or separation, potentially returning an invalid IP address.

Changes:

  • Modified the docker network inspect command to properly filter and extract only IPv4 gateway addresses by adding newline separation, grep filtering for IPv4 pattern, and selecting the first match

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

run: |
# Get the Kind network gateway IP that pods can reach
HOST_IP=$(docker network inspect kind -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}')
HOST_IP=$(docker network inspect kind -f '{{range .IPAM.Config}}{{if .Gateway}}{{.Gateway}}{{"\n"}}{{end}}{{end}}' | grep -E '^[0-9]+\.' | head -1)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command to extract HOST_IP could fail silently if no IPv4 gateway is found. If the grep or head commands return empty results, HOST_IP will be empty, which could cause the e2e tests to fail with unclear error messages. Consider adding validation after this line to ensure HOST_IP is not empty and fail with a clear error message if it is. For example: if [ -z "$HOST_IP" ]; then echo "Failed to detect IPv4 gateway from Kind network" && exit 1; fi

Suggested change
HOST_IP=$(docker network inspect kind -f '{{range .IPAM.Config}}{{if .Gateway}}{{.Gateway}}{{"\n"}}{{end}}{{end}}' | grep -E '^[0-9]+\.' | head -1)
HOST_IP=$(docker network inspect kind -f '{{range .IPAM.Config}}{{if .Gateway}}{{.Gateway}}{{"\n"}}{{end}}{{end}}' | grep -E '^[0-9]+\.' | head -1)
if [ -z "$HOST_IP" ]; then
echo "Failed to detect IPv4 gateway from Kind network" >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
@EItanya EItanya merged commit dce1702 into main Feb 12, 2026
22 checks passed
@EItanya EItanya deleted the eitanya/fix-e2e-test branch February 12, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants