Skip to content

Commit

Permalink
Fail if fence-create client fails in kube-setup-ohdsi (#2514)
Browse files Browse the repository at this point in the history
Co-authored-by: Aidan Hilt <[email protected]>
  • Loading branch information
jawadqur and AidanHilt authored Apr 4, 2024
1 parent 797fdf3 commit 07813b6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions gen3/bin/kube-setup-ohdsi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ new_client() {
local secrets=$(g3kubectl exec -c fence $(gen3 pod fence) -- fence-create client-create --client atlas --urls https://${atlas_hostname}/WebAPI/user/oauth/callback?client_name=OidcClient --username atlas --allowed-scopes openid profile email user | tail -1)
# secrets looks like ('CLIENT_ID', 'CLIENT_SECRET')
if [[ ! $secrets =~ (\'(.*)\', \'(.*)\') ]]; then
# try delete client
g3kubectl exec -c fence $(gen3 pod fence) -- fence-create client-delete --client atlas > /dev/null 2>&1
secrets=$(g3kubectl exec -c fence $(gen3 pod fence) -- fence-create client-create --client atlas --urls https://${atlas_hostname}/WebAPI/user/oauth/callback?client_name=OidcClient --username atlas --allowed-scopes openid profile email user | tail -1)
if [[ ! $secrets =~ (\'(.*)\', \'(.*)\') ]]; then
gen3_log_err "kube-setup-ohdsi" "Failed generating oidc client for atlas: $secrets"
return 1
fi
gen3_log_err "kube-setup-ohdsi" "Failed generating oidc client for atlas: $secrets"
return 1
fi
local FENCE_CLIENT_ID="${BASH_REMATCH[2]}"
local FENCE_CLIENT_SECRET="${BASH_REMATCH[3]}"
Expand Down

0 comments on commit 07813b6

Please sign in to comment.