diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2019-04-26 13:28:49 +1000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-29 22:55:12 -0700 |
commit | 0a4817dd77eb371f171b634e4df180eafa115721 (patch) | |
tree | 9f7caaedef2c3e297e04cf6f2c333950f3d2f0c0 | |
parent | 50fa7847bb89254ab0dbe163b5e71bb43b6d6b14 (diff) | |
download | gitlab-ce-0a4817dd77eb371f171b634e4df180eafa115721.tar.gz |
In Prometheus use update! instead of update
In order to not miss any errors since we are not checking the return
value of update
-rw-r--r-- | app/models/clusters/applications/prometheus.rb | 4 | ||||
-rw-r--r-- | spec/models/clusters/applications/prometheus_spec.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 1a715830953..a6b7617b830 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -21,7 +21,7 @@ module Clusters state_machine :status do after_transition any => [:installed] do |application| application.cluster.projects.each do |project| - project.find_or_initialize_service('prometheus').update(active: true) + project.find_or_initialize_service('prometheus').update!(active: true) end end end @@ -94,7 +94,7 @@ module Clusters def disable_prometheus_integration cluster.projects.each do |project| - project.prometheus_service&.update(active: false) + project.prometheus_service&.update!(active: false) end end diff --git a/spec/models/clusters/applications/prometheus_spec.rb b/spec/models/clusters/applications/prometheus_spec.rb index 76d2c4a9d1c..8649d3e2710 100644 --- a/spec/models/clusters/applications/prometheus_spec.rb +++ b/spec/models/clusters/applications/prometheus_spec.rb @@ -40,7 +40,7 @@ describe Clusters::Applications::Prometheus do end it 'ensures Prometheus service is activated' do - expect(prometheus_service).to receive(:update).with(active: true) + expect(prometheus_service).to receive(:update!).with(active: true) subject.make_installed end |