Skip to content

Commit

Permalink
Merge pull request #151 from rabi/preprovisioning-network-data
Browse files Browse the repository at this point in the history
Add PreprovisioningNetworkDataName to baremetalset spec
  • Loading branch information
openshift-merge-bot[bot] authored Mar 18, 2024
2 parents c4efa71 + c861726 commit e5f6ab9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
preprovisioningNetworkDataName:
description: PreprovisioningNetworkDataName - NetwoData Secret
name for Preprovisining in the local namespace
type: string
userData:
description: UserData - Host User Data
properties:
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/openstackbaremetalset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type InstanceSpec struct {
// +kubebuilder:validation:Optional
// NetworkData - Host Network Data
NetworkData *corev1.SecretReference `json:"networkData,omitempty"`
// +kubebuilder:validation:Optional
// PreprovisioningNetworkDataName - NetwoData Secret name for Preprovisining in the local namespace
PreprovisioningNetworkDataName string `json:"preprovisioningNetworkDataName,omitempty"`
}

// Allowed automated cleaning modes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec:
type: string
type: object
x-kubernetes-map-type: atomic
preprovisioningNetworkDataName:
description: PreprovisioningNetworkDataName - NetwoData Secret
name for Preprovisining in the local namespace
type: string
userData:
description: UserData - Host User Data
properties:
Expand Down
3 changes: 3 additions & 0 deletions pkg/openstackbaremetalset/baremetalhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ func BaremetalHostProvision(
// Ensure AutomatedCleaningMode is set as per spec
foundBaremetalHost.Spec.AutomatedCleaningMode = metal3v1.AutomatedCleaningMode(instance.Spec.AutomatedCleaningMode)

// Ensure PreprovisioningNetworkDataName is set as per spec
foundBaremetalHost.Spec.PreprovisioningNetworkDataName = instance.Spec.BaremetalHosts[hostName].PreprovisioningNetworkDataName

//
// Ensure the image url is up to date unless already provisioned
//
Expand Down

0 comments on commit e5f6ab9

Please sign in to comment.