Class: Gitlab::Kubernetes::Helm::V3::DeleteCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/gitlab/kubernetes/helm/v3/delete_command.rb

Constant Summary

Constants inherited from BaseCommand

BaseCommand::HELM_VERSION

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#files, #name

Instance Method Summary collapse

Methods inherited from BaseCommand

#cluster_role_binding_resource, #config_map_resource, #env, #file_names, #pod_resource, #rbac?, #repository_command, #service_account_resource

Constructor Details

#initialize(predelete: nil, postdelete: nil, **args) ⇒ DeleteCommand

Returns a new instance of DeleteCommand.


10
11
12
13
14
# File 'lib/gitlab/kubernetes/helm/v3/delete_command.rb', line 10

def initialize(predelete: nil, postdelete: nil, **args)
  super(**args)
  @predelete = predelete
  @postdelete = postdelete
end

Instance Attribute Details

#postdeleteObject (readonly)

Returns the value of attribute postdelete.


8
9
10
# File 'lib/gitlab/kubernetes/helm/v3/delete_command.rb', line 8

def postdelete
  @postdelete
end

#predeleteObject (readonly)

Returns the value of attribute predelete.


8
9
10
# File 'lib/gitlab/kubernetes/helm/v3/delete_command.rb', line 8

def predelete
  @predelete
end

Instance Method Details

#delete_commandObject


28
29
30
# File 'lib/gitlab/kubernetes/helm/v3/delete_command.rb', line 28

def delete_command
  ['helm', 'uninstall', name, *namespace_flag].shelljoin
end

#generate_scriptObject


16
17
18
19
20
21
22
# File 'lib/gitlab/kubernetes/helm/v3/delete_command.rb', line 16

def generate_script
  super + [
    predelete,
    delete_command,
    postdelete
  ].compact.join("\n")
end

#pod_nameObject


24
25
26
# File 'lib/gitlab/kubernetes/helm/v3/delete_command.rb', line 24

def pod_name
  "uninstall-#{name}"
end