-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Migrate gsutil usage to gcloud storage #13722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -65,7 +65,7 @@ an explanation of how the code works. | |||||
|
|
||||||
| * To create a new bucket, run the following command. Your bucket name must be unique. | ||||||
|
|
||||||
| gsutil mb -p {{project-id}} gs://your-bucket-name | ||||||
| gcloud storage buckets create --project={{project-id}} gs://your-bucket-name | ||||||
|
|
||||||
|
|
||||||
| 2. Set environment variables. | ||||||
|
|
@@ -145,12 +145,12 @@ Cluster cluster-name successfully deleted. | |||||
| If you created a Cloud Storage bucket to use for this walkthrough, | ||||||
| you can run the following command to delete the bucket (the bucket must be empty). | ||||||
|
|
||||||
| gsutil rb gs://$BUCKET | ||||||
| gcloud storage buckets delete gs://$BUCKET | ||||||
|
|
||||||
| * You can run the following command to **delete the bucket and all | ||||||
| objects within it. Note: the deleted objects cannot be recovered.** | ||||||
|
|
||||||
| gsutil rm -r gs://$BUCKET | ||||||
| gcloud storage rm --recursive gs://$BUCKET | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The command To correctly empty the bucket with
Suggested change
|
||||||
|
|
||||||
|
|
||||||
| * **For more information.** See the [Dataproc documentation](https://cloud.google.com/dataproc/docs/) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command
gcloud storage rm --recursive gs://$BUCKETis not the correct equivalent forgsutil rm -r gs://$BUCKETwhen the goal is to empty a bucket. Thegsutilcommand removes all objects within the bucket, but not the bucket itself. Thegcloud storage rmcommand used here with a bucket URL will fail.To correctly empty the bucket using
gcloud storage, you should use a wildcard/**to target all objects within the bucket.