Class: Rhelm::Subcommand::Rollback

Inherits:
Base
  • Object
show all
Defined in:
lib/rhelm/subcommand/rollback.rb

Overview

Helm rollback subcommand: ‘helm rollback <RELEASE> [REVISION] [flags]`. docs: helm.sh/docs/helm/helm_rollback/

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #debug, #kube_apiserver, #kube_as_group, #kube_as_user, #kube_context, #kube_token, #kubeconfig, #namespace, #registry_config, #repository_cache, #repository_config

Instance Method Summary collapse

Methods inherited from Base

#args, #full_cli_call, #report_failure, #run

Constructor Details

#initialize(release, revision, options = {}) ⇒ Rollback

Returns a new instance of Rollback.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rhelm/subcommand/rollback.rb', line 20

def initialize(release, revision, options = {})
  super(options)

  @release = release
  @revision = revision
  @cleanup_on_fail = options[:cleanup_on_fail]
  @dry_run = options[:dry_run]
  @force = options[:force]
  @help = options[:help]
  @history_max_int = options[:history_max_int]
  @no_hooks = options[:no_hooks]
  @recreate_pods = options[:recreate_pods]
  @timeout_duration = options[:timeout_duration]
  @wait = options[:wait]
end

Instance Attribute Details

#cleanup_on_failObject (readonly)

Returns the value of attribute cleanup_on_fail.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def cleanup_on_fail
  @cleanup_on_fail
end

#dry_runObject (readonly)

Returns the value of attribute dry_run.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def dry_run
  @dry_run
end

#forceObject (readonly)

Returns the value of attribute force.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def force
  @force
end

#helpObject (readonly)

Returns the value of attribute help.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def help
  @help
end

#history_max_intObject (readonly)

Returns the value of attribute history_max_int.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def history_max_int
  @history_max_int
end

#no_hooksObject (readonly)

Returns the value of attribute no_hooks.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def no_hooks
  @no_hooks
end

#recreate_podsObject (readonly)

Returns the value of attribute recreate_pods.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def recreate_pods
  @recreate_pods
end

#releaseObject (readonly)

Returns the value of attribute release.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def release
  @release
end

#revisionObject (readonly)

Returns the value of attribute revision.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def revision
  @revision
end

#timeout_durationObject (readonly)

Returns the value of attribute timeout_duration.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def timeout_duration
  @timeout_duration
end

#waitObject (readonly)

Returns the value of attribute wait.



8
9
10
# File 'lib/rhelm/subcommand/rollback.rb', line 8

def wait
  @wait
end

Instance Method Details

#cli_argsObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rhelm/subcommand/rollback.rb', line 40

def cli_args
  super.tap do |args|
    args << '--cleanup-on-fail' if cleanup_on_fail
    args << '--dry-run' if dry_run
    args << '--force' if force
    args << '--help' if help
    args << ['--history-max-int', history_max_int] if history_max_int
    args << '--no-hooks' if no_hooks
    args << '--recreate-pods' if recreate_pods
    args << ['--timeout-duration', timeout_duration] if timeout_duration
    args << '--wait' if wait

    args << release
    args << revision
  end.flatten
end

#subcommand_nameObject



36
37
38
# File 'lib/rhelm/subcommand/rollback.rb', line 36

def subcommand_name
  "rollback"
end