-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1698 from jtomasek/multi-list-page
Use MultiListPage for BaremetalHostsPage
- Loading branch information
Showing
12 changed files
with
192 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import * as _ from 'lodash-es'; | ||
|
||
import { K8sResourceKind } from '@console/internal/module/k8s'; | ||
|
||
export const getName = (value: K8sResourceKind): string => _.get(value, 'metadata.name'); | ||
export const getNamespace = (value: K8sResourceKind): string => _.get(value, 'metadata.namespace'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
import * as _ from 'lodash-es'; | ||
|
||
import { K8sResourceKind } from '@console/internal/module/k8s'; | ||
|
||
export const getName = (value: K8sResourceKind): string => _.get(value, 'metadata.name'); | ||
export const getNamespace = (value: K8sResourceKind): string => _.get(value, 'metadata.namespace'); | ||
export * from './common'; | ||
export * from './machine'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as _ from 'lodash-es'; | ||
|
||
import { | ||
MachineKind, | ||
MachineSetKind, | ||
MachineDeploymentKind, | ||
NodeKind, | ||
} from '@console/internal/module/k8s'; | ||
import { getName } from './common'; | ||
|
||
export const getMachineRole = (obj: MachineKind | MachineSetKind | MachineDeploymentKind) => | ||
_.get(obj, ['metadata', 'labels', 'machine.openshift.io/cluster-api-machine-role']); | ||
export const getMachineNodeName = (obj: MachineKind) => _.get(obj, 'status.nodeRef.name'); | ||
export const getMachineAWSPlacement = (machine: MachineKind) => | ||
_.get(machine, 'spec.providerSpec.value.placement') || {}; | ||
|
||
export const getMachineNode = (machine: MachineKind, nodes: NodeKind[]) => | ||
nodes.find((node) => getMachineNodeName(machine) === getName(node)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { getMachineRole, DASH } from '@console/shared'; | ||
import { MachineKind } from '@console/internal/module/k8s'; | ||
|
||
type BaremetalHostRoleProps = { | ||
machine: MachineKind; | ||
}; | ||
export const BaremetalHostRole: React.FC<BaremetalHostRoleProps> = ({ machine }) => | ||
getMachineRole(machine) || DASH; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters