Skip to content

Commit dd73a2f

Browse files
committed
CH-110 fix quotas assignment
1 parent af3703e commit dd73a2f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • applications/jupyterhub/src/harness_jupyter/harness_jupyter
  • libraries/cloudharness-common/cloudharness/auth

applications/jupyterhub/src/harness_jupyter/harness_jupyter/jupyterhub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ def change_pod_manifest(self: KubeSpawner):
225225

226226
# set user quota cpu/mem usage if value has a "value" else don't change the value
227227
logging.info("Setting user quota cpu/mem usage")
228-
set_key_value(self, key="cpu_guarantee", value=user_quotas.get(
229-
"quota-ws-guaranteecpu"))
228+
set_key_value(self, key="cpu_guarantee", value=float(user_quotas.get(
229+
"quota-ws-guaranteecpu")))
230230
set_key_value(self, key="cpu_limit",
231-
value=user_quotas.get("quota-ws-maxcpu"))
231+
value=float(user_quotas.get("quota-ws-maxcpu")))
232232
set_key_value(self, key="mem_guarantee", value=user_quotas.get(
233233
"quota-ws-guaranteemem"), unit="G")
234234
set_key_value(self, key="mem_limit", value=user_quotas.get(

libraries/cloudharness-common/cloudharness/auth/quota.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_user_quotas(application_config: ApplicationConfig = None, user_id: str =
3939
valid_keys_map = {key for key in base_quotas}
4040

4141
try:
42-
return get_user_attributes(user_id, valid_keys=valid_keys_map, default_attributes=base_quotas)
42+
return get_user_attributes(user_id, valid_keys=valid_keys_map, default_attributes=base_quotas, transform_value_fn=attribute_to_quota)
4343

4444
except UserNotFound as e:
4545
log.warning("Quotas not available: error retrieving user: %s", user_id)

0 commit comments

Comments
 (0)