Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiger <twatson@gitlab.com>2019-04-15 05:11:50 +0300
committerTiger <twatson@gitlab.com>2019-04-16 06:59:37 +0300
commite33ecfdec30a8efee191f8c2dd85ca54011128ce (patch)
tree9b97e13ff405e56add3a45ab1ce6ff4433e6e1d5 /spec/services
parent0a99e0220d9371423039f05f700af3675b26624f (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 'spec/services')
-rw-r--r--spec/services/clusters/refresh_service_spec.rb26
1 files changed, 22 insertions, 4 deletions
diff --git a/spec/services/clusters/refresh_service_spec.rb b/spec/services/clusters/refresh_service_spec.rb
index 58ab3c3cf73..9e442ebf4e9 100644
--- a/spec/services/clusters/refresh_service_spec.rb
+++ b/spec/services/clusters/refresh_service_spec.rb
@@ -93,14 +93,32 @@ describe Clusters::RefreshService do
let(:group) { cluster.group }
let(:project) { create(:project, group: group) }
- include_examples 'creates a kubernetes namespace'
+ context 'when ci_preparing_state feature flag is enabled' do
+ include_examples 'does not create a kubernetes namespace'
- context 'when project already has kubernetes namespace' do
+ context 'when project already has kubernetes namespace' do
+ before do
+ create(:cluster_kubernetes_namespace, project: project, cluster: cluster)
+ end
+
+ include_examples 'does not create a kubernetes namespace'
+ end
+ end
+
+ context 'when ci_preparing_state feature flag is disabled' do
before do
- create(:cluster_kubernetes_namespace, project: project, cluster: cluster)
+ stub_feature_flags(ci_preparing_state: false)
end
- include_examples 'does not create a kubernetes namespace'
+ include_examples 'creates a kubernetes namespace'
+
+ context 'when project already has kubernetes namespace' do
+ before do
+ create(:cluster_kubernetes_namespace, project: project, cluster: cluster)
+ end
+
+ include_examples 'does not create a kubernetes namespace'
+ end
end
end
end