From fc1d9dbd181043003172adebcd23ea12e01f4b65 Mon Sep 17 00:00:00 2001 From: Tim Wilfong Date: Thu, 24 May 2018 19:23:12 -0700 Subject: [PATCH] Fix hasClusterTag to actually get behavior we want --- pkg/cloudprovider/providers/aws/tags.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cloudprovider/providers/aws/tags.go b/pkg/cloudprovider/providers/aws/tags.go index 2daff4d4e4..43130c3601 100644 --- a/pkg/cloudprovider/providers/aws/tags.go +++ b/pkg/cloudprovider/providers/aws/tags.go @@ -137,13 +137,13 @@ func (t *awsTagging) hasClusterTag(tags []*ec2.Tag) bool { clusterTagKey := t.clusterTagKey() for _, tag := range tags { tagKey := aws.StringValue(tag.Key) - // Check if this is a newer-style cluster tag before checking if legacy tag value matches ClusterID - if tagKey == clusterTagKey { + // For 1.6, we continue to recognize the legacy tags, for the 1.5 -> 1.6 upgrade + // 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 } - // For 1.6, we continue to recognize the legacy tags, for the 1.5 -> 1.6 upgrade - if tagKey == TagNameKubernetesClusterLegacy { - return aws.StringValue(tag.Value) == t.ClusterID + if tagKey == clusterTagKey { + return true } } return false