Skip to content

Commit

Permalink
Fix timedrift (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
osterman authored Apr 6, 2018
1 parent bfc4ee2 commit 8f43de2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rootfs/etc/profile.d/aws-vault.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ function assume-role() {
echo "Usage: $0 [role]"
return 1
fi
# Sync the clock in the Docker Virtual Machine to the system's hardware clock to avoid time drift
# (Only works in privileged mode)
hwclock -s >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "* Failed to sync system time from hardware clock"
fi

shift
if [ $# -eq 0 ]; then
aws-vault exec --assume-role-ttl=${AWS_VAULT_ASSUME_ROLE_TTL} $role -- bash -l
Expand Down
2 changes: 2 additions & 0 deletions rootfs/etc/profile.d/prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function geodesic_prompt() {

if [ -n "${AWS_VAULT}" ]; then
ROLE_PROMPT="(${AWS_VAULT})"
else
ROLE_PROMPT="(none)"
fi

if [ -n "${CLUSTER_NAME}" ]; then
Expand Down

0 comments on commit 8f43de2

Please sign in to comment.