Skip to content

Commit 6e11713

Browse files
authored
Apply Search overrides in e2e operator config map (#295)
# Summary This makes sure that e2e tests respect the `MDB_SEARCH_COMMUNITY_*` variable overrides in a context. ## Proof of Work [Passing e2e tests](https://spruce.mongodb.com/version/68872f20797f2500073406ff/tasks?page=0&sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&variant=%5Ee2e_mdb_community%24). ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [ ] Have you checked whether your jira ticket required DOCSP changes? - [ ] Have you checked for release_note changes?
1 parent 22d83f8 commit 6e11713

File tree

6 files changed

+13
-22
lines changed

6 files changed

+13
-22
lines changed

api/v1/search/mongodbsearch_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
const (
1919
MongotDefaultPort = 27027
2020
MongotDefaultMetricsPort = 9946
21-
MongotDefautHealthCheckPort = 8080
21+
MongotDefautHealthCheckPort = 8080
2222
MongotDefaultSyncSourceUsername = "mongot-user"
2323
)
2424

controllers/operator/mongodbsearch_controller_test.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func newMongoDBCommunity(name, namespace string) *mdbcv1.MongoDBCommunity {
3737
Spec: mdbcv1.MongoDBCommunitySpec{
3838
Type: mdbcv1.ReplicaSet,
3939
Members: 1,
40-
Version: "8.0",
40+
Version: "8.0.10",
4141
},
4242
}
4343
}
@@ -109,15 +109,15 @@ func buildExpectedMongotConfig(search *searchv1.MongoDBSearch, mdbc *mdbcv1.Mong
109109
Mode: "keyfile",
110110
KeyFile: "/tmp/keyfile",
111111
},
112-
TLS: mongot.ConfigTLS{Mode: "disabled"},
112+
TLS: mongot.ConfigTLS{Mode: mongot.ConfigTLSModeDisabled},
113113
},
114114
},
115115
Metrics: mongot.ConfigMetrics{
116116
Enabled: true,
117-
Address: fmt.Sprintf("localhost:%d", searchv1.MongotDefaultMetricsPort),
117+
Address: fmt.Sprintf("0.0.0.0:%d", search.GetMongotMetricsPort()),
118118
},
119119
HealthCheck: mongot.ConfigHealthCheck{
120-
Address: "0.0.0.0:8080",
120+
Address: fmt.Sprintf("0.0.0.0:%d", search.GetMongotHealthCheckPort()),
121121
},
122122
Logging: mongot.ConfigLogging{
123123
Verbosity: "TRACE",
@@ -220,16 +220,6 @@ func TestMongoDBSearchReconcile_InvalidVersion(t *testing.T) {
220220
checkSearchReconcileFailed(ctx, t, reconciler, c, search, "MongoDB version")
221221
}
222222

223-
func TestMongoDBSearchReconcile_TLSNotSupported(t *testing.T) {
224-
ctx := context.Background()
225-
search := newMongoDBSearch("search", mock.TestNamespace, "mdb")
226-
mdbc := newMongoDBCommunity("mdb", mock.TestNamespace)
227-
mdbc.Spec.Security.TLS.Enabled = true
228-
reconciler, c := newSearchReconciler(mdbc, search)
229-
230-
checkSearchReconcileFailed(ctx, t, reconciler, c, search, "TLS-enabled")
231-
}
232-
233223
func TestMongoDBSearchReconcile_MultipleSearchResources(t *testing.T) {
234224
ctx := context.Background()
235225
search1 := newMongoDBSearch("search1", mock.TestNamespace, "mdb")

controllers/search_controller/mongodbsearch_reconcile_helper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,10 @@ func createMongotConfig(search *searchv1.MongoDBSearch, db SearchSourceDBResourc
363363
}
364364
config.Metrics = mongot.ConfigMetrics{
365365
Enabled: true,
366-
Address: fmt.Sprintf("localhost:%d", search.GetMongotMetricsPort()),
366+
Address: fmt.Sprintf("0.0.0.0:%d", search.GetMongotMetricsPort()),
367367
}
368368
config.HealthCheck = mongot.ConfigHealthCheck{
369-
Address: fmt.Sprintf("localhost:%d", search.GetMongotHealthCheckPort()),
369+
Address: fmt.Sprintf("0.0.0.0:%d", search.GetMongotHealthCheckPort()),
370370
}
371371
config.Logging = mongot.ConfigLogging{
372372
Verbosity: "TRACE",

controllers/search_controller/mongodbsearch_reconcile_helper_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ func TestMongoDBSearchReconcileHelper_ValidateSearchSource(t *testing.T) {
3434
Version: "4.4.0",
3535
},
3636
},
37-
expectedError: "MongoDB version must be 8.0 or higher",
37+
expectedError: "MongoDB version must be 8.0.10 or higher",
3838
},
3939
{
4040
name: "Valid version",
4141
mdbc: mdbcv1.MongoDBCommunity{
4242
ObjectMeta: mdbcMeta,
4343
Spec: mdbcv1.MongoDBCommunitySpec{
44-
Version: "8.0",
44+
Version: "8.0.10",
4545
},
4646
},
4747
},
@@ -50,15 +50,14 @@ func TestMongoDBSearchReconcileHelper_ValidateSearchSource(t *testing.T) {
5050
mdbc: mdbcv1.MongoDBCommunity{
5151
ObjectMeta: mdbcMeta,
5252
Spec: mdbcv1.MongoDBCommunitySpec{
53-
Version: "8.0",
53+
Version: "8.0.10",
5454
Security: mdbcv1.Security{
5555
TLS: mdbcv1.TLS{
5656
Enabled: true,
5757
},
5858
},
5959
},
6060
},
61-
expectedError: "MongoDBSearch does not support TLS-enabled sources",
6261
},
6362
}
6463

docker/mongodb-kubernetes-tests/tests/opsmanager/withMonitoredAppDB/om_appdb_scale_up_down.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pytest import fixture
99
from tests.conftest import is_multi_cluster
1010

11-
1211
# Important - you need to ensure that OM and Appdb images are build and pushed into your current docker registry before
1312
# running tests locally - use "make om-image" and "make appdb" to do this
1413

scripts/funcs/operator_deployment

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ get_operator_helm_values() {
3434
"operator.telemetry.send.enabled=${MDB_OPERATOR_TELEMETRY_SEND_ENABLED:-false}"
3535
# lets collect and save in the configmap as frequently as we can
3636
"operator.telemetry.collection.frequency=${MDB_OPERATOR_TELEMETRY_COLLECTION_FREQUENCY:-1m}"
37+
"search.community.version=${MDB_SEARCH_COMMUNITY_VERSION}"
38+
"search.community.name=${MDB_SEARCH_COMMUNITY_NAME}"
39+
"search.community.repo=${MDB_SEARCH_COMMUNITY_REPO_URL}"
3740
)
3841

3942
if [[ "${MDB_OPERATOR_TELEMETRY_INSTALL_CLUSTER_ROLE_INSTALLATION:-}" != "" ]]; then

0 commit comments

Comments
 (0)