Skip to content

Commit

Permalink
Add PreprovisioningNetworkDataName to baremetalset spec
Browse files Browse the repository at this point in the history
This is the name of the Secret in the local namespace containing
network configuration (e.g content of network_data.json) which
is passed to the preprovisioning image. It is also passed to
the Config Drive if not overridden by specifying NetworkData.

Signed-off-by: rabi <[email protected]>
  • Loading branch information
rabi committed Mar 18, 2024
1 parent 33d0a42 commit c861726
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 c861726

Please sign in to comment.