Class: Clusters::Applications::PrometheusUpdateService

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

Overview

Deprecated, to be removed in %14.0 as part of gitlab.com/groups/gitlab-org/-/epics/4280

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.


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

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

Instance Attribute Details

#projectObject

Returns the value of attribute project.


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

def project
  @project
end

Instance Method Details

#executeObject


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

def execute
  raise NotImplementedError, 'Externally installed prometheus should not be modified!' unless app.managed_prometheus?

  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