Skip to content

Conversation

@ninja-quokka
Copy link
Collaborator

Fixes: #27784

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

Added validation to `podman play kube` command to detect when the mandatory container image field is missing

@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@ninja-quokka ninja-quokka force-pushed the kube_play_image_validation branch 2 times, most recently from 0c395e9 to 9883465 Compare December 17, 2025 12:46
var podWithoutAnImage = `
apiVersion: v1
kind: Pod
spec:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
spec:
metadata:
name: my-pod-name # <--- This is missing
labels:
app: my-app
spec:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

err := writeYaml(podWithoutAnImage, kubeYaml)
Expect(err).ToNot(HaveOccurred())

kube := podmanTest.PodmanExitCleanly("kube", "play", kubeYaml)
Copy link
Member

Choose a reason for hiding this comment

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

PodmanExitCleanly will fail here because we expect no error; just podmanTest.Podman will work better

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done! Thanks @mheon !

@ninja-quokka ninja-quokka force-pushed the kube_play_image_validation branch from 9883465 to 85e3bf2 Compare December 21, 2025 09:01
@ninja-quokka ninja-quokka force-pushed the kube_play_image_validation branch from 85e3bf2 to 74c0795 Compare December 21, 2025 10:15
Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM

@mheon
Copy link
Member

mheon commented Dec 22, 2025

LGTM

@mheon mheon merged commit 2fbecb4 into containers:main Dec 22, 2025
77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

play kube crashes on missing image container field

3 participants