Skip to content

Commit

Permalink
Allow writing 'null' for HardwareRAIDVolumes and SoftwareRAIDVolumes.
Browse files Browse the repository at this point in the history
BuildRAIDCleanSteps and saveHostProvisioningSettings rely on distinguishing between empty/missing and [].
  • Loading branch information
levsha committed Sep 5, 2021
1 parent ae74cdc commit e4de599
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/metal3.io/v1alpha1/baremetalhost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ type RAIDConfig struct {
// The list of logical disks for hardware RAID, if rootDeviceHints isn't used, first volume is root volume.
// You can set the value of this field to `[]` to clear all the hardware RAID configurations.
// +optional
// +nullable
HardwareRAIDVolumes []HardwareRAIDVolume `json:"hardwareRAIDVolumes"`

// The list of logical disks for software RAID, if rootDeviceHints isn't used, first volume is root volume.
Expand All @@ -290,6 +291,7 @@ type RAIDConfig struct {
// Software RAID will always be deleted.
// +kubebuilder:validation:MaxItems=2
// +optional
// +nullable
SoftwareRAIDVolumes []SoftwareRAIDVolume `json:"softwareRAIDVolumes"`
}

Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/metal3.io_baremetalhosts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ spec:
required:
- level
type: object
nullable: true
type: array
softwareRAIDVolumes:
description: The list of logical disks for software RAID, if rootDeviceHints
Expand Down Expand Up @@ -403,6 +404,7 @@ spec:
- level
type: object
maxItems: 2
nullable: true
type: array
type: object
rootDeviceHints:
Expand Down Expand Up @@ -903,6 +905,7 @@ spec:
required:
- level
type: object
nullable: true
type: array
softwareRAIDVolumes:
description: The list of logical disks for software RAID,
Expand Down Expand Up @@ -992,6 +995,7 @@ spec:
- level
type: object
maxItems: 2
nullable: true
type: array
type: object
rootDeviceHints:
Expand Down
4 changes: 4 additions & 0 deletions config/render/capm3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ spec:
required:
- level
type: object
nullable: true
type: array
softwareRAIDVolumes:
description: The list of logical disks for software RAID, if rootDeviceHints
Expand Down Expand Up @@ -401,6 +402,7 @@ spec:
- level
type: object
maxItems: 2
nullable: true
type: array
type: object
rootDeviceHints:
Expand Down Expand Up @@ -901,6 +903,7 @@ spec:
required:
- level
type: object
nullable: true
type: array
softwareRAIDVolumes:
description: The list of logical disks for software RAID,
Expand Down Expand Up @@ -990,6 +993,7 @@ spec:
- level
type: object
maxItems: 2
nullable: true
type: array
type: object
rootDeviceHints:
Expand Down

0 comments on commit e4de599

Please sign in to comment.