Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entrypoint rewriting logic is ignoring cmd #574

Closed
bobcatfish opened this issue Mar 1, 2019 · 5 comments
Closed

Entrypoint rewriting logic is ignoring cmd #574

bobcatfish opened this issue Mar 1, 2019 · 5 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@bobcatfish
Copy link
Collaborator

Expected Behavior

I'm a bit confused about this to tell you the truth, but I think think that when we are wrapping a container, we should be respecting both the entrypoint and the cmd

Actual Behavior

When we retrieve an image's entrypoint we do just that - we get the entrypoint only and ignore the cmd. So if an image is relying on the cmd to do the right thing, we wipe it out and completely ignore it.

Steps to Reproduce the Problem

  1. Create a Task with a step that tries to rely on an image's cmd, e.g. in this case the cmd for the golang image is go, so we shouldn't need to specify that explicitly,:
  - name: install-ko
    image: golang
    args:
    - "get"
    - "github.com/google/go-containerregistry/cmd/ko"
  1. Create a TaskRun that uses the above. It will fail with an error like:
could not start the process: exec: \"get\": executable file not found in $PATH
  1. If you update the step to use go explicitly, it will work:
  - name: install-ko
    image: golang
    command: ["go"]
    args:
    - "get"
    - "github.com/google/go-containerregistry/cmd/ko"

Additional Info

@bobcatfish bobcatfish added kind/bug Categorizes issue or PR as related to a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Mar 1, 2019
@nader-ziada
Copy link
Member

/assign

@nader-ziada
Copy link
Member

in pr #564, I have logic that will check the remote image entrypoint and if there isn't one, will check the cmd
would that cover the problem you ran into?

@abayer
Copy link
Contributor

abayer commented Mar 4, 2019

Oh boy, this is always a fun area - we've flip-flopped on how the Jenkins/Docker integration works from using entrypoint vs cmd...well, multiple times. The lesson I've taken away from our pain there is that if you try to handle every particular permutation of entrypoint vs cmd as default behavior, you're going to have a bad time. My opinion is that it's best to settle on one expected/required behavior, and just accept that this means some images will require a bit more configuration to use. Our situation here seems to be much simpler than the Jenkins/Docker concerns, though, so I may just be paranoid. =)

@nader-ziada
Copy link
Member

@bobcatfish I think this should be closed as part of the changes in PR #564

@dlorenc
Copy link
Contributor

dlorenc commented Mar 8, 2019

Fixed with #564

@dlorenc dlorenc closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

4 participants