From 3b57409590e8abed56a18be0e79e370d7800f298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=82=A8=EA=B3=A4?= Date: Thu, 26 Sep 2024 13:12:46 +0900 Subject: [PATCH] Fix bastion serverMetadata not applied - Fixed issue where spec.bastion.spec.serverMetadata was not set in bastion. - Updated bastionToInstanceSpec to apply serverMetadata in InstanceSpec. --- controllers/openstackcluster_controller.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/openstackcluster_controller.go b/controllers/openstackcluster_controller.go index d310aced6a..7429958805 100644 --- a/controllers/openstackcluster_controller.go +++ b/controllers/openstackcluster_controller.go @@ -564,6 +564,12 @@ func bastionToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, cluster * } machineSpec := bastion.Spec + + // Create metadata map from ServerMetadata + metadata := make(map[string]string) + for _, item := range bastion.Spec.ServerMetadata { + metadata[item.Key] = item.Value + } instanceSpec := &compute.InstanceSpec{ Name: bastionName(cluster.Name), Flavor: machineSpec.Flavor, @@ -572,6 +578,7 @@ func bastionToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, cluster * RootVolume: machineSpec.RootVolume, ServerGroupID: resolved.ServerGroupID, Tags: compute.InstanceTags(machineSpec, openStackCluster), + Metadata: metadata, } if bastion.AvailabilityZone != nil { instanceSpec.FailureDomain = *bastion.AvailabilityZone