Skip to content

Commit

Permalink
Update docker.rb for Podman
Browse files Browse the repository at this point in the history
  • Loading branch information
malikparvez committed Nov 27, 2024
1 parent 5a0775b commit eb9bed3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/facter/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ def interfaces
docker_network_names.each do |network|
inspect = JSON.parse(Facter::Core::Execution.execute("#{docker_command} network inspect #{network}", timeout: 90))
docker['network'][network] = inspect[0]
network_id = docker['network'][network]['Id'][0..11]
network_id = if docker['network'][network]['Id'].nil?
docker['network'][network]['id'][0..11]

Check failure on line 142 in lib/facter/docker.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/IndentationWidth: Use 2 (not -11) spaces for indentation. (https://rubystyle.guide#spaces-indentation)

Check failure on line 142 in lib/facter/docker.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/IndentationWidth: Use 2 (not -11) spaces for indentation. (https://rubystyle.guide#spaces-indentation)
else

Check failure on line 143 in lib/facter/docker.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/ElseAlignment: Align `else` with `if`.

Check failure on line 143 in lib/facter/docker.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/ElseAlignment: Align `else` with `if`.
docker['network'][network]['Id'][0..11]
end

Check failure on line 145 in lib/facter/docker.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/EndAlignment: `end` at 145, 10 is not aligned with `if` at 141, 23.

Check failure on line 145 in lib/facter/docker.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/EndAlignment: `end` at 145, 10 is not aligned with `if` at 141, 23.
interfaces.each do |iface|
docker['network']['managed_interfaces'][iface] = network if %r{#{network_id}}.match?(iface)
end
Expand Down

0 comments on commit eb9bed3

Please sign in to comment.