Sha256: 9709e585d9228a37f2e0b8a0e227a4c33038158fcd4b63f948ecc51fb7ca55ef
Contents?: true
Size: 748 Bytes
Versions: 1
Compression:
Stored size: 748 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 exit_code(container:) json_path = "{ .status.containerStatuses[?(@.name == '#{container}')].state.terminated.exitCode }" Integer(context.run("get pod #{name} -o jsonpath=\"#{json_path}\"")) rescue StandardError nil end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
k8s_kit-0.0.6 | lib/k8s_kit/pod.rb |