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

[CLOUD-1981] docker image update script runs in noop mode #297

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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