Skip to content

Commit 0c6bee0

Browse files
authored
revert temporary changes (TENANT) (#291)
1 parent 4bc10bb commit 0c6bee0

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

test/e2e/data/atlascluster_basic.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ spec:
77
projectRef:
88
name: my-project
99
providerSettings:
10-
instanceSizeName: M10
11-
providerName: AWS
10+
instanceSizeName: M2
11+
providerName: TENANT
1212
regionName: US_EAST_1
13+
backingProviderName: AWS

test/e2e/data/atlascluster_basic_update.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ spec:
77
projectRef:
88
name: my-project
99
providerSettings:
10-
instanceSizeName: M20
11-
providerName: AWS
10+
instanceSizeName: M5
11+
providerName: TENANT
1212
regionName: US_EAST_1
13+
backingProviderName: AWS

test/int/cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ var _ = Describe("AtlasCluster", func() {
596596
Describe("Deleting the cluster (not cleaning Atlas)", func() {
597597
It("Should Succeed", func() {
598598
By(`Creating the cluster with retention policy "keep" first`, func() {
599-
createdCluster = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
599+
createdCluster = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
600600
createdCluster.ObjectMeta.Annotations = map[string]string{customresource.ResourcePolicyAnnotation: customresource.ResourcePolicyKeep}
601601
Expect(k8sClient.Create(context.Background(), createdCluster)).ToNot(HaveOccurred())
602602

test/int/clusterwide/dbuser_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ var _ = Describe("ClusterWide", func() {
105105
passwordSecret := buildPasswordSecret(userNS.Name, UserPasswordSecret, DBUserPassword)
106106
Expect(k8sClient.Create(context.Background(), &passwordSecret)).To(Succeed())
107107

108-
createdClusterAWS = mdbv1.DefaultAWSCluster(clusterNS.Name, createdProject.Name)
108+
createdClusterAWS = mdbv1.DefaultAWSCluster(clusterNS.Name, createdProject.Name).Lightweight()
109109
// The project namespace is different from the cluster one - need to specify explicitly
110110
createdClusterAWS.Spec.Project.Namespace = namespace.Name
111111

test/int/dbuser_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ var _ = Describe("AtlasDatabaseUser", func() {
151151
Describe("Create/Update two users, two clusters", func() {
152152
It("They should be created successfully", func() {
153153
By("Creating clusters", func() {
154-
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
154+
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
155155
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).ToNot(HaveOccurred())
156156

157-
createdClusterAzure = mdbv1.DefaultAzureCluster(namespace.Name, createdProject.Name)
157+
createdClusterAzure = mdbv1.DefaultAzureCluster(namespace.Name, createdProject.Name).Lightweight()
158158
Expect(k8sClient.Create(context.Background(), createdClusterAzure)).ToNot(HaveOccurred())
159159

160160
Eventually(testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
@@ -184,11 +184,11 @@ var _ = Describe("AtlasDatabaseUser", func() {
184184
// The user created lacks read/write roles
185185
err := tryWrite(createdProject.ID(), *createdClusterAzure, *createdDBUser, "test", "operatortest")
186186
Expect(err).To(HaveOccurred())
187-
Expect(err.Error()).To(MatchRegexp("not authorized on test to execute command")) // TODO check this is the same "user is not allowed"
187+
Expect(err.Error()).To(MatchRegexp("user is not allowed"))
188188

189189
err = tryWrite(createdProject.ID(), *createdClusterAWS, *createdDBUser, "test", "operatortest")
190190
Expect(err).To(HaveOccurred())
191-
Expect(err.Error()).To(MatchRegexp("not authorized on test to execute command")) // TODO check this is the same "user is not allowed"
191+
Expect(err.Error()).To(MatchRegexp("user is not allowed"))
192192
})
193193
})
194194
By("Update database user - give readWrite permissions", func() {
@@ -267,7 +267,7 @@ var _ = Describe("AtlasDatabaseUser", func() {
267267

268268
err := tryWrite(createdProject.ID(), *createdClusterAzure, *secondDBUser, "test", "someNotAllowedCollection")
269269
Expect(err).To(HaveOccurred())
270-
Expect(err.Error()).To(MatchRegexp("not authorized on test to execute command")) // TODO check this is the same "user is not allowed"
270+
Expect(err.Error()).To(MatchRegexp("user is not allowed"))
271271
})
272272
By("Removing Second user", func() {
273273
Expect(k8sClient.Delete(context.Background(), secondDBUser)).To(Succeed())
@@ -305,7 +305,7 @@ var _ = Describe("AtlasDatabaseUser", func() {
305305
checkNumberOfConnectionSecrets(k8sClient, *createdProject, 0)
306306
})
307307
By("Creating cluster", func() {
308-
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
308+
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
309309
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).ToNot(HaveOccurred())
310310

311311
// We don't wait for the full cluster creation - only when it has started the process
@@ -338,7 +338,7 @@ var _ = Describe("AtlasDatabaseUser", func() {
338338
Describe("Check the password Secret is watched", func() {
339339
It("Should succeed", func() {
340340
By("Creating clusters", func() {
341-
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
341+
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
342342
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).ToNot(HaveOccurred())
343343

344344
Eventually(testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
@@ -394,10 +394,10 @@ var _ = Describe("AtlasDatabaseUser", func() {
394394
Describe("Change database users (make sure all stale secrets are removed)", func() {
395395
It("Should succeed", func() {
396396
By("Creating AWS and Azure clusters", func() {
397-
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
397+
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
398398
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).ToNot(HaveOccurred())
399399

400-
createdClusterAzure = mdbv1.DefaultAzureCluster(namespace.Name, createdProject.Name)
400+
createdClusterAzure = mdbv1.DefaultAzureCluster(namespace.Name, createdProject.Name).Lightweight()
401401
Expect(k8sClient.Create(context.Background(), createdClusterAzure)).ToNot(HaveOccurred())
402402

403403
Eventually(testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
@@ -463,7 +463,7 @@ var _ = Describe("AtlasDatabaseUser", func() {
463463
Describe("Check the user expiration", func() {
464464
It("Should succeed", func() {
465465
By("Creating a AWS cluster", func() {
466-
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
466+
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
467467
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).To(Succeed())
468468

469469
Eventually(testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
@@ -529,7 +529,7 @@ var _ = Describe("AtlasDatabaseUser", func() {
529529
Describe("Deleting the db user (not cleaning Atlas)", func() {
530530
It("Should Succeed", func() {
531531
By(`Creating the db user with retention policy "keep" first`, func() {
532-
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name)
532+
createdClusterAWS = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
533533
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).ToNot(HaveOccurred())
534534

535535
Eventually(testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),

0 commit comments

Comments
 (0)