Class: Metatron::Templates::Secret
- Inherits:
-
Metatron::Template
- Object
- Metatron::Template
- Metatron::Templates::Secret
- Includes:
- Concerns::Annotated, Concerns::Namespaced
- Defined in:
- lib/metatron/templates/secret.rb
Overview
The Secret Kubernetes resource
Instance Attribute Summary collapse
-
#additional_labels ⇒ Object
Returns the value of attribute additional_labels.
-
#data ⇒ Object
Returns the value of attribute data.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Metatron::Template
#api_version, #kind, #label_namespace, #name
Instance Method Summary collapse
-
#initialize(name, data = {}) ⇒ Secret
constructor
A new instance of Secret.
- #render ⇒ Object
Methods included from Concerns::Namespaced
#formatted_namespace, included, #namespaced_initialize
Methods included from 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 = {}) ⇒ Secret
Returns a new instance of Secret.
12 13 14 15 16 17 |
# File 'lib/metatron/templates/secret.rb', line 12 def initialize(name, data = {}) super(name) @data = data @additional_labels = {} @type = "Opaque" end |
Instance Attribute Details
#additional_labels ⇒ Object
Returns the value of attribute additional_labels.
10 11 12 |
# File 'lib/metatron/templates/secret.rb', line 10 def additional_labels @additional_labels end |
#data ⇒ Object
Returns the value of attribute data.
10 11 12 |
# File 'lib/metatron/templates/secret.rb', line 10 def data @data end |
#type ⇒ Object
Returns the value of attribute type.
10 11 12 |
# File 'lib/metatron/templates/secret.rb', line 10 def type @type end |
Instance Method Details
#render ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/metatron/templates/secret.rb', line 19 def render { apiVersion:, kind:, metadata: { name:, labels: { "#{label_namespace}/name": name }.merge(additional_labels) }.merge(formatted_annotations).merge(formatted_namespace).compact, type:, stringData: data }.compact end |