Sha256: 3f208d5106746455ec4499227163cf51527d1f0c547f57f89a3419d0eadaadf5

Contents?: true

Size: 833 Bytes

Versions: 23

Compression:

Stored size: 833 Bytes

Contents

class Kubes::Compiler
  module Layering
    def pre_layers
      return [] if Kubes.kustomize?

      ext = File.extname(@path)
      kind = File.basename(@path).sub(ext,'') # IE: deployment
      all = "all"
      if @block_form
        kind = kind.pluralize
        all = all.pluralize
      end
      layers = [
        "#{all}#{ext}",
        "#{all}/#{Kubes.env}#{ext}",
        "#{kind}#{ext}",
        "#{kind}/#{Kubes.env}#{ext}",
      ]
      layers.map do |layer|
        "#{Kubes.root}/.kubes/resources/base/#{layer}"
      end
    end

    def post_layers
      return [] if Kubes.kustomize?

      ext = File.extname(@path)
      kind_path = @path.sub(ext,'')

      layers = [
        "base",
        Kubes.env.to_s
      ]
      layers.map do |layer|
        "#{kind_path}/#{layer}#{ext}"
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
kubes-0.5.1 lib/kubes/compiler/layering.rb
kubes-0.5.0 lib/kubes/compiler/layering.rb
kubes-0.4.7 lib/kubes/compiler/layering.rb
kubes-0.4.6 lib/kubes/compiler/layering.rb
kubes-0.4.5 lib/kubes/compiler/layering.rb
kubes-0.4.4 lib/kubes/compiler/layering.rb
kubes-0.4.3 lib/kubes/compiler/layering.rb
kubes-0.4.2 lib/kubes/compiler/layering.rb
kubes-0.4.1 lib/kubes/compiler/layering.rb
kubes-0.4.0 lib/kubes/compiler/layering.rb
kubes-0.3.5 lib/kubes/compiler/layering.rb
kubes-0.3.4 lib/kubes/compiler/layering.rb
kubes-0.3.3 lib/kubes/compiler/layering.rb
kubes-0.3.2 lib/kubes/compiler/layering.rb
kubes-0.3.1 lib/kubes/compiler/layering.rb
kubes-0.3.0 lib/kubes/compiler/layering.rb
kubes-0.2.6 lib/kubes/compiler/layering.rb
kubes-0.2.5 lib/kubes/compiler/layering.rb
kubes-0.2.4 lib/kubes/compiler/layering.rb
kubes-0.2.3 lib/kubes/compiler/layering.rb