Skip to content

Commit

Permalink
puppetlabs#627 and puppetlabs#526: Fix problems with image version "l…
Browse files Browse the repository at this point in the history
…atest"

If image version is set to "latest"

- there are changes on each run, even if nothing is really done
- docker containers are restarted every time

This is fixed here.

However, this needs a change in using docker::run, which now needs an additional subscribe => Docker::Image[...].

See puppetlabs#627
  • Loading branch information
gerdriesselmann authored and mxey committed Jun 24, 2024
1 parent 715743d commit 5bd8929
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manifests/image.pp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
logoutput => true,
}
} elsif $ensure == 'latest' or $image_tag == 'latest' or $force {
/*

Check warning on line 150 in manifests/image.pp

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

/* */ comment found (check: star_comments)

Check warning on line 150 in manifests/image.pp

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

/* */ comment found (check: star_comments)

Check warning on line 150 in manifests/image.pp

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

/* */ comment found (check: star_comments)

Check warning on line 150 in manifests/image.pp

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

/* */ comment found (check: star_comments)

Check warning on line 150 in manifests/image.pp

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

/* */ comment found (check: star_comments)

Check warning on line 150 in manifests/image.pp

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

/* */ comment found (check: star_comments)
notify { "Check if image ${image_arg} is in-sync":
noop => false,
}
Expand All @@ -159,14 +160,15 @@
provider => $exec_provider,
logoutput => true,
}
~> exec { "echo 'Update of ${image_arg} complete'":
~> */ exec { "echo 'Update of ${image_arg} complete'":
environment => $exec_environment,
path => $exec_path,
timeout => $exec_timeout,
require => File[$update_docker_image_path],
provider => $exec_provider,
logoutput => true,
refreshonly => true,
#refreshonly => true,
onlyif => $image_install,
}
} elsif $ensure == 'present' {
exec { $image_install:
Expand Down

0 comments on commit 5bd8929

Please sign in to comment.