-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem statement
When trying to deploy the metallb
addon (or another addon that depend on it) and there already exists an IPAddressPool
which conflicts with the one to be deployed then the following error is blocking the deployment:
Message: "admission webhook \"ipaddresspoolvalidationwebhook.metallb.io\" denied the request: CIDR \"172.18.0.100/30\" in pool \"ktf-pool\" overlaps with already defined CIDR \"172.18.0.100/30\"",
Reason: "CIDR \"172.18.0.100/30\" in pool \"ktf-pool\" overlaps with already defined CIDR \"172.18.0.100/30\"",
Details: *k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails nil,
Code: 403
type of the error: https://pkg.go.dev/k8s.io/apimachinery/pkg/api/errors#StatusError
relevant piece of code:
kubernetes-testing-framework/pkg/clusters/addons/metallb/metallb.go
Lines 225 to 254 in 05a2a38
_, err = res.Create(ctx, &unstructured.Unstructured{ | |
Object: map[string]interface{}{ | |
"apiVersion": "metallb.io/v1beta1", | |
"kind": "IPAddressPool", | |
"metadata": map[string]string{ | |
"name": addressPoolName, | |
}, | |
"spec": map[string]interface{}{ | |
"addresses": []string{ | |
fmt.Sprintf("%s-%s", ipStart, ipEnd), | |
fmt.Sprintf("%s-%s", ip6Start, ip6End), | |
}, | |
}, | |
}, | |
}, metav1.CreateOptions{}) | |
if err != nil { | |
if errors.IsAlreadyExists(err) { | |
// delete the existing resource and recreate it in another round of loop. | |
err = res.Delete(ctx, addressPoolName, metav1.DeleteOptions{}) | |
} | |
select { | |
case <-time.After(time.Second): | |
lastErr = err | |
continue | |
case <-ctx.Done(): | |
return fmt.Errorf("failed to create metallb.io/v1beta1 IPAddressPool: %w, last error on create: %v", ctx.Err(), lastErr) | |
} | |
} |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working