File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You may
4
+ # not use this file except in compliance with the License. A copy of the
5
+ # License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is distributed
10
+ # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
11
+ # express or implied. See the License for the specific language governing
12
+ # permissions and limitations under the License.
13
+
14
+ """Utilities for working with tags
15
+ TODO(vijtrip2): reuse tag utility from test-infra/acktest.
16
+ Currently using this duplicate method to punt changing the
17
+ way resources are bootstrapped
18
+ """
19
+
20
+ ACK_SYSTEM_TAG_PREFIX = "services.k8s.aws/"
21
+
22
+
23
+ def clean (tags ):
24
+ """Returns supplied tags collection, stripped of ACK system tags.
25
+ """
26
+ return [
27
+ t for t in tags if not t ['Key' ].startswith (ACK_SYSTEM_TAG_PREFIX )
28
+ ]
Original file line number Diff line number Diff line change 28
28
get_resource_tags ,
29
29
)
30
30
from e2e .replacement_values import REPLACEMENT_VALUES
31
+ from e2e import tag
31
32
32
33
RESOURCE_PLURAL = "tables"
33
34
@@ -153,7 +154,7 @@ def test_table_update_tags(self, dynamodb_client):
153
154
k8s .patch_custom_resource (ref , cr )
154
155
time .sleep (UPDATE_TAGS_WAIT_AFTER_SECONDS )
155
156
156
- table_tags = get_resource_tags (cr ["status" ]["ackResourceMetadata" ]["arn" ])
157
+ table_tags = tag . clean ( get_resource_tags (cr ["status" ]["ackResourceMetadata" ]["arn" ]) )
157
158
assert len (table_tags ) == len (tags )
158
159
assert table_tags [0 ]['Key' ] == tags [0 ]['key' ]
159
160
assert table_tags [0 ]['Value' ] == tags [0 ]['value' ]
You can’t perform that action at this time.
0 commit comments