Method: KubernetesCLI#restart_deployment

Defined in:
lib/kubernetes-cli.rb

#restart_deployment(namespace, deployment) ⇒ Object

T::Sig::WithoutRuntime.sig { params(namespace: String, deployment: String).void }


407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/kubernetes-cli.rb', line 407

def restart_deployment(namespace, deployment)
  cmd = [
    executable,
    '--kubeconfig', kubeconfig_path,
    '-n', namespace,
    'rollout', 'restart', 'deployment', deployment
  ]

  systemm(cmd)

  on_last_status_failure do |last_status|
    raise KubernetesError, 'could not restart deployment: kubectl exited with '\
      "status code #{last_status.exitstatus}"
  end
end