mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
feat(k8s/node): Add the ability to apply taints and labels to nodes (#4176)
* feat(node): Add the ability to apply taints and labels to nodes * feat(k8s/node): minor UI update * feat(k8s/node): UI update and disable system labels * feat(k8s/node): minor UI update * fix(node): fix add first taint * refacto(node): add KubernetesNodeHelper * feat(node): add used label to labels * feat(node): add node update modals * fix(node): modal when used label changes * feat(k8s/node): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
1f614ee95a
commit
1bf97426bf
11 changed files with 568 additions and 8 deletions
|
@ -13,6 +13,7 @@ class KubernetesNodeService {
|
|||
|
||||
this.getAsync = this.getAsync.bind(this);
|
||||
this.getAllAsync = this.getAllAsync.bind(this);
|
||||
this.patchAsync = this.patchAsync.bind(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,6 +45,27 @@ class KubernetesNodeService {
|
|||
}
|
||||
return this.$async(this.getAllAsync);
|
||||
}
|
||||
|
||||
/**
|
||||
* PATCH
|
||||
*/
|
||||
|
||||
async patchAsync(node, nodeFormValues) {
|
||||
try {
|
||||
const params = new KubernetesCommonParams();
|
||||
params.id = node.Name;
|
||||
const newNode = KubernetesNodeConverter.formValuesToNode(node, nodeFormValues);
|
||||
const payload = KubernetesNodeConverter.patchPayload(node, newNode);
|
||||
const data = await this.KubernetesNodes().patch(params, payload).$promise;
|
||||
return data;
|
||||
} catch (err) {
|
||||
throw { msg: 'Unable to patch node', err: err };
|
||||
}
|
||||
}
|
||||
|
||||
patch(node, nodeFormValues) {
|
||||
return this.$async(this.patchAsync, node, nodeFormValues);
|
||||
}
|
||||
}
|
||||
|
||||
export default KubernetesNodeService;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue