Skip to content

Commit e986799

Browse files
committed
Handle deployment-service-check user for auth0
That user (which we use for our health checks) does not have any auth state, so this was causing health checks to fail. Follow-up to #3618
1 parent de54ad3 commit e986799

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

config/clusters/earthscope/common.values.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,15 @@ basehub:
8787
return False
8888
8989
def populate_token(spawner, auth_state):
90-
token_env = {
91-
'AUTH0_ACCESS_TOKEN': auth_state.get("access_token", ""),
92-
'AUTH0_ID_TOKEN': auth_state.get("id_token", ""),
93-
'AUTH0_REFRESH_TOKEN': auth_state.get('refresh_token', '')
94-
}
95-
spawner.environment.update(token_env)
90+
# For our deployment-service-check health check user, there is no auth_state.
91+
# So these env variables need not be set.
92+
if auth_state:
93+
token_env = {
94+
'AUTH0_ACCESS_TOKEN': auth_state.get("access_token", ""),
95+
'AUTH0_ID_TOKEN': auth_state.get("id_token", ""),
96+
'AUTH0_REFRESH_TOKEN': auth_state.get('refresh_token', '')
97+
}
98+
spawner.environment.update(token_env)
9699
97100
c.Spawner.auth_state_hook = populate_token
98101

0 commit comments

Comments
 (0)