-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
update deployment_crud.py
to include a restart_deployment
method for typed client
#1452
update deployment_crud.py
to include a restart_deployment
method for typed client
#1452
Conversation
bff3fc8
to
f6efc56
Compare
thanks for the pr |
f6efc56
to
b0767eb
Compare
b0767eb
to
8be8e87
Compare
/lgtm |
Hi @yliaog, some of the travis CI jobs are failing. I’m unable to understand the issues here. Could you please point me with what might be a fix for this? https://travis-ci.org/github/kubernetes-client/python/jobs/769364787#L329 thank you. |
from https://travis-ci.org/github/kubernetes-client/python/jobs/769364787#L329 /home/travis/build/kubernetes-client/python/kubernetes/../examples/deployment_crud.py:16:80: E501 line too long (84 > 79 characters) |
8be8e87
to
c77a8ba
Compare
c77a8ba
to
32558c3
Compare
Thank you so much for pointing. I'm trying to fix them. |
0f7edfa
to
15365fe
Compare
15365fe
to
1118e3c
Compare
closing to trigger CI |
@yliaog: Reopened this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
# Create a deployment object with client-python API. The deployment we | ||
# created is same as the `nginx-deployment.yaml` in the /examples folder. | ||
deployment = create_deployment_object() | ||
# update `spec.template.metadata` section |
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.
to fix the pycodestyle test failure, please add an empty line above
examples/deployment_crud.py
Outdated
resp.metadata.generation, | ||
resp.spec.template.metadata.annotations, | ||
) | ||
) |
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.
to fix the pycodestyle test failure, please remove the trailing spaces in this line.
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.
@roycaihw, I fixed the whitespaces issues but the job still remain failing.
Another thing to note:
Just to figure out what exactly amongst the new changes I added, is a breaking change. I started by adding just the following import commands (on top of the example file in master branch)
+ import datetime
+ import pytz
from kubernetes import client, config
The job is still failing. https://travis-ci.org/github/kubernetes-client/python/jobs/770894221
I'm not sure if I'm missing something really simple here?
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.
pycodestyle is asking for some empty lines between the imports. Sorry the tool has a strong opinion about standard v.s. third-party imports-- imports in different categories need to be separated by empty lines.
diff --git a/examples/deployment_crud.py b/examples/deployment_crud.py
index 4fd02a7..7dcd6b3 100644
--- a/examples/deployment_crud.py
+++ b/examples/deployment_crud.py
@@ -17,7 +17,9 @@ Creates, updates, and deletes a deployment using AppsV1Api.
"""
import datetime
+
import pytz
+
from kubernetes import client, config
DEPLOYMENT_NAME = "nginx-deployment"
ERROR: InvocationError for command /home/travis/build/kubernetes-client/python/scripts/update-pycodestyle.sh (exited with code 1)
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.
05e2b4c
to
5a55826
Compare
5a55826
to
bc7a7c7
Compare
bc7a7c7
to
e013888
Compare
378983a
to
5fd910e
Compare
483c5ae
to
cbc6dc3
Compare
Signed-off-by: Priyanka Saggu <priyankasaggu11929@gmail.com>
cbc6dc3
to
525f287
Compare
deployment_crud.py
to include a rolling_restart_deployment
method for typed clientdeployment_crud.py
to include a restart_deployment
method for typed client
/lgtm |
[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 |
What type of PR is this?
/kind documentation
/kind cleanup
What this PR does / why we need it:
This PR updates the
examples/deployment_crud.py
python script, to add arolling_restart_deployment
method. This new method demonstrates how to perform a rolling restart on adeployment
resource using the k8s pythontyped client
.The output of the script looks like:
Which issue(s) this PR fixes:
Fixes #1378
Does this PR introduce a user-facing change?