10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/kuber_kit/actions/kubectl_attacher.rb', line 10
def call(pod_name, options)
kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
kubectl_entrypoint = KuberKit.current_configuration.kubectl_entrypoint
deployer_namespace = KuberKit.current_configuration.deployer_namespace
if !pod_name
pod_name = resource_selector.call("attach")
end
kubectl_commands.exec(
local_shell, pod_name, "bash", args: "-it",
kubeconfig_path: kubeconfig_path,
interactive: true,
namespace: deployer_namespace,
entrypoint: kubectl_entrypoint
)
true
rescue KuberKit::Error => e
ui.print_error("Error", e.message)
false
end
|