Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-06-06 15:40:03 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-06 15:40:03 +0300
commitc7a1da800ff6fa16db5de796a8f8d715ddd3b582 (patch)
tree3db1bd3488130c4fe3eacc9ce947dc7898c9f92f /app/controllers/projects/deployments_controller.rb
parentc0a66dbd2dd8b716e809938d20e7655d84595176 (diff)
Explicitly require format.json in prometheus_controller
+ add missing prometheus_controller tests!
Diffstat (limited to 'app/controllers/projects/deployments_controller.rb')
-rw-r--r--app/controllers/projects/deployments_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/deployments_controller.rb b/app/controllers/projects/deployments_controller.rb
index 29d94e2760a..acf5573935a 100644
--- a/app/controllers/projects/deployments_controller.rb
+++ b/app/controllers/projects/deployments_controller.rb
@@ -24,10 +24,11 @@ class Projects::DeploymentsController < Projects::ApplicationController
def additional_metrics
return render_404 unless deployment.has_additional_metrics?
+
metrics = deployment.additional_metrics
- if metrics&.any?
- render json: metrics, status: :ok
+ if metrics.any?
+ render json: metrics
else
head :no_content
end