Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-09-07 06:07:47 +0300
committerThong Kuah <tkuah@gitlab.com>2018-09-14 07:26:51 +0300
commitc9af170d9aeeb39dbb41a99c00402beb384da0e9 (patch)
tree53544844fd8ac75f0fc2f2d44595b01089fad874 /spec/support/services
parent2e47e1f80e000fb717f89effef983bf22c9e2f4d (diff)
Create a GKE cluster with legacy_abac disabled when the `:rbac_clusters` feature flag is enabled
Explicitly persist the legacy_abac value of the cluster_provider_gcp so that we can disable abac if the `:rbac_clusters` feature flag is enabled
Diffstat (limited to 'spec/support/services')
-rw-r--r--spec/support/services/clusters/create_service_shared.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/support/services/clusters/create_service_shared.rb b/spec/support/services/clusters/create_service_shared.rb
index 43a2fd05498..b45ad3f6b8c 100644
--- a/spec/support/services/clusters/create_service_shared.rb
+++ b/spec/support/services/clusters/create_service_shared.rb
@@ -29,9 +29,12 @@ shared_context 'invalid cluster create params' do
end
shared_examples 'create cluster service success' do
- it 'creates a cluster object and performs a worker' do
+ before do
+ stub_feature_flags(rbac_clusters: false)
expect(ClusterProvisionWorker).to receive(:perform_async)
+ end
+ it 'creates a cluster object and performs a worker' do
expect { subject }
.to change { Clusters::Cluster.count }.by(1)
.and change { Clusters::Providers::Gcp.count }.by(1)
@@ -44,8 +47,19 @@ shared_examples 'create cluster service success' do
expect(subject.provider.num_nodes).to eq(1)
expect(subject.provider.machine_type).to eq('machine_type-a')
expect(subject.provider.access_token).to eq(access_token)
+ expect(subject.provider).to be_legacy_abac
expect(subject.platform).to be_nil
end
+
+ context 'rbac_clusters feature is enabled' do
+ before do
+ stub_feature_flags(rbac_clusters: true)
+ end
+
+ it 'has legacy_abac false' do
+ expect(subject.provider).not_to be_legacy_abac
+ end
+ end
end
shared_examples 'create cluster service error' do