From 164a833b9fc7d88166059484718dd7127fb91a15 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Tue, 23 Jul 2024 17:57:55 +0200 Subject: [PATCH] [#1307] added check for plan --- .../api/cli/v1/projects/clusters_controller_module.rb | 2 ++ .../api/cli/v1/projects/deployments_controller_module.rb | 2 ++ .../uffizzi_core/api/cli/v1/projects/clusters_controller.rb | 1 + .../uffizzi_core/api/cli/v1/projects/deployments_controller.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/clusters_controller_module.rb b/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/clusters_controller_module.rb index 0fe3faec..e45e65e8 100644 --- a/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/clusters_controller_module.rb +++ b/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/clusters_controller_module.rb @@ -6,4 +6,6 @@ module UffizziCore::Api::Cli::V1::Projects::ClustersControllerModule def update_show_trial_quota_exceeded_warning; end def check_account_quota; end + + def check_current_plan; end end diff --git a/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/deployments_controller_module.rb b/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/deployments_controller_module.rb index ad854d1b..f446fa4b 100644 --- a/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/deployments_controller_module.rb +++ b/core/app/controller_modules/uffizzi_core/api/cli/v1/projects/deployments_controller_module.rb @@ -6,4 +6,6 @@ module UffizziCore::Api::Cli::V1::Projects::DeploymentsControllerModule def check_account_quota; end def update_show_trial_quota_exceeded_warning; end + + def check_current_plan; end end diff --git a/core/app/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller.rb b/core/app/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller.rb index cc18d724..b6a0528c 100644 --- a/core/app/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller.rb +++ b/core/app/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller.rb @@ -5,6 +5,7 @@ class UffizziCore::Api::Cli::V1::Projects::ClustersController < UffizziCore::Api before_action :authorize_uffizzi_core_api_cli_v1_projects_clusters before_action :check_account_quota, only: [:create] + before_action :check_current_plan after_action :update_show_trial_quota_exceeded_warning, only: [:create, :destroy] def index diff --git a/core/app/controllers/uffizzi_core/api/cli/v1/projects/deployments_controller.rb b/core/app/controllers/uffizzi_core/api/cli/v1/projects/deployments_controller.rb index 173496b5..3489aaca 100644 --- a/core/app/controllers/uffizzi_core/api/cli/v1/projects/deployments_controller.rb +++ b/core/app/controllers/uffizzi_core/api/cli/v1/projects/deployments_controller.rb @@ -7,6 +7,7 @@ class UffizziCore::Api::Cli::V1::Projects::DeploymentsController < UffizziCore:: before_action :authorize_uffizzi_core_api_cli_v1_projects_deployments before_action :check_account_quota, only: :create + before_action :check_current_plan after_action :update_show_trial_quota_exceeded_warning, only: :destroy # Get a list of active deployements for a project