Skip to content

Commit

Permalink
Merge pull request #297 from mihaibuzgau/master
Browse files Browse the repository at this point in the history
[CLOUD-1981] docker image update script runs in noop mode
  • Loading branch information
davejrt authored Jul 25, 2018
2 parents 9a6bdaa + c7a3125 commit 359b7a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
12 changes: 1 addition & 11 deletions manifests/image.pp
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,7 @@
timeout => $exec_timeout,
logoutput => true,
}
} elsif $ensure == 'latest' or $image_tag == 'latest' {
exec { "echo 'Update of ${image_arg} complete'":
environment => $exec_environment,
path => $exec_path,
timeout => $exec_timeout,
onlyif => $image_install,
require => File[$update_docker_image_path],
provider => $exec_provider,
logoutput => true,
}
} elsif $ensure == 'present' {
} elsif $ensure == 'latest' or $image_tag == 'latest' or $ensure == 'present' {
exec { $image_install:
unless => $_image_find,
environment => $exec_environment,
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,17 @@

context 'with ensure => latest' do
let(:params) { { 'ensure' => 'latest' } }
it { should contain_exec("echo 'Update of base complete'").with_onlyif('/usr/local/bin/update_docker_image.sh base') }
it { should contain_exec("/usr/local/bin/update_docker_image.sh base") }
end

context 'with ensure => latest and image_tag => precise' do
let(:params) { { 'ensure' => 'latest', 'image_tag' => 'precise' } }
it { should contain_exec("echo 'Update of base:precise complete'") }
it { should contain_exec("/usr/local/bin/update_docker_image.sh base:precise") }
end

context 'with ensure => latest and image_digest => sha256:deadbeef' do
let(:params) { { 'ensure' => 'latest', 'image_digest' => 'sha256:deadbeef' } }
it { should contain_exec("echo 'Update of base@sha256:deadbeef complete'") }
it { should contain_exec("/usr/local/bin/update_docker_image.sh base@sha256:deadbeef") }
end

context 'with an invalid image name' do
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/image_windows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

context 'with ensure => latest' do
let(:params) { { 'ensure' => 'latest' } }
it { should contain_exec("echo 'Update of base complete'").with_onlyif('& C:/Windows/Temp/update_docker_image.ps1 base') }
it { should contain_exec("& C:/Windows/Temp/update_docker_image.ps1 base") }
end

end

0 comments on commit 359b7a6

Please sign in to comment.