Sha256: 430e5f96ae4d17f1fb605698788c122091af0b6b7aea416fe7f6e9135b73e050

Contents?: true

Size: 695 Bytes

Versions: 6

Compression:

Stored size: 695 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, :type, :data

      def initialize(name, data = {})
        super(name)
        @data = data
        @additional_labels = {}
      end

      def render
        {
          apiVersion:,
          kind:,
          metadata: {
            name:,
            labels: { "#{label_namespace}/name": name }.merge(additional_labels)
          }.merge(formatted_annotations).merge(formatted_namespace),
          data:
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
metatron-0.2.4 lib/metatron/templates/config_map.rb
metatron-0.2.3 lib/metatron/templates/config_map.rb
metatron-0.2.2 lib/metatron/templates/config_map.rb
metatron-0.2.1 lib/metatron/templates/config_map.rb
metatron-0.2.0 lib/metatron/templates/config_map.rb
metatron-0.1.9 lib/metatron/templates/config_map.rb