Unverified Commit fc1d9dbd authored by Tim Wilfong's avatar Tim Wilfong Committed by GitHub

Fix hasClusterTag to actually get behavior we want

parent d8d2a4e8
...@@ -137,13 +137,13 @@ func (t *awsTagging) hasClusterTag(tags []*ec2.Tag) bool { ...@@ -137,13 +137,13 @@ func (t *awsTagging) hasClusterTag(tags []*ec2.Tag) bool {
clusterTagKey := t.clusterTagKey() clusterTagKey := t.clusterTagKey()
for _, tag := range tags { for _, tag := range tags {
tagKey := aws.StringValue(tag.Key) tagKey := aws.StringValue(tag.Key)
// Check if this is a newer-style cluster tag before checking if legacy tag value matches ClusterID // For 1.6, we continue to recognize the legacy tags, for the 1.5 -> 1.6 upgrade
if tagKey == clusterTagKey { // Note that we want to continue traversing tag list if we see a legacy tag with value != ClusterID
if (tagKey == TagNameKubernetesClusterLegacy) && (aws.StringValue(tag.Value) == t.ClusterID) {
return true return true
} }
// For 1.6, we continue to recognize the legacy tags, for the 1.5 -> 1.6 upgrade if tagKey == clusterTagKey {
if tagKey == TagNameKubernetesClusterLegacy { return true
return aws.StringValue(tag.Value) == t.ClusterID
} }
} }
return false return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment