Sha256: aa23dc63c0e3c0e5d779ca0ac1168323e1413793240d32c0d0c1ff711cdb57cc

Contents?: true

Size: 956 Bytes

Versions: 3

Compression:

Stored size: 956 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'optparse'

require 'kubernetes-deploy/restart_task'
require 'kubernetes-deploy/options_helper'
require 'kubernetes-deploy/label_selector'

raw_deployments = nil
max_watch_seconds = nil
selector = nil
ARGV.options do |opts|
  opts.on("--deployments=LIST") { |v| raw_deployments = v.split(",") }
  opts.on("--max-watch-seconds=seconds") { |t| max_watch_seconds = t.to_i }
  opts.on("--selector=SELECTOR", "Restarts deployments matching selector (format: k1=v1,k2=v2)") do |s|
    selector = KubernetesDeploy::LabelSelector.parse(s)
  end
  opts.parse!
end

namespace = ARGV[0]
context = ARGV[1]

restart = KubernetesDeploy::RestartTask.new(namespace: namespace, context: context,
   max_watch_seconds: max_watch_seconds)
begin
  restart.run!(raw_deployments, selector: selector)
rescue KubernetesDeploy::DeploymentTimeoutError
  exit(70)
rescue KubernetesDeploy::FatalDeploymentError
  exit(1)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kubernetes-deploy-0.30.0 exe/kubernetes-restart
kubernetes-deploy-0.29.0 exe/kubernetes-restart
kubernetes-deploy-0.28.0 exe/kubernetes-restart