kitchen-dokken icon indicating copy to clipboard operation
kitchen-dokken copied to clipboard

Fix/login command

Open jmauro opened this issue 3 years ago • 8 comments

Description

When using Podman the login is not working the way it should.

Issues Resolved

N/A

Type of Change

This is just a quick fix

The most important prefixes you should have in mind are:

  • _fix_: which represents bug fixes, and correlates to a SemVer patch.
  • _feat_: which represents a new feature, and correlates to a SemVer minor.
  • _feat!_:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a major version change.

If you have not included a conventional commit message, this can be fixed on merge.

jmauro avatar Jun 04 '22 01:06 jmauro

Hello,

Any love regarding this PR?

jmauro avatar Jun 23 '22 11:06 jmauro

hello @jmauro I tried to reproduce the login issue with podman but was unable to do so. Could you please create the issue, write the detailed steps to reproduce it, and link to this PR?

sanjain-progress avatar Jun 23 '22 15:06 sanjain-progress

Hello,

To reproduce: just use podman has test-kitchen driver then kitchen-test login <your_suite> once the kitchen-test suite have been created.

The login command hard coded the docker binary so I don't see how you could manage, but I might be wrong.

Kind regards, JM

jmauro avatar Jun 23 '22 15:06 jmauro

@jmauro Which OS you are using ? Yeah agree, it's Hardcode.

Thing is to use Podman API , usually we change reference the DOCKER_HOST variable to Podman socket

sanjain-progress avatar Jun 24 '22 05:06 sanjain-progress

Hello,

I am running on Linux (Debian). I don't see how this is related to the definition of the DOCKER_HOST, I don't have docker install on my computer, so no work around could help me. I am fully using podman service to do all the API work, meaning any docker reference is not working on my computer.

Kind regards, JM

jmauro avatar Jun 24 '22 08:06 jmauro

Hello @matschaffer,

Any news ? Were you able to reproduce the issue ?

Kind Regards, JM

jmauro avatar Jul 11 '22 16:07 jmauro

@jmauro To interact with Docker kitchen-dokken determine the socket on which DOCKER_HOST is currently running. In this podman scenario we usually change the DOCKER_HOST to podman.socket. So communication happens with Podman. By default podman.socket runs on ///run/user/1000/podman/podman.sock

Can you please share the log what happens actually when you exec login command? And can you also verify is kitchen test is working fine

sanjain-progress avatar Jul 26 '22 19:07 sanjain-progress

@jmauro To interact with Docker kitchen-dokken determine the socket on which DOCKER_HOST is currently running. In this podman scenario we usually change the DOCKER_HOST to podman.socket. So communication happens with Podman. By default podman.socket runs on ///run/user/1000/podman/podman.sock

Can you please share the log what happens actually when you exec login command? And can you also verify is kitchen test is working fine

Hello, Sorry for the delay. So I think I was not clear enough: Here is the trick I used:

$ ls -al /usr/bin/docker
lrwxrwxrwx 1 root root 8 Apr 26 14:44 /usr/bin/docker -> ./podman
$ $ kitchen login workstation-debian-12
root@dokken:/#
logout
$

Now let's remove the link:

$ rm /usr/bin/docker
$ kitchen login workstation-debian-12
/home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/lib/kitchen/instance.rb:221:in `exec': No such file or directory - docker (Errno::ENOENT)
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/lib/kitchen/instance.rb:221:in `login'
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/lib/kitchen/command/login.rb:35:in `call'
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/lib/kitchen/cli.rb:52:in `perform'
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/lib/kitchen/cli.rb:257:in `login'
        from /home/debian/.gem/ruby/3.0.4/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /home/debian/.gem/ruby/3.0.4/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /home/debian/.gem/ruby/3.0.4/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /home/debian/.gem/ruby/3.0.4/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/bin/kitchen:11:in `block in <top (required)>'
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/lib/kitchen/errors.rb:183:in `with_friendly_errors'
        from /home/debian/.gem/ruby/3.0.4/gems/test-kitchen-3.3.2/bin/kitchen:11:in `<top (required)>'
        from /home/debian/.gem/ruby/3.0.4/bin/kitchen:25:in `load'
        from /home/debian/.gem/ruby/3.0.4/bin/kitchen:25:in `<main>'

So when applying my patch here works as expected.

I hope it is clearer.

Kind regards, JM

jmauro avatar Sep 16 '22 19:09 jmauro