mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
feat(k8s/application): add/edit placement preferences/constraints (#4210)
* feat(k8s/application): create application with placement preferences/constraints * feat(k8s/application): edit application placement preferences/constraints
This commit is contained in:
parent
32bac9ffcc
commit
52bdcf2e2b
22 changed files with 451 additions and 190 deletions
|
@ -20,4 +20,15 @@ export class KubernetesNodeHelper {
|
|||
return label;
|
||||
});
|
||||
}
|
||||
|
||||
static generateNodeLabelsFromNodes(nodes) {
|
||||
const pairs = _.flatMap(nodes, (node) => {
|
||||
return _.map(_.toPairs(node.Labels), ([k, v]) => {
|
||||
return { key: k, value: v };
|
||||
});
|
||||
});
|
||||
return _.map(_.groupBy(pairs, 'key'), (values, key) => {
|
||||
return { Key: key, Values: _.uniq(_.map(values, 'value')) };
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue