diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /app/models/clusters/platforms | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'app/models/clusters/platforms')
-rw-r--r-- | app/models/clusters/platforms/kubernetes.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb index e3dcd5b0d07..da5f4cc1862 100644 --- a/app/models/clusters/platforms/kubernetes.rb +++ b/app/models/clusters/platforms/kubernetes.rb @@ -7,6 +7,7 @@ module Clusters include EnumWithNil include AfterCommitQueue include ReactiveCaching + include NullifyIfBlank RESERVED_NAMESPACES = %w(gitlab-managed-apps).freeze @@ -25,7 +26,6 @@ module Clusters key: Settings.attr_encrypted_db_key_base_truncated, algorithm: 'aes-256-cbc' - before_validation :nullify_blank_namespace before_validation :enforce_namespace_to_lower_case before_validation :enforce_ca_whitespace_trimming @@ -64,6 +64,8 @@ module Clusters default_value_for :authorization_type, :rbac + nullify_if_blank :namespace + def predefined_variables(project:, environment_name:, kubernetes_namespace: nil) Gitlab::Ci::Variables::Collection.new.tap do |variables| variables.append(key: 'KUBE_URL', value: api_url) @@ -255,10 +257,6 @@ module Clusters true end - def nullify_blank_namespace - self.namespace = nil if namespace.blank? - end - def extract_relevant_pod_data(pods) pods.map do |pod| { |