diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 15:10:18 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 15:10:18 +0100 |
commit | c63641ea8687cb0f2c138c618d7a03014f37957f (patch) | |
tree | 9714f831269f8c72238eaa3ae2d1e7c7830aea55 /app | |
parent | ec09883b3683b6cf59e01933170972d3e3c0faf1 (diff) | |
download | gitlab-ce-c63641ea8687cb0f2c138c618d7a03014f37957f.tar.gz |
Filter update params
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/clusters_controller.rb | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index f451d4c9774..ab32930a434 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -61,15 +61,25 @@ class Projects::ClustersController < Projects::ApplicationController end def update_params - params.require(:cluster).permit( - :enabled, - :name, - platform_kubernetes_attributes: [ - :namespace, - :api_url, - :token, - :ca_cert - ]) + if cluster.managed? + params.require(:cluster).permit( + :enabled, + platform_kubernetes_attributes: [ + :namespace + ] + ) + else + params.require(:cluster).permit( + :enabled, + :name, + platform_kubernetes_attributes: [ + :api_url, + :token, + :ca_cert, + :namespace + ] + ) + end end def authorize_update_cluster! |