diff options
author | Tiger <twatson@gitlab.com> | 2019-03-18 13:02:39 +1100 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-03-20 12:04:46 +1100 |
commit | 325d504c3c9697c73130aef67e8b32c99544b453 (patch) | |
tree | 026504e8dbcd2218447bc78c07903167f1a05e33 /spec/lib/gitlab | |
parent | 89b0bc04b9927abc85ce5fc3735438f956a8d5a2 (diff) | |
download | gitlab-ce-325d504c3c9697c73130aef67e8b32c99544b453.tar.gz |
Don't recreate Kubernetes namespaces if they exist
Instead of attempting to create or update a Kubernetes
namespace on every deploy, only do so when we know it
doesn't exist yet.
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb | 6 |
1 files changed, 6 insertions, 0 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 ba87863c978..62dcd80fad7 100644 --- a/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb +++ b/spec/lib/gitlab/ci/build/prerequisite/kubernetes_namespace_spec.rb @@ -27,6 +27,12 @@ describe Gitlab::Ci::Build::Prerequisite::KubernetesNamespace do end it { is_expected.to be_truthy } + + context 'and a namespace is already created for this project' do + let!(:kubernetes_namespace) { create(:cluster_kubernetes_namespace, cluster: cluster, project: build.project) } + + it { is_expected.to be_falsey } + end end context 'and no cluster to deploy to' do |