mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
Merge pull request #11044 from vrothberg/play
play kube: support capitalized pull policy
This commit is contained in:
@ -277,7 +277,10 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY
|
|||||||
// registry on localhost.
|
// registry on localhost.
|
||||||
pullPolicy := config.PullPolicyNewer
|
pullPolicy := config.PullPolicyNewer
|
||||||
if len(container.ImagePullPolicy) > 0 {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -1729,7 +1729,7 @@ var _ = Describe("Podman play kube", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman play kube with pull policy of missing", 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)
|
err := generateKubeYaml("pod", getPod(withCtr(ctr)), kubeYaml)
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user