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
Implement feature management policy and reference #21
Implement feature management policy and reference #21
Conversation
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Hi @turkenh This is the initial commit for an early review. The feature has been manually tested at local and I was adding test cases to catch up the code coverage, will submit a second commit including the test cases soon. |
Signed-off-by: Ying Mo <morningspace@yahoo.com>
d7bcc5a
to
e8ea770
Compare
Added test cases and now the coverage has been increased to 81.17% :-) https://codecov.io/github/crossplane-contrib/provider-kubernetes/commit/d7bcc5a8e1aff6bad593147b0f2b95fd4af31405 |
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.
Thanks @morningspace, added couple of comments mostly around styling and nitpick.
I just have some questions for the client to use reference resolution and also a concern with ignoring errors.
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Code has been updated according to the review comments. Now, all newly added code has been fully covered by unit tests. :-) @turkenh |
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.
Looking pretty good @morningspace, I think we are very close to get this merged.
I did some testing this time using the manifest I used in some of my comments and working well except minor issues I've commented.
Could you also include some examples under examples/object
and fill the How has this code been tested
section in PR description :)
Thanks again also for your patience during this review process!
err = f.handleRefFinalizer(ctx, obj, func( | ||
ctx context.Context, res *unstructured.Unstructured, finalizer string) error { | ||
if !meta.FinalizerExists(res, finalizer) { | ||
meta.AddFinalizer(res, finalizer) |
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.
One problem with adding finalizers to referred resources is how to handle changes there. For example, an Object
depends on secret-a
, but then changed to secret-b
with a kubectl apply
, in that case, we would need to remove finalizer from secret-a
and add secret-b
.
However, this could be handled with a subsequent PR, feel free to create an issue to track such a case and ignore for this PR.
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.
That makes sense. Issue created #28.
@morningspace can you check latest comments ? We really want to use this feature ;) |
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Signed-off-by: Ying Mo <morningspace@yahoo.com>
…-kubernetes into feature-mgmtpolicy-reference
…eam change Signed-off-by: Ying Mo <morningspace@yahoo.com>
5bba4ec
to
6a2499b
Compare
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Signed-off-by: Ying Mo <morningspace@yahoo.com>
Alright, I think ultimately I've made all changes needed per latest comments. @turkenh Could you please take another round of review, and see if anything missed :-) |
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.
Looking great, thanks for incorporating all the feedback @morningspace 👍
My only suggestion would be to consider some sort of documentation, especially how to configure RBAC if other resources need to be referenced. Your design doc is already great for anyone that wants to understand how things are working (which also needs some updates due to naming changes during implementation), but a simpler document or maybe a small section in Readme could be helpful. But this is definitely not blocking, please let me know if you want to handle this separately so that we can merge this!
@turkenh wow, it's great to see the PR gets approved ultimately! Re: docs updates, sure, how about having a separate PR to address it since this PR has been full of so many comments and makes it hard to follow. I will start another PR to cover all docs related work. |
Instead of the patchesFrom being another object could it be from a patchSet? I’m trying to patch aws-auth which mapRoles is a Literal Scalar Block |
@cdenneen IIUC, you are referring to the |
Signed-off-by: Ying Mo morningspace@yahoo.com
Description of your changes
Fixes #13 to implement the proposed features that are documented in this design doc.
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
All newly-added methods have been tested by adding new test cases in
object_test.go
. Just follow the same pattern that is used onobject_test.go
to define sample data, add new cases with expected results, and iterate over the cases to triggerObserve/Create/Update/Delete
, alsoAddFinalizer/RemoveFinalizer
. The code coverage has also been increased.