From f7c1dd6132906cf6fb1bbd7cba3f4251f6a38afb Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Wed, 11 Feb 2026 13:20:07 +0000 Subject: [PATCH 1/2] chore: Migrate gsutil usage to gcloud storage --- ci/cloudbuild/test.yaml | 8 ++++---- cmd/generate-release/cloudbuild.yaml | 2 +- cmd/generate-release/scripts/setup-kcc.bash | 2 +- hack/create-dev-release.sh | 2 +- hack/deploy-dev-release.sh | 2 +- hack/prow/e2e-test.sh | 8 ++++---- operator/pkg/release/commandtools/commands.go | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ci/cloudbuild/test.yaml b/ci/cloudbuild/test.yaml index 3a215067c..280983b80 100644 --- a/ci/cloudbuild/test.yaml +++ b/ci/cloudbuild/test.yaml @@ -193,12 +193,12 @@ steps: echo "_SKIP_DOWNLOAD_KF_CLI is set to true. Not downloading CLI..." else echo "Downloading Kf CLI..." - gsutil cp ${_FULL_RELEASE_BUCKET}/kf-linux /workspace/${BUILD_ID}/kf + gcloud storage cp ${_FULL_RELEASE_BUCKET}/kf-linux /workspace/${BUILD_ID}/kf chmod +x /workspace/${BUILD_ID}/kf fi - gsutil cp ${_FULL_RELEASE_BUCKET}/cloud-build/fresh-cluster.yaml /workspace/${BUILD_ID}/fresh-cluster.yaml - gsutil cp ${_FULL_RELEASE_BUCKET}/cloud-build/delete-cluster.yaml /workspace/${BUILD_ID}/delete-cluster.yaml + gcloud storage cp ${_FULL_RELEASE_BUCKET}/cloud-build/fresh-cluster.yaml /workspace/${BUILD_ID}/fresh-cluster.yaml + gcloud storage cp ${_FULL_RELEASE_BUCKET}/cloud-build/delete-cluster.yaml /workspace/${BUILD_ID}/delete-cluster.yaml - id: unit tests waitFor: ['-'] @@ -284,7 +284,7 @@ steps: --substitutions="$$VARS" if [ ! -z "${_EXTRA_CERTS_URL}" ]; then - gsutil cp "${_EXTRA_CERTS_URL}" /workspace/certs.pem + gcloud storage cp "${_EXTRA_CERTS_URL}" /workspace/certs.pem fi - id: deploy certs diff --git a/cmd/generate-release/cloudbuild.yaml b/cmd/generate-release/cloudbuild.yaml index 9391e13c7..a69bccc62 100644 --- a/cmd/generate-release/cloudbuild.yaml +++ b/cmd/generate-release/cloudbuild.yaml @@ -400,7 +400,7 @@ steps: - | FOLDER="$( /dev/null 2>&1; then +if ! gcloud storage ls "gs://${bucket}/${VERSION}" > /dev/null 2>&1; then >&2 gcloud builds submit . \ "--project=${project_id}" \ --config=cmd/generate-release/cloudbuild.yaml \ diff --git a/hack/deploy-dev-release.sh b/hack/deploy-dev-release.sh index 7625233b9..2054b9191 100755 --- a/hack/deploy-dev-release.sh +++ b/hack/deploy-dev-release.sh @@ -33,7 +33,7 @@ git submodule update --init --recursive gcloud builds submit \ --no-source \ - --config=<(gsutil cat "gs://${release}/cloud-build/fresh-cluster.yaml") \ + --config=<(gcloud storage cat "gs://${release}/cloud-build/fresh-cluster.yaml") \ --substitutions="_CLOUDSDK_COMPUTE_ZONE=${zone},_CLOUDSDK_CONTAINER_CLUSTER=${cluster_name},_MACHINE_TYPE=${machine},_ASM_MANAGED=${asm_managed}" gcloud container clusters get-credentials "${cluster_name}" --zone "${zone}" diff --git a/hack/prow/e2e-test.sh b/hack/prow/e2e-test.sh index 5b6a5cb1c..1f44f7a45 100755 --- a/hack/prow/e2e-test.sh +++ b/hack/prow/e2e-test.sh @@ -41,7 +41,7 @@ release_id="$(date +%s)-$(git rev-parse --short $git_sha)" # Determine the path to export results to and store the latest release ID export_path=gs://${_EXPORT_BUCKET}/logs/${_EXPORT_JOB_NAME}/$release_id -[ ! -z "${_EXPORT_BUCKET}" ] && echo $release_id | gsutil cp - gs://${_EXPORT_BUCKET}/logs/${_EXPORT_JOB_NAME}/latest-build.txt +[ ! -z "${_EXPORT_BUCKET}" ] && echo $release_id | gcloud storage cp - gs://${_EXPORT_BUCKET}/logs/${_EXPORT_JOB_NAME}/latest-build.txt # Write 'started.json' to report start of job to testgrid [ ! -z "${_EXPORT_BUCKET}" ] && jq -n \ @@ -51,7 +51,7 @@ export_path=gs://${_EXPORT_BUCKET}/logs/${_EXPORT_JOB_NAME}/$release_id --arg "${_EXPORT_REPO}" $git_sha \ '$ARGS.named' \ )" \ - '$ARGS.named' | gsutil cp - ${export_path}/started.json + '$ARGS.named' | gcloud storage cp - ${export_path}/started.json # Install exit hook to write 'finished.json' to report results to testgrid RESULT="FAILURE" @@ -69,8 +69,8 @@ function finish { --arg "Build" "$BUILD_ID" \ '$ARGS.named' \ )" \ - '$ARGS.named' | gsutil cp - ${export_path}/finished.json - gsutil cp ./build-log.txt ${export_path}/build-log.txt + '$ARGS.named' | gcloud storage cp - ${export_path}/finished.json + gcloud storage cp ./build-log.txt ${export_path}/build-log.txt fi } trap finish EXIT diff --git a/operator/pkg/release/commandtools/commands.go b/operator/pkg/release/commandtools/commands.go index b8afaa77f..4900c6576 100644 --- a/operator/pkg/release/commandtools/commands.go +++ b/operator/pkg/release/commandtools/commands.go @@ -46,9 +46,9 @@ func ExecuteTerminalCommand(command string, arguments ...string) string { return string(output) } -// RunGsCpUtil - Run gsutil command with given arguments +// RunGsCpUtil - Run gcloud storage cp command with given arguments func RunGsCpUtil(arguments ...string) string { // Invoke ko resolve command - args := append([]string{"cp"}, arguments...) - return ExecuteTerminalCommand("gsutil", args...) + args := append([]string{"storage", "cp"}, arguments...) + return ExecuteTerminalCommand("gcloud", args...) } From 4654d7978343c19b208d3b135d0d0e5200ad5d0d Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Wed, 11 Feb 2026 13:29:16 +0000 Subject: [PATCH 2/2] chore: update --- operator/pkg/release/commandtools/commands.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/operator/pkg/release/commandtools/commands.go b/operator/pkg/release/commandtools/commands.go index 4900c6576..b8afaa77f 100644 --- a/operator/pkg/release/commandtools/commands.go +++ b/operator/pkg/release/commandtools/commands.go @@ -46,9 +46,9 @@ func ExecuteTerminalCommand(command string, arguments ...string) string { return string(output) } -// RunGsCpUtil - Run gcloud storage cp command with given arguments +// RunGsCpUtil - Run gsutil command with given arguments func RunGsCpUtil(arguments ...string) string { // Invoke ko resolve command - args := append([]string{"storage", "cp"}, arguments...) - return ExecuteTerminalCommand("gcloud", args...) + args := append([]string{"cp"}, arguments...) + return ExecuteTerminalCommand("gsutil", args...) }