Class: Serverspec::Type::DockerSecret
- Inherits:
-
DockerBase
- Object
- DockerBase
- Serverspec::Type::DockerSecret
- Defined in:
- lib/serverspec_extra_types/types/docker_secret.rb
Instance Method Summary collapse
- #data ⇒ Object
- #data64 ⇒ Object
- #exist? ⇒ Boolean
- #has_data64?(data) ⇒ Boolean
- #has_data?(data) ⇒ Boolean
- #has_label?(label, value = nil) ⇒ Boolean
- #has_name?(name) ⇒ Boolean
- #label(label) ⇒ Object
- #labels ⇒ Object
- #name ⇒ Object
Instance Method Details
#data ⇒ Object
14 15 16 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 14 def data @data ||= Base64.decode64(data64) end |
#data64 ⇒ Object
22 23 24 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 22 def data64 inspection['Spec']['Data'] end |
#exist? ⇒ Boolean
6 7 8 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 6 def exist? get_inspection.success? end |
#has_data64?(data) ⇒ Boolean
18 19 20 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 18 def has_data64?(data) data64 == data end |
#has_data?(data) ⇒ Boolean
10 11 12 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 10 def has_data?(data) self.data == data end |
#has_label?(label, value = nil) ⇒ Boolean
30 31 32 33 34 35 36 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 30 def has_label?(label, value = nil) if value label(label)[1] == value else label(label) end end |
#has_name?(name) ⇒ Boolean
42 43 44 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 42 def has_name?(name) self.name == name end |
#label(label) ⇒ Object
38 39 40 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 38 def label(label) labels.find { |key, _val| key == label } end |
#labels ⇒ Object
26 27 28 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 26 def labels inspection['Spec']['Labels'] end |
#name ⇒ Object
46 47 48 |
# File 'lib/serverspec_extra_types/types/docker_secret.rb', line 46 def name inspection['Spec']['Name'] end |