Skip to content
Snippets Groups Projects
Commit f1ba1b96 authored by Yas Naoi's avatar Yas Naoi
Browse files

Issue #3284108 by yas: Hotfix - Refactor to update K8s resources

parent 87bd62aa
No related branches found
No related tags found
3 merge requests!1316Issue #3310263: Release 4.5.0,!1260Issue #3307397: Release 4.4.0,!1047Issue #3284108: Refactor to update K8s resources
...@@ -1113,7 +1113,7 @@ class K8sService extends CloudServiceBase implements K8sServiceInterface { ...@@ -1113,7 +1113,7 @@ class K8sService extends CloudServiceBase implements K8sServiceInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function updateResourceQuota($namespace, array $params = []): ?array { public function updateResourceQuota($namespace, array $params = []): ?array {
return $this->updateResource(ResourceQuota::class, $params, $namespace); return $this->updateResource(QuotaModel::class, $params, $namespace);
} }
/** /**
...@@ -4119,6 +4119,11 @@ class K8sService extends CloudServiceBase implements K8sServiceInterface { ...@@ -4119,6 +4119,11 @@ class K8sService extends CloudServiceBase implements K8sServiceInterface {
$method = substr($resource, 0, -1) . 'ies'; $method = substr($resource, 0, -1) . 'ies';
} }
// NOTE: Resource Quota is defined as Maclof\Kubernetes\Models\QuotaModel.
if (str_ends_with($resource, 'quotaModel')) {
$method = 'quotas';
}
return $this->getClient($namespace) return $this->getClient($namespace)
->$method() ->$method()
->update(new $class($params)); ->update(new $class($params));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment