Sha256: 4e8a2870f0d6adbc5811ff453913d0fddf8bc58fd744f48a9a55c176a00b8df0

Contents?: true

Size: 564 Bytes

Versions: 45

Compression:

Stored size: 564 Bytes

Contents

class Kubes::CLI
  class Base
    include Kubes::Logging

    def initialize(options={})
      @options = options
    end

    def compile
      Compile.new(@options).run unless @options[:compile] == false
    end

    def pod_name
      return unless @options[:pod]

      pods = Kubes::Kubectl::Fetch::Pods.new(@options)
      items = pods.fetch(:pod)
      metas = items.map { |i| i['metadata'] }
      metas.select! { |i| i['name'].include?(@options[:pod]) }
      meta = metas.sort { i['creationTimestamp'] }.last
      meta['name'] if meta
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
kubes-0.9.3 lib/kubes/cli/base.rb
kubes-0.9.2 lib/kubes/cli/base.rb
kubes-0.9.1 lib/kubes/cli/base.rb
kubes-0.9.0 lib/kubes/cli/base.rb
kubes-0.8.10 lib/kubes/cli/base.rb
kubes-0.8.9 lib/kubes/cli/base.rb
kubes-0.8.8 lib/kubes/cli/base.rb
kubes-0.8.7 lib/kubes/cli/base.rb
kubes-0.8.6 lib/kubes/cli/base.rb
kubes-0.8.5 lib/kubes/cli/base.rb
kubes-0.8.4 lib/kubes/cli/base.rb
kubes-0.8.3 lib/kubes/cli/base.rb
kubes-0.8.2 lib/kubes/cli/base.rb
kubes-0.8.1 lib/kubes/cli/base.rb
kubes-0.8.0 lib/kubes/cli/base.rb
kubes-0.7.10 lib/kubes/cli/base.rb
kubes-0.7.9 lib/kubes/cli/base.rb
kubes-0.7.8 lib/kubes/cli/base.rb
kubes-0.7.7 lib/kubes/cli/base.rb
kubes-0.7.6 lib/kubes/cli/base.rb