Skip to content
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

Allow setting controller block owner deletion false #858

Merged

Conversation

nashant
Copy link
Contributor

@nashant nashant commented Nov 1, 2021

What do these changes do?

This will allow setting controller and blockOwnerDeletion from both build_owner_references and append_owner_references

Description

Previous behaviour:
Error from trying to set multiple owner controllers

New behaviour:
Allow explicitly setting controller=False, so no error

Does the change affect end users?
Only if they choose to use it

Issues/PRs

Related:
#687

Type of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • The code addresses only the mentioned problem, and this problem only
  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt

@nashant nashant requested a review from nolar as a code owner November 1, 2021 19:23
@nashant nashant force-pushed the allow-setting-controller-blockOwnerDeletion-False branch from 980ded5 to 1ebaaf2 Compare November 1, 2021 19:24
Copy link
Owner

@nolar nolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it also make sense to add these same-named arguments to kopf.adopt() — an aggregate on top of all these ownership/hierarchy functions? For consistency of the interfaces. Wdyt?

kopf/_cogs/structs/bodies.py Show resolved Hide resolved
kopf/_kits/hierarchies.py Show resolved Hide resolved
@nolar
Copy link
Owner

nolar commented Nov 2, 2021

Please rebase on main and force-push — #859 has fixed the tests.

@nashant nashant force-pushed the allow-setting-controller-blockOwnerDeletion-False branch from eefe7df to f491fe8 Compare November 2, 2021 09:33
@nashant
Copy link
Contributor Author

nashant commented Nov 2, 2021

Would it also make sense to add these same-named arguments to kopf.adopt() — an aggregate on top of all these ownership/hierarchy functions? For consistency of the interfaces. Wdyt?

I considered that and decided probably not. As per the comment you left on the issue I referenced I think adopt means that the child is under full control of the parent. If I'm adding an owner ref explicitly then I may well want to have multiple, if I'm adopting then I want that as the only owner

@nashant nashant force-pushed the allow-setting-controller-blockOwnerDeletion-False branch 5 times, most recently from d2aece4 to eddb1b4 Compare November 2, 2021 09:55
@nashant
Copy link
Contributor Author

nashant commented Nov 2, 2021

I've rebased against main but am still getting the tests/hierarchies/test_labelling.py failures

@nashant nashant force-pushed the allow-setting-controller-blockOwnerDeletion-False branch from eddb1b4 to 735c4c4 Compare November 2, 2021 10:05
anthonynashduco and others added 8 commits November 2, 2021 10:05
Signed-off-by: Anthony Nash <anthony.nash@du.co>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
controller/block_owner_deletion kwargs only

Co-authored-by: Sergey Vasilyev <nolar@nolar.info>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
controller/block_owner_deletion kwargs only

Co-authored-by: Sergey Vasilyev <nolar@nolar.info>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
Signed-off-by: Anthony Nash <anthony.nash@du.co>
@nashant nashant force-pushed the allow-setting-controller-blockOwnerDeletion-False branch from 735c4c4 to 4eec6f9 Compare November 2, 2021 10:05
@nashant
Copy link
Contributor Author

nashant commented Nov 2, 2021

Ok, I've re-rebased against your main (forgot I had accidentally pushed to my main) and commits are now clean, but still the same test failures

@nashant nashant requested a review from nolar November 2, 2021 10:15
@nashant
Copy link
Contributor Author

nashant commented Nov 4, 2021

Would it also make sense to add these same-named arguments to kopf.adopt() — an aggregate on top of all these ownership/hierarchy functions? For consistency of the interfaces. Wdyt?

I considered that and decided probably not. As per the comment you left on the issue I referenced I think adopt means that the child is under full control of the parent. If I'm adding an owner ref explicitly then I may well want to have multiple, if I'm adopting then I want that as the only owner

@nolar what would you prefer?

@nolar nolar merged commit b1ae024 into nolar:main Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants