Skip to content

Commit 8ec01d3

Browse files
committed
fix: only append if not empty
1 parent 5bd4c48 commit 8ec01d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/controller/metalstackmachine_controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,9 @@ func (r *machineReconciler) machineTags() []string {
450450
func (r *machineReconciler) additionalMachineTags(partition *models.V1PartitionResponse) []string {
451451
tags := []string{
452452
tag.New(corev1.LabelTopologyZone, r.infraCluster.Spec.Partition),
453-
tag.New(corev1.LabelTopologyRegion, partition.Labels[tag.PartitionRegion]),
453+
}
454+
if partition.Labels != nil && partition.Labels[tag.PartitionRegion] != "" {
455+
tags = append(tags, partition.Labels[tag.PartitionRegion])
454456
}
455457

456458
return tags

0 commit comments

Comments
 (0)