From 06947f207ef8c35f5ad2d650132272272d901518 Mon Sep 17 00:00:00 2001 From: rabi Date: Mon, 18 Mar 2024 14:21:53 +0530 Subject: [PATCH] Don't override preprovisioningNetworkDataName If already set in the BMH and not provided in baremetalSpec don't override preprovisioningNetworkDataName. Signed-off-by: rabi --- pkg/openstackbaremetalset/baremetalhost.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/openstackbaremetalset/baremetalhost.go b/pkg/openstackbaremetalset/baremetalhost.go index 14bec92..27f8ffe 100644 --- a/pkg/openstackbaremetalset/baremetalhost.go +++ b/pkg/openstackbaremetalset/baremetalhost.go @@ -206,7 +206,10 @@ func BaremetalHostProvision( foundBaremetalHost.Spec.AutomatedCleaningMode = metal3v1.AutomatedCleaningMode(instance.Spec.AutomatedCleaningMode) // Ensure PreprovisioningNetworkDataName is set as per spec - foundBaremetalHost.Spec.PreprovisioningNetworkDataName = instance.Spec.BaremetalHosts[hostName].PreprovisioningNetworkDataName + preprovNetworkData := instance.Spec.BaremetalHosts[hostName].PreprovisioningNetworkDataName + if preprovNetworkData != "" { + foundBaremetalHost.Spec.PreprovisioningNetworkDataName = preprovNetworkData + } // // Ensure the image url is up to date unless already provisioned