-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat: add yaml processor to create/delete resources from yaml manifest files #2377
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: master
Are you sure you want to change the base?
Conversation
Welcome @kocarba! |
73aeb93
to
b18352f
Compare
/assign @yliaog |
body=yml_object, field_manager="python-client", **kwargs | ||
) | ||
elif action == "delete": | ||
resp = apply_client.delete( |
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.
DynamicClient delete function only takes the resource name
resp = apply_client.delete( | |
name = yml_object["metadata"]["name"] | |
resp = apply_client.delete( | |
body=yml_object, field_manager="python-client", **kwargs | |
) |
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 for the feedback, @ThisIsQasim. I updated the code based on your suggestions. 5f486fb
Summary of changes:
- Modify the delete method call to use the name only
- Add an E2E test for process_from_yaml with the arguments for apply and action
Let me know if anything else needs adjustment, or if this looks good to you.
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.
Hey @kocarba,
Thanks for the fix but unfortunately I am not a maintainer so can’t review/merge. Also I ended up switching to https://github.com/tomplus/kubernetes_asyncio
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kocarba 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 |
(original PR Delete kubernetes resources from yaml files , solves #940 #1392 by @DiptoChakrabarty)
What type of PR is this?
/kind feature
What this PR does / why we need it:
The kubernetes python client has the ability to create resources from yaml files but lacks the ability to delete resources from yaml files. A delete action is provided to delete kubernetes resources in addition to the existing create.
This closes a long standing feature request in #940, and refactors the existing logic into a combined internal module while preserving backwards compatibility for existing users.
Which issue(s) this PR fixes:
Fixes #940
Special notes for your reviewer:
master
Does this PR introduce a user-facing change?