diff --git a/frontend/public/components/machine-config-pool.tsx b/frontend/public/components/machine-config-pool.tsx index a2ecd683dc3..a1518bcbdc2 100644 --- a/frontend/public/components/machine-config-pool.tsx +++ b/frontend/public/components/machine-config-pool.tsx @@ -1,15 +1,18 @@ /* eslint-disable no-undef, no-unused-vars */ import * as _ from 'lodash-es'; import * as React from 'react'; -import { Link } from 'react-router-dom'; -import { MachineConfigPoolModel } from '../models'; -import { referenceForModel, MachineConfigPoolKind } from '../module/k8s'; -import { machineConfigReference, MachineConfigPage } from './machine-config'; -import { Tooltip } from './utils/tooltip'; import { Conditions } from './conditions'; import { errorModal } from './modals'; -import { machineReference, MachinePage } from './machine'; +import { Tooltip } from './utils/tooltip'; +import { MachineConfigPoolModel, NodeModel } from '../models'; +import { machineConfigReference, MachineConfigPage } from './machine-config'; +import { + K8sResourceConditionStatus, + MachineConfigPoolConditionType, + MachineConfigPoolKind, + referenceForModel, +} from '../module/k8s'; import { ColHead, DetailsPage, @@ -23,7 +26,6 @@ import { pluralize, ResourceKebab, ResourceLink, - resourcePath, ResourceSummary, SectionHeading, Selector, @@ -37,7 +39,13 @@ const pauseAction = (kind, obj) => ({ }); const machineConfigPoolReference = referenceForModel(MachineConfigPoolModel); +const nodeReference = referenceForModel(NodeModel); const machineConfigPoolMenuActions = [pauseAction, ...Kebab.factory.common]; +const getConditionStatus = (mcp: MachineConfigPoolKind, type: MachineConfigPoolConditionType): K8sResourceConditionStatus => { + const {conditions} = mcp.status; + const condition = _.find(conditions, {type}); + return condition ? condition.status : K8sResourceConditionStatus.Unknown; +}; const MachineConfigPoolCharacteristics: React.SFC = ({obj}) => { const { maxUnavailable } = obj.spec; @@ -59,8 +67,8 @@ const MachineConfigPoolCharacteristics: React.SFC { configuration.source - ? _.map(configuration.source, mc => - + ? _.map(configuration.source, ({apiVersion, kind, name}) => + ) : '-' } @@ -133,17 +141,13 @@ const MachineConfigPoolSummary: React.SFC = ({obj
Machine Selector
; }; -const MachineList: React.SFC = ({obj}) => ( - -); - const MachineConfigList: React.SFC = ({obj}) => ( ); @@ -174,7 +178,6 @@ const MachineConfigPoolDetails: React.SFC = ({obj const pages = [ navFactory.details(MachineConfigPoolDetails), navFactory.editYaml(), - navFactory.machines(MachineList), navFactory.machineConfigs(MachineConfigList), ]; @@ -188,23 +191,30 @@ export const MachineConfigPoolDetailsPage: React.SFC = props => ( ); const MachineConfigPoolHeader: React.SFC = props => - Name - Configuration - Machines + Name + Configuration + Updated + Updating + Degraded ; const MachineConfigPoolRow: React.SFC = ({obj}) =>
-
+
-
+
{_.get(obj, 'status.configuration.name') ? : '-'}
-
- - {obj.status.readyMachineCount} of {obj.status.machineCount} machines - +
+ {getConditionStatus(obj, MachineConfigPoolConditionType.Updated)} +
+
+ {getConditionStatus(obj, MachineConfigPoolConditionType.Updating)}
+
+ {getConditionStatus(obj, MachineConfigPoolConditionType.Degraded)} +
+
@@ -235,10 +245,6 @@ type MachineConfigPoolDetailsProps = { obj: MachineConfigPoolKind; }; -type MachineListProps = { - obj: MachineConfigPoolKind; -}; - type MachineConfigListProps = { obj: MachineConfigPoolKind; }; diff --git a/frontend/public/components/utils/horizontal-nav.tsx b/frontend/public/components/utils/horizontal-nav.tsx index dd6ada34dc3..84aff27b509 100644 --- a/frontend/public/components/utils/horizontal-nav.tsx +++ b/frontend/public/components/utils/horizontal-nav.tsx @@ -96,11 +96,6 @@ export const navFactory: NavFactory = { name: 'Cluster Operators', component, }), - machines: component => ({ - href: 'machines', - name: 'Machines', - component, - }), machineConfigs: component => ({ href: 'machineconfigs', name: 'Machine Configs', diff --git a/frontend/public/module/k8s/index.ts b/frontend/public/module/k8s/index.ts index 36c4d7247d9..27ce31dfabb 100644 --- a/frontend/public/module/k8s/index.ts +++ b/frontend/public/module/k8s/index.ts @@ -39,9 +39,9 @@ export type ObjectMetadata = { }; export enum K8sResourceConditionStatus { - ConditionTrue = 'True', - ConditionFalse = 'False', - ConditionUnknown = 'Unknown', + True = 'True', + False = 'False', + Unknown = 'Unknown', } export type K8sResourceCondition = { @@ -181,9 +181,9 @@ export type MachineConfigKind = { } & K8sResourceKind; export enum MachineConfigPoolConditionType { - MachineConfigPoolUpdated = 'Updated', - MachineConfigPoolUpdating = 'Updating', - MachineConfigPoolDegraded = 'Degraded', + Updated = 'Updated', + Updating = 'Updating', + Degraded = 'Degraded', } export type MachineConfigPoolCondition = K8sResourceCondition;