-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Tag and Untag APIs for User resource. (#45)
Issue #, if available: Customers cannot update tags of User resource after creation. Description of changes: Add functions so that customers can update tags of User resource after creation. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
- Loading branch information
1 parent
0cd29f3
commit 2e57557
Showing
8 changed files
with
258 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
ack_generate_info: | ||
build_date: "2022-12-23T06:27:19Z" | ||
build_date: "2022-12-23T17:00:07Z" | ||
build_hash: 16f0e201b37a06b535370cc69e11adb934a22d33 | ||
go_version: go1.19 | ||
version: v0.20.1-18-g16f0e20 | ||
api_directory_checksum: a1e396caca4bdd1612fa7d09f0ee56f3e4976ff7 | ||
api_version: v1alpha1 | ||
aws_sdk_go_version: v1.44.93 | ||
generator_config_info: | ||
file_checksum: 62ca61f60f6152f6c53f31b6ebbe43b39f86d225 | ||
file_checksum: f50534e33903e1ca74491595fd6c21351988eb1c | ||
original_file_name: generator.yaml | ||
last_modification: | ||
reason: API generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
resourceARN := (*string)(ko.Status.ACKResourceMetadata.ARN) | ||
tags, err := rm.getTags(ctx, *resourceARN) | ||
if err != nil { | ||
return nil, err | ||
} | ||
ko.Spec.Tags = tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
res, err := rm.validateUserNeedsUpdate(desired, latest, delta) | ||
res, err := rm.validateUserNeedsUpdate(desired, latest, delta) | ||
|
||
if err != nil || res!= nil{ | ||
return res, err | ||
} | ||
if err != nil || res!= nil{ | ||
return res, err | ||
} | ||
|
||
if delta.DifferentAt("Spec.Tags") { | ||
err = rm.updateTags(ctx, desired, latest) | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
|
||
if !delta.DifferentExcept("Spec.Tags") { | ||
return desired, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
id: "USER_UPDATE_WITH_TAGS" | ||
description: "In this test we create User and update its tags" | ||
#marks: | ||
# - slow | ||
# - blocked | ||
resource: | ||
apiVersion: $CRD_GROUP/$CRD_VERSION | ||
kind: User | ||
metadata: | ||
name: user$RANDOM_SUFFIX | ||
steps: | ||
- id: "USER_INITIAL_CREATE" | ||
description: "Create User" | ||
create: | ||
spec: | ||
name: user$RANDOM_SUFFIX | ||
accessString: on +get | ||
authenticationMode: | ||
type_: password | ||
passwords: | ||
- key: password | ||
name: $SECRET1 | ||
wait: | ||
status: | ||
conditions: | ||
ACK.ResourceSynced: | ||
status: "True" | ||
timeout: 100 | ||
- id: "USER_ADD_TAGS" | ||
description: "Add tags in User" | ||
patch: | ||
spec: | ||
tags: | ||
- key: "test_key_1" | ||
value: "test_value_1" | ||
- key: "test_key_2" | ||
- key: | ||
wait: | ||
status: | ||
conditions: | ||
ACK.ResourceSynced: | ||
status: "True" | ||
timeout: 100 | ||
- id: "USER_DELETE_TAGS" | ||
description: "Delete tags in User" | ||
patch: | ||
spec: | ||
tags: | ||
- key: "test_key_1" | ||
value: "test_value_1" | ||
wait: | ||
status: | ||
conditions: | ||
ACK.ResourceSynced: | ||
status: "True" | ||
timeout: 100 | ||
- id: "SG_ADD_AND_DELETE_TAGS" | ||
description: "Add some tags and delete some tags in User" | ||
patch: | ||
spec: | ||
tags: | ||
- key: "test_key_2" | ||
value: "test_value_2" | ||
wait: | ||
status: | ||
conditions: | ||
ACK.ResourceSynced: | ||
status: "True" | ||
timeout: 100 | ||
- id: "DELETE_USER" | ||
description: "Delete User" | ||
delete: user$RANDOM_SUFFIX |