-
Notifications
You must be signed in to change notification settings - Fork 593
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 #3811 from suomiy/metal.deprovisionAction
add Deprovision action to Bare Metal Hosts
- Loading branch information
Showing
9 changed files
with
178 additions
and
27 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const DELETE_MACHINE_ANNOTATION = 'machine.openshift.io/cluster-api-delete-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
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,9 @@ | ||
import * as _ from 'lodash'; | ||
import { MachineSetKind } from '@console/internal/module/k8s'; | ||
import { getUID } from '@console/shared/src'; | ||
|
||
export const findMachineSet = (machineSets: MachineSetKind[], uid: string) => | ||
uid && machineSets ? machineSets.find((machineSet) => getUID(machineSet) === uid) : null; | ||
|
||
export const getReplicas = (machineSet: MachineSetKind, defaultValue: number = 0) => | ||
_.has(machineSet, 'spec') ? machineSet.spec.replicas : defaultValue; |
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,14 @@ | ||
import { apiVersionForModel, MachineKind } from '@console/internal/module/k8s'; | ||
import { MachineSetModel } from '@console/internal/models'; | ||
import { getOwnerReferences } from '@console/shared/src'; | ||
import { compareOwnerReference } from '@console/shared/src/utils/owner-references'; | ||
|
||
export const getMachineMachineSetOwner = (machine: MachineKind) => { | ||
const desiredReference = { | ||
apiVersion: apiVersionForModel(MachineSetModel), | ||
kind: MachineSetModel.kind, | ||
} as any; | ||
return (getOwnerReferences(machine) || []).find((reference) => | ||
compareOwnerReference(desiredReference, reference, true), | ||
); | ||
}; |