Skip to content

Commit 4d9dadf

Browse files
authored
Merge pull request #2179 from namgon-kim/bugfix/bastion-metadata
🐛 Fix ServerMetadata Not Applied to Bastion in OpenStackCluster
2 parents e4730ca + 3b57409 commit 4d9dadf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controllers/openstackcluster_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,12 @@ func bastionToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, cluster *
564564
}
565565

566566
machineSpec := bastion.Spec
567+
568+
// Create metadata map from ServerMetadata
569+
metadata := make(map[string]string)
570+
for _, item := range bastion.Spec.ServerMetadata {
571+
metadata[item.Key] = item.Value
572+
}
567573
instanceSpec := &compute.InstanceSpec{
568574
Name: bastionName(cluster.Name),
569575
Flavor: machineSpec.Flavor,
@@ -572,6 +578,7 @@ func bastionToInstanceSpec(openStackCluster *infrav1.OpenStackCluster, cluster *
572578
RootVolume: machineSpec.RootVolume,
573579
ServerGroupID: resolved.ServerGroupID,
574580
Tags: compute.InstanceTags(machineSpec, openStackCluster),
581+
Metadata: metadata,
575582
}
576583
if bastion.AvailabilityZone != nil {
577584
instanceSpec.FailureDomain = *bastion.AvailabilityZone

0 commit comments

Comments
 (0)