Sha256: 998db265a25e93a634a794e3e6582aeb9b1ac9c772b8ae93b6d94a1984fb1a4a
Contents?: true
Size: 1020 Bytes
Versions: 18
Compression:
Stored size: 1020 Bytes
Contents
class KuberKit::Actions::KubectlAttacher include KuberKit::Import[ "shell.kubectl_commands", "shell.local_shell", "kubernetes.resource_selector", "ui" ] Contract Maybe[String], Hash => Any def call(resource_name, options) kubeconfig_path = KuberKit.current_configuration.kubeconfig_path kubectl_entrypoint = KuberKit.current_configuration.kubectl_entrypoint deployer_namespace = KuberKit.current_configuration.deployer_namespace if !resource_name resource_name = resource_selector.call("attach", additional_resources: [ KuberKit::Kubernetes::Resources::POD, KuberKit::Kubernetes::Resources::JOB ]) end kubectl_commands.exec( local_shell, resource_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 end
Version data entries
18 entries across 18 versions & 1 rubygems