Sha256: d958e8b312cb91fa5f7b69c2b118e7bc76c0d1fd07366f0d9ab523a5985e7709

Contents?: true

Size: 775 Bytes

Versions: 14

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

module Metatron
  module Templates
    # The ConfigMap Kubernetes resource
    class ConfigMap < Template
      include Concerns::Annotated
      include Concerns::Namespaced

      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).compact,
          data:,
          immutable:
        }.compact
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
metatron-0.6.0 lib/metatron/templates/config_map.rb
metatron-0.5.0 lib/metatron/templates/config_map.rb
metatron-0.4.2 lib/metatron/templates/config_map.rb
metatron-0.4.1 lib/metatron/templates/config_map.rb
metatron-0.4.0 lib/metatron/templates/config_map.rb
metatron-0.3.4 lib/metatron/templates/config_map.rb
metatron-0.3.3 lib/metatron/templates/config_map.rb
metatron-0.3.2 lib/metatron/templates/config_map.rb
metatron-0.3.1 lib/metatron/templates/config_map.rb
metatron-0.3.0 lib/metatron/templates/config_map.rb
metatron-0.2.8 lib/metatron/templates/config_map.rb
metatron-0.2.7 lib/metatron/templates/config_map.rb
metatron-0.2.6 lib/metatron/templates/config_map.rb
metatron-0.2.5 lib/metatron/templates/config_map.rb