diff --git a/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml b/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml index 1a620f3..caedfcd 100644 --- a/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml +++ b/api/bases/baremetal.openstack.org_openstackbaremetalsets.yaml @@ -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: diff --git a/api/v1beta1/openstackbaremetalset_types.go b/api/v1beta1/openstackbaremetalset_types.go index 7e81d31..56e8df5 100644 --- a/api/v1beta1/openstackbaremetalset_types.go +++ b/api/v1beta1/openstackbaremetalset_types.go @@ -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 diff --git a/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml b/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml index 1a620f3..caedfcd 100644 --- a/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml +++ b/config/crd/bases/baremetal.openstack.org_openstackbaremetalsets.yaml @@ -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: diff --git a/pkg/openstackbaremetalset/baremetalhost.go b/pkg/openstackbaremetalset/baremetalhost.go index d452df0..14bec92 100644 --- a/pkg/openstackbaremetalset/baremetalhost.go +++ b/pkg/openstackbaremetalset/baremetalhost.go @@ -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 //