Class: Eien::Routes::UpdateTask
- Defined in:
- lib/eien/routes/update_task.rb
Constant Summary collapse
- ALLOWED_ATTRIBUTES =
[:enabled, :domains, :path, :process, :port].freeze
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Task
#context, #namespace, #task_config
Instance Method Summary collapse
-
#initialize(context, app, name, **attributes) ⇒ UpdateTask
constructor
A new instance of UpdateTask.
- #run! ⇒ Object
Methods included from Helpers::TimeHelpers
Constructor Details
#initialize(context, app, name, **attributes) ⇒ UpdateTask
Returns a new instance of UpdateTask.
10 11 12 13 14 15 |
# File 'lib/eien/routes/update_task.rb', line 10 def initialize(context, app, name, **attributes) @app = Eien.app_from_name(context, app) @name = name @attributes = attributes super(context) end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/eien/routes/update_task.rb', line 8 def app @app end |
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
8 9 10 |
# File 'lib/eien/routes/update_task.rb', line 8 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/eien/routes/update_task.rb', line 8 def name @name end |
Instance Method Details
#run! ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/eien/routes/update_task.rb', line 17 def run! client = kubeclient_builder.build_eien_kubeclient(context) the_route = client.get_route(name, app.spec.namespace) the_route.spec = (the_route.spec&.to_h || {}).merge(attributes) client.update_route(the_route) end |