Thanks to visit codestin.com
Credit goes to github.com

Skip to content

#884: Cleanup examples folder #938

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

Merged
merged 2 commits into from
Sep 14, 2019
Merged

#884: Cleanup examples folder #938

merged 2 commits into from
Sep 14, 2019

Conversation

scottilee
Copy link
Contributor

  • Added README
  • Added descriptions
  • Renamed files to consistent format (generally ..py)
  • Removes examples that are basically duplicates
  • Some minor refactoring

Fixes #884

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 21, 2019
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 21, 2019
Copy link
Contributor

@micw523 micw523 left a comment

Choose a reason for hiding this comment

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

I didn’t get through all of it, but some of the changes introduced here do warrant more discussion / more carefully thought over. Also, large PRs can be very hard to review.

# shortNames:
# - ct
"""
Uses a Custom Resource Definition (CRD) to create a custom object, in this case
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this first sentence needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you're asking? Let me know if you'd prefer something else.

@micw523
Copy link
Contributor

micw523 commented Sep 5, 2019

CI is failing - please address the code style suggestions by the CI

@scottilee
Copy link
Contributor Author

@micw523 I fixed all the code style suggestions related to the files touched in this PR but there's additional ones about unrelated files.

/home/travis/build/kubernetes-client/python/kubernetes/config/kube_config_test.py:1375:80: E501 line too long (96 > 79 characters)
/home/travis/build/kubernetes-client/python/kubernetes/watch/watch_test.py:81:80: E501 line too long (86 > 79 characters)
/home/travis/build/kubernetes-client/python/kubernetes/utils/quantity.py:24:80: E501 line too long (91 > 79 characters)

@micw523
Copy link
Contributor

micw523 commented Sep 5, 2019

E501 errors are non-blocking; the problems are in pod_namespace_watch.py, examples/pod_exec.py, pod_config_list.py, examples/custom_object.py. Try using autopep8 with aggressive level 2 on those files.

Copy link
Contributor

@micw523 micw523 left a comment

Choose a reason for hiding this comment

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

The create_deployment.py file is renamed to deployment_create_yaml.py. I prefer the previous name b/c this file is not using the create_from_yaml utlity but calling the API directly.

@@ -1,367 +0,0 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a little different from the create_deployment file since it is also using rollback and rollingupdate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Restored. I also changed deployment_create_yaml.py to deployment_create.py

Copy link
Member

Choose a reason for hiding this comment

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

Are these ipynb file auto-generated? Do they affect the document website? @micw523

Copy link
Contributor

Choose a reason for hiding this comment

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

This one is not automatically generated and was written by someone a long time ago. However, I believe this one is a little out of date for using beta API (?).

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 11, 2019
@scottilee scottilee requested a review from roycaihw September 11, 2019 20:47
@scottilee
Copy link
Contributor Author

Renamed files:

examples/create_deployment.py → examples/deployment_create.py
examples/deployment_examples.py → examples/deployment_crud.py
examples/example1.py → examples/in_cluster_config.py
examples/example2.py → examples/pod_namespace_watch.py
examples/example3.py → examples/api_discovery.py
examples/exec.py → examples/pod_exec.py
examples/ingress-example.py → examples/ingress_create.py
examples/job_examples.py → examples/job_crud.py
examples/manage_node_labels.py → examples/node_labels.py

@roycaihw
Copy link
Member

examples/example1.py → examples/in_cluster_config.py

example1 and in_cluster_config are under different assumptions and use different config loading methods. Could you keep both of them and rename example1 to out_of_cluster_config (similar to what client-go has)?

@scottilee
Copy link
Contributor Author

@roycaihw done, and I rebased.

@roycaihw
Copy link
Member

One major questions about unexpected example content being changed (oversight during copy-pasting?): #938 (comment). Otherwise looks pretty good. Thanks @scottilee!

/approve

@micw523 has lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roycaihw, scottilee

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 Sep 13, 2019
@micw523
Copy link
Contributor

micw523 commented Sep 13, 2019

Yeah, lgtm to me as long as the last round of comments are addressed.

@micw523
Copy link
Contributor

micw523 commented Sep 14, 2019

/lgtm
Since there are only two commits I’m gonna lgtm this

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 14, 2019
@k8s-ci-robot k8s-ci-robot merged commit ceaf188 into kubernetes-client:master Sep 14, 2019
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix and Update Existing Examples
4 participants