Skip to content

Commit d96eab1

Browse files
release-26.2: release/sentry: use 'gcloud storage cp' to download artifact (#170728)
release-26.2: release/sentry: use 'gcloud storage cp' to download artifact
2 parents 88ea864 + 8d0ed3b commit d96eab1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

pkg/cmd/release/sentry/main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,16 @@ func main() {
225225
}
226226
artifactName := fmt.Sprintf("cockroach-%s.%s.tgz", version, platform)
227227
log.Printf("Downloading artifact: %s", artifactName)
228-
gsutilCmd := exec.Command("gsutil", "cp",
228+
// Use `gcloud storage cp` rather than `gsutil cp`: under Workload
229+
// Identity Federation, gsutil does not honor the credentials file
230+
// google-github-actions/auth writes and silently falls back to the
231+
// runner VM's metadata service account.
232+
downloadCmd := exec.Command("gcloud", "storage", "cp",
229233
fmt.Sprintf("gs://cockroach-release-artifacts-staged-prod/%s", artifactName),
230234
"./")
231-
if err := gsutilCmd.Run(); err != nil {
235+
downloadCmd.Stdout = os.Stdout
236+
downloadCmd.Stderr = os.Stderr
237+
if err := downloadCmd.Run(); err != nil {
232238
log.Fatal(err)
233239
}
234240
log.Printf("Downloaded artifact: %s", artifactName)

0 commit comments

Comments
 (0)