Skip to content

Question: the relationship between docker::image and docker::run #479

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

Closed
f4rx opened this issue May 6, 2019 · 4 comments
Closed

Question: the relationship between docker::image and docker::run #479

f4rx opened this issue May 6, 2019 · 4 comments

Comments

@f4rx
Copy link

f4rx commented May 6, 2019

I have manifest:

  docker::image { 'f3ex/some-content-nginx':
    ensure => 'latest',
    image_tag => '1',
  } ~>
  docker::run { 'my-nginx':
    image            => 'f3ex/some-content-nginx:1',
  }

Expectation: to update/restart a running container on getting a new image.
In the currently: restarting a container on every puppet agent execution.

Notice: /Stage[main]/Prometheus_node::Alertmanager/Docker::Image[f3ex/some-content-nginx]/Notify[Check if image f3ex/some-content-nginx:1 is in-sync]/message: defined 'message' as 'Check if image f3ex/some-content-nginx:1 is in-sync'
Info: /Stage[main]/Prometheus_node::Alertmanager/Docker::Image[f3ex/some-content-nginx]/Notify[Check if image f3ex/some-content-nginx:1 is in-sync]: Scheduling refresh of Exec[echo 'Update of f3ex/some-content-nginx:1 complete']
Notice: /Stage[main]/Prometheus_node::Alertmanager/Docker::Image[f3ex/some-content-nginx]/Exec[echo 'Update of f3ex/some-content-nginx:1 complete']: Triggered 'refresh' from 1 event
Info: Docker::Image[f3ex/some-content-nginx]: Scheduling refresh of Docker::Run[my-nginx]
Info: Docker::Run[my-nginx]: Scheduling refresh of Service[docker-my-nginx]
Info: Docker::Run[my-nginx]: Scheduling refresh of Exec[docker-my-nginx-systemd-reload]
Notice: /Stage[main]/Prometheus_node::Alertmanager/Docker::Run[my-nginx]/Exec[docker-my-nginx-systemd-reload]: Triggered 'refresh' from 1 event
Notice: /Stage[main]/Prometheus_node::Alertmanager/Docker::Run[my-nginx]/Service[docker-my-nginx]: Triggered 'refresh' from 1 event

Cause - the 'exec', that running on every execution:

    notify { "Check if image ${image_arg} is in-sync":
      noop      => false,
    }
    ~>
    exec { "echo 'Update of ${image_arg} complete'":

The changes were made in this issue #316

@f4rx
Copy link
Author

f4rx commented May 6, 2019

To prevent starting 'Exec' and downloading new image with --noop, maybe use something like this:

    if ! $::clientnoop {
      exec { "echo 'Update of ${image_arg} complete'":
...

@pegasd
Copy link

pegasd commented Aug 28, 2019

This is a very inconvenient behavior for us. Even if this gets fixed using the solution suggested by @f4rx , this still throws notifies on every Puppet run (and also returns 2 with --detailed-exitcodes).

I believe the issue that was fixed in #297 is a lot more minor that the current behavior.

We're stuck with using 1.1.0 because of this. The way images are updated there seems to me a LOT cleaner.

@adrianiurca
Copy link
Contributor

work-related to this issue will be included in PR #705

@github-actions
Copy link

This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.

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