debian-mirror-gitlab/lib/gitlab/kubernetes/helm/delete_command.rb

37 lines
745 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
module Gitlab
module Kubernetes
module Helm
2020-06-23 00:09:42 +05:30
class DeleteCommand < BaseCommand
2019-07-31 22:56:46 +05:30
include ClientCommand
2019-10-12 21:52:04 +05:30
attr_reader :predelete, :postdelete
2019-07-31 22:56:46 +05:30
2020-06-23 00:09:42 +05:30
def initialize(predelete: nil, postdelete: nil, **args)
super(**args)
2019-10-12 21:52:04 +05:30
@predelete = predelete
@postdelete = postdelete
2019-07-31 22:56:46 +05:30
end
def generate_script
super + [
init_command,
2019-10-12 21:52:04 +05:30
predelete,
delete_command,
postdelete
2019-07-31 22:56:46 +05:30
].compact.join("\n")
end
def pod_name
"uninstall-#{name}"
end
def delete_command
2020-10-24 23:57:45 +05:30
['helm', 'delete', '--purge', name].shelljoin
2019-07-31 22:56:46 +05:30
end
end
end
end
end