Class: Metatron::Templates::ConfigMap
- Inherits:
-
Metatron::Template
- Object
- Metatron::Template
- Metatron::Templates::ConfigMap
- Defined in:
- lib/metatron/templates/config_map.rb
Overview
The ConfigMap Kubernetes resource
Instance Attribute Summary collapse
-
#additional_labels ⇒ Object
Returns the value of attribute additional_labels.
-
#data ⇒ Object
Returns the value of attribute data.
-
#immutable ⇒ Object
Returns the value of attribute immutable.
Attributes inherited from Metatron::Template
#api_version, #base_labels, #kind, #name
Instance Method Summary collapse
- #immutable? ⇒ Boolean
-
#initialize(name, data = {}) ⇒ ConfigMap
constructor
A new instance of ConfigMap.
- #render ⇒ Object
Methods included from Metatron::Templates::Concerns::Namespaced
#formatted_namespace, included, #namespaced_initialize
Methods included from Metatron::Templates::Concerns::Annotated
#annotated_initialize, #formatted_annotations, included
Methods inherited from Metatron::Template
initializer, initializers, metatron_template_class?, nearest_metatron_ancestor
Constructor Details
#initialize(name, data = {}) ⇒ ConfigMap
Returns a new instance of ConfigMap.
12 13 14 15 16 |
# File 'lib/metatron/templates/config_map.rb', line 12 def initialize(name, data = {}) super(name) @data = data @additional_labels = {} end |
Instance Attribute Details
#additional_labels ⇒ Object
Returns the value of attribute additional_labels.
10 11 12 |
# File 'lib/metatron/templates/config_map.rb', line 10 def additional_labels @additional_labels end |
#data ⇒ Object
Returns the value of attribute data.
10 11 12 |
# File 'lib/metatron/templates/config_map.rb', line 10 def data @data end |
#immutable ⇒ Object
Returns the value of attribute immutable.
10 11 12 |
# File 'lib/metatron/templates/config_map.rb', line 10 def immutable @immutable end |
Instance Method Details
#immutable? ⇒ Boolean
18 |
# File 'lib/metatron/templates/config_map.rb', line 18 def immutable? = !!@immutable |
#render ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/metatron/templates/config_map.rb', line 20 def render { apiVersion:, kind:, metadata: { name:, labels: base_labels.merge(additional_labels) }.merge(formatted_annotations).merge(formatted_namespace).compact, data:, immutable: }.compact end |