feat: add yaml processor to create/delete resources from yaml manifest files#2377
feat: add yaml processor to create/delete resources from yaml manifest files#2377kocarba wants to merge 2 commits intokubernetes-client:masterfrom
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.
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.
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.
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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
|
/remove-lifecycle stale |
|
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
|
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
|
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
|
@k8s-triage-robot: Closed this PR. DetailsIn response to this:
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-sigs/prow repository. |
(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:
masterDoes this PR introduce a user-facing change?