Commit c63641ea authored by Kamil Trzcinski's avatar Kamil Trzcinski

Filter update params

parent ec09883b
...@@ -61,15 +61,25 @@ class Projects::ClustersController < Projects::ApplicationController ...@@ -61,15 +61,25 @@ class Projects::ClustersController < Projects::ApplicationController
end end
def update_params def update_params
if cluster.managed?
params.require(:cluster).permit(
:enabled,
platform_kubernetes_attributes: [
:namespace
]
)
else
params.require(:cluster).permit( params.require(:cluster).permit(
:enabled, :enabled,
:name, :name,
platform_kubernetes_attributes: [ platform_kubernetes_attributes: [
:namespace,
:api_url, :api_url,
:token, :token,
:ca_cert :ca_cert,
]) :namespace
]
)
end
end end
def authorize_update_cluster! def authorize_update_cluster!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment