Sha256: 3aef3e0f30137b24ba9ce5a9d26864ce5e3f14d3b84c75ff106adf83ee55b18d

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

# frozen_string_literal: true

module Metatron
  module Templates
    # Template for basic Namespace k8s resource
    class Namespace < Template
      include Concerns::Annotated

      attr_accessor :additional_labels

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

      def render
        {
          apiVersion:,
          kind:,
          metadata: {
            name:,
            labels: base_labels.merge(additional_labels)
          }.merge(formatted_annotations)
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metatron-0.7.0 lib/metatron/templates/namespace.rb
metatron-0.6.1 lib/metatron/templates/namespace.rb