Sha256: 17daa9719caf76278e3e1b7fc371b3fdfbff7e396d2e699cdc3054d3644aad7b

Contents?: true

Size: 759 Bytes

Versions: 25

Compression:

Stored size: 759 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
    deployer_namespace = KuberKit.current_configuration.deployer_namespace

    if !pod_name 
      pod_name = resource_selector.call("attach")
    end

    kubectl_commands.exec(
      local_shell, pod_name, "bin/console", args: "-it", 
      kubeconfig_path: kubeconfig_path, 
      interactive: true,
      namespace: deployer_namespace
    )

    true
  rescue KuberKit::Error => e
    ui.print_error("Error", e.message)
    
    false
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
kuber_kit-0.8.7 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.6 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.5 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.4 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.3 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.2 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.1 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.8.0 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.7.1 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.7.0 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.6.4 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.6.3 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.6.2 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.6.1 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.6.0 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.5.10 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.5.9 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.5.8 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.5.7 lib/kuber_kit/actions/kubectl_console.rb
kuber_kit-0.5.6 lib/kuber_kit/actions/kubectl_console.rb