lib/metatron/templates/config_map.rb in metatron-0.2.4 vs lib/metatron/templates/config_map.rb in metatron-0.2.5
- old
+ new
@@ -5,27 +5,30 @@
# The ConfigMap Kubernetes resource
class ConfigMap < Template
include Concerns::Annotated
include Concerns::Namespaced
- attr_accessor :additional_labels, :type, :data
+ attr_accessor :additional_labels, :immutable, :data
def initialize(name, data = {})
super(name)
@data = data
@additional_labels = {}
end
+ def immutable? = !!@immutable
+
def render
{
apiVersion:,
kind:,
metadata: {
name:,
labels: { "#{label_namespace}/name": name }.merge(additional_labels)
- }.merge(formatted_annotations).merge(formatted_namespace),
- data:
- }
+ }.merge(formatted_annotations).merge(formatted_namespace).compact,
+ data:,
+ immutable:
+ }.compact
end
end
end
end