From 660a68363bd793df443141b4533edd7daaef7a2f Mon Sep 17 00:00:00 2001 From: rabi Date: Fri, 27 Sep 2024 14:31:32 +0530 Subject: [PATCH] Set status when only PreprovisioningNetworkDataName is used Set bmhStatus.NetworkDataSecretName correctly when only PreprovisioningNetworkDataName is provided. Signed-off-by: rabi --- pkg/openstackbaremetalset/baremetalhost.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/openstackbaremetalset/baremetalhost.go b/pkg/openstackbaremetalset/baremetalhost.go index 93b2dd4..45cd0f6 100644 --- a/pkg/openstackbaremetalset/baremetalhost.go +++ b/pkg/openstackbaremetalset/baremetalhost.go @@ -253,7 +253,11 @@ func BaremetalHostProvision( // Update status with BMH provisioning details // bmhStatus.UserDataSecretName = userDataSecret.Name - bmhStatus.NetworkDataSecretName = networkDataSecret.Name + if networkDataSecret != nil { + bmhStatus.NetworkDataSecretName = networkDataSecret.Name + } else { + bmhStatus.NetworkDataSecretName = preProvNetworkData + } bmhStatus.ProvisioningState = baremetalv1.ProvisioningState(foundBaremetalHost.Status.Provisioning.State) instance.Status.BaremetalHosts[hostName] = bmhStatus