Sha256: c99c8ea2e4cf229a0b02d877630788d48295d88033b225779e2a5b249abef940
Contents?: true
Size: 860 Bytes
Versions: 4
Compression:
Stored size: 860 Bytes
Contents
module K8sKit class Pod attr_reader :context, :name def initialize(context, name) @context = context @name = name end def logs(container: nil, stream: false) command = "logs #{name}" command += " -c #{container}" if container command += " -f" if stream context.run(command, silent: false) end def wait_until_ready(timeout: '5m') context.run("wait pod/#{name} --for=condition=Ready --timeout=#{timeout}") end def wait_until_complete(timeout: '5m') context.run("wait pod/#{name} --for=condition=Completed") end def exit_code(container:) json_path = "{ .status.containerStatuses[?(@.name == '#{container}')].state.terminated.exitCode }" context.run("get pod #{name} -o jsonpath=\"#{json_path}\"").to_i rescue StandardError nil end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
k9s_kit-0.0.7.pre.pre4 | lib/k8s_kit/pod.rb |
k9s_kit-0.0.7.pre.pre3 | lib/k8s_kit/pod.rb |
k9s_kit-0.0.7.pre.pre2 | lib/k8s_kit/pod.rb |
k9s_kit-0.0.7.pre.pre1 | lib/k8s_kit/pod.rb |