mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
Enable the ability to cordon/uncordon/drain nodes (#4723)
* feat(node): Enable the ability to cordon/uncordon/drain nodes * feat(cluster): check if there is a drain operation somewhere * feat(kubernetes): allow to cordon, uncordon, drain nodes * refacto(kubernetes): set a constant for drain label name * fix(node): Relocate the warning message next to the dropdown and change the information message
This commit is contained in:
parent
660bc2dadf
commit
32a9a2e46b
10 changed files with 182 additions and 13 deletions
|
@ -10,7 +10,7 @@ import {
|
|||
} from 'Kubernetes/models/application/models';
|
||||
|
||||
import { createPayloadFactory } from './payloads/create';
|
||||
import { KubernetesPod, KubernetesPodToleration, KubernetesPodAffinity, KubernetesPodContainer, KubernetesPodContainerTypes } from './models';
|
||||
import { KubernetesPod, KubernetesPodToleration, KubernetesPodAffinity, KubernetesPodContainer, KubernetesPodContainerTypes, KubernetesPodEviction } from 'Kubernetes/pod/models';
|
||||
|
||||
function computeStatus(statuses) {
|
||||
const containerStatuses = _.map(statuses, 'state');
|
||||
|
@ -117,6 +117,13 @@ export default class KubernetesPodConverter {
|
|||
return res;
|
||||
}
|
||||
|
||||
static evictionPayload(pod) {
|
||||
const res = new KubernetesPodEviction();
|
||||
res.metadata.name = pod.Name;
|
||||
res.metadata.namespace = pod.Namespace;
|
||||
return res;
|
||||
}
|
||||
|
||||
static patchPayload(oldPod, newPod) {
|
||||
const oldPayload = createPayload(oldPod);
|
||||
const newPayload = createPayload(newPod);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue