Sha256: ec7e5ba51c9187644826ac60cffeaecd2870a9d8cd47d9b107265a01ed136dc2

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 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.perform!(raw_deployments, selector: selector)
rescue KubernetesDeploy::DeploymentTimeoutError
  exit(70)
rescue KubernetesDeploy::FatalDeploymentError
  exit(1)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kubernetes-deploy-0.27.0 exe/kubernetes-restart