Sha256: af05068a805c2b7282bc2dd3bb446a6630da24a29df7c486d986e2a281e4001a

Contents?: true

Size: 751 Bytes

Versions: 4

Compression:

Stored size: 751 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: base_labels.merge(additional_labels)
          }.merge(formatted_annotations).merge(formatted_namespace).compact,
          data:,
          immutable:
        }.compact
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metatron-0.8.2 lib/metatron/templates/config_map.rb
metatron-0.8.0 lib/metatron/templates/config_map.rb
metatron-0.7.0 lib/metatron/templates/config_map.rb
metatron-0.6.1 lib/metatron/templates/config_map.rb