-
Notifications
You must be signed in to change notification settings - Fork 24
[feat]: allow adding resource policy to dynamodb tables #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[feat]: allow adding resource policy to dynamodb tables #154
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shabbskagalwala The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @shabbskagalwala. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
f868396
to
2266683
Compare
2266683
to
7f28e30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @shabbskagalwala ! this looks great overall - i left a few comments in line :)
pkg/resource/table/hooks.go
Outdated
if ackcompare.HasNilDifference(a.ko.Spec.ResourcePolicy, b.ko.Spec.ResourcePolicy) { | ||
delta.Add("Spec.ResourcePolicy", a.ko.Spec.ResourcePolicy, b.ko.Spec.ResourcePolicy) | ||
} else if a.ko.Spec.ResourcePolicy != nil && b.ko.Spec.ResourcePolicy != nil { | ||
if *a.ko.Spec.ResourcePolicy != *b.ko.Spec.ResourcePolicy { | ||
delta.Add("Spec.ResourcePolicy", a.ko.Spec.ResourcePolicy, b.ko.Spec.ResourcePolicy) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this block the same the original generated code when we set compare.is_ignore: false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually we do have a way to parse IAM policies that gets formatted/reformatted by the AWS APIs, checkout https://github.com/aws-controllers-k8s/iam-controller/blob/main/pkg/resource/role/hooks.go#L398-L432
} | ||
if !delta.DifferentExcept("Spec.Tags") { | ||
|
||
// ResourcePolicy can be updated independently of table state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shabbskagalwala can we also get some basic e2e tests for this feature? a test case here would be great https://github.com/aws-controllers-k8s/dynamodb-controller/blob/main/test/e2e/tests/test_table.py
Co-authored-by: Amine <hilalyamine@gmail.com>
77b0bb0
to
cb66843
Compare
@shabbskagalwala: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Issue #, if available: aws-controllers-k8s/community#2655
Description of changes:
Allows to add a resource policy to a dynamodb table.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.