Skip to content

Commit 77bc57f

Browse files
authored
Merge pull request #49 from CodeNow/user-vault-rollbar-trap
User vault rollbar trap
2 parents e50f090 + 3dfa270 commit 77bc57f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/aws.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ aws::fetch_poppa_id() {
9595
log::info "Setting Poppa ID"
9696

9797
# Generate the org-tag fetching script
98-
rollbar::fatal_trap \
98+
rollbar::warning_trap \
9999
"Dock-Init: Failed to Render Org Script" \
100100
"Consule-Template was unable to realize the given template."
101101

lib/vault.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ vault::set_s3_keys() {
5656

5757
# creates a token for a the organizations-readonly policy
5858
vault::store_private_registry_token() {
59+
rollbar::fatal_trap \
60+
"Dock-Init: Cannot store private registry token" \
61+
"The user vault token was not generated"
62+
5963
log::info "Storing vault token for private registry key"
6064
local NODE_ENV=$(consul::get node/env)
6165
local token_path="${DOCK_INIT_BASE}/consul-resources/vault/${NODE_ENV}"
@@ -72,4 +76,5 @@ vault::store_private_registry_token() {
7276
vault token-create -policy=dock-${POPPA_ID} | awk '/token/ { print $2 }' | awk 'NR==1 { print $1 }' > /opt/runnable/dock-init/user-private-registry-token
7377
VAULT_TOKEN=$(cat "${token_path}"/auth-token)
7478
export VAULT_TOKEN
79+
rollbar::clear_trap
7580
}

0 commit comments

Comments
 (0)