From 6f2ad2b6041b8a007df7eb8c4f477c24cc153ac3 Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Thu, 6 Sep 2018 10:03:38 +0000 Subject: Enable Kubernetes RBAC for GitLab Managed Apps for existing clusters --- spec/models/clusters/platforms/kubernetes_spec.rb | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'spec/models/clusters/platforms/kubernetes_spec.rb') diff --git a/spec/models/clusters/platforms/kubernetes_spec.rb b/spec/models/clusters/platforms/kubernetes_spec.rb index ab7f89f9bf4..66198d5ee2b 100644 --- a/spec/models/clusters/platforms/kubernetes_spec.rb +++ b/spec/models/clusters/platforms/kubernetes_spec.rb @@ -92,6 +92,30 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching end end + describe '#kubeclient' do + subject { kubernetes.kubeclient } + + let(:kubernetes) { build(:cluster_platform_kubernetes, :configured, namespace: 'a-namespace') } + + it { is_expected.to be_an_instance_of(Gitlab::Kubernetes::KubeClient) } + end + + describe '#rbac?' do + subject { kubernetes.rbac? } + + let(:kubernetes) { build(:cluster_platform_kubernetes, :configured) } + + context 'when authorization type is rbac' do + let(:kubernetes) { build(:cluster_platform_kubernetes, :rbac_enabled, :configured) } + + it { is_expected.to be_truthy } + end + + context 'when authorization type is nil' do + it { is_expected.to be_falsey } + end + end + describe '#actual_namespace' do subject { kubernetes.actual_namespace } -- cgit v1.2.1