Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion steps/assets/ignition-bootstrap.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ data "template_file" "rm_assets" {
vars {
cluster_name = "${var.tectonic_cluster_name}"
awscli_image = "${var.tectonic_container_images["awscli"]}"
assets_s3_location = "${local.bucket_name}/${local.bucket_assets_key}"
bucket_s3_location = "${local.bucket_name}"
}
}

Expand Down
5 changes: 3 additions & 2 deletions steps/assets/resources/rm-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ s3_clean() {
/usr/bin/docker run \
--volume /tmp:/tmp \
--network=host \
--env LOCATION="${assets_s3_location}" \
--env LOCATION="${bucket_s3_location}" \
--entrypoint=/bin/bash \
${awscli_image} \
-c '
set -e
set -o pipefail
REGION=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone | sed '"'"'s/[a-zA-Z]$//'"'"')
/usr/bin/aws --region="$REGION" s3 cp /tmp/assets.zip s3://"$LOCATION"
/usr/bin/aws --region="$REGION" s3 cp /tmp/assets.zip s3://"$LOCATION/assets.zip"
Copy link
Contributor

@alexsomesan alexsomesan Feb 16, 2018

Choose a reason for hiding this comment

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

I think we actually want to invalidate both assets.zip and ignition.
Would something like echo > ignition and echo > assets.zip before each cp operation work for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isn't what we are doing by touch /tmp/assets.zip? I can rename if it's not clear

Copy link
Contributor

Choose a reason for hiding this comment

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

Unless /tmp/assets.zip doesn't already exist.
In that case it just gets it's timestamps updated and ends up being uploaded to S3.
Not the right time and place to obsess about edge cases tough, so this might be nitpicking.

/usr/bin/aws --region="$REGION" s3 cp /tmp/assets.zip s3://"$LOCATION/ignition"
'
}

Expand Down