Sha256: 9f219fd9cd1f3ce58086513f5fcd82ec7802ca1e2a510e648d4f0c48b452e556

Contents?: true

Size: 758 Bytes

Versions: 14

Compression:

Stored size: 758 Bytes

Contents

# frozen_string_literal: true

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

      attr_accessor :additional_labels, :type, :data

      def initialize(name, data = {})
        super(name)
        @data = data
        @additional_labels = {}
        @type = "Opaque"
      end

      def render
        {
          apiVersion:,
          kind:,
          metadata: {
            name:,
            labels: { "#{label_namespace}/name": name }.merge(additional_labels)
          }.merge(formatted_annotations).merge(formatted_namespace).compact,
          type:,
          stringData: data
        }.compact
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
metatron-0.6.0 lib/metatron/templates/secret.rb
metatron-0.5.0 lib/metatron/templates/secret.rb
metatron-0.4.2 lib/metatron/templates/secret.rb
metatron-0.4.1 lib/metatron/templates/secret.rb
metatron-0.4.0 lib/metatron/templates/secret.rb
metatron-0.3.4 lib/metatron/templates/secret.rb
metatron-0.3.3 lib/metatron/templates/secret.rb
metatron-0.3.2 lib/metatron/templates/secret.rb
metatron-0.3.1 lib/metatron/templates/secret.rb
metatron-0.3.0 lib/metatron/templates/secret.rb
metatron-0.2.8 lib/metatron/templates/secret.rb
metatron-0.2.7 lib/metatron/templates/secret.rb
metatron-0.2.6 lib/metatron/templates/secret.rb
metatron-0.2.5 lib/metatron/templates/secret.rb