Skip to content

Commit

Permalink
Merge pull request containers#11044 from vrothberg/play
Browse files Browse the repository at this point in the history
play kube: support capitalized pull policy
  • Loading branch information
openshift-merge-robot authored Jul 26, 2021
2 parents ec5c7c1 + c197d19 commit 21e1c31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/domain/infra/abi/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
// registry on localhost.
pullPolicy := config.PullPolicyNewer
if len(container.ImagePullPolicy) > 0 {
pullPolicy, err = config.ParsePullPolicy(string(container.ImagePullPolicy))
// Make sure to lower the strings since K8s pull policy
// may be capitalized (see bugzilla.redhat.com/show_bug.cgi?id=1985905).
rawPolicy := string(container.ImagePullPolicy)
pullPolicy, err = config.ParsePullPolicy(strings.ToLower(rawPolicy))
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/play_kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ var _ = Describe("Podman play kube", func() {
})

It("podman play kube with pull policy of missing", func() {
ctr := getCtr(withPullPolicy("missing"), withImage(BB))
ctr := getCtr(withPullPolicy("Missing"), withImage(BB))
err := generateKubeYaml("pod", getPod(withCtr(ctr)), kubeYaml)
Expect(err).To(BeNil())

Expand Down

0 comments on commit 21e1c31

Please sign in to comment.