Sha256: 0afe0f7d21427ead272dbd3054c149e1e8142bf1cf6635866ed7ed7f4a44e974

Contents?: true

Size: 686 Bytes

Versions: 11

Compression:

Stored size: 686 Bytes

Contents

class KuberKit::Actions::KubectlApplier
  include KuberKit::Import[
    "shell.kubectl_commands",
    "shell.local_shell",
    "ui"
  ]

  Contract String, Hash => Any
  def call(file_path, options)
    kubeconfig_path  = KuberKit.current_configuration.kubeconfig_path
    deploy_namespace = KuberKit.current_configuration.deploy_namespace
    ui.create_task("Applying file: #{file_path}") do |task|
      kubectl_commands.apply_file(local_shell, file_path, kubeconfig_path: kubeconfig_path, namespace: deploy_namespace)
      task.update_title("Applied file: #{file_path}")
    end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kuber_kit-0.3.1 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.3.0 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.9 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.8 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.7 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.6 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.5 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.4 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.3 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.2 lib/kuber_kit/actions/kubectl_applier.rb
kuber_kit-0.2.1 lib/kuber_kit/actions/kubectl_applier.rb