diff --git a/lib/cc/cli/engines/install.rb b/lib/cc/cli/engines/install.rb index 07f6adb78..021d58cbd 100644 --- a/lib/cc/cli/engines/install.rb +++ b/lib/cc/cli/engines/install.rb @@ -18,7 +18,7 @@ def config end def pull_docker_images - config.engines.each(&method(:pull_engine)) + config.engines.select(&:enabled?).each(&method(:pull_engine)) end def pull_engine(engine) diff --git a/spec/cc/cli/engines/install_spec.rb b/spec/cc/cli/engines/install_spec.rb index 12b62e66f..e3bc0a25d 100644 --- a/spec/cc/cli/engines/install_spec.rb +++ b/spec/cc/cli/engines/install_spec.rb @@ -61,6 +61,22 @@ module CC::CLI::Engines expect { install.run }.to raise_error(Install::ImagePullFailure) end end + + it "excludes disabled images" do + write_cc_yaml(YAML.dump("plugins" => { "madeup" => true, "structure" => false })) + stub_engine_registry(YAML.dump( + "structure" => { "channels" => { "stable" => "structure" } }, + "duplication" => { "channels" => { "stable" => "duplication" } }, + "madeup" => { "channels" => { "stable" => "madeup" } }, + )) + + install = Install.new + + expect_system(install, "docker pull duplication") + expect_system(install, "docker pull madeup") + + capture_io { install.run } + end end def expect_system(install, cmd, result = true)