Sha256: a4e038d9df074a78ebd32b18db643d35654fa3c302dc68266e164f47214e6c75

Contents?: true

Size: 758 Bytes

Versions: 4

Compression:

Stored size: 758 Bytes

Contents

class KuberKit::ShellLauncher::Strategies::Kubernetes < KuberKit::ShellLauncher::Strategies::Abstract
  include KuberKit::Import[
    "service_reader.reader",
    "shell.kubectl_commands",
    "configs",
  ]

  Contract KuberKit::Shell::AbstractShell => Any
  def call(shell)
    kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
    if kubeconfig_path.is_a?(KuberKit::Core::ArtifactPath)
      kubeconfig_path = artifact_path_resolver.call(kubeconfig_path)
    end

    deployer_namespace = KuberKit.current_configuration.deployer_namespace
    if deployer_namespace
      kubectl_commands.set_namespace(shell, deployer_namespace, kubeconfig_path: kubeconfig_path)
    end

    shell.replace!(env: ["KUBECONFIG=#{kubeconfig_path}"])
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kuber_kit-0.9.3 lib/kuber_kit/shell_launcher/strategies/kubernetes.rb
kuber_kit-0.9.2 lib/kuber_kit/shell_launcher/strategies/kubernetes.rb
kuber_kit-0.9.1 lib/kuber_kit/shell_launcher/strategies/kubernetes.rb
kuber_kit-0.9.0 lib/kuber_kit/shell_launcher/strategies/kubernetes.rb