diff options
author | Thong Kuah <tkuah@gitlab.com> | 2018-11-15 15:28:29 +1300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2018-12-04 15:46:11 +1300 |
commit | 28b0b9c144a0869e218728d1d056607d1a7a7a8a (patch) | |
tree | 70d5159903e2dfd84c12ede44fa41baff38a5914 /app/services/clusters/gcp | |
parent | 76d4e6d6d87f3e59f1864fa15da701bb789e301e (diff) | |
download | gitlab-ce-28b0b9c144a0869e218728d1d056607d1a7a7a8a.tar.gz |
Call ClusterPlatformConfigureWorker to re-use code
We remove configure_project_service_account and replace
ClusterPlatformConfigureWorker as they perform exactly the same piece of
work. This also makes GKE cluster creation to be the same as Adding
existing cluster - they both now use another worker to execute
CreateOrUpdateNamespaceService.
Diffstat (limited to 'app/services/clusters/gcp')
-rw-r--r-- | app/services/clusters/gcp/finalize_creation_service.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/app/services/clusters/gcp/finalize_creation_service.rb b/app/services/clusters/gcp/finalize_creation_service.rb index 3df43657fa0..9efe8d85dee 100644 --- a/app/services/clusters/gcp/finalize_creation_service.rb +++ b/app/services/clusters/gcp/finalize_creation_service.rb @@ -12,7 +12,8 @@ module Clusters create_gitlab_service_account! configure_kubernetes cluster.save! - configure_project_service_account + + ClusterPlatformConfigureWorker.perform_async(cluster.id) rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e provider.make_errored!("Failed to request to CloudPlatform; #{e.message}") @@ -55,15 +56,6 @@ module Clusters ).execute end - def configure_project_service_account - kubernetes_namespace = cluster.find_or_initialize_kubernetes_namespace(cluster.cluster_project) - - Clusters::Gcp::Kubernetes::CreateOrUpdateNamespaceService.new( - cluster: cluster, - kubernetes_namespace: kubernetes_namespace - ).execute - end - def authorization_type create_rbac_cluster? ? 'rbac' : 'abac' end |