summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-08-29 23:38:26 +1200
committerThong Kuah <tkuah@gitlab.com>2018-09-14 16:26:50 +1200
commitbf0179b7f170d06d88a8bbe1fbf37e4c8abe6aad (patch)
treefb17b4c714fdc5d581ff467eb5595119c57e5d25 /spec
parent0f210a69be773bcc9ce99d8e4bcbd0f695b0b280 (diff)
downloadgitlab-ce-bf0179b7f170d06d88a8bbe1fbf37e4c8abe6aad.tar.gz
Set RBAC support behind a feature flag.
This is the same as with adding an existing cluster
Diffstat (limited to 'spec')
-rw-r--r--spec/services/clusters/gcp/finalize_creation_service_spec.rb27
1 files changed, 26 insertions, 1 deletions
diff --git a/spec/services/clusters/gcp/finalize_creation_service_spec.rb b/spec/services/clusters/gcp/finalize_creation_service_spec.rb
index aec865872a0..9283df0b492 100644
--- a/spec/services/clusters/gcp/finalize_creation_service_spec.rb
+++ b/spec/services/clusters/gcp/finalize_creation_service_spec.rb
@@ -59,6 +59,8 @@ describe Clusters::Gcp::FinalizeCreationService do
metadata_name: 'gitlab-token-Y1a',
token: Base64.encode64(token)
} )
+
+ stub_feature_flags(rbac_clusters: false)
end
it_behaves_like 'success'
@@ -74,9 +76,32 @@ describe Clusters::Gcp::FinalizeCreationService do
expect(platform.ca_cert).to eq(Base64.decode64(load_sample_cert))
expect(platform.username).to eq(username)
expect(platform.password).to eq(password)
- expect(platform.authorization_type).to eq('rbac')
+ expect(platform.authorization_type).to eq('abac')
expect(platform.token).to eq(token)
end
+
+ context 'rbac_clusters feature enabled' do
+ before do
+ stub_feature_flags(rbac_clusters: true)
+ end
+
+ it_behaves_like 'success'
+
+ it 'has corresponded data' do
+ described_class.new.execute(provider)
+ cluster.reload
+ provider.reload
+ platform.reload
+
+ expect(provider.endpoint).to eq(endpoint)
+ expect(platform.api_url).to eq(api_url)
+ expect(platform.ca_cert).to eq(Base64.decode64(load_sample_cert))
+ expect(platform.username).to eq(username)
+ expect(platform.password).to eq(password)
+ expect(platform.authorization_type).to eq('rbac')
+ expect(platform.token).to eq(token)
+ end
+ end
end
context 'when default-token is not found' do