Sha256: 9427f65b0ae1bf4af3e2c749b70adb862140e89b6ea2592b3e5f0c045e0285be

Contents?: true

Size: 801 Bytes

Versions: 21

Compression:

Stored size: 801 Bytes

Contents

class KuberKit::Actions::KubectlGet
  include KuberKit::Import[
    "shell.kubectl_commands",
    "shell.local_shell",
    "kubernetes.resource_selector",
    "ui"
  ]

  Contract Maybe[String], Hash => Array
  def call(resource_name, options)
    kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
    deployer_namespace = KuberKit.current_configuration.deployer_namespace

    resources = kubectl_commands.get_resources(
      local_shell, "pod",
      kubeconfig_path: kubeconfig_path, 
      namespace: deployer_namespace
    )
    
    if resource_name
      resources = resources.select{|r| r.include?(resource_name) }
    end

    ui.print_info("Pods", resources.join("\n"))

    resources
  rescue KuberKit::Error => e
    ui.print_error("Error", e.message)
    
    []
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
kuber_kit-1.3.8 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.7 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.1.8 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.6 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.1.7 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.5 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.4 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.1.6 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.3 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.2 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.1.5 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.1 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.3.0 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.1.4 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.2.7 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.2.6 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.2.5 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.2.4 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.2.2 lib/kuber_kit/actions/kubectl_get.rb
kuber_kit-1.1.2 lib/kuber_kit/actions/kubectl_get.rb