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

Add example to demonstrate usage of patch_cluster_custom_object method #1437

Conversation

Priyankasaggu11929
Copy link
Contributor

@Priyankasaggu11929 Priyankasaggu11929 commented Apr 28, 2021

What type of PR is this?

/kind documentation

What this PR does / why we need it:

This PR adds a new example python script examples/cluster_scoped_custom_object.py which demonstrates the use of kubernetes.client.CustomObjectsApi for a cluster scoped custom resource. It does the following:

  • create a cluster scoped custom resource using create_cluster_custom_object method.
  • get a specific cluster scoped custom resoucee using get_cluster_custom_object method.
  • patch a cluster scoped custom resource using patch_cluster_custom_object.

This newly added example suffices the ask in the issue #1427.

Which issue(s) this PR fixes:

Fixes #1427

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 28, 2021
@k8s-ci-robot k8s-ci-robot requested review from roycaihw and yliaog April 28, 2021 14:37
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 28, 2021
Copy link
Member

@roycaihw roycaihw left a comment

Choose a reason for hiding this comment

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

Could you paste a sample output?

examples/cluster_scoped_custom_object.py Outdated Show resolved Hide resolved
@Priyankasaggu11929
Copy link
Contributor Author

The output looks like the following:

Screenshot from 2021-04-28 22-43-09

Copy link
Member

@roycaihw roycaihw left a comment

Choose a reason for hiding this comment

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

A few nits. LGTM otherwise

examples/cluster_scoped_custom_object.py Outdated Show resolved Hide resolved
examples/cluster_scoped_custom_object.py Outdated Show resolved Hide resolved
@yliaog
Copy link
Contributor

yliaog commented Apr 28, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 28, 2021
@Priyankasaggu11929
Copy link
Contributor Author

@yliaog, all prow tests passed successfully this time. PR now needs an approved label to be merged. Could you mark it approved.

Thank you.

@yliaog
Copy link
Contributor

yliaog commented Apr 28, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Priyankasaggu11929, yliaog

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

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 28, 2021
@k8s-ci-robot k8s-ci-robot merged commit 0ea3542 into kubernetes-client:master Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example of body format for patch_cluster_custom_object
4 participants