mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-01 06:10:17 +00:00
Update e2e tests to pipe in clusterID for gce resource cleanup
This commit is contained in:
@@ -5124,7 +5124,7 @@ func (p *E2ETestNodePreparer) CleanupNodes() error {
|
||||
// CleanupGCEResources cleans up GCE Service Type=LoadBalancer resources with
|
||||
// the given name. The name is usually the UUID of the Service prefixed with an
|
||||
// alpha-numeric character ('a') to work around cloudprovider rules.
|
||||
func CleanupGCEResources(loadBalancerName, zone string) (retErr error) {
|
||||
func CleanupGCEResources(c clientset.Interface, loadBalancerName, zone string) (retErr error) {
|
||||
gceCloud, err := GetGCECloud()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -5155,7 +5155,12 @@ func CleanupGCEResources(loadBalancerName, zone string) (retErr error) {
|
||||
if hc != nil {
|
||||
hcNames = append(hcNames, hc.Name)
|
||||
}
|
||||
if err := gceCloud.DeleteExternalTargetPoolAndChecks(loadBalancerName, region, hcNames...); err != nil &&
|
||||
clusterID, err := GetClusterID(c)
|
||||
if err != nil {
|
||||
retErr = fmt.Errorf("%v\n%v", retErr, err)
|
||||
return
|
||||
}
|
||||
if err := gceCloud.DeleteExternalTargetPoolAndChecks(loadBalancerName, region, clusterID, hcNames...); err != nil &&
|
||||
!IsGoogleAPIHTTPErrorCode(err, http.StatusNotFound) {
|
||||
retErr = fmt.Errorf("%v\n%v", retErr, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user