Filter update params

This commit is contained in:
Kamil Trzcinski 2017-12-03 15:10:18 +01:00
parent ec09883b36
commit c63641ea86

View file

@ -61,15 +61,25 @@ class Projects::ClustersController < Projects::ApplicationController
end end
def update_params def update_params
params.require(:cluster).permit( if cluster.managed?
:enabled, params.require(:cluster).permit(
:name, :enabled,
platform_kubernetes_attributes: [ platform_kubernetes_attributes: [
:namespace, :namespace
:api_url, ]
:token, )
:ca_cert else
]) params.require(:cluster).permit(
:enabled,
:name,
platform_kubernetes_attributes: [
:api_url,
:token,
:ca_cert,
:namespace
]
)
end
end end
def authorize_update_cluster! def authorize_update_cluster!