Sha256: 6ac085a83a99c8e64ec79ecbc06da764d906ed215dd572ede9723c238e94c849
Contents?: true
Size: 1006 Bytes
Versions: 27
Compression:
Stored size: 1006 Bytes
Contents
class KuberKit::Actions::KubectlConsole include KuberKit::Import[ "shell.kubectl_commands", "shell.local_shell", "kubernetes.resource_selector", "ui" ] Contract Maybe[String], Hash => Any 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", additional_resources: [ KuberKit::Kubernetes::Resources::POD, KuberKit::Kubernetes::Resources::JOB, ]) end kubectl_commands.exec( local_shell, pod_name, "bin/console", 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
27 entries across 27 versions & 1 rubygems