-
Notifications
You must be signed in to change notification settings - Fork 3.3k
add examples of deployment object #345
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
Conversation
Ping @mbohlool .I have updated the code style for PEP8. Now, it's ready to be reviewed. |
examples/deployment_examples.py
Outdated
# Update container image | ||
deployment.container.image = "nginx:1.9.1" | ||
# Update the deployment | ||
api_response = api_instance.replace_namespaced_deployment( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you use patch_namespaced_deployment
here as it is the recommended way to update an API object. Replace can have unintentional consequences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion.
@mbohlool Updated. Plz review. |
Have you actually tried this code? specially the patch that you just changed? I just want to make sure it is working for you before merging it into master. I will see if I can give it a try tomorrow. |
@DjangoPeng I tried these examples and they gave me syntax errors. That could be because of the new client generation. Can you please take a look at them and make sure that they can be run? |
@mbohlool I have fixed the error and tested all examples by myself. Please review and check. |
@DjangoPeng The branch is out of date. The new client has some differences (like you need to provide required fields on model creation, etc.). Please rebase to master and run the examples again. An example failure I get:
|
@mbohlool Ok, I'll test it today . |
I run all examples on Kubernetes 1.7 with client-python 3.0, and I attached the stdout as below. It looks like all is well. Should I try it on Kubernetes 1.8, or what?
|
Use master. You can goto root folder of repo and call |
@mbohlool Now, it works on latest master branch. I delete the rollback example because there is a error that I'm debugging and identifying. When I solve it, I'll make a new PR to append the rollback example. |
@mbohlool Please review the PR. I think it's ready to be merged. |
@DjangoPeng Thanks. Great work. |
I have updated the description of the PR. Welcome to append the rollback example of Deployment. |
Add 4 examples of deployment object, including:
@mbohlool Please check the PR. Refer this issue