mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Fix hasClusterTag to actually get behavior we want
This commit is contained in:
parent
d8d2a4e84c
commit
fc1d9dbd18
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user