-
Notifications
You must be signed in to change notification settings - Fork 516
chore: Migrate gsutil usage to gcloud storage #1377
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,11 +15,11 @@ def setUp(self): | |||||||||||||||||
| super().setUp() | ||||||||||||||||||
| self.GCS_BUCKET = "test-hbase-{}-{}".format(self.datetime_str(), | ||||||||||||||||||
| self.random_str()) | ||||||||||||||||||
| self.assert_command('gsutil mb -c regional -l {} gs://{}'.format( | ||||||||||||||||||
| self.assert_command('gcloud storage buckets create --default-storage-class=regional --location {} gs://{}'.format( | ||||||||||||||||||
| self.REGION, self.GCS_BUCKET)) | ||||||||||||||||||
|
Comment on lines
+18
to
19
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. This command string is getting long. To improve readability, you could break it into multiple lines and assign it to a variable before passing it to
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| def tearDown(self): | ||||||||||||||||||
| self.assert_command('gsutil -m rm -rf gs://{}'.format(self.GCS_BUCKET)) | ||||||||||||||||||
| self.assert_command('gcloud storage rm --recursive --continue-on-error gs://{}'.format(self.GCS_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. |
||||||||||||||||||
| super().tearDown() | ||||||||||||||||||
|
|
||||||||||||||||||
| def verify_instance(self, name): | ||||||||||||||||||
|
|
||||||||||||||||||
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
gcloud storage cpcommand uses unquoted variables${BEAM_JOB_SERVICE_DESTINATION}and${BEAM_SOURCE_VERSION}on line 18. This can lead to command injection or argument injection if these variables contain shell metacharacters or start with a hyphen. While the change is on line 16, it is part of the same command. It is recommended to quote these variables and use--to signal the end of options.