Commit dbff1452 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'remove_project_only_cluster_applications' into 'master'

Refactor out empty constant

See merge request gitlab-org/gitlab!19135
parents 770b4a0c 9cf2848d
...@@ -9,8 +9,6 @@ module Clusters ...@@ -9,8 +9,6 @@ module Clusters
self.table_name = 'clusters' self.table_name = 'clusters'
PROJECT_ONLY_APPLICATIONS = {
}.freeze
APPLICATIONS = { APPLICATIONS = {
Applications::Helm.application_name => Applications::Helm, Applications::Helm.application_name => Applications::Helm,
Applications::Ingress.application_name => Applications::Ingress, Applications::Ingress.application_name => Applications::Ingress,
...@@ -20,7 +18,7 @@ module Clusters ...@@ -20,7 +18,7 @@ module Clusters
Applications::Jupyter.application_name => Applications::Jupyter, Applications::Jupyter.application_name => Applications::Jupyter,
Applications::Knative.application_name => Applications::Knative, Applications::Knative.application_name => Applications::Knative,
Applications::ElasticStack.application_name => Applications::ElasticStack Applications::ElasticStack.application_name => Applications::ElasticStack
}.merge(PROJECT_ONLY_APPLICATIONS).freeze }.freeze
DEFAULT_ENVIRONMENT = '*' DEFAULT_ENVIRONMENT = '*'
KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN' KUBE_INGRESS_BASE_DOMAIN = 'KUBE_INGRESS_BASE_DOMAIN'
......
...@@ -64,19 +64,13 @@ module Clusters ...@@ -64,19 +64,13 @@ module Clusters
end end
def invalid_application? def invalid_application?
unknown_application? || (!cluster.project_type? && project_only_application?) || (application_name == Applications::ElasticStack.application_name && !Feature.enabled?(:enable_cluster_application_elastic_stack)) unknown_application? || (application_name == Applications::ElasticStack.application_name && !Feature.enabled?(:enable_cluster_application_elastic_stack))
end end
def unknown_application? def unknown_application?
Clusters::Cluster::APPLICATIONS.keys.exclude?(application_name) Clusters::Cluster::APPLICATIONS.keys.exclude?(application_name)
end end
# These applications will need extra configuration to enable them to work
# with groups of projects
def project_only_application?
Clusters::Cluster::PROJECT_ONLY_APPLICATIONS.include?(application_name)
end
def application_name def application_name
params[:application] params[:application]
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment