Sha256: b06023fac22eff53dd93754a7fd32914b5638fb47e34ec3bf51fcb5857e5c6ff

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metatron-0.1.8 lib/metatron/templates/config_map.rb
metatron-0.1.7 lib/metatron/templates/config_map.rb
metatron-0.1.6 lib/metatron/templates/config_map.rb