Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/test_shell_script_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
fi

echo 'Uploading local logs to GCS bucket.'
gsutil -m rsync -r /tmp/custom-image-my-image-20190611-160823/logs/ gs://my-bucket/custom-image-my-image-20190611-160823/logs/
gcloud storage rsync --recursive /tmp/custom-image-my-image-20190611-160823/logs/ gs://my-bucket/custom-image-my-image-20190611-160823/logs/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

While this change correctly migrates gsutil rsync to the equivalent gcloud storage rsync --recursive command, it will cause the TestShellScriptGenerator.test_generate_shell_script test to fail. The script generator in custom_image_utils/shell_script_generator.py appears to have a bug where it incorrectly constructs the rsync command when using gcloud storage. It seems to generate gcloud storage rsync -r ... instead of gcloud storage rsync --recursive ....

To fix the failing test, the generator logic in custom_image_utils/shell_script_generator.py will need to be updated to produce the correct command shown here.


if [[ -f /tmp/custom-image-my-image-20190611-160823/image_created ]]; then
echo -e "${GREEN}Workflow succeeded, check logs at /tmp/custom-image-my-image-20190611-160823/logs/ or gs://my-bucket/custom-image-my-image-20190611-160823/logs/${NC}"
Expand All @@ -55,7 +55,7 @@
declare -a sources_k=([0]='run.sh' [1]='init_actions.sh' [2]='ext'\\''ra_src.txt')
declare -a sources_v=([0]='startup_script/run.sh' [1]='/tmp/my-script.sh' [2]='/path/to/extra.txt')
for i in "${!sources_k[@]}"; do
gsutil cp "${sources_v[i]}" "gs://my-bucket/custom-image-my-image-20190611-160823/sources/${sources_k[i]}"
gcloud storage cp "${sources_v[i]}" "gs://my-bucket/custom-image-my-image-20190611-160823/sources/${sources_k[i]}"
done

echo 'Creating disk.'
Expand Down