Class: Eien::Apps::DeleteTask

Inherits:
Task
  • Object
show all
Defined in:
lib/eien/apps/delete_task.rb

Instance Attribute Summary collapse

Attributes inherited from Task

#context, #namespace, #task_config

Instance Method Summary collapse

Methods included from Helpers::TimeHelpers

#summarize_age

Constructor Details

#initialize(context, name) ⇒ DeleteTask

Returns a new instance of DeleteTask.



8
9
10
11
# File 'lib/eien/apps/delete_task.rb', line 8

def initialize(context, name)
  @name = name
  super(context, nil)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/eien/apps/delete_task.rb', line 6

def name
  @name
end

Instance Method Details

#run!Object



13
14
15
16
17
18
19
20
21
# File 'lib/eien/apps/delete_task.rb', line 13

def run!
  v1_client = kubeclient_builder.build_v1_kubeclient(context)
  eien_client = kubeclient_builder.build_eien_kubeclient(context)

  namespace = eien_client.get_app(name).spec.namespace

  v1_client.delete_namespace(namespace)
  eien_client.delete_app(name)
end