Skip to content

Commit

Permalink
CH-110 fix quotas assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Oct 8, 2024
1 parent af3703e commit dd73a2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ def change_pod_manifest(self: KubeSpawner):

# set user quota cpu/mem usage if value has a "value" else don't change the value
logging.info("Setting user quota cpu/mem usage")
set_key_value(self, key="cpu_guarantee", value=user_quotas.get(
"quota-ws-guaranteecpu"))
set_key_value(self, key="cpu_guarantee", value=float(user_quotas.get(
"quota-ws-guaranteecpu")))
set_key_value(self, key="cpu_limit",
value=user_quotas.get("quota-ws-maxcpu"))
value=float(user_quotas.get("quota-ws-maxcpu")))
set_key_value(self, key="mem_guarantee", value=user_quotas.get(
"quota-ws-guaranteemem"), unit="G")
set_key_value(self, key="mem_limit", value=user_quotas.get(
Expand Down
2 changes: 1 addition & 1 deletion libraries/cloudharness-common/cloudharness/auth/quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_user_quotas(application_config: ApplicationConfig = None, user_id: str =
valid_keys_map = {key for key in base_quotas}

try:
return get_user_attributes(user_id, valid_keys=valid_keys_map, default_attributes=base_quotas)
return get_user_attributes(user_id, valid_keys=valid_keys_map, default_attributes=base_quotas, transform_value_fn=attribute_to_quota)

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

0 comments on commit dd73a2f

Please sign in to comment.