Skip to content

Commit b686ba0

Browse files
committed
Skip the aws internal tags
1 parent e5b01de commit b686ba0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pkg/cloud/converters/tags.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package converters
1818

1919
import (
2020
"sort"
21+
"strings"
2122

2223
"github.com/aws/aws-sdk-go/aws"
2324
"github.com/aws/aws-sdk-go/service/autoscaling"
@@ -58,12 +59,14 @@ func MapToTags(src infrav1.Tags) []*ec2.Tag {
5859
tags := make([]*ec2.Tag, 0, len(src))
5960

6061
for k, v := range src {
61-
tag := &ec2.Tag{
62-
Key: aws.String(k),
63-
Value: aws.String(v),
64-
}
62+
if !strings.HasPrefix(k, "aws:") {
63+
tag := &ec2.Tag{
64+
Key: aws.String(k),
65+
Value: aws.String(v),
66+
}
6567

66-
tags = append(tags, tag)
68+
tags = append(tags, tag)
69+
}
6770
}
6871

6972
// Sort so that unit tests can expect a stable order

0 commit comments

Comments
 (0)