Skip to content

Commit

Permalink
CB-22262 Discard local SSD when stopping GCP instances
Browse files Browse the repository at this point in the history
Depdenencies had to be updated so that DiscardLocalSsd function is available
  • Loading branch information
Bajzathd committed Jun 21, 2023
1 parent 9fe334b commit bbb8fb7
Show file tree
Hide file tree
Showing 1,057 changed files with 433,428 additions and 89,565 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ mod-tidy:
@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

_mod-tidy:
go mod tidy -v
go mod tidy -compat=$(GO_VERSION) -v
go mod vendor

release: cleanup build
Expand Down
4 changes: 2 additions & 2 deletions gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ func (p gcpProvider) StopInstances(instances *types.InstanceContainer) []error {
zone := instance.Metadata["zone"]
log.Infof("[GCP] Sending request to stop instance in zone %s : %s", zone, instance.Name)

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

listOperationCall := p.sqlClient.Operations.List(p.projectID, instanceName)
listOperationCall := p.sqlClient.Operations.List(p.projectID).Instance(instanceName)
creationTimeStamp, err := getDatabaseInstanceCreationTimeStamp(listOperationCall, instanceName)
if err != nil {
log.Errorf("[GCP] Failed to get the creation timestamp of the DB: %s, err: %s", instanceName, err.Error())
Expand Down
41 changes: 26 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,27 @@ require (
github.com/Azure/go-autorest/autorest/azure/auth v0.5.9
github.com/aws/aws-sdk-go v1.29.34
github.com/sirupsen/logrus v1.0.5
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.8.1
github.com/tbruyelle/hipchat-go v0.0.0-20160921153256-749fb9e14beb
golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd
google.golang.org/api v0.0.0-20180717000714-0025a57598c0
gopkg.in/yaml.v2 v2.2.2
golang.org/x/oauth2 v0.8.0
google.golang.org/api v0.128.0
gopkg.in/yaml.v2 v2.2.3
)

require (
cloud.google.com/go v0.25.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
go.opencensus.io v0.24.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
cloud.google.com/go v0.34.0 // indirect
github.com/Azure/azure-pipeline-go v0.2.3 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.14 // indirect
Expand All @@ -27,24 +39,23 @@ require (
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/mattn/go-ieproxy v0.0.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.0.0-20220411224347-583f2d630306
google.golang.org/appengine v1.1.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
)
194 changes: 175 additions & 19 deletions go.sum

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions vendor/cloud.google.com/go/compute/metadata/metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/davecgh/go-spew/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

187 changes: 90 additions & 97 deletions vendor/github.com/davecgh/go-spew/spew/bypass.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/davecgh/go-spew/spew/common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions vendor/github.com/davecgh/go-spew/spew/dump.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bbb8fb7

Please sign in to comment.