Sha256: 576585b80ed83cc92ad1116dd74656cf93bd364d4412d43c453156d389040b00

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 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
        @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.8.2 lib/metatron/templates/namespace.rb
metatron-0.8.0 lib/metatron/templates/namespace.rb