Skip to content

Commit

Permalink
Remove timeout prefix from docker command
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Carabas committed Jul 5, 2021
1 parent 8ea5c52 commit f4cc1a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/facter/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
docker_command = if Facter.value(:kernel) == 'windows'
'powershell -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -c docker'
else
'timeout -k 90 60 docker'
'docker'
end

def interfaces
Expand Down Expand Up @@ -102,7 +102,7 @@ def interfaces
Facter.add(:docker) do
setcode do
docker_version = Facter.value(:docker_client_version)
if docker_version.match?(%r{1[.][0-9][0-2]?[.]\w+})
if docker_version.match?(%r{1[0-9][0-2]?[.]\w+})
if Facter::Core::Execution.which('docker')
docker_json_str = Facter::Core::Execution.exec(
"#{docker_command} info --format '{{json .}}'", timeout: 90
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/lib/facter/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
Facter.clear
if Facter.value(:kernel) == 'windows'
docker_command = 'powershell -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -c docker'
Facter::Core::Execution.stubs(:which).with('route').returns('C:\Windows\System32\ROUTE.EXE')
Facter::Core::Execution.stubs(:which).with('docker').returns('C:\Program Files\Docker\docker.exe')
else
docker_command = 'docker'
Facter::Core::Execution.stubs(:which).with('route').returns('/usr/bin/route')
Facter::Core::Execution.stubs(:which).with('docker').returns('/usr/bin/docker')
end
docker_info = File.read(fixtures('facts', 'docker_info'))
Expand Down

0 comments on commit f4cc1a4

Please sign in to comment.