diff options
author | Tiger Watson <twatson@gitlab.com> | 2019-06-21 03:55:30 +0000 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-21 03:55:30 +0000 |
commit | a87f0f3937261486960c55d1791c9c04dd6e4171 (patch) | |
tree | 0fddf8c9d29e3fd17f0cc6838ba404ee4693082e /spec | |
parent | 148516ba36855095fa995c2d4e8077919cdb6db6 (diff) | |
download | gitlab-ce-a87f0f3937261486960c55d1791c9c04dd6e4171.tar.gz |
Remove project-level cluster credential fallback
Project-level clusters that made use of this legacy
behaviour have been migrated to unmanaged clusters,
so we are now free to remove this fallback.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/clusters/platforms/kubernetes_spec.rb | 32 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 4 |
2 files changed, 5 insertions, 31 deletions
diff --git a/spec/models/clusters/platforms/kubernetes_spec.rb b/spec/models/clusters/platforms/kubernetes_spec.rb index 1fb3a8de808..0fa5d031736 100644 --- a/spec/models/clusters/platforms/kubernetes_spec.rb +++ b/spec/models/clusters/platforms/kubernetes_spec.rb @@ -281,14 +281,14 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching it_behaves_like 'setting variables' - it 'sets KUBE_TOKEN' do - expect(subject).to include( + it 'does not set KUBE_TOKEN' do + expect(subject).not_to include( { key: 'KUBE_TOKEN', value: kubernetes.token, public: false, masked: true } ) end end - context 'kubernetes namespace is created with no service account token' do + context 'kubernetes namespace is created with service account token' do let!(:kubernetes_namespace) { create(:cluster_kubernetes_namespace, :with_token, cluster: cluster) } it_behaves_like 'setting variables' @@ -340,32 +340,6 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching end end - context 'namespace is provided' do - let(:namespace) { 'my-project' } - - before do - kubernetes.namespace = namespace - end - - it_behaves_like 'setting variables' - - it 'sets KUBE_TOKEN' do - expect(subject).to include( - { key: 'KUBE_TOKEN', value: kubernetes.token, public: false, masked: true } - ) - end - end - - context 'no namespace provided' do - it_behaves_like 'setting variables' - - it 'sets KUBE_TOKEN' do - expect(subject).to include( - { key: 'KUBE_TOKEN', value: kubernetes.token, public: false, masked: true } - ) - end - end - context 'group level cluster' do let!(:cluster) { create(:cluster, :group, platform_kubernetes: kubernetes) } diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 20b98b5eb85..cc0f5002a1e 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2656,8 +2656,8 @@ describe Project do let!(:cluster) { create(:cluster, :project, :provided_by_gcp) } let(:project) { cluster.project } - it 'returns variables from this service' do - expect(project.deployment_variables).to include( + it 'does not return variables from this service' do + expect(project.deployment_variables).not_to include( { key: 'KUBE_TOKEN', value: project.deployment_platform.token, public: false, masked: true } ) end |