diff options
author | Tiger <twatson@gitlab.com> | 2019-08-07 12:19:17 +1000 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-08-07 12:20:32 +1000 |
commit | d1921afaf96b220ca5d171afd057efa94a33624d (patch) | |
tree | 522076736c7c7c98af9b56038f3f478c4613c3cc | |
parent | 9d582f407df6f4894a7c2674a7b160837d6dd5e8 (diff) | |
download | gitlab-ce-52494-separate-namespace-per-project-environment-slug.tar.gz |
Only look up Kubernetes namespaces by project ID52494-separate-namespace-per-project-environment-slug
Also finding by cluster_project_id is redundant
-rw-r--r-- | app/finders/clusters/kubernetes_namespace_finder.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/finders/clusters/kubernetes_namespace_finder.rb b/app/finders/clusters/kubernetes_namespace_finder.rb index 73567c2472a..e947796c1e7 100644 --- a/app/finders/clusters/kubernetes_namespace_finder.rb +++ b/app/finders/clusters/kubernetes_namespace_finder.rb @@ -20,11 +20,9 @@ module Clusters attr_reader :allow_blank_token def find_namespace(with_environment:) - attributes = { project: project } - attributes[:cluster_project] = cluster.cluster_project if cluster.project_type? - relation = with_environment ? namespaces.with_environment_slug(environment_slug) : namespaces - relation.find_by(attributes) # rubocop: disable CodeReuse/ActiveRecord + + relation.find_by_project_id(project.id) end def namespaces |