Skip to content

Commit

Permalink
Merge pull request #2179 from namgon-kim/bugfix/bastion-metadata
Browse files Browse the repository at this point in the history
πŸ›  Fix ServerMetadata Not Applied to Bastion in OpenStackCluster
  • Loading branch information
k8s-ci-robot authored Oct 29, 2024
2 parents e4730ca + 3b57409 commit 4d9dadf
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 4d9dadf

Please sign in to comment.