Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metallb setup fails in Kind action #446

Closed
skonto opened this issue Jun 12, 2024 · 3 comments · Fixed by #448
Closed

metallb setup fails in Kind action #446

skonto opened this issue Jun 12, 2024 · 3 comments · Fixed by #448

Comments

@skonto
Copy link
Contributor

skonto commented Jun 12, 2024

See here. This probably started failing on ubuntu-latest (there is a runner image update happening) due to some docker upgrade?

Error from server (parsing address pool config: invalid CIDR "fc00:f853:ccd:e793::/64.255.1-fc00:f853:ccd:e793::/64.255.250" in pool "config": invalid IP range "fc00:f853:ccd:e793::/64.255.1-fc00:f853:ccd:e793::/64.255.250": invalid start IP "fc00:f853:ccd:e793::/64.255.1"): error when creating "./metallb-crds.yaml": admission webhook "ipaddresspoolvalidationwebhook.metallb.io" denied the request: parsing address pool config: invalid CIDR "fc00:f853:ccd:e793::/64.255.1-fc00:f853:ccd:e793::/64.255.250" in pool "config": invalid IP range "fc00:f853:ccd:e793::/64.255.1-fc00:f853:ccd:e793::/64.255.250": invalid start IP "fc00:f853:ccd:e793::/64.255.1"

Getting the net config is not valid anymore as it needs to use the second index.
The following should do the trick (tested locally), not sure about compatibility across envs:

"$(docker network inspect kind -f '{{.IPAM.Config}}' |  grep -Po '(\d+\.){3}\d+' | head -n 1 | cut -d '.' -f1,2)"
@ReToCode
Copy link
Contributor

@skonto tested on MacOS, does not work there:

grep: invalid option -- P

But should not be relevant, as this is only used on GH actions anyway. Alternative could be to use jq (which is included in the GH runner images)

network=$(docker network inspect kind | jq -r '.[0].IPAM.Config[] | select(.Subnet | test("^[0-9]+\\.")) | .Subnet' | cut -d '.' -f1,2)

Tested here.

@skonto do you want to PR your changes to fix this?

@skonto
Copy link
Contributor Author

skonto commented Jun 13, 2024

-P is for gnu grep. Yeah I thought about jq bu wast not sure if all runner images have it, as probably the repo is used elsewhere, besides Serving. It seems they have it with some version diff.

@skonto
Copy link
Contributor Author

skonto commented Jun 13, 2024

Also this should work:

docker network inspect kind -f '{{json .}}' | jq -r '.IPAM.Config.[].Subnet | select(. | contains("::") | not)' |  cut -d '.' -f1,2

or

docker network inspect kind -f '{{json .}}' | jq -r '.IPAM.Config.[].Subnet | select(. | test("^[0-9]+\\."))' |  cut -d '.' -f1,2

I will go with the latter, I will create a PR shortly.

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 a pull request may close this issue.

2 participants