Unverified Commit 880dbd33 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #64231 from twilfong/patch-1

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Update function hasClusterTag to fix issue #64230 **What this PR does / why we need it**: Fixes issue #64230, by changing function hasClusterTag, in aws/tags.go, to ensure that, when called with a list of tags containing a tag with a key which matches clusterTagKey, function will return true even if a tag with key TagNameKubernetesClusterLegacy also exists in the list with a value other than the ClusterID. **Which issue(s) this PR fixes**: Fixes #64230 **Special notes for your reviewer**: Notes are in issue **Release note**: ```release-note NONE ```
parents a176a8b1 fc1d9dbd
...@@ -138,10 +138,10 @@ func (t *awsTagging) hasClusterTag(tags []*ec2.Tag) bool { ...@@ -138,10 +138,10 @@ func (t *awsTagging) hasClusterTag(tags []*ec2.Tag) bool {
for _, tag := range tags { for _, tag := range tags {
tagKey := aws.StringValue(tag.Key) tagKey := aws.StringValue(tag.Key)
// For 1.6, we continue to recognize the legacy tags, for the 1.5 -> 1.6 upgrade // For 1.6, we continue to recognize the legacy tags, for the 1.5 -> 1.6 upgrade
if tagKey == TagNameKubernetesClusterLegacy { // Note that we want to continue traversing tag list if we see a legacy tag with value != ClusterID
return aws.StringValue(tag.Value) == t.ClusterID if (tagKey == TagNameKubernetesClusterLegacy) && (aws.StringValue(tag.Value) == t.ClusterID) {
return true
} }
if tagKey == clusterTagKey { if tagKey == clusterTagKey {
return true return true
} }
......
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