Sha256: 1b6fce84c378eb159da5ce01e6b1a3b8b5c6db27661be379a0bb2877e7438523

Contents?: true

Size: 578 Bytes

Versions: 19

Compression:

Stored size: 578 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: { "#{label_namespace}/name": name }.merge(additional_labels)
          }.merge(formatted_annotations)
        }
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
metatron-0.6.0 lib/metatron/templates/namespace.rb
metatron-0.5.0 lib/metatron/templates/namespace.rb
metatron-0.4.2 lib/metatron/templates/namespace.rb
metatron-0.4.1 lib/metatron/templates/namespace.rb
metatron-0.4.0 lib/metatron/templates/namespace.rb
metatron-0.3.4 lib/metatron/templates/namespace.rb
metatron-0.3.3 lib/metatron/templates/namespace.rb
metatron-0.3.2 lib/metatron/templates/namespace.rb
metatron-0.3.1 lib/metatron/templates/namespace.rb
metatron-0.3.0 lib/metatron/templates/namespace.rb
metatron-0.2.8 lib/metatron/templates/namespace.rb
metatron-0.2.7 lib/metatron/templates/namespace.rb
metatron-0.2.6 lib/metatron/templates/namespace.rb
metatron-0.2.5 lib/metatron/templates/namespace.rb
metatron-0.2.4 lib/metatron/templates/namespace.rb
metatron-0.2.3 lib/metatron/templates/namespace.rb
metatron-0.2.2 lib/metatron/templates/namespace.rb
metatron-0.2.1 lib/metatron/templates/namespace.rb
metatron-0.2.0 lib/metatron/templates/namespace.rb