Skip to content

Commit acd8593

Browse files
Merge pull request #8527 from tsmetana/filestore-destroy-revert
No-jira: Revert "Cleanup GCP Filestore instances on destroy"
2 parents 7534f9b + c99a407 commit acd8593

File tree

5 files changed

+0
-8086
lines changed

5 files changed

+0
-8086
lines changed

pkg/destroy/gcp/filestore.go

Lines changed: 0 additions & 92 deletions
This file was deleted.

pkg/destroy/gcp/gcp.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
resourcemanager "google.golang.org/api/cloudresourcemanager/v3"
1414
"google.golang.org/api/compute/v1"
1515
"google.golang.org/api/dns/v1"
16-
"google.golang.org/api/file/v1"
1716
"google.golang.org/api/googleapi"
1817
"google.golang.org/api/iam/v1"
1918
"google.golang.org/api/option"
@@ -64,7 +63,6 @@ type ClusterUninstaller struct {
6463
dnsSvc *dns.Service
6564
storageSvc *storage.Service
6665
rmSvc *resourcemanager.Service
67-
fileSvc *file.Service
6866

6967
// cpusByMachineType caches the number of CPUs per machine type, used in quota
7068
// calculations on deletion
@@ -149,11 +147,6 @@ func (o *ClusterUninstaller) Run() (*types.ClusterQuota, error) {
149147
return nil, errors.Wrap(err, "failed to create resourcemanager service")
150148
}
151149

152-
o.fileSvc, err = file.NewService(ctx, options...)
153-
if err != nil {
154-
return nil, errors.Wrap(err, "failed to create filestore service")
155-
}
156-
157150
err = wait.PollImmediateInfinite(
158151
time.Second*10,
159152
o.destroyCluster,
@@ -194,7 +187,6 @@ func (o *ClusterUninstaller) destroyCluster() (bool, error) {
194187
{name: "Routers", execute: o.destroyRouters},
195188
{name: "Subnetworks", execute: o.destroySubnetworks},
196189
{name: "Networks", execute: o.destroyNetworks},
197-
{name: "Filestores", execute: o.destroyFilestores},
198190
}}
199191

200192
// create the main Context, so all stages can accept and make context children
@@ -267,18 +259,6 @@ func (o *ClusterUninstaller) clusterLabelOrClusterIDFilter() string {
267259
return fmt.Sprintf("(%s) OR (%s)", o.clusterIDFilter(), o.clusterLabelFilter())
268260
}
269261

270-
func isForbidden(err error) bool {
271-
if err == nil {
272-
return false
273-
}
274-
var ae *googleapi.Error
275-
if errors.As(err, &ae) {
276-
return ae.Code == http.StatusForbidden
277-
}
278-
279-
return false
280-
}
281-
282262
func isNoOp(err error) bool {
283263
if err == nil {
284264
return false

0 commit comments

Comments
 (0)