Sha256: 97a22446c0560686ba783a40fcdac02208e079bf121d736305f677847788c069

Contents?: true

Size: 705 Bytes

Versions: 5

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

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

      attr_accessor :additional_labels, :type, :data

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metatron-0.1.4 lib/metatron/templates/secret.rb
metatron-0.1.3 lib/metatron/templates/secret.rb
metatron-0.1.2 lib/metatron/templates/secret.rb
metatron-0.1.1 lib/metatron/templates/secret.rb
metatron-0.1.0 lib/metatron/templates/secret.rb