Skip to content

Commit ffdd96a

Browse files
fix: evaluate controller-added tags (#314)
Signed-off-by: Eytan Avisror <[email protected]>
1 parent ea5c8ae commit ffdd96a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

controllers/provisioners/eks/update.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,11 @@ func (ctx *EksInstanceGroupContext) UpdateScalingGroup(configName string, scalin
235235

236236
func (ctx *EksInstanceGroupContext) TagsUpdateNeeded() bool {
237237
var (
238-
instanceGroup = ctx.GetInstanceGroup()
239-
configuration = instanceGroup.GetEKSConfiguration()
240-
state = ctx.GetDiscoveredState()
241-
scalingGroup = state.GetScalingGroup()
242-
asgName = aws.StringValue(scalingGroup.AutoScalingGroupName)
243-
rmTags = ctx.GetRemovedTags(asgName)
238+
state = ctx.GetDiscoveredState()
239+
scalingGroup = state.GetScalingGroup()
240+
asgName = aws.StringValue(scalingGroup.AutoScalingGroupName)
241+
rmTags = ctx.GetRemovedTags(asgName)
242+
addedTags = ctx.GetAddedTags(asgName)
244243
)
245244

246245
if len(rmTags) > 0 {
@@ -256,7 +255,11 @@ func (ctx *EksInstanceGroupContext) TagsUpdateNeeded() bool {
256255
existingTags = append(existingTags, tagSet)
257256
}
258257

259-
for _, tag := range configuration.GetTags() {
258+
for _, tag := range addedTags {
259+
tag := map[string]string{
260+
"key": aws.StringValue(tag.Key),
261+
"value": aws.StringValue(tag.Value),
262+
}
260263
if !common.StringMapSliceContains(existingTags, tag) {
261264
return true
262265
}

0 commit comments

Comments
 (0)