Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kocarba wants to merge2 commits intokubernetes-client:master
base:master
Choose a base branch
Loading
fromkocarba:pr/create-delete-utils

Conversation

kocarba
Copy link

@kocarbakocarba commentedMar 26, 2025
edited
Loading

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:

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).

ThisIsQasim and jeski-jit reacted with thumbs up emoji
@k8s-ci-robotk8s-ci-robot added release-noteDenotes a PR that will be considered when it comes time to generate release notes. do-not-merge/invalid-commit-messageIndicates that a PR should not merge because it has an invalid commit message. kind/featureCategorizes issue or PR as related to a new feature. labelsMar 26, 2025
@linux-foundation-easyclaLinux Foundation: EasyCLA
Copy link

linux-foundation-easyclabot commentedMar 26, 2025
edited
Loading

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robotk8s-ci-robot added the cncf-cla: noIndicates the PR's author has not signed the CNCF CLA. labelMar 26, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome@kocarba!

It looks like this is your first PR tokubernetes-client/python 🎉. Please refer to ourpull 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 hasits own contribution guidelines.

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

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

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robotk8s-ci-robot added size/XLDenotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yesIndicates the PR's author has signed the CNCF CLA. and removed cncf-cla: noIndicates the PR's author has not signed the CNCF CLA. labelsMar 26, 2025
@kocarbakocarba changed the titleRevive PR #1392: solves #940 and update to latestfeature: Revive PR #1392: solves #940 and update to latestMar 26, 2025
@kocarbakocarba changed the titlefeature: Revive PR #1392: solves #940 and update to latestfeature: add yaml processor to create/delete resources from yaml manifest filesMar 26, 2025
@kocarbakocarbaforce-pushed thepr/create-delete-utils branch from73aeb93 tob18352fCompareMarch 26, 2025 04:48
@kocarbakocarba changed the titlefeature: add yaml processor to create/delete resources from yaml manifest filesfeat: add yaml processor to create/delete resources from yaml manifest filesMar 26, 2025
@k8s-ci-robotk8s-ci-robot removed the do-not-merge/invalid-commit-messageIndicates that a PR should not merge because it has an invalid commit message. labelMar 26, 2025
@roycaihw
Copy link
Member

/assign@yliaog

body=yml_object, field_manager="python-client", **kwargs
)
elif action == "delete":
resp = apply_client.delete(

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

Suggested change
resp=apply_client.delete(
name=yml_object["metadata"]["name"]
resp=apply_client.delete(
body=yml_object,field_manager="python-client",**kwargs
)

Copy link
Author

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.

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 tohttps://github.com/tomplus/kubernetes_asyncio

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR isNOT APPROVED

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

The full list of commands accepted by this bot can be foundhere.

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ThisIsQasimThisIsQasimThisIsQasim left review comments

@roycaihwroycaihwAwaiting requested review from roycaihw

@yliaogyliaogAwaiting requested review from yliaog

Assignees

@yliaogyliaog

Labels
cncf-cla: yesIndicates the PR's author has signed the CNCF CLA.kind/featureCategorizes issue or PR as related to a new feature.release-noteDenotes a PR that will be considered when it comes time to generate release notes.size/XLDenotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

delete_from_yaml
5 participants
@kocarba@k8s-ci-robot@roycaihw@ThisIsQasim@yliaog

[8]ページ先頭

©2009-2025 Movatter.jp