Skip to content

Commit bbb8fb7

Browse files
committed
CB-22262 Discard local SSD when stopping GCP instances
Depdenencies had to be updated so that DiscardLocalSsd function is available
1 parent 9fe334b commit bbb8fb7

1,057 files changed

Lines changed: 433428 additions & 89565 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ mod-tidy:
8484
@docker run --rm ${USER_NS} -v "${PWD}":/go/src/$(PKG_BASE) -w /go/src/$(PKG_BASE) -e GO111MODULE=on golang:$(GO_VERSION) make _mod-tidy
8585

8686
_mod-tidy:
87-
go mod tidy -v
87+
go mod tidy -compat=$(GO_VERSION) -v
8888
go mod vendor
8989

9090
release: cleanup build

gcp/gcp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ func (p gcpProvider) StopInstances(instances *types.InstanceContainer) []error {
717717
zone := instance.Metadata["zone"]
718718
log.Infof("[GCP] Sending request to stop instance in zone %s : %s", zone, instance.Name)
719719

720-
if _, err := p.computeClient.Instances.Stop(p.projectID, zone, instance.Name).Do(); err != nil {
720+
if _, err := p.computeClient.Instances.Stop(p.projectID, zone, instance.Name).DiscardLocalSsd(true).Do(); err != nil {
721721
errChan <- err
722722
}
723723
}
@@ -1068,7 +1068,7 @@ func (p gcpProvider) getDatabases(aggregator *sqladmin.InstancesListCall) ([]*ty
10681068
for _, databaseInstance := range gDatabaseList.Items {
10691069
instanceName := databaseInstance.Name
10701070

1071-
listOperationCall := p.sqlClient.Operations.List(p.projectID, instanceName)
1071+
listOperationCall := p.sqlClient.Operations.List(p.projectID).Instance(instanceName)
10721072
creationTimeStamp, err := getDatabaseInstanceCreationTimeStamp(listOperationCall, instanceName)
10731073
if err != nil {
10741074
log.Errorf("[GCP] Failed to get the creation timestamp of the DB: %s, err: %s", instanceName, err.Error())

go.mod

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,27 @@ require (
99
github.com/Azure/go-autorest/autorest/azure/auth v0.5.9
1010
github.com/aws/aws-sdk-go v1.29.34
1111
github.com/sirupsen/logrus v1.0.5
12-
github.com/stretchr/testify v1.4.0
12+
github.com/stretchr/testify v1.8.1
1313
github.com/tbruyelle/hipchat-go v0.0.0-20160921153256-749fb9e14beb
14-
golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd
15-
google.golang.org/api v0.0.0-20180717000714-0025a57598c0
16-
gopkg.in/yaml.v2 v2.2.2
14+
golang.org/x/oauth2 v0.8.0
15+
google.golang.org/api v0.128.0
16+
gopkg.in/yaml.v2 v2.2.3
1717
)
1818

1919
require (
20-
cloud.google.com/go v0.25.0 // indirect
20+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
21+
github.com/google/s2a-go v0.1.4 // indirect
22+
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
23+
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
24+
go.opencensus.io v0.24.0 // indirect
25+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
26+
google.golang.org/grpc v1.55.0 // indirect
27+
google.golang.org/protobuf v1.30.0 // indirect
28+
gopkg.in/yaml.v3 v3.0.1 // indirect
29+
)
30+
31+
require (
32+
cloud.google.com/go v0.34.0 // indirect
2133
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
2234
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
2335
github.com/Azure/go-autorest/autorest/adal v0.9.14 // indirect
@@ -27,24 +39,23 @@ require (
2739
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
2840
github.com/Azure/go-autorest/logger v0.2.1 // indirect
2941
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
30-
github.com/davecgh/go-spew v1.1.0 // indirect
42+
github.com/davecgh/go-spew v1.1.1 // indirect
3143
github.com/dimchansky/utfbom v1.1.1 // indirect
3244
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
33-
github.com/golang/protobuf v1.2.0 // indirect
45+
github.com/golang/protobuf v1.5.3 // indirect
3446
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 // indirect
35-
github.com/google/uuid v1.2.0 // indirect
47+
github.com/google/uuid v1.3.0 // indirect
3648
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
3749
github.com/mattn/go-ieproxy v0.0.1 // indirect
3850
github.com/mitchellh/go-homedir v1.1.0 // indirect
3951
github.com/pmezard/go-difflib v1.0.0 // indirect
40-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
41-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
42-
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
43-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
44-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
45-
golang.org/x/text v0.3.3 // indirect
52+
golang.org/x/crypto v0.9.0 // indirect
53+
golang.org/x/net v0.10.0 // indirect
54+
golang.org/x/sys v0.8.0 // indirect
55+
golang.org/x/term v0.8.0 // indirect
56+
golang.org/x/text v0.9.0 // indirect
4657
golang.org/x/time v0.0.0-20220411224347-583f2d630306
47-
google.golang.org/appengine v1.1.0 // indirect
58+
google.golang.org/appengine v1.6.7 // indirect
4859
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
4960
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
5061
)

go.sum

Lines changed: 175 additions & 19 deletions
Large diffs are not rendered by default.

vendor/cloud.google.com/go/compute/metadata/metadata.go

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/LICENSE

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/bypass.go

Lines changed: 90 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/common.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/davecgh/go-spew/spew/dump.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)