mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Clean up static-ip in e2e
This commit is contained in:
parent
e37b7cbde0
commit
7cde81b59c
@ -359,6 +359,14 @@ func (cont *GCEIngressController) deleteAddresses(del bool) string {
|
||||
if err := gcloudDelete("addresses", cont.staticIPName, cont.cloud.ProjectID, "--global"); err == nil {
|
||||
cont.staticIPName = ""
|
||||
}
|
||||
} else {
|
||||
e2eIPs := []compute.Address{}
|
||||
gcloudList("addresses", "e2e-.*", cont.cloud.ProjectID, &e2eIPs)
|
||||
ips := []string{}
|
||||
for _, ip := range e2eIPs {
|
||||
ips = append(ips, ip.Name)
|
||||
}
|
||||
framework.Logf("None of the remaining %d static-ips were created by this e2e: %v", len(ips), strings.Join(ips, ", "))
|
||||
}
|
||||
return msg
|
||||
}
|
||||
@ -605,6 +613,8 @@ func (cont *GCEIngressController) staticIP(name string) string {
|
||||
}
|
||||
framework.Failf("Failed to allocated static ip %v: %v", name, err)
|
||||
}
|
||||
cont.staticIPName = ip.Name
|
||||
framework.Logf("Reserved static ip %v: %v", cont.staticIPName, ip.Address)
|
||||
return ip.Address
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user