Skip to content

Commit b0b7b48

Browse files
leo-rifabritsius
andauthored
CLOUDP-103755-M0-test (#418)
* CLOUDP-103755: add e2e tests for m0 * Fix the status label for X.509 Co-authored-by: fabritsius <[email protected]>
1 parent c2e311a commit b0b7b48

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

pkg/controller/atlasproject/x509_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (r *AtlasProjectReconciler) ensureX509(ctx *workflow.Context, projectID str
5555
}
5656
}
5757

58-
if !authModes.CheckAuthMode(authmode.X509) {
58+
if !authModes.CheckAuthMode(authmode.X509) && specCert != "" {
5959
log.Debugw("Adding new AuthMode to the status", "mode", authmode.X509)
6060
authModes.AddAuthMode(authmode.X509)
6161
}

scripts/create_kind_cluster.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ nodes:
9898
hostPort: 30015
9999
listenAddress: "0.0.0.0"
100100
protocol: TCP
101+
- containerPort: 30016
102+
hostPort: 30016
103+
listenAddress: "0.0.0.0"
104+
protocol: TCP
105+
- containerPort: 30017
106+
hostPort: 30017
107+
listenAddress: "0.0.0.0"
108+
protocol: TCP
101109
EOF
102110

103111
# connect the registry to the cluster network

test/e2e/config/kind.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,11 @@ nodes:
6969
hostPort: 30015
7070
listenAddress: "0.0.0.0"
7171
protocol: TCP
72+
- containerPort: 30016
73+
hostPort: 30016
74+
listenAddress: "0.0.0.0"
75+
protocol: TCP
76+
- containerPort: 30017
77+
hostPort: 30017
78+
listenAddress: "0.0.0.0"
79+
protocol: TCP

test/e2e/configuration_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,40 @@ var _ = Describe("Configuration namespaced. Deploy cluster", Label("cluster-ns")
180180
},
181181
),
182182
),
183+
Entry("Free - Users can use M0, default key",
184+
model.NewTestDataProvider(
185+
"operator-ns-free",
186+
model.NewEmptyAtlasKeyType().UseDefaulFullAccess(),
187+
[]string{"data/atlascluster_basic_free.yaml"},
188+
[]string{""},
189+
[]model.DBUser{
190+
*model.NewDBUser("user").
191+
WithSecretRef("dbuser-secret").
192+
AddBuildInAdminRole(),
193+
},
194+
30016,
195+
[]func(*model.TestDataProvider){
196+
actions.DeleteFirstUser,
197+
},
198+
),
199+
),
200+
Entry("Free - Users can use M0, global",
201+
model.NewTestDataProvider(
202+
"operator-ns-free",
203+
model.NewEmptyAtlasKeyType().UseDefaulFullAccess().CreateAsGlobalLevelKey(),
204+
[]string{"data/atlascluster_basic_free.yaml"},
205+
[]string{""},
206+
[]model.DBUser{
207+
*model.NewDBUser("user").
208+
WithSecretRef("dbuser-secret").
209+
AddBuildInAdminRole(),
210+
},
211+
30017,
212+
[]func(*model.TestDataProvider){
213+
actions.DeleteFirstUser,
214+
},
215+
),
216+
),
183217
)
184218
})
185219

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: atlas.mongodb.com/v1
2+
kind: AtlasCluster
3+
metadata:
4+
name: atlascluster-basic-free
5+
spec:
6+
projectRef:
7+
name: my-project
8+
clusterSpec:
9+
name: cluster-basic
10+
providerSettings:
11+
instanceSizeName: M0
12+
providerName: TENANT
13+
regionName: US_EAST_1
14+
backingProviderName: AWS

0 commit comments

Comments
 (0)