Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2019-07-10 08:33:09 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2019-07-11 10:22:58 +0300
commitdacd0ee18b617f0c81c4a478a4d801b3c37e0c56 (patch)
treeb129e20413cefe21c2ad33c890b223d0a37a4928 /lib
parent4efc8574cb45369797cf902d4e9676506a6e4cf7 (diff)
Refactor: model errors for multi cluster validation
The current approach requires catching exceptions to handle these errors and callers are already handling model validations so it seems more appropriate. Also it seemed to convoluted to add this logic directly to the model since the model needs to check too many possible associations to determine whether or not there are more than one cluster since the model doesn't know what it's being created on. Additionally we only wanted to validate during create to avoid the risk of existing models becoming invalid by many different edge cases.
Diffstat (limited to 'lib')
-rw-r--r--lib/api/project_clusters.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/project_clusters.rb b/lib/api/project_clusters.rb
index dcc8d94fb79..4f093e9be08 100644
--- a/lib/api/project_clusters.rb
+++ b/lib/api/project_clusters.rb
@@ -65,7 +65,7 @@ module API
use :create_params_ee
end
post ':id/clusters/user' do
- authorize! :add_cluster, user_project, 'Instance does not support multiple Kubernetes clusters'
+ authorize! :add_cluster, user_project
user_cluster = ::Clusters::CreateService
.new(current_user, create_cluster_user_params)