Class: Inspec::Resources::Podman
- Inherits:
-
Object
- Object
- Inspec::Resources::Podman
- Defined in:
- lib/inspec/resources/podman.rb
Instance Method Summary collapse
- #containers ⇒ Object
- #images ⇒ Object
- #info ⇒ Object
- #networks ⇒ Object
-
#object(id) ⇒ Object
returns information about podman objects.
- #pods ⇒ Object
- #to_s ⇒ Object
- #version ⇒ Object
- #volumes ⇒ Object
Instance Method Details
#containers ⇒ Object
46 47 48 |
# File 'lib/inspec/resources/podman.rb', line 46 def containers PodmanContainerFilter.new(parse_containers) end |
#images ⇒ Object
50 51 52 |
# File 'lib/inspec/resources/podman.rb', line 50 def images PodmanImageFilter.new(parse_images) end |
#info ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'lib/inspec/resources/podman.rb', line 76 def info return @info if defined?(@info) sub_cmd = "info --format json" output = run_command(sub_cmd) @info = Hashie::Mash.new(JSON.parse(output)) rescue JSON::ParserError => _e Hashie::Mash.new({}) end |
#networks ⇒ Object
54 55 56 |
# File 'lib/inspec/resources/podman.rb', line 54 def networks PodmanNetworkFilter.new(parse_networks) end |
#object(id) ⇒ Object
returns information about podman objects
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/inspec/resources/podman.rb', line 87 def object(id) return @inspect if defined?(@inspect) output = run_command("inspect #{id} --format json") data = JSON.parse(output) data = data[0] if data.is_a?(Array) @inspect = Hashie::Mash.new(data) rescue JSON::ParserError => _e Hashie::Mash.new({}) end |
#pods ⇒ Object
58 59 60 |
# File 'lib/inspec/resources/podman.rb', line 58 def pods PodmanPodFilter.new(parse_pods) end |
#to_s ⇒ Object
98 99 100 |
# File 'lib/inspec/resources/podman.rb', line 98 def to_s "Podman" end |
#version ⇒ Object
66 67 68 69 70 71 72 73 74 |
# File 'lib/inspec/resources/podman.rb', line 66 def version return @version if defined?(@version) sub_cmd = "version --format json" output = run_command(sub_cmd) @version = Hashie::Mash.new(JSON.parse(output)) rescue JSON::ParserError => _e Hashie::Mash.new({}) end |
#volumes ⇒ Object
62 63 64 |
# File 'lib/inspec/resources/podman.rb', line 62 def volumes PodmanVolumeFilter.new(parse_volumes) end |