diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 17:00:33 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 17:00:33 +0300 |
commit | 7af2161ca50484fea77ef816dc98ba66ff848681 (patch) | |
tree | a7d5b5d151f68b9385786906c29815d84bd4047e /app/controllers/projects | |
parent | 1385d700265a12c0fba344ff606feaea56538641 (diff) |
Fix controllers and links
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/clusters/gcp_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/projects/clusters_controller.rb | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/app/controllers/projects/clusters/gcp_controller.rb b/app/controllers/projects/clusters/gcp_controller.rb index 54eef2426a5..5e909a57345 100644 --- a/app/controllers/projects/clusters/gcp_controller.rb +++ b/app/controllers/projects/clusters/gcp_controller.rb @@ -2,8 +2,6 @@ class Projects::Clusters::GcpController < Projects::ApplicationController before_action :authorize_read_cluster! before_action :authorize_google_api, except: [:login] before_action :authorize_create_cluster!, only: [:new, :create] - before_action :authorize_update_cluster!, only: [:update] - before_action :authorize_admin_cluster!, only: [:destroy] def login begin @@ -52,6 +50,14 @@ class Projects::Clusters::GcpController < Projects::ApplicationController ) end + def update_params + params.require(:cluster).permit( + :enabled, + platform_kubernetes_attributes: [ + :namespace + ]) + end + def authorize_google_api unless GoogleApi::CloudPlatform::Client.new(token_in_session, nil) .validate_token(expires_at_in_session) diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index def7342b262..f451d4c9774 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -1,5 +1,5 @@ class Projects::ClustersController < Projects::ApplicationController - before_action :cluster, except: [:login, :index, :new] + before_action :cluster, except: [:index, :new] before_action :authorize_read_cluster! before_action :authorize_create_cluster!, only: [:new] before_action :authorize_update_cluster!, only: [:update] @@ -13,6 +13,9 @@ class Projects::ClustersController < Projects::ApplicationController end end + def new + end + def status respond_to do |format| format.json do @@ -60,6 +63,7 @@ class Projects::ClustersController < Projects::ApplicationController def update_params params.require(:cluster).permit( :enabled, + :name, platform_kubernetes_attributes: [ :namespace, :api_url, |