Skip to content

Commit cdecbbb

Browse files
committed
remove value check for tags
1 parent fa4ffab commit cdecbbb

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pkg/awsutils/awsutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ func checkClusterTags(tags []ec2types.Tag, localClusterTagKey string) (hasCluste
13541354
for _, tag := range tags {
13551355
if tag.Key != nil && strings.HasPrefix(*tag.Key, clusterTagKeyPrefix) {
13561356
hasClusterTags = true
1357-
if *tag.Key == localClusterTagKey && tag.Value != nil && *tag.Value == "shared" {
1357+
if *tag.Key == localClusterTagKey {
13581358
belongsToThisCluster = true
13591359
}
13601360
}

pkg/awsutils/awsutils_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,7 @@ func TestValidTagWithClusterSpecificTags(t *testing.T) {
24522452
description: "Should NOT be available to any cluster when CNI tag is missing",
24532453
},
24542454
{
2455-
name: "primary subnet with wrong cluster value",
2455+
name: "primary subnet with cluster tag (value ignored)",
24562456
subnet: ec2types.Subnet{
24572457
SubnetId: aws.String("subnet-def"),
24582458
Tags: []ec2types.Tag{
@@ -2462,13 +2462,13 @@ func TestValidTagWithClusterSpecificTags(t *testing.T) {
24622462
},
24632463
{
24642464
Key: aws.String("kubernetes.io/cluster/" + testClusterName),
2465-
Value: aws.String("not-shared"), // Wrong value
2465+
Value: aws.String("not-shared"), // Value doesn't matter, only key
24662466
},
24672467
},
24682468
},
24692469
isPrimarySubnet: true,
2470-
want: false,
2471-
description: "Should NOT be available when cluster tag has wrong value",
2470+
want: true,
2471+
description: "Should be available when cluster tag key matches (value ignored)",
24722472
},
24732473
}
24742474

0 commit comments

Comments
 (0)