Podman: play kube doesn't support container args

Created on 6 Apr 2020  路  14Comments  路  Source: containers/podman

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description


play kube doesn't support the "args" config option for a container in a YAML pod spec.

Behaviour of command and args are defined here:
https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes

In the code it always uses the image entry point (expected), then if a command is specified it is appended to the image entrypoint, otherwise if defined the image command is used (expected).
However there is no handling of args, which if specified without a command should replace the image Cmd, or if specified with a command should be appended to the command, neither of which as handled.
https://github.com/containers/libpod/blob/1fe2fbb42114b9072a1caf359beff63042df90fd/pkg/adapter/pods.go#L882-L894

Steps to reproduce the issue:

  1. Add args to a container in a pod spec YAML

  2. Use play kube to start the pod

  3. Use podman inspect to inspect the running container

Describe the results you received:
Cmd from inspect is composed of the image entry point and the image Cmd

Describe the results you expected:
Cmd from inspect is composed of the image entry point and the args in the containers definition in the pod spec.

Additional information you deem important (e.g. issue happens only occasionally):
The inelegant work around is to include the arguments in the containers command option, but it would be better if play kube behaved more like kubernetes

Output of podman version:

podman version 1.8.2

Output of podman info --debug:

N/A

Package info (e.g. output of rpm -q podman or apt list podman):

podman-1.8.2-2.fc32.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):
physical

Good First Issue kinbug stale-issue

All 14 comments

Definitely sounds like a bug. Are you willing to do a PR to fix this?

@kunalkushwaha @sujil02 FYI?

If no one working.. I can pick it up this too.

@kunalkushwaha I did start on this but happy to leave it to you to pick up. I was struggling with adding appropriate tests as there don't appear to be any unit test suites covering any of the code in pkgs, and it would take several e2e tests for coverage which are quite time consuming to run so didn't want to be making many additions here. It would also probably required a different image to be used than the ones currently used for e2e as it needs one which defines an entrypoint in the image

@athena-metis Please continue. Please free to ping me, if you feel to discuss anything.

A friendly reminder that this issue had no activity for 30 days.

@athena-metis @kunalkushwaha Any progress?

Sorry i've been struggling for time to do any meaningful tests, they are not worthy of PRs but if anyone wanted to look at some potential changes for this they are at:
athena-metis@e8b2602 - Code change
athena-metis@6060170 - Start on some tests (not an ideal way of doing things but that would require a new unit test suite rather than adding to the existing e2e)

@ryanchpowell Could you work on this with consultation with @haircommander

A friendly reminder that this issue had no activity for 30 days.

@ryanchpowell Any movement on this?

@rhatdan Yes, close to a PR
Edit: fixed tag

@ashley-cui PTAL

close it, could reopen if this rehappend

Was this page helpful?
0 / 5 - 0 ratings