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

docker command called on server from docker_params_changed #662

Closed
traylenator opened this issue Oct 1, 2020 · 3 comments
Closed

docker command called on server from docker_params_changed #662

traylenator opened this issue Oct 1, 2020 · 3 comments

Comments

@traylenator
Copy link
Contributor

Describe the Bug

The new function docker_params_changed introduced in #648
calls docker inspect via a popen call.

This function running on a puppet server does not make sense I believe.

At the very least docker would have to be installed on the puppet server but I don't believe it makes sense
anyway as the particular instances could not be expected.

docker::run { 'helloworld':
  image   => 'base',
  command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
  restart => 'no',                                                         
}

results in

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Cannot run program "docker" (in directory "/opt/puppetlabs/server/a
pps/puppetserver"): error=2, No such file or directory (file: /mnt/puppetnfsdir/environments/straylen_dns/modules/docker/manifests/run.pp, line: 408, column: 25) (file: /mnt/puppetnfsdir/environments/straylen_dns/hostgroups/hg_playground/manifests/straylen/new.pp, line: 25) on

Expected Behavior

Should not call docker on the puppet server via a function.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Set up a puppet server and puppet agent on distinct hosts
  2. Create manifest for agent containing a docker::run type with restart => no
  3. When compilation occurs docker_params_changed is called
  4. Ruby function will shell out to docker call which fails as command not present and it's the wrong host anyway.

Environment

  • Version 5.5.19
  • Platform CentOS 7

Additional Context

Add any other context about the problem here.

Situation introduced with #648

@traylenator traylenator added the bug label Oct 1, 2020
@DavidS
Copy link
Contributor

DavidS commented Oct 29, 2020

This is now also being tracked in https://tickets.puppetlabs.com/browse/IAC-1218

@dannygoulder
Copy link

This seemingly has other side effects - when trying to unit test our own modules that depend on the docker module, compilation tests fail (although only when the OS is windows)

@traylenator
Copy link
Contributor Author

This was fixed when a deferred function was used for the docker call here.

3b4d89d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants