Update request quota
Some checks failed
Run Check Script / check (push) Failing after 46s

This commit is contained in:
Taha Hawa 2025-05-29 15:41:57 -04:00
parent 97fba07f4e
commit 5e51f7490c

View File

@ -21,8 +21,7 @@ impl TenantManager for K8sTenantManager {
"metadata": {
"labels": {
"harmony.nationtech.io/tenant.id": config.id,
"name": config.name,
"harmony.nationtech.io/tenant.name": config.name,
},
"name": config.name,
},
@ -32,7 +31,6 @@ impl TenantManager for K8sTenantManager {
let namespace: Namespace = serde_json::from_value(namespace).unwrap();
let resource_quota = json!(
{
"apiVersion": "v1",
@ -42,21 +40,20 @@ impl TenantManager for K8sTenantManager {
"apiVersion": "v1",
"kind": "ResourceQuota",
"metadata": {
"name": config.name
"name": config.name,
"labels": {
"harmony.nationtech.io/tenant.id": config.id,
"harmony.nationtech.io/tenant.name": config.name,
},
"namespace": config.name,
},
"spec": {
"hard": {
"cpu": config.resource_limits.cpu_limit_cores,
"memory": format!("{:.3}Gi", config.resource_limits.memory_limit_gb),
},
"scopeSelector": {
"matchExpressions": [
{
"operator": "In",
"scopeName": "PriorityClass",
"values": ["high"]
}
]
"limits.cpu": format!("{:.0}",config.resource_limits.cpu_limit_cores),
"limits.memory": format!("{:.3}Gi", config.resource_limits.memory_limit_gb),
"requests.cpu": format!("{:.0}",config.resource_limits.cpu_request_cores),
"requests.memory": format!("{:.3}Gi", config.resource_limits.memory_request_gb),
"requests.storage": format!("{:.3}", config.resource_limits.storage_total_gb)
}
}
}