Skip to content

CoreV1APi.create_namespaced_pod() always sets "image_pull_policy" to "NotIfPresent" #1770

@spleeeen

Description

@spleeeen

What happened:
Function works as intended and sets every other value of large nested pod definition (the body arg). However, as seen in the V1Pod return value, it sets the all container.image_pull_policy values to "NotIfPresent" in the pod.spec.containers array. kubectl applyinging the generated yaml with this value changed to 'Always' succeeds in persisting it. Problem only occurs when using the python client.

Relevant Code

call to create_namespaced_pod()
image
definition of pod body
image

Excerpt of print statement

image

What you expected to happen:
image pull policy to be set to 'Always'

How to reproduce it (as minimally and precisely as possible):
see code

Environment:

Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.11", GitCommit:"27522a29febbcc4badac257763044d0d90c11abd", GitTreeState:"clean", BuildDate:"2021-09-15T19:16:25Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}

Python 3.8.9

kubernetes==21.7.0

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions