python icon indicating copy to clipboard operation
python copied to clipboard

feat: add yaml processor to create/delete resources from yaml manifest files

Open kocarba opened this issue 8 months ago • 4 comments

  • Implement delete_from_yaml functionality
  • Combine create_from_yaml and delete_from_yaml into yaml_processor, preserving existing signatures for create (original PR #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:

  • Original implementation started in PR #1392 by @DiptoChakrabarty
  • This PR revives and modernizes that work, rebased on latest master
  • All relevant tests pass locally; 4 unrelated (outside of scope of change) test failures/errors occur before and after changes

Does this PR introduce a user-facing change?

Added the ability to choose to create or delete resources from yaml manifest files.
Refactored into a new internal `yaml_processor` module (backwards-compatible).

kocarba avatar Mar 26 '25 04:03 kocarba

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: kocarba (b18352f9084096b87850db9fe7145f887769c5f2, 5f486fb1be5ad915f16979bddb57d32d880f8526)

Welcome @kocarba!

It looks like this is your first PR to kubernetes-client/python 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-client/python has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Mar 26 '25 04:03 k8s-ci-robot

/assign @yliaog

roycaihw avatar Mar 26 '25 20:03 roycaihw

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kocarba Once this PR has been reviewed and has the lgtm label, please ask for approval from yliaog. For more information see the Code Review Process.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 20 '25 19:04 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 24 '25 17:08 k8s-triage-robot

/remove-lifecycle stale

ThisIsQasim avatar Aug 24 '25 17:08 ThisIsQasim

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 22 '25 18:11 k8s-triage-robot