Skip to content

Remove code execution output from create_pod notebook#261

Merged
mbohlool merged 1 commit into
kubernetes-client:masterfrom
djkonro:remove_output
Jul 7, 2017
Merged

Remove code execution output from create_pod notebook#261
mbohlool merged 1 commit into
kubernetes-client:masterfrom
djkonro:remove_output

Conversation

@djkonro

@djkonro djkonro commented Jun 19, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2017
@mbohlool
mbohlool requested a review from sebgoa June 21, 2017 06:25
@djkonro

djkonro commented Jun 25, 2017

Copy link
Copy Markdown
Contributor Author

@mbohlool, I am trying to use replace_namespaced_pod(...), but when I execute the following lines

pod.spec.containers[0].image = 'busybox:1.26.1'
v1.replace_namespaced_pod(name=name, namespace="default", body=pod)

I get the error

kubernetes.client.rest.ApiException: (422)
Reason: Unprocessable Entity
HTTP response headers: HTTPHeaderDict({'Date': 'Sun, 25 Jun 2017 16:11:17 GMT', 'Content-Length': '604', 'Content-Type': 'application/json'}) HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Pod \"busybox\" is invalid: spec: Forbidden: pod updates may not change fields other than containers[].image or spec.activeDeadlineSeconds or spec.tolerations (only additions to existing tolerations)","reason":"Invalid","details":{"name":"busybox","kind":"Pod","causes": [{"reason":"FieldValueForbidden","message":"Forbidden: pod updates may not change fields other than containers[].imageorspec.activeDeadlineSecondsorspec.tolerations (only additions to existing tolerations)","field":"spec"}]},"code":422}

From code, the only change I have made is to containers[*].image
https://gist.github.com/djkonro/1b46f583107311ef3a144759ec26180f#file-intro_notebook-py-L64

@mbohlool

Copy link
Copy Markdown
Contributor

That look like a usecase for "patch" not "replace". Have you tried that?

@djkonro

djkonro commented Jun 28, 2017

Copy link
Copy Markdown
Contributor Author

@mbohlool I was just trying to see how the "replace" command works with various object. I tried "patch" and it works fine for pods, and the "replace" command also works fine with ReplicationControllers and Deployments.

@sebgoa sebgoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this good, no real need to show the replace here.

@mbohlool

mbohlool commented Jul 5, 2017

Copy link
Copy Markdown
Contributor

Please apply LGTM label to any PR that is ready to merge (also make sure the branch is up to date).

@sebgoa

sebgoa commented Jul 7, 2017

Copy link
Copy Markdown
Contributor

/lgtm

@mbohlool I don't think I have privs to add labels

@mbohlool
mbohlool merged commit 1471c6d into kubernetes-client:master Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants