Only set NTH ManagedASGTag label if it doesn't already exist

This commit is contained in:
Peter Rifel 2024-12-16 21:50:19 -06:00
parent c6334caeb0
commit 12b9fac068
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -161,7 +161,10 @@ func (b *KopsModelContext) CloudTagsForInstanceGroup(ig *kops.InstanceGroup) (ma
// Apply NTH Labels
nth := b.Cluster.Spec.CloudProvider.AWS.NodeTerminationHandler
if nth.IsQueueMode() {
labels[fi.ValueOf(nth.ManagedASGTag)] = ""
k := fi.ValueOf(nth.ManagedASGTag)
if _, ok := labels[k]; !ok && k != "" {
labels[k] = ""
}
}
}