Sha256: 061f2b2fecf9e8d937705bc53c6123eb80a5da53d988b5a486ec2943bf5c3335
Contents?: true
Size: 702 Bytes
Versions: 8
Compression:
Stored size: 702 Bytes
Contents
# frozen_string_literal: true module KubernetesDeploy module Kubectl def self.run_kubectl(*args, namespace:, context:, log_failure: true) args = args.unshift("kubectl") args.push("--namespace=#{namespace}") if namespace.present? args.push("--context=#{context}") if context.present? KubernetesDeploy.logger.debug Shellwords.join(args) out, err, st = Open3.capture3(*args) KubernetesDeploy.logger.debug(out.shellescape) if !st.success? && log_failure KubernetesDeploy.logger.warn("The following command failed: #{Shellwords.join(args)}") KubernetesDeploy.logger.warn(err) end [out.chomp, err.chomp, st] end end end
Version data entries
8 entries across 8 versions & 1 rubygems