diff options
Diffstat (limited to 'app/models/clusters')
-rw-r--r-- | app/models/clusters/concerns/provider_status.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/providers/aws.rb | 12 | ||||
-rw-r--r-- | app/models/clusters/providers/gcp.rb | 6 |
3 files changed, 1 insertions, 19 deletions
diff --git a/app/models/clusters/concerns/provider_status.rb b/app/models/clusters/concerns/provider_status.rb index 2da1ee7aabb..44da840bec3 100644 --- a/app/models/clusters/concerns/provider_status.rb +++ b/app/models/clusters/concerns/provider_status.rb @@ -24,7 +24,7 @@ module Clusters transition any - [:errored] => :errored end - before_transition any => [:errored, :created] do |provider| + before_transition any => [:errored, :created] do |provider, _| provider.nullify_credentials end diff --git a/app/models/clusters/providers/aws.rb b/app/models/clusters/providers/aws.rb index f0f56d9ebd9..969820459e3 100644 --- a/app/models/clusters/providers/aws.rb +++ b/app/models/clusters/providers/aws.rb @@ -45,18 +45,6 @@ module Clusters ) end - def api_client - strong_memoize(:api_client) do - ::Aws::CloudFormation::Client.new(credentials: credentials, region: region) - end - end - - def credentials - strong_memoize(:credentials) do - ::Aws::Credentials.new(access_key_id, secret_access_key, session_token) - end - end - def has_rbac_enabled? true end diff --git a/app/models/clusters/providers/gcp.rb b/app/models/clusters/providers/gcp.rb index fde5ed592cb..6f39037b947 100644 --- a/app/models/clusters/providers/gcp.rb +++ b/app/models/clusters/providers/gcp.rb @@ -37,12 +37,6 @@ module Clusters greater_than: 0 } - def api_client - return unless access_token - - @api_client ||= GoogleApi::CloudPlatform::Client.new(access_token, nil) - end - def nullify_credentials assign_attributes( access_token: nil, |