diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-08-22 16:38:07 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-08-22 16:38:07 +0000 |
commit | 080a359e0cad3f2a08fc0050aef4ef038bd645dc (patch) | |
tree | 265c8dab023775c0b6874f3198bc780e921c892f /app | |
parent | d3005c98fabe47fe0feecc299cc05cf7642457a3 (diff) | |
parent | 38cb32933b1ba1a6179adf2e37860bac018848ab (diff) | |
download | gitlab-ce-080a359e0cad3f2a08fc0050aef4ef038bd645dc.tar.gz |
Merge branch 'fix/sm/34762-bad-validation-message' into 'master'
Enforce namespace of Kubernetes to lowercase
Closes #34762
See merge request !13732
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project_services/kubernetes_service.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/project_services/kubernetes_service.rb b/app/models/project_services/kubernetes_service.rb index dee99bbb859..8ba07173c74 100644 --- a/app/models/project_services/kubernetes_service.rb +++ b/app/models/project_services/kubernetes_service.rb @@ -24,6 +24,8 @@ class KubernetesService < DeploymentService validates :token end + before_validation :enforce_namespace_to_lower_case + validates :namespace, allow_blank: true, length: 1..63, @@ -207,4 +209,8 @@ class KubernetesService < DeploymentService max_session_time: current_application_settings.terminal_max_session_time } end + + def enforce_namespace_to_lower_case + self.namespace = self.namespace&.downcase + end end |