Class: Kbt::Container
- Inherits:
-
Object
- Object
- Kbt::Container
- Defined in:
- lib/kbt/container.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args = {}) ⇒ Container
constructor
A new instance of Container.
- #overrides ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Container
Returns a new instance of Container.
4 5 6 7 8 9 10 |
# File 'lib/kbt/container.rb', line 4 def initialize(args = {}) @template = args.fetch(:template) @name = args.fetch(:name) @image = args.fetch(:image) @command = args.fetch(:command) @env = args.fetch(:env) end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
3 4 5 |
# File 'lib/kbt/container.rb', line 3 def command @command end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
3 4 5 |
# File 'lib/kbt/container.rb', line 3 def env @env end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
3 4 5 |
# File 'lib/kbt/container.rb', line 3 def image @image end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/kbt/container.rb', line 3 def name @name end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
3 4 5 |
# File 'lib/kbt/container.rb', line 3 def template @template end |
Instance Method Details
#call ⇒ Object
29 30 |
# File 'lib/kbt/container.rb', line 29 def call end |
#overrides ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/kbt/container.rb', line 19 def overrides { "name"=> name, "image"=> image, "command" => command, "env" => env.to_h } # TODO add volumeMounts end |
#to_h ⇒ Object
12 13 14 15 16 17 |
# File 'lib/kbt/container.rb', line 12 def to_h Fusu::Hash.deep_merge( template.value, overrides ) end |