RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1793084 - "podman play kube" generates wrong UserCommand when creating pod, defaults to /bin/bash
Summary: "podman play kube" generates wrong UserCommand when creating pod, defaults to...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.2
Assignee: Jindrich Novy
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1734579
TreeView+ depends on / blocked
 
Reported: 2020-01-20 16:07 UTC by Robb Manes
Modified: 2023-03-24 16:47 UTC (History)
11 users (show)

Fixed In Version: podman-1.6.4-2.module+el8.1.1+5363+bf8ff1af podman-1.6.4-5.module+el8.2.0+5795+9bd98c8c
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 15:52:11 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4849071 0 None None None 2020-02-21 13:56:47 UTC
Red Hat Product Errata RHSA-2020:1650 0 None None None 2020-04-28 15:53:15 UTC

Description Robb Manes 2020-01-20 16:07:37 UTC
Description of problem:
When using `podman play kube <YAML FILE>` in RHEL8 (or, subsequently, RHEL7), the "command" directive is ignored, and instead defaults to /bin/bash.

Using this example for a YAML file:

version: v1
kind: Pod
metadata:
  name: sleep-pod
spec:
  containers:
  - command: ["/usr/bin/sleep", "5"]
    image: ubi8/ubi
    name: sleep-container
status: {}


When we play the pod, we do not get '/usr/bin/sleep' as the CMD, but rather /bin/bash:

# podman play kube pod.yaml 
Pod:
f2835d9b9a3aa9e02aea68b99d337d12391de4351830fe9ff9cf938492cdd3da
Container:
2867ab7738d4173ec4d60ffe4e5205e264b3fc4ecf98cbf0d3414c51b90b75d6

# podman pod ps
POD ID         NAME        STATUS    CREATED         # OF CONTAINERS   INFRA ID
f2835d9b9a3a   sleep-pod   Running   3 minutes ago   1                 9ce7bbce16bf

# podman ps -a
CONTAINER ID  IMAGE                                COMMAND               CREATED        STATUS                    PORTS  NAMES
2867ab7738d4  registry.access.redhat.com/ubi8/ubi  /bin/bash             9 seconds ago  Exited (0) 8 seconds ago         sleep-container

This appears to be fixed by this commit:

https://github.com/containers/libpod/commit/fb9e1d7d9f332e513d392c7b8ccf1093807bb1a0

commit fb9e1d7d9f332e513d392c7b8ccf1093807bb1a0
Author: Chen Zhiwei <zhiweik>
Date:   Wed Aug 14 07:13:24 2019 +0000

    Fix play kube command in pod yaml
    
    Signed-off-by: Chen Zhiwei <zhiweik>

If we use the next branch this is included in, the problem is resolved; I compiled 1.5.1 (compiling on the exact commit causes execution errors due to another bug):

$ git tag --contains=fb9e1d7d9f332e513d392c7b8ccf1093807bb1a0
v1.5.1
v1.6.0
v1.6.0-rc1
v1.6.0-rc2
v1.6.1
v1.6.1-rc1
v1.6.2
v1.6.2-rc1
v1.6.3
v1.6.4
v1.7.0
v1.7.0-rc1
v1.7.0-rc2

Opening this BZ to ensure this makes it into the next release from upstream as a backport.


Version-Release number of selected component (if applicable):
podman-1.4.2-6.module+el8.1.0+4830+f49150d7.x86_64

How reproducible:
Every time

Steps to Reproduce:
Steps are provided above with YAML file.

Actual results:
Command from `podman play kube` is always /bin/bash instead of actual container command

Expected results:
Command should always be specified container command.

Comment 13 errata-xmlrpc 2020-04-28 15:52:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1650


Note You need to log in before you can comment on or make changes to this bug.