Skip to content

Commit

Permalink
Fix bastion serverMetadata not applied
Browse files Browse the repository at this point in the history
- Fixed issue where spec.bastion.spec.serverMetadata was not set in bastion.
- Updated bastionToInstanceSpec to apply serverMetadata in InstanceSpec.
  • Loading branch information
namgon-kim authored and EmilienM committed Oct 29, 2024
1 parent e4730ca commit 3b57409
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/openstackcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 3b57409

Please sign in to comment.