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

Limit Image -> Run dependencies to those used #199

Merged
merged 2 commits into from
Mar 18, 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
1 change: 1 addition & 0 deletions manifests/image.pp
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@
}
}

Docker::Image <| title == $title |> -> Docker::Run <| image == $image_arg |>
}
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,8 @@
contain 'docker::service'

Class['docker::repos'] -> Class['docker::install'] -> Class['docker::config'] ~> Class['docker::service']
Class['docker'] -> Docker::Registry <||> -> Docker::Image <||> -> Docker::Run <||>
Class['docker'] -> Docker::Image <||> -> Docker::Run <||>
Class['docker'] -> Docker::Registry <||> -> Docker::Image <||>
Class['docker'] -> Docker::Image <||>
Class['docker'] -> Docker::Run <||>

}
26 changes: 26 additions & 0 deletions spec/acceptance/docker_full_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,32 @@ class { 'docker':}

shell('docker inspect container_3_6', :acceptable_exit_codes => [1])
end

it 'should allow dependency for ordering of independent run and image' do
pp=<<-EOS
class { 'docker':}

docker::image { 'ubuntu': }

docker::run { 'container_3_7_1':
image => 'ubuntu',
command => 'init',
}

docker::image { 'busybox':
require => Docker::Run['container_3_7_1'],
}

docker::run { 'container_3_7_2':
image => 'busybox',
command => 'init',
}
EOS

apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true) unless fact('selinux') == 'true'

end
end

describe "docker::exec" do
Expand Down