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/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
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/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb b/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
index 62dcd80fad7..e8332b14627 100644
--- a/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
+++ b/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb
@@ -20,7 +20,7 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do
let!(:deployment) { create(:deployment, deployable: build) }
context 'and a cluster to deploy to' do
- let(:cluster) { create(:cluster, projects: [build.project]) }
+ let(:cluster) { create(:cluster, :group) }
before do
allow(build.deployment).to receive(:cluster).and_return(cluster)
@@ -33,6 +33,12 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do
it { is_expected.to be_falsey }
end
+
+ context 'and cluster is project type' do
+ let(:cluster) { create(:cluster, :project) }
+
+ it { is_expected.to be_falsey }
+ end
end
context 'and no cluster to deploy to' do
@@ -52,7 +58,7 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do
subject { described_class.new(build).complete! }
context 'completion is required' do
- let(:cluster) { create(:cluster, projects: [build.project]) }
+ let(:cluster) { create(:cluster, :group) }
before do
allow(build.deployment).to receive(:cluster).and_return(cluster)