Class: Eien::Domains::DeleteTask
- Defined in:
- lib/eien/domains/delete_task.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
Attributes inherited from Task
#context, #namespace, #task_config
Instance Method Summary collapse
-
#initialize(context, app, name) ⇒ DeleteTask
constructor
A new instance of DeleteTask.
- #run! ⇒ Object
Methods included from Helpers::TimeHelpers
Constructor Details
#initialize(context, app, name) ⇒ DeleteTask
Returns a new instance of DeleteTask.
8 9 10 11 12 |
# File 'lib/eien/domains/delete_task.rb', line 8 def initialize(context, app, name) @app = Eien.app_from_name(context, app) @domain = name super(context) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/eien/domains/delete_task.rb', line 6 def app @app end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
6 7 8 |
# File 'lib/eien/domains/delete_task.rb', line 6 def domain @domain end |
Instance Method Details
#run! ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/eien/domains/delete_task.rb', line 14 def run! client = kubeclient_builder.build_eien_kubeclient(context) domains = client.get_domains(namespace: app.spec.namespace) domains.map do |domain_resource| next unless domain_resource.spec.domain == domain client.delete_domain(domain_resource..name, app.spec.namespace) end end |