Skip to content

Commit bb12718

Browse files
authored
feat(iam-v2): handle known error code NOT_IMPLEMENTED (#76)
Error code `NOT_IMPLEMENTED` is returned if Automatic Identity Management is not enabled for the Databricks workspace. If this error code is returned, return with exit code 1 instead of continuing the loop for 30 minutes.
1 parent a010cf1 commit bb12718

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

modules/iam-v2/resolve_group_proxy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ while [[ "$SECONDS" -lt "$END_TIME_SECONDS" ]]; do
4646
exit 0
4747
fi
4848

49+
error_code=$(echo "$response" | jq -r .error_code)
50+
case "$error_code" in
51+
"NOT_IMPLEMENTED")
52+
echo "Error ($error_code): Automatic identity management is not enabled for this workspace." >&2
53+
exit 1
54+
;;
55+
esac
56+
4957
sleep 10s
5058
done
5159

modules/iam-v2/resolve_service_principal_proxy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ while [[ "$SECONDS" -lt "$END_TIME_SECONDS" ]]; do
4747
exit 0
4848
fi
4949

50+
error_code=$(echo "$response" | jq -r .error_code)
51+
case "$error_code" in
52+
"NOT_IMPLEMENTED")
53+
echo "Error ($error_code): Automatic identity management is not enabled for this workspace." >&2
54+
exit 1
55+
;;
56+
esac
57+
5058
sleep 10s
5159
done
5260

0 commit comments

Comments
 (0)