Filter update params
This commit is contained in:
parent
ec09883b36
commit
c63641ea86
1 changed files with 19 additions and 9 deletions
|
@ -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!
|
||||||
|
|
Loading…
Reference in a new issue