e33ecfdec3
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
14 lines
406 B
Ruby
14 lines
406 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ClusterConfigureWorker
|
|
include ApplicationWorker
|
|
include ClusterQueue
|
|
|
|
def perform(cluster_id)
|
|
Clusters::Cluster.find_by_id(cluster_id).try do |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
|