Class: Metatron::Templates::PriorityClass
- Inherits:
-
Metatron::Template
- Object
- Metatron::Template
- Metatron::Templates::PriorityClass
- Includes:
- Concerns::Annotated
- Defined in:
- lib/metatron/templates/priority_class.rb
Overview
Template for the PriorityClass k8s resource
Instance Attribute Summary collapse
-
#additional_labels ⇒ Object
Returns the value of attribute additional_labels.
-
#description ⇒ Object
Returns the value of attribute description.
-
#global_default ⇒ Object
(also: #global_default?, #globalDefault)
Returns the value of attribute global_default.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Metatron::Template
#api_version, #base_labels, #kind, #name
Instance Method Summary collapse
-
#initialize(name) ⇒ PriorityClass
constructor
A new instance of PriorityClass.
- #render ⇒ Object
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) ⇒ PriorityClass
Returns a new instance of PriorityClass.
14 15 16 17 18 19 20 21 |
# File 'lib/metatron/templates/priority_class.rb', line 14 def initialize(name) super @api_version = "scheduling.k8s.io/v1" @additional_labels = {} @description = nil @global_default = false @value = 0 end |
Instance Attribute Details
#additional_labels ⇒ Object
Returns the value of attribute additional_labels.
9 10 11 |
# File 'lib/metatron/templates/priority_class.rb', line 9 def additional_labels @additional_labels end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/metatron/templates/priority_class.rb', line 9 def description @description end |
#global_default ⇒ Object Also known as: global_default?, globalDefault
Returns the value of attribute global_default.
9 10 11 |
# File 'lib/metatron/templates/priority_class.rb', line 9 def global_default @global_default end |
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'lib/metatron/templates/priority_class.rb', line 9 def value @value end |
Instance Method Details
#render ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/metatron/templates/priority_class.rb', line 23 def render { apiVersion:, kind:, metadata: { name:, labels: base_labels.merge(additional_labels) }.merge(formatted_annotations), description:, globalDefault:, value: }.compact end |