diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-11-07 02:30:36 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-11-08 13:28:30 +0300 |
commit | b4488cee97b8f0b6d4b2849061fde823e988f190 (patch) | |
tree | 7877b9d8164d8e41bad0c02dc58f1b4e5c9e2805 /app/models/clusters/platforms/kubernetes.rb | |
parent | a551758da2cd625a26397910259a6dbee1e0c713 (diff) |
Consolidate how we allow user defined namespace
Use model method as single source of truth instead of splitting between
presenter and Kubernetes model
Diffstat (limited to 'app/models/clusters/platforms/kubernetes.rb')
-rw-r--r-- | app/models/clusters/platforms/kubernetes.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb index a90a5395749..1fa28e13f60 100644 --- a/app/models/clusters/platforms/kubernetes.rb +++ b/app/models/clusters/platforms/kubernetes.rb @@ -38,7 +38,7 @@ module Clusters validates :namespace, exclusion: { in: RESERVED_NAMESPACES } - validate :no_namespace, unless: :project_type? + validate :no_namespace, unless: :allow_user_defined_namespace? # We expect to be `active?` only when enabled and cluster is created (the api_url is assigned) validates :api_url, url: true, presence: true @@ -54,7 +54,7 @@ module Clusters delegate :project, to: :cluster, allow_nil: true delegate :enabled?, to: :cluster, allow_nil: true delegate :managed?, to: :cluster, allow_nil: true - delegate :project_type?, to: :cluster, allow_nil: true + delegate :allow_user_defined_namespace?, to: :cluster, allow_nil: true delegate :kubernetes_namespace, to: :cluster alias_method :active?, :enabled? |