diff --git a/libs/ui-lib/lib/cim/components/common/constants.ts b/libs/ui-lib/lib/cim/components/common/constants.ts index 521f3306b9..95927a5523 100644 --- a/libs/ui-lib/lib/cim/components/common/constants.ts +++ b/libs/ui-lib/lib/cim/components/common/constants.ts @@ -19,3 +19,5 @@ export const getInfraEnvDocs = (docVersion: string) => `https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/${docVersion}/html-single/clusters/index#enable-cim`; export const BMH_HOSTNAME_ANNOTATION = 'bmac.agent-install.openshift.io/hostname'; + +export const OCP_VERSION_MAJOR_MINOR = 'hive.openshift.io/version-major-minor'; diff --git a/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts b/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts index f3d7d67478..ec18c2ca6e 100644 --- a/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts +++ b/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts @@ -6,7 +6,11 @@ import { AgentClusterInstallK8sResource } from '../../types/k8s/agent-cluster-in import { getAgentStatus, getClusterStatus } from './status'; import { getHostNetworks } from './network'; import { BareMetalHostK8sResource, InfraEnvK8sResource } from '../../types'; -import { AGENT_BMH_NAME_LABEL_KEY, BMH_HOSTNAME_ANNOTATION } from '../common/constants'; +import { + AGENT_BMH_NAME_LABEL_KEY, + BMH_HOSTNAME_ANNOTATION, + OCP_VERSION_MAJOR_MINOR, +} from '../common/constants'; import { getAgentProgress, getAgentRole, getInfraEnvNameOfAgent } from './agents'; import { getClusterDeploymentCpuArchitecture } from './clusterDeployment'; @@ -117,7 +121,9 @@ export const getAICluster = ({ agents?: AgentK8sResource[]; infraEnv?: InfraEnvK8sResource; }): Cluster => { - const installVersion = clusterDeployment.status?.installVersion; + const installVersion = + clusterDeployment.status?.installVersion || + clusterDeployment.metadata?.labels?.[OCP_VERSION_MAJOR_MINOR]; const [status, statusInfo] = getClusterStatus(agentClusterInstall); const aiCluster: Cluster = { id: clusterDeployment.metadata?.uid || '',