From 9b686a3c2dc072c21e7b54d4777db08feb535d8a Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Tue, 12 Apr 2022 12:57:04 +0100 Subject: [PATCH 1/2] (GH-819) Revert TMPDIR changes This commit reverts the modification of the TMPDIR environment variable from the previous release. This change was made to fix a bug in docker compose where some processes would fail if the noexec bit had been set on /tmp. However this change caused unexpected failures in certain environments. --- lib/puppet/provider/docker_compose/ruby.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/puppet/provider/docker_compose/ruby.rb b/lib/puppet/provider/docker_compose/ruby.rb index 0fef7f3f..7d05150f 100644 --- a/lib/puppet/provider/docker_compose/ruby.rb +++ b/lib/puppet/provider/docker_compose/ruby.rb @@ -14,8 +14,7 @@ end has_command(:docker_compose, command(:dockercompose)) do - Dir.mkdir('/tmp_docker') unless Dir.exist?('/tmp_docker') - ENV.store('TMPDIR', '/tmp_docker') + environment(HOME: '/root') end def exists? From a34a1e2fee58fb0bfdc4bfa63899373e0e86d9b1 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Tue, 12 Apr 2022 13:03:37 +0100 Subject: [PATCH 2/2] (GH-819) Fix acceptance and unit tests --- spec/classes/init_spec.rb | 6 ------ spec/defines/registry_spec.rb | 9 --------- spec/unit/lib/puppet/type/docker_compose_spec.rb | 9 --------- 3 files changed, 24 deletions(-) diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index c2a4af4c..0e4ab609 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -196,12 +196,6 @@ } else it { - # Stub /tmp_docker dir to prevent shelling out during spec test - allow(Dir).to receive(:exist?).and_wrap_original do |original_method, a| - original_method.call(a) - end - allow(Dir).to receive(:exist?).with('/tmp_docker').and_return(true) - is_expected.to contain_class('docker::repos').that_comes_before('Class[docker::install]') is_expected.to contain_class('docker::install').that_comes_before('Class[docker::config]') is_expected.to contain_class('docker::config').that_comes_before('Class[docker::service]') diff --git a/spec/defines/registry_spec.rb b/spec/defines/registry_spec.rb index de89b70d..bae0e0d8 100644 --- a/spec/defines/registry_spec.rb +++ b/spec/defines/registry_spec.rb @@ -2,15 +2,6 @@ require 'spec_helper' -# Stub /tmp_docker dir to prevent shelling out during spec test -class Dir - class << self - def exist?(var) - return true if var == '/tmp_docker' - end - end -end - tests = { 'with ensure => absent' => { 'ensure' => 'absent', diff --git a/spec/unit/lib/puppet/type/docker_compose_spec.rb b/spec/unit/lib/puppet/type/docker_compose_spec.rb index b0f36d8f..9b310ffb 100644 --- a/spec/unit/lib/puppet/type/docker_compose_spec.rb +++ b/spec/unit/lib/puppet/type/docker_compose_spec.rb @@ -2,15 +2,6 @@ require 'spec_helper' -# Stub /tmp_docker dir to prevent shelling out during spec test -class Dir - class << self - def exist?(var) - return true if var == '/tmp_docker' - end - end -end - compose = Puppet::Type.type(:docker_compose) describe compose do