summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-28 01:26:14 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-28 20:47:59 +0900
commit54c70a775af21863d51bd2b3e96e5998c90ddaf7 (patch)
tree7f73d5c4a3af093ce454aa5f087018989edd1477 /app
parentf6d9dcf8382a00a5f2ae2100b13774b01f0328bb (diff)
downloadgitlab-ce-54c70a775af21863d51bd2b3e96e5998c90ddaf7.tar.gz
Fix static analysys
Diffstat (limited to 'app')
-rw-r--r--app/models/clusters/platforms/kubernetes.rb1
-rw-r--r--app/models/project.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb
index 39b4f8f7bfc..7ab670cf1ef 100644
--- a/app/models/clusters/platforms/kubernetes.rb
+++ b/app/models/clusters/platforms/kubernetes.rb
@@ -134,6 +134,7 @@ module Clusters
kubeclient.get_pods(namespace: actual_namespace).as_json
rescue KubeException => err
raise err unless err.error_code == 404
+
[]
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 49c56e76dfc..95aabc4ad45 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -905,7 +905,7 @@ class Project < ActiveRecord::Base
# TODO: This will be extended for multiple enviroment clusters
# TODO: Add super nice tests to check this interchangeability
def deployment_platform
- @deployment_platform ||= clusters.where(enabled: true).first&.platform_kubernetes
+ @deployment_platform ||= clusters.find_by(enabled: true)&.platform_kubernetes
@deployment_platform ||= services.where(category: :deployment).reorder(nil).find_by(active: true)
end