File tree 3 files changed +19
-5
lines changed
3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 140
140
timeout => $exec_timeout ,
141
141
logoutput => true ,
142
142
}
143
- } elsif $ensure == ' latest' or $image_tag == ' latest' or $ensure == ' present' {
143
+ } elsif $ensure == ' latest' or $image_tag == ' latest' {
144
+ notify { "Check if image ${image_arg} is in-sync" :
145
+ noop => false ,
146
+ }
147
+ ~> exec { " echo 'Update of ${image_arg} complete'" :
148
+ environment => $exec_environment ,
149
+ path => $exec_path ,
150
+ timeout => $exec_timeout ,
151
+ onlyif => $image_install ,
152
+ require => File [$update_docker_image_path ],
153
+ provider => $exec_provider ,
154
+ logoutput => true ,
155
+ refreshonly => true ,
156
+ }
157
+ } elsif $ensure == ' present' {
144
158
exec { $image_install:
145
159
unless => $_image_find,
146
160
environment => $exec_environment ,
Original file line number Diff line number Diff line change 134
134
135
135
context 'with ensure => latest' do
136
136
let ( :params ) { { 'ensure' => 'latest' } }
137
- it { should contain_exec ( "/usr/local/bin/update_docker_image.sh base" ) }
137
+ it { should contain_exec ( "echo 'Update of base complete'" ) . with_onlyif ( ' /usr/local/bin/update_docker_image.sh base' ) }
138
138
end
139
139
140
140
context 'with ensure => latest and image_tag => precise' do
141
141
let ( :params ) { { 'ensure' => 'latest' , 'image_tag' => 'precise' } }
142
- it { should contain_exec ( "/usr/local/bin/update_docker_image.sh base:precise" ) }
142
+ it { should contain_exec ( "echo 'Update of base:precise complete' " ) }
143
143
end
144
144
145
145
context 'with ensure => latest and image_digest => sha256:deadbeef' do
146
146
let ( :params ) { { 'ensure' => 'latest' , 'image_digest' => 'sha256:deadbeef' } }
147
- it { should contain_exec ( "/usr/local/bin/update_docker_image.sh base@sha256:deadbeef" ) }
147
+ it { should contain_exec ( "echo 'Update of base@sha256:deadbeef complete' " ) }
148
148
end
149
149
150
150
context 'with an invalid image name' do
Original file line number Diff line number Diff line change 48
48
49
49
context 'with ensure => latest' do
50
50
let ( :params ) { { 'ensure' => 'latest' } }
51
- it { should contain_exec ( "& C:/Users/Administrator/AppData/Local/Temp/update_docker_image.ps1 -DockerImage base" ) }
51
+ it { should contain_exec ( "echo 'Update of base complete'" ) . with_onlyif ( ' & C:/Users/Administrator/AppData/Local/Temp/update_docker_image.ps1 -DockerImage base' ) }
52
52
end
53
53
54
54
end
You can’t perform that action at this time.
0 commit comments