diff --git a/pkg/cloudprovider/providers/aws/tags.go b/pkg/cloudprovider/providers/aws/tags.go index 40947cb379f..2a293e7271f 100644 --- a/pkg/cloudprovider/providers/aws/tags.go +++ b/pkg/cloudprovider/providers/aws/tags.go @@ -137,14 +137,14 @@ 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 { + 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 }