Commit 1a25ad3e authored by James Fargher's avatar James Fargher

Allow a user defined namespace on non-gitlab managed clusters

Since they are not GitLab managed we wont make assumptions about the
namespaces used
parent f26884a0
......@@ -208,7 +208,7 @@ module Clusters
end
def allow_user_defined_namespace?
project_type?
project_type? || !managed?
end
def kube_ingress_domain
......
......@@ -509,19 +509,43 @@ describe Clusters::Cluster, :use_clean_rails_memory_store_caching do
subject { cluster.allow_user_defined_namespace? }
context 'project type cluster' do
it { is_expected.to be_truthy }
context 'gitlab managed' do
it { is_expected.to be_truthy }
end
context 'not managed' do
let(:cluster) { create(:cluster, :provided_by_gcp, managed: false) }
it { is_expected.to be_truthy }
end
end
context 'group type cluster' do
let(:cluster) { create(:cluster, :provided_by_gcp, :group) }
context 'gitlab managed' do
let(:cluster) { create(:cluster, :provided_by_gcp, :group) }
it { is_expected.to be_falsey }
end
it { is_expected.to be_falsey }
context 'not managed' do
let(:cluster) { create(:cluster, :provided_by_gcp, :group, managed: false) }
it { is_expected.to be_truthy }
end
end
context 'instance type cluster' do
let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
context 'gitlab managed' do
let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
it { is_expected.to be_falsey }
end
context 'not managed' do
let(:cluster) { create(:cluster, :provided_by_gcp, :instance, managed: false) }
it { is_expected.to be_falsey }
it { is_expected.to be_truthy }
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment