gce: set values for role labels

This seems to be required to keep terraform from always recreating
the instancegroup configuration (though that is likely a TF bug)
This commit is contained in:
justinsb 2025-04-27 14:15:01 -04:00
parent 46a8ffe24d
commit 51a58f4bd0
1 changed files with 2 additions and 2 deletions

View File

@ -184,11 +184,11 @@ func (b *AutoscalingGroupModelBuilder) buildInstanceTemplate(c *fi.CloudupModelB
roleLabel := gce.GceLabelNameRolePrefix + ig.Spec.Role.ToLowerString() roleLabel := gce.GceLabelNameRolePrefix + ig.Spec.Role.ToLowerString()
t.Labels = map[string]string{ t.Labels = map[string]string{
clusterLabel.Key: clusterLabel.Value, clusterLabel.Key: clusterLabel.Value,
roleLabel: "", roleLabel: ig.Spec.Role.ToLowerString(),
gce.GceLabelNameInstanceGroup: ig.ObjectMeta.Name, gce.GceLabelNameInstanceGroup: ig.ObjectMeta.Name,
} }
if ig.Spec.Role == kops.InstanceGroupRoleControlPlane { if ig.Spec.Role == kops.InstanceGroupRoleControlPlane {
t.Labels[gce.GceLabelNameRolePrefix+"master"] = "" t.Labels[gce.GceLabelNameRolePrefix+"master"] = "master"
} }
if gce.UsesIPAliases(b.Cluster) { if gce.UsesIPAliases(b.Cluster) {