diff options
author | Tiger <twatson@gitlab.com> | 2019-04-15 05:11:50 +0300 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-04-16 06:59:37 +0300 |
commit | e33ecfdec30a8efee191f8c2dd85ca54011128ce (patch) | |
tree | 9b97e13ff405e56add3a45ab1ce6ff4433e6e1d5 /app/workers | |
parent | 0a99e0220d9371423039f05f700af3675b26624f (diff) |
Disable JIT resource creation for project clusters
JIT resource creation blocks deployments if a user is
self-managing their cluster, as it will fail the build
if unable to create a namespace and service account.
Using a custom namespace and service account was previously
supported for project level clusters, so we should preserve
this functionality.
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27352
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/cluster_configure_worker.rb | 6 | ||||
-rw-r--r-- | app/workers/cluster_project_configure_worker.rb | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/app/workers/cluster_configure_worker.rb b/app/workers/cluster_configure_worker.rb index b984dee5b21..22681157b62 100644 --- a/app/workers/cluster_configure_worker.rb +++ b/app/workers/cluster_configure_worker.rb @@ -5,10 +5,10 @@ class ClusterConfigureWorker include ClusterQueue def perform(cluster_id) - return if Feature.enabled?(:ci_preparing_state, default_enabled: true) - Clusters::Cluster.find_by_id(cluster_id).try do |cluster| - Clusters::RefreshService.create_or_update_namespaces_for_cluster(cluster) + if cluster.project_type? || Feature.disabled?(:ci_preparing_state, default_enabled: true) + Clusters::RefreshService.create_or_update_namespaces_for_cluster(cluster) + end end end end diff --git a/app/workers/cluster_project_configure_worker.rb b/app/workers/cluster_project_configure_worker.rb index d7bea69a01c..497e57c0d0b 100644 --- a/app/workers/cluster_project_configure_worker.rb +++ b/app/workers/cluster_project_configure_worker.rb @@ -5,8 +5,6 @@ class ClusterProjectConfigureWorker include ClusterQueue def perform(project_id) - return if Feature.enabled?(:ci_preparing_state, default_enabled: true) - project = Project.find(project_id) ::Clusters::RefreshService.create_or_update_namespaces_for_project(project) |