podman play kube
only binds ports when hostPort
is specified.
#15942
Labels
Good First Issue
This issue would be a good issue for a first time contributor to undertake.
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
According to k8s documentation, specifying
hostPort
seems optional. If I specify onlycontainerPort
, I would expect this to use the same value forhostPort
, or throw a validation error if it is really required. Instead, it looks successful, but doesn't bind the ports.Steps to reproduce the issue:
test.yaml
with the following config:Run
podman play kube test.yaml
Run `podman ps --format '{{ .Names }} - {{ .Ports }}' and observe the following:
test-2.yaml
with the following config:Run
podman rm -af && podman play kube test-2.yaml
Run `podman ps --format '{{ .Names }} - {{ .Ports }}' and observe the following:
Describe the results you received:
No error, but no ports bound.
Describe the results you expected:
I would expect excluding
hostPort
to EITHER throw a validation error OR (preferably) copy the value fromcontainerPort
Additional information you deem important (e.g. issue happens only occasionally):
K8s definition of
hostPort
, emphasis mine:Also, I double checked my containers running on OpenShift and they only have
containerPort
specified and nothostPort
.Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
I have checked the troubleshooting guide, have not tested on latest.
Additional environment details (AWS, VirtualBox, physical, etc.):
Phyiscal Fedora 36 Workstation.
The text was updated successfully, but these errors were encountered: