diff --git a/.ci/magician/cmd/vcr_cassette_update.go b/.ci/magician/cmd/vcr_cassette_update.go index 54fcdc42b188..b4f68198d566 100644 --- a/.ci/magician/cmd/vcr_cassette_update.go +++ b/.ci/magician/cmd/vcr_cassette_update.go @@ -123,8 +123,8 @@ func execVCRCassetteUpdate(buildID, today string, rnr ExecRunner, ctlr *source.C // main cassettes backup // incase nightly run goes wrong. this will be used to restore the cassettes cassettePath := vt.CassettePath(provider.Beta) - args := []string{"-m", "-q", "cp", filepath.Join(cassettePath, "*"), bucketPrefix + "/main_cassettes_backup/fixtures/"} - if _, err := rnr.Run("gsutil", args, nil); err != nil { + args := []string{"storage", "cp", filepath.Join(cassettePath, "*"), bucketPrefix + "/main_cassettes_backup/fixtures/"} + if _, err := rnr.Run("gcloud", args, nil); err != nil { return fmt.Errorf("error backup cassettes: %w", err) } @@ -222,18 +222,18 @@ func execVCRCassetteUpdate(buildID, today string, rnr ExecRunner, ctlr *source.C } func uploadLogsToGCS(src, dest string, rnr ExecRunner) (string, error) { - return uploadToGCS(src, dest, []string{"-h", "Content-Type:text/plain", "-q", "cp", "-r"}, rnr) + return uploadToGCS(src, dest, []string{"storage", "cp", "--content-type=text/plain", "--recursive"}, rnr) } func uploadCassettesToGCS(src, dest string, rnr ExecRunner) (string, error) { - return uploadToGCS(src, dest, []string{"-m", "-q", "cp"}, rnr) + return uploadToGCS(src, dest, []string{"storage", "cp"}, rnr) } func uploadToGCS(src, dest string, opts []string, rnr ExecRunner) (string, error) { fmt.Printf("uploading from %s to %s\n", src, dest) args := append(opts, src, dest) - fmt.Println("gsutil", args) - return rnr.Run("gsutil", args, nil) + fmt.Println("gcloud", args) + return rnr.Run("gcloud", args, nil) } func formatVCRCassettesUpdateReplaying(data vcrCassetteUpdateReplayingResult) (string, error) { diff --git a/.ci/magician/cmd/vcr_merge.go b/.ci/magician/cmd/vcr_merge.go index adeb6a507322..55d0d7c5a31e 100644 --- a/.ci/magician/cmd/vcr_merge.go +++ b/.ci/magician/cmd/vcr_merge.go @@ -20,7 +20,7 @@ var vcrMergeCmd = &cobra.Command{ It then performs the following operations: 1. Get the latest closed PR matching the reference commit SHA. - 2. Run gsutil to list, copy, and remove the vcr cassettes fixtures. + 2. Run gcloud storage to list, copy, and remove the vcr cassettes fixtures. `, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -88,11 +88,12 @@ func mergeCassettes(basePath, baseBranch, prPath string, runner source.Runner) { func listCassettes(path string, runner source.Runner) error { lsArgs := []string{ + "storage", "ls", path, } - fmt.Println("Running command: ", "gsutil", lsArgs) - ret, err := runner.Run("gsutil", lsArgs, nil) + fmt.Println("Running command: ", "gcloud", lsArgs) + ret, err := runner.Run("gcloud", lsArgs, nil) if err != nil { return err } @@ -102,26 +103,26 @@ func listCassettes(path string, runner source.Runner) error { func cpCassettes(src, dest string, runner source.Runner) { cpArgs := []string{ - "-m", + "storage", "cp", src, dest, } - fmt.Println("Running command: ", "gsutil", cpArgs) - if _, err := runner.Run("gsutil", cpArgs, nil); err != nil { + fmt.Println("Running command: ", "gcloud", cpArgs) + if _, err := runner.Run("gcloud", cpArgs, nil); err != nil { fmt.Println("Error in copy: ", err) } } func rmCassettes(dest string, runner source.Runner) { rmArgs := []string{ - "-m", + "storage", "rm", - "-r", + "--recursive", dest, } - fmt.Println("Running command: ", "gsutil", rmArgs) - if _, err := runner.Run("gsutil", rmArgs, nil); err != nil { + fmt.Println("Running command: ", "gcloud", rmArgs) + if _, err := runner.Run("gcloud", rmArgs, nil); err != nil { fmt.Println("Error in remove: ", err) } } diff --git a/.ci/magician/cmd/vcr_merge_eap.go b/.ci/magician/cmd/vcr_merge_eap.go index 2c6d68436454..36d40b89ebdd 100644 --- a/.ci/magician/cmd/vcr_merge_eap.go +++ b/.ci/magician/cmd/vcr_merge_eap.go @@ -18,7 +18,7 @@ var vcrMergeEapCmd = &cobra.Command{ 1. CL number It then performs the following operations: - 1. Run gsutil to list, copy, and remove the vcr cassettes fixtures. + 1. Run gcloud storage to list, copy, and remove the vcr cassettes fixtures. `, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/.ci/magician/cmd/vcr_merge_test.go b/.ci/magician/cmd/vcr_merge_test.go index cb9d6d3ba0b3..2eb0c5cdddc8 100644 --- a/.ci/magician/cmd/vcr_merge_test.go +++ b/.ci/magician/cmd/vcr_merge_test.go @@ -22,12 +22,12 @@ func TestExecVCRMerge(t *testing.T) { baseBranch: "main", commitSha: "sha", calledMethods: []string{ - "gsutil ls gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/", - "gsutil -m cp gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/fixtures/", - "gsutil -m rm -r gs://ci-vcr-cassettes/refs/heads/auto-pr-123/", - "gsutil ls gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/", - "gsutil -m cp gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/beta/fixtures/", - "gsutil -m rm -r gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/", + "gcloud storage ls gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/", + "gcloud storage cp gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/fixtures/", + "gcloud storage rm --recursive gs://ci-vcr-cassettes/refs/heads/auto-pr-123/", + "gcloud storage ls gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/", + "gcloud storage cp gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/beta/fixtures/", + "gcloud storage rm --recursive gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/", }, }, { @@ -35,12 +35,12 @@ func TestExecVCRMerge(t *testing.T) { baseBranch: "test-branch", commitSha: "sha", calledMethods: []string{ - "gsutil ls gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/", - "gsutil -m cp gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/refs/branches/test-branch/fixtures/", - "gsutil -m rm -r gs://ci-vcr-cassettes/refs/heads/auto-pr-123/", - "gsutil ls gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/", - "gsutil -m cp gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/beta/refs/branches/test-branch/fixtures/", - "gsutil -m rm -r gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/", + "gcloud storage ls gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/", + "gcloud storage cp gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/refs/branches/test-branch/fixtures/", + "gcloud storage rm --recursive gs://ci-vcr-cassettes/refs/heads/auto-pr-123/", + "gcloud storage ls gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/", + "gcloud storage cp gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/* gs://ci-vcr-cassettes/beta/refs/branches/test-branch/fixtures/", + "gcloud storage rm --recursive gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/", }, }, { @@ -54,8 +54,8 @@ func TestExecVCRMerge(t *testing.T) { lsReturnedError: true, baseBranch: "main", calledMethods: []string{ - "gsutil ls gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/", - "gsutil ls gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/", + "gcloud storage ls gs://ci-vcr-cassettes/refs/heads/auto-pr-123/fixtures/", + "gcloud storage ls gs://ci-vcr-cassettes/beta/refs/heads/auto-pr-123/fixtures/", }, }, } diff --git a/mmv1/third_party/terraform/.teamcity/components/builds/build_steps.kt b/mmv1/third_party/terraform/.teamcity/components/builds/build_steps.kt index 9216b59ab694..31608cf6b3ca 100644 --- a/mmv1/third_party/terraform/.teamcity/components/builds/build_steps.kt +++ b/mmv1/third_party/terraform/.teamcity/components/builds/build_steps.kt @@ -160,7 +160,7 @@ fun BuildSteps.saveArtifactsToGCS() { fi # Copy logs to GCS - gsutil -m cp %teamcity.build.checkoutDir%/debug* gs://teamcity-logs/${'$'}{FOLDER}/%env.BUILD_NUMBER%/ + gcloud storage cp %teamcity.build.checkoutDir%/debug* gs://teamcity-logs/${'$'}{FOLDER}/%env.BUILD_NUMBER%/ # Cleanup rm google-account.json diff --git a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go index 32d0d91a770f..a0750d10e771 100644 --- a/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go +++ b/mmv1/third_party/terraform/services/dataproc/resource_dataproc_cluster_test.go @@ -2202,7 +2202,7 @@ resource "google_storage_bucket_object" "init_script" { content = <> /tmp/%s -gsutil cp /tmp/%s ${google_storage_bucket.init_bucket.url} +gcloud storage cp /tmp/%s ${google_storage_bucket.init_bucket.url} EOL } diff --git a/mmv1/third_party/terraform/services/storage/data_source_storage_object_signed_url_internal_test.go b/mmv1/third_party/terraform/services/storage/data_source_storage_object_signed_url_internal_test.go index 1137b739bc4f..56f8cc6c57e2 100644 --- a/mmv1/third_party/terraform/services/storage/data_source_storage_object_signed_url_internal_test.go +++ b/mmv1/third_party/terraform/services/storage/data_source_storage_object_signed_url_internal_test.go @@ -24,9 +24,9 @@ const fakeCredentials = `{ } ` -// The following values are derived from the output of the `gsutil signurl` command. +// The following values are derived from the output of the `gcloud storage sign-url` command. // i.e. -// gsutil signurl fake_creds.json gs://tf-test-bucket-6159205297736845881/path/to/file +// gcloud storage sign-url --private-key-file=fake_creds.json gs://tf-test-bucket-6159205297736845881/path/to/file // URL HTTP Method Expiration Signed URL // gs://tf-test-bucket-6159205297736845881/path/to/file GET 2016-08-12 14:03:30 https://storage.googleapis.com/tf-test-bucket-6159205297736845881/path/to/file?GoogleAccessId=user@gcp-project.iam.gserviceaccount.com&Expires=1470967410&Signature=JJvE2Jc%2BeoagyS1qRACKBGUkgLkKjw7cGymHhtB4IzzN3nbXDqr0acRWGy0%2BEpZ3HYNDalEYsK0lR9Q0WCgty5I0JKmPIuo9hOYa1xTNH%2B22xiWsekxGV%2FcA9FXgWpi%2BFt7fBmMk4dhDe%2BuuYc7N79hd0FYuSBNW1Wp32Bluoe4SNkNAB%2BuIDd9KqPzqs09UAbBoz2y4WxXOQnRyR8GAfb8B%2FDtv62gYjtmp%2F6%2Fyr6xj7byWKZdQt8kEftQLTQmP%2F17Efjp6p%2BXo71Q0F9IhAFiqWfp3Ij8hHDSebLcVb2ULXyHNNQpHBOhFgALrFW3I6Uc3WciLEOsBS9Ej3EGdTg%3D%3D