Class: Clusters::Applications::PrometheusUpdateService

Inherits:
BaseHelmService show all
Defined in:
app/services/clusters/applications/prometheus_update_service.rb

Instance Attribute Summary collapse

Attributes inherited from BaseHelmService

#app

Instance Method Summary collapse

Constructor Details

#initialize(app, project) ⇒ PrometheusUpdateService

Returns a new instance of PrometheusUpdateService.


8
9
10
11
# File 'app/services/clusters/applications/prometheus_update_service.rb', line 8

def initialize(app, project)
  super(app)
  @project = project
end

Instance Attribute Details

#projectObject

Returns the value of attribute project


6
7
8
# File 'app/services/clusters/applications/prometheus_update_service.rb', line 6

def project
  @project
end

Instance Method Details

#executeObject


13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/clusters/applications/prometheus_update_service.rb', line 13

def execute
  app.make_updating!

  helm_api.update(patch_command(values))

  ::ClusterWaitForAppUpdateWorker.perform_in(::ClusterWaitForAppUpdateWorker::INTERVAL, app.name, app.id)
rescue ::Kubeclient::HttpError => ke
  app.make_update_errored!("Kubernetes error: #{ke.message}")
rescue StandardError => e
  app.make_update_errored!(e.message)
end