Sha256: 4c11e8865d1b5ea3d942f0ccd95547cbb7de30763b5f9fbe3481345c9af129ee
Contents?: true
Size: 797 Bytes
Versions: 37
Compression:
Stored size: 797 Bytes
Contents
class KuberKit::Actions::KubectlGet 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 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")) true rescue KuberKit::Error => e ui.print_error("Error", e.message) false end end
Version data entries
37 entries across 37 versions & 1 rubygems