mirror of https://github.com/rancher/dashboard.git
Tweak function to determine if a cluster is a Harvester cluster
This commit is contained in:
parent
66f1e139a7
commit
61d5de67ab
|
|
@ -1,5 +1,5 @@
|
|||
import { VIRTUAL_HARVESTER_PROVIDER } from '@/config/types';
|
||||
import { HCI } from '@/config/labels-annotations';
|
||||
import { VIRTUAL_HARVESTER_PROVIDER } from '@/config/types';
|
||||
|
||||
// Filter out any clusters that are not Kubernetes Clusters
|
||||
// Currently this removes Harvester clusters
|
||||
|
|
@ -10,5 +10,13 @@ export function filterOnlyKubernetesClusters(mgmtClusters) {
|
|||
}
|
||||
|
||||
export function isHarvesterCluster(mgmtCluster) {
|
||||
return mgmtCluster?.metadata?.labels?.[HCI.HARVESTER_CLUSTER] === 'true' || mgmtCluster?.status?.provider === VIRTUAL_HARVESTER_PROVIDER;
|
||||
// Use the provider if it is set
|
||||
const provider = mgmtCluster?.status?.provider;
|
||||
|
||||
if (provider) {
|
||||
return provider === VIRTUAL_HARVESTER_PROVIDER;
|
||||
}
|
||||
|
||||
// Otherwise use the label
|
||||
return mgmtCluster?.metadata?.labels?.[HCI.HARVESTER_CLUSTER] === 'true';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue