diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-08-22 09:12:27 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-08-22 09:12:27 +0300 |
commit | fe9fc0af7519a2809116d73a8322d881e146e3f8 (patch) | |
tree | 27ecca1d9f359ade17646122e241866a655dcd32 /app | |
parent | 539ed0a6375d5bb6d734e688b801373e4b8006f9 (diff) |
Enfouce namespace for Kubernetes to lowercase
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 |