Latest changes from harvester/master

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:01:03 +02:00
parent deeccf3db6
commit ec3d88aeb7
56 changed files with 1498 additions and 2197 deletions
@@ -8,6 +8,7 @@ import { STATE, NAME, AGE } from '@shell/config/table-headers';
import { matching } from '@shell/utils/selector';
import { NODE } from '@shell/config/types';
import { isEmpty } from '@shell/utils/object';
import { HCI } from '@pkg/harvester/config/labels-annotations';
export default {
components: {
@@ -55,10 +56,13 @@ export default {
const inStore = this.$store.getters['currentProduct'].inStore;
const nodes = this.$store.getters[`${ inStore }/all`](NODE);
const matchedNodes = this.value?.metadata?.annotations?.[HCI.MATCHED_NODES];
const selector = this.value?.spec?.nodeSelector;
if (!isEmpty(selector)) {
return matching(nodes, selector);
} else if (matchedNodes && matchedNodes.length > 0) {
return nodes.filter(node => matchedNodes.includes(node.id));
} else {
return nodes;
}