Skip to content

Commit 8edd129

Browse files
lsierantJulien-Benviveksinghggitsanandsyncsclaude
authored
CLOUDP-392735: Search: support multiple mongots and envoy load balancer (#817)
<!-- start git-machete generated --> # Based on PR #806 ## Chain of upstream PRs as of 2026-03-23 * PR #806: `master` <- `search/base` * **PR #817 (THIS ONE)**: `search/base` <- `search/multiple-mongot` <!-- end git-machete generated --> # Summary This PR adds support for **multiple mongot instances** per MongoDB source, with L7 load balancing and sharded cluster integration. It builds on `search/base` (#806) and introduces three major capabilities: 1. **Multiple mongot replicas** with managed (Envoy) or unmanaged (BYO) load balancing 2. **Sharded cluster support** for both operator-managed and external MongoDB 3. **X509 client certificate authentication** for mongot-to-MongoDB sync source connections 4. **JVM flags** for mongot process configuration --- ## API/CRD Changes The `MongoDBSearch` CRD gains the following new fields: ```yaml spec: # New: Load balancer configuration (exactly one of managed/unmanaged must be set) loadBalancer: # was: spec.lb with mode enum managed: # operator-deployed Envoy proxy externalHostname: "..." # SNI hostname, supports {shardName} placeholder resourceRequirements: { ... } # Envoy container resources (default: 100m/128Mi req, 500m/512Mi lim) deployment: { ... } # Envoy Deployment overrides (same convention as spec.statefulSet) unmanaged: # BYO L7 load balancer endpoint: "lb.example.com:27029" # supports {shardName} placeholder for sharded # New: X509 client certificate auth for sync source (mutually exclusive with username/password) source: x509: clientCertificateSecretRef: name: "mongot-x509-cert" # Secret with tls.crt, tls.key (required), tls.keyFilePassword (optional) # New: JVM flags for mongot jvmFlags: ["-Xms2g", "-Xmx2g"] # New: External sharded cluster source source: external: shardedCluster: router: hosts: ["mongos-0.example.com:27017"] shards: - shardName: "shard-0" hosts: ["shard0-rs0.example.com:27017"] - shardName: "shard-1" hosts: ["shard1-rs0.example.com:27017"] ``` Key structural change: `spec.lb.mode` (Managed/Unmanaged enum) was replaced with `spec.loadBalancer.managed` / `spec.loadBalancer.unmanaged` (mutually exclusive sub-objects, enforced via CEL validation). --- ## Resource Naming Conventions All search resource names include a hardcoded `-0-` cluster index to reserve the naming scheme for future multi-cluster support. ### ReplicaSet (Non-Sharded) Resources | Resource | Name Pattern | |----------|-------------| | StatefulSet | `{name}-search` | | Headless Service | `{name}-search-svc` | | ConfigMap | `{name}-search-config` | | TLS Secret | `[{prefix}-]{name}-search-0-cert` | | TLS Client Secret | `[{prefix}-]{name}-search-0-client-cert` | | X509 Client Cert Secret | `{name}-x509-client-cert` | | Proxy Service (Envoy) | `{name}-search-0-proxy-svc` | | LB Deployment | `{name}-search-lb-0` | | LB ConfigMap | `{name}-search-lb-0-config` | | LB Server Cert | `[{prefix}-]{name}-search-lb-0-cert` | | LB Client Cert | `[{prefix}-]{name}-search-lb-0-client-cert` | ### Sharded Resources (Per-Shard) | Resource | Name Pattern | |----------|-------------| | StatefulSet | `{name}-search-0-{shard}` | | Headless Service | `{name}-search-0-{shard}-svc` | | ConfigMap | `{name}-search-0-{shard}-config` | | TLS Secret | `[{prefix}-]{name}-search-0-{shard}-cert` | | Proxy Service (Envoy) | `{name}-search-0-{shard}-proxy-svc` | | LB Server Cert (per-shard) | `[{prefix}-]{name}-search-lb-0-{shard}-cert` | --- ## Architecture ### Reconciliation Paths The `MongoDBSearchReconcileHelper` dispatches to: - **`reconcileNonSharded`**: Creates a single set of resources (1 StatefulSet, 1 Service, 1 ConfigMap). All mongot pods connect to the same RS host seeds. - **`reconcileSharded`**: Creates per-shard resources -- one StatefulSet, Service, ConfigMap, and TLS secret per shard. Each shard's mongot connects to that shard's mongod hosts. A `Router` section in the mongot config points to mongos for query routing. ### MongoDBSearchEnvoyReconciler (New Controller) A dedicated controller that manages the Envoy proxy infrastructure when `spec.loadBalancer.managed` is set: - **ReplicaSet**: 1 Envoy Deployment + 1 ConfigMap + 1 ClusterIP proxy Service - **Sharded**: 1 Envoy Deployment + 1 ConfigMap + N ClusterIP proxy Services (one per shard) For sharded clusters, all shard routes are multiplexed through a **single Envoy deployment** using SNI-based routing. Each shard gets a dedicated proxy Service that resolves to the same Envoy pods. Envoy reads the SNI hostname from the TLS ClientHello to route traffic to the correct shard's mongot backend. The controller: - Watches `MongoDBSearch`, `MongoDB`, and `MongoDBCommunity` resources - Owns Deployment and ConfigMap resources - Returns early with `Pending` status if no routes can be configured - Updates LB sub-status on the MongoDBSearch CR at every return path - Uses TLS 1.3 exclusively for Envoy-to-mongot connections ### X509 Client Certificate Authentication When `spec.source.x509` is configured, mongot authenticates to the MongoDB sync source using x509 client certificates instead of username/password: - **Mutually exclusive** with `spec.source.passwordSecretRef` and `spec.source.username` (enforced by validation) - **Requires TLS** to be enabled on the sync source - The operator reads the user-provided Secret (containing `tls.crt`, `tls.key`, and optionally `tls.keyFilePassword`), combines them into an operator-managed Secret (`{name}-x509-client-cert`), and mounts it into the mongot container - Mongot config is modified to clear username/password fields and set `authSource: $external` with `x509.tlsCertificateKeyFile` pointing to the mounted cert - For sharded clusters, x509 config is applied to both the ReplicaSet sync source and the Router section - Optional key password support: if `tls.keyFilePassword` is present in the Secret, it is mounted separately and referenced via `tlsCertificateKeyFilePasswordFile` The `x509AuthResource` adapter implements the `TLSConfigurableResource` interface, allowing reuse of the existing `tls.EnsureTLSSecret` infrastructure. ### Endpoint Resolution How `mongod.setParameter.mongotHost` resolves for each topology + LB mode: | Topology | LB Mode | mongotHost | |----------|---------|------------| | RS | None (single replica) | `{name}-search-svc.{ns}.svc.{domain}:27028` | | RS | Unmanaged | User-provided `spec.loadBalancer.unmanaged.endpoint` | | RS | Managed | `{name}-search-0-proxy-svc.{ns}.svc.{domain}:27029` | | Sharded | None | `{name}-search-0-{shard}-svc.{ns}.svc.{domain}:27028` (per shard) | | Sharded | Unmanaged | Endpoint template with `{shardName}` substituted per shard | | Sharded | Managed | `{name}-search-0-{shard}-proxy-svc.{ns}.svc.{domain}:27029` (per shard) | ### Sharded Controller Integration The `mongodbshardedcluster_controller` is extended to watch MongoDBSearch resources via `lookupCorrespondingSearchResource()`. It applies search config to each shard via `applySearchParametersForShards()`: - Per-shard mongod config points to each shard's own mongot endpoint - Mongos config gets `mongotHost` pointing to the first shard's endpoint --- ## Test Coverage ### E2E Tests (Python) | # | Topology | Source | Mongot Count | LB Mode | Test File | |---|----------|--------|-------------|---------|-----------| | 1 | RS | External | Single | None | `search_replicaset_external_mongodb_single_mongot.py` | | 2 | RS | External | Multi | Unmanaged | `search_replicaset_external_mongodb_multi_mongot_unmanaged_lb.py` | | 3 | RS | Internal | Multi | Unmanaged | `search_replicaset_internal_mongodb_multi_mongot_unmanaged_lb.py` | | 4 | RS | External | Multi | Managed | `search_replicaset_external_mongodb_multi_mongot_managed_lb.py` | | 5 | RS | Internal | Multi | Managed | `search_replicaset_internal_mongodb_multi_mongot_managed_lb.py` | | 6 | RS | External | - | Proxy Svc | `search_replicaset_external_mongodb_proxy_service.py` | | 7 | RS | - | - | X509 | `search_mongot_replicaset_x509_auth.py` | | 8 | RS | Community | Multi | Managed | `search_community_auto_embedding_multi_mongot.py` | | 9 | Sharded | Internal | Single | None | `search_sharded_internal_mongodb_single_mongot.py` | | 10 | Sharded | External | Single | None | `search_sharded_external_mongodb_single_mongot.py` | | 11 | Sharded | Internal | Multi | Unmanaged | `search_sharded_internal_mongodb_multi_mongot_unmanaged_lb.py` | | 12 | Sharded | External | Multi | Unmanaged | `search_sharded_external_mongodb_multi_mongot_unmanaged_lb.py` | | 13 | Sharded | Internal | Multi | Managed | `search_sharded_internal_mongodb_multi_mongot_managed_lb.py` | | 14 | Sharded | External (Ent) | Multi | Managed | `search_sharded_enterprise_external_mongod_managed_lb.py` | ### Unit Tests (Go) | File | Lines | Coverage | |------|-------|----------| | `mongodbsearch_reconcile_helper_test.go` | 2,313 | Per-shard mongod/mongos config, LB endpoint resolution, validation | | `sharded_external_search_source_test.go` | 452 | External sharded source, shard name validation, host lists | | `enterprise_search_source_test.go` | 373 | Enterprise RS source, error returns (no panic) | | `envoy_config_builder_test.go` | 318 | Envoy JSON generation, TLS/non-TLS, single/multi route | | `mongodbsearch_validation_test.go` | 300 | Shard names, X509 auth config | | `mongodbsearchenvoy_controller_test.go` | 255 | Route building, pod spec, deployment overrides | | `mongodbsearch_validation_test.go` (api/) | 212 | JVM flags, LB config, endpoint template | | `search_construction_test.go` | 209 | StatefulSet construction, JVM flags generation | | `mongodbsearch_types_test.go` | 132 | Resource name generation | --- ## Other Changes - **Error handling**: `panic()` calls in `HostSeeds()` implementations replaced with `fmt.Errorf` returns across `enterprise_search_source.go`, `external_search_source.go`, `community_search_source.go` - **Keyfile handling**: Extracted `ensureKeyfileModification()` helper to deduplicate keyfile blocks between `reconcileNonSharded` and `reconcileSharded` - **Endpoint resolution**: Extracted `mongotEndpointForShard()` helper for consistent endpoint resolution across managed/unmanaged/direct modes - **File renames**: `sharded_enterprise_search_source.go` renamed to `sharded_internal_search_source.go` (struct `ShardedInternalSearchSource`) - **Changelog**: Consolidated all search changes into a single entry (`20260318_feature_mongodbsearch_improvements.md`) - **RBAC**: Added `deployments` permission to `apps` API group for Envoy Deployment management - **Helm chart**: New `MDB_ENVOY_IMAGE` env var for configuring the Envoy container image - **Readiness probe** for mongot containers - **Auto-heap sizing**: JVM `-Xms`/`-Xmx` set to 50% of memory request when not explicitly provided - **Duplicate function consolidation**: `verify_rs_mongod_parameters` consolidated into `replicaset_search_helper.py` - **IsShardedEndpoint()**: Extracted helper method for checking sharded endpoint configuration - **Status updates**: `updateLBStatus()` patches LB sub-status on MongoDBSearch CR at every reconcile return path - **Test infrastructure**: `SearchDeploymentHelper`, `SearchTester` factories, `search_resource_names` utilities, `ToolsPod` for in-cluster mongorestore --- ## Known Limitations / Follow-ups - **Envoy log level**: Currently hardcoded to `"info"` -- needs a configurable field in `ManagedLBConfig` - **`rs_search_helper.py`**: Should be consolidated into `replicaset_search_helper.py` and removed - **Reconcile loop tests**: `mongodbsearchenvoy_controller_test.go` covers route building and pod spec but lacks full reconcile loop integration tests - **Test file naming**: Some test files don't follow a consistent naming convention from the test matrix ## 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 added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in [CONTRIBUTING.md](http://CONTRIBUTING.md) for more details --------- Co-authored-by: Julien Benhaim <julien.benhaim@mongodb.com> Co-authored-by: Vivek Singh <vsingh.ggits.2010@gmail.com> Co-authored-by: Julien-Ben <33035980+Julien-Ben@users.noreply.github.com> Co-authored-by: Anand <13899132+anandsyncs@users.noreply.github.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Vivek Singh <vivek.s@mongodb.com>
1 parent c23b484 commit 8edd129

File tree

116 files changed

+12257
-1213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+12257
-1213
lines changed

.evergreen-tasks.yml

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,17 +1325,22 @@ tasks:
13251325
commands:
13261326
- func: "e2e_test"
13271327

1328+
- name: e2e_search_community_auto_embedding_multi_mongot
1329+
tags: ["patch-run"]
1330+
commands:
1331+
- func: "e2e_test"
1332+
13281333
- name: e2e_search_community_tls
13291334
tags: ["patch-run"]
13301335
commands:
13311336
- func: "e2e_test"
13321337

1333-
- name: e2e_search_external_basic
1338+
- name: e2e_search_community_external_mongod_basic
13341339
tags: [ "patch-run" ]
13351340
commands:
13361341
- func: "e2e_test"
13371342

1338-
- name: e2e_search_external_tls
1343+
- name: e2e_search_community_external_mongod_tls
13391344
tags: [ "patch-run" ]
13401345
commands:
13411346
- func: "e2e_test"
@@ -1355,7 +1360,66 @@ tasks:
13551360
commands:
13561361
- func: "e2e_test"
13571362

1358-
- name: e2e_search_sharded_external_mongod_single_mongot
1363+
- name: e2e_search_sharded_internal_mongodb_multi_mongot_unmanaged_lb
1364+
tags: [ "patch-run" ]
1365+
commands:
1366+
- func: "e2e_test"
1367+
1368+
- name: e2e_search_sharded_internal_mongodb_multi_mongot_managed_lb
1369+
tags: [ "patch-run" ]
1370+
commands:
1371+
- func: "e2e_test"
1372+
1373+
- name: e2e_search_replicaset_internal_mongodb_multi_mongot_managed_lb
1374+
tags: [ "patch-run" ]
1375+
commands:
1376+
- func: "e2e_test"
1377+
1378+
- name: e2e_search_replicaset_external_mongodb_multi_mongot_managed_lb
1379+
tags: [ "patch-run" ]
1380+
commands:
1381+
- func: "e2e_test"
1382+
1383+
- name: e2e_search_replicaset_external_mongodb_proxy_service
1384+
tags: [ "patch-run" ]
1385+
commands:
1386+
- func: "e2e_test"
1387+
1388+
- name: e2e_search_sharded_external_mongodb_multi_mongot_unmanaged_lb
1389+
tags: [ "patch-run" ]
1390+
commands:
1391+
- func: "e2e_test"
1392+
1393+
- name: e2e_search_sharded_enterprise_external_mongod_managed_lb
1394+
tags: [ "patch-run" ]
1395+
commands:
1396+
- func: "e2e_test"
1397+
1398+
- name: e2e_search_sharded_external_mongodb_single_mongot
1399+
tags: [ "patch-run" ]
1400+
commands:
1401+
- func: "e2e_test"
1402+
- name: e2e_search_replicaset_external_mongodb_single_mongot
1403+
tags: [ "patch-run" ]
1404+
commands:
1405+
- func: "e2e_test"
1406+
1407+
- name: e2e_search_replicaset_external_mongodb_multi_mongot_unmanaged_lb
1408+
tags: [ "patch-run" ]
1409+
commands:
1410+
- func: "e2e_test"
1411+
1412+
- name: e2e_search_replicaset_internal_mongodb_multi_mongot_unmanaged_lb
1413+
tags: [ "patch-run" ]
1414+
commands:
1415+
- func: "e2e_test"
1416+
1417+
- name: e2e_search_sharded_internal_mongodb_single_mongot
1418+
tags: [ "patch-run" ]
1419+
commands:
1420+
- func: "e2e_test"
1421+
1422+
- name: e2e_search_mongot_replicaset_x509_auth
13591423
tags: [ "patch-run" ]
13601424
commands:
13611425
- func: "e2e_test"

.evergreen.yml

Lines changed: 116 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,6 @@ task_groups:
669669
<<: *setup_and_teardown_task
670670
tasks:
671671
- e2e_community_replicaset_scale
672-
- e2e_search_community_basic
673-
- e2e_search_community_auto_embedding
674-
- e2e_search_community_tls
675-
- e2e_search_external_basic
676-
- e2e_search_external_tls
677672

678673
# This is the task group that contains all the tests run in the e2e_mdb_kind_ubi_cloudqa build variant
679674
- name: e2e_mdb_kind_cloudqa_task_group
@@ -806,11 +801,85 @@ task_groups:
806801
- e2e_replica_set_oidc_workforce
807802
- e2e_sharded_cluster_oidc_m2m_group
808803
- e2e_sharded_cluster_oidc_m2m_user
809-
# MongoDBSearch test group
804+
<<: *teardown_group
805+
806+
# All MongoDBSearch tests that fit on large instances (mongot requires 2 CPU).
807+
# Added to cloudqa-large variants.
808+
- name: e2e_mdb_kind_search_task_group
809+
max_hosts: -1
810+
<<: *setup_group
811+
<<: *setup_and_teardown_task_cloudqa
812+
tasks:
813+
- e2e_search_community_basic
814+
- e2e_search_community_auto_embedding
815+
- e2e_search_community_auto_embedding_multi_mongot
816+
- e2e_search_community_tls
817+
- e2e_search_community_external_mongod_basic
818+
- e2e_search_community_external_mongod_tls
810819
- e2e_search_enterprise_basic
820+
- e2e_search_replicaset_external_mongodb_single_mongot
821+
- e2e_search_sharded_internal_mongodb_single_mongot
811822
- e2e_search_enterprise_tls
812823
- e2e_search_enterprise_x509_cluster_auth
813-
- e2e_search_sharded_external_mongod_single_mongot
824+
- e2e_search_sharded_external_mongodb_single_mongot
825+
- e2e_search_sharded_external_mongodb_multi_mongot_unmanaged_lb
826+
- e2e_search_replicaset_external_mongodb_multi_mongot_unmanaged_lb
827+
- e2e_search_replicaset_internal_mongodb_multi_mongot_unmanaged_lb
828+
- e2e_search_mongot_replicaset_x509_auth
829+
<<: *teardown_group
830+
831+
# MongoDBSearch tests that require a large instance (multiple mongots per shard:
832+
# 2 shards x 2 mongots x 2 CPU = 8 CPU). Added to cloudqa-large variants.
833+
- name: e2e_mdb_kind_search_large_task_group
834+
max_hosts: -1
835+
<<: *setup_group
836+
<<: *setup_and_teardown_task_cloudqa
837+
tasks:
838+
- e2e_search_sharded_internal_mongodb_multi_mongot_unmanaged_lb
839+
- e2e_search_sharded_internal_mongodb_multi_mongot_managed_lb
840+
- e2e_search_sharded_enterprise_external_mongod_managed_lb
841+
- e2e_search_replicaset_internal_mongodb_multi_mongot_managed_lb
842+
- e2e_search_replicaset_external_mongodb_multi_mongot_managed_lb
843+
- e2e_search_replicaset_external_mongodb_proxy_service
844+
<<: *teardown_group
845+
846+
# Same as e2e_mdb_kind_search_task_group but for om80 variants.
847+
# Uses setup_and_teardown_task (not cloudqa) since ops_manager_version is not 'cloud_qa'.
848+
- name: e2e_om80_kind_search_task_group
849+
max_hosts: -1
850+
<<: *setup_group
851+
<<: *setup_and_teardown_task
852+
tasks:
853+
- e2e_search_community_basic
854+
- e2e_search_community_auto_embedding
855+
- e2e_search_community_auto_embedding_multi_mongot
856+
- e2e_search_community_tls
857+
- e2e_search_community_external_mongod_basic
858+
- e2e_search_community_external_mongod_tls
859+
- e2e_search_enterprise_basic
860+
- e2e_search_replicaset_external_mongodb_single_mongot
861+
- e2e_search_sharded_internal_mongodb_single_mongot
862+
- e2e_search_enterprise_tls
863+
- e2e_search_enterprise_x509_cluster_auth
864+
- e2e_search_sharded_external_mongodb_single_mongot
865+
- e2e_search_sharded_external_mongodb_multi_mongot_unmanaged_lb
866+
- e2e_search_replicaset_external_mongodb_multi_mongot_unmanaged_lb
867+
- e2e_search_replicaset_internal_mongodb_multi_mongot_unmanaged_lb
868+
- e2e_search_mongot_replicaset_x509_auth
869+
<<: *teardown_group
870+
871+
# Same as e2e_mdb_kind_search_large_task_group but for om80 variants.
872+
# Uses setup_and_teardown_task (not cloudqa) since ops_manager_version is not 'cloud_qa'.
873+
- name: e2e_om80_kind_search_large_task_group
874+
max_hosts: -1
875+
<<: *setup_group
876+
<<: *setup_and_teardown_task
877+
tasks:
878+
- e2e_search_sharded_internal_mongodb_multi_mongot_unmanaged_lb
879+
- e2e_search_sharded_internal_mongodb_multi_mongot_managed_lb
880+
- e2e_search_replicaset_internal_mongodb_multi_mongot_managed_lb
881+
- e2e_search_replicaset_external_mongodb_multi_mongot_managed_lb
882+
- e2e_search_replicaset_external_mongodb_proxy_service
814883
<<: *teardown_group
815884

816885
# this task group contains just a one task, which is smoke testing whether the operator
@@ -1241,8 +1310,6 @@ task_groups:
12411310
<<: *setup_group
12421311
<<: *setup_and_teardown_task
12431312
tasks:
1244-
- e2e_search_enterprise_tls
1245-
- e2e_search_enterprise_x509_cluster_auth
12461313
- e2e_om_ops_manager_backup_object_lock
12471314
<<: *teardown_group
12481315

@@ -1361,6 +1428,26 @@ buildvariants:
13611428
tasks:
13621429
- name: e2e_custom_domain_task_group
13631430

1431+
- name: e2e_mdb_kind_ubi_cloudqa_large
1432+
display_name: e2e_mdb_kind_ubi_cloudqa_large
1433+
tags: [ "pr_patch", "staging", "e2e_test_suite", "cloudqa", "cloudqa_non_static" ]
1434+
run_on:
1435+
- ubuntu2404-large
1436+
<<: *base_no_om_image_dependency
1437+
tasks:
1438+
- name: e2e_mdb_kind_search_task_group
1439+
- name: e2e_mdb_kind_search_large_task_group
1440+
1441+
- name: e2e_static_mdb_kind_ubi_cloudqa_large
1442+
display_name: e2e_static_mdb_kind_ubi_cloudqa_large
1443+
tags: [ "pr_patch", "staging", "e2e_test_suite", "cloudqa", "static" ]
1444+
run_on:
1445+
- ubuntu2404-large
1446+
<<: *base_no_om_image_dependency
1447+
tasks:
1448+
- name: e2e_mdb_kind_search_task_group
1449+
- name: e2e_mdb_kind_search_large_task_group
1450+
13641451
# We do not want to run openshift variants on every PR.
13651452
- name: e2e_mdb_openshift_ubi_cloudqa
13661453
display_name: e2e_mdb_openshift_ubi_cloudqa
@@ -1470,6 +1557,26 @@ buildvariants:
14701557
- name: e2e_static_ops_manager_kind_6_0_only_task_group
14711558
- name: e2e_ops_manager_upgrade_only_task_group
14721559

1560+
- name: e2e_om80_kind_ubi_large
1561+
display_name: e2e_om80_kind_ubi_large
1562+
tags: [ "pr_patch", "staging", "e2e_test_suite" ]
1563+
run_on:
1564+
- ubuntu2404-large
1565+
<<: *base_om8_dependency
1566+
tasks:
1567+
- name: e2e_om80_kind_search_task_group
1568+
- name: e2e_om80_kind_search_large_task_group
1569+
1570+
- name: e2e_static_om80_kind_ubi_large
1571+
display_name: e2e_static_om80_kind_ubi_large
1572+
tags: [ "pr_patch", "staging", "e2e_test_suite", "static" ]
1573+
run_on:
1574+
- ubuntu2404-large
1575+
<<: *base_om8_dependency
1576+
tasks:
1577+
- name: e2e_om80_kind_search_task_group
1578+
- name: e2e_om80_kind_search_large_task_group
1579+
14731580
- name: e2e_operator_race_ubi_with_telemetry
14741581
display_name: e2e_operator_race_ubi_with_telemetry
14751582
tags: [ "staging", "e2e_test_suite", "race" ]

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ repos:
129129
^scripts/funcs/[^/]+$
130130
)
131131
132+
- repo: local
133+
hooks:
134+
- id: ty-search
135+
name: ty (search tests)
136+
entry: bash -c 'cd docker/mongodb-kubernetes-tests && uvx ty check tests/search/ tests/common/search/'
137+
language: system
138+
pass_filenames: false
139+
files: docker/mongodb-kubernetes-tests/tests/(common/)?search/.*\.py$
140+
stages: [pre-commit]
141+
132142
- repo: https://github.com/golangci/golangci-lint
133143
rev: v2.0.2
134144
hooks:

LICENSE-THIRD-PARTY

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11

2+
cel.dev/expr,v0.25.1,https://github.com/google/cel-spec/blob/v0.25.1/LICENSE,Apache-2.0
23
github.com/Masterminds/semver/v3,v3.4.0,https://github.com/Masterminds/semver/blob/v3.4.0/LICENSE.txt,MIT
34
github.com/beorn7/perks/quantile,v1.0.1,https://github.com/beorn7/perks/blob/v1.0.1/LICENSE,MIT
45
github.com/blang/semver,v3.5.1,https://github.com/blang/semver/blob/v3.5.1/LICENSE,MIT
56
github.com/cenkalti/backoff/v4,v4.3.0,https://github.com/cenkalti/backoff/blob/v4.3.0/LICENSE,MIT
67
github.com/cenkalti/backoff/v5,v5.0.3,https://github.com/cenkalti/backoff/blob/v5.0.3/LICENSE,MIT
78
github.com/cespare/xxhash/v2,v2.3.0,https://github.com/cespare/xxhash/blob/v2.3.0/LICENSE.txt,MIT
9+
github.com/cncf/xds/go,v0.0.0-20251210132809-ee656c7534f5,https://github.com/cncf/xds/blob/ee656c7534f5/go/LICENSE,Apache-2.0
810
github.com/davecgh/go-spew/spew,v1.1.2-0.20180830191138-d8f796af33cc,https://github.com/davecgh/go-spew/blob/d8f796af33cc/LICENSE,ISC
911
github.com/emicklei/go-restful/v3,v3.11.0,https://github.com/emicklei/go-restful/blob/v3.11.0/LICENSE,MIT
12+
github.com/envoyproxy/go-control-plane/envoy,v1.36.0,https://github.com/envoyproxy/go-control-plane/blob/envoy/v1.36.0/envoy/LICENSE,Apache-2.0
13+
github.com/envoyproxy/go-control-plane/pkg/wellknown,v0.14.0,https://github.com/envoyproxy/go-control-plane/blob/v0.14.0/LICENSE,Apache-2.0
14+
github.com/envoyproxy/protoc-gen-validate/validate,v1.3.0,https://github.com/envoyproxy/protoc-gen-validate/blob/v1.3.0/LICENSE,Apache-2.0
1015
github.com/evanphx/json-patch/v5,v5.9.11,https://github.com/evanphx/json-patch/blob/v5.9.11/v5/LICENSE,BSD-3-Clause
1116
github.com/fsnotify/fsnotify,v1.8.0,https://github.com/fsnotify/fsnotify/blob/v1.8.0/LICENSE,BSD-3-Clause
1217
github.com/fxamacker/cbor/v2,v2.7.0,https://github.com/fxamacker/cbor/blob/v2.7.0/LICENSE,MIT
@@ -74,7 +79,7 @@ go.uber.org/multierr,v1.11.0,https://github.com/uber-go/multierr/blob/v1.11.0/LI
7479
go.uber.org/zap,v1.27.1,https://github.com/uber-go/zap/blob/v1.27.1/LICENSE,MIT
7580
go.yaml.in/yaml/v2,v2.4.2,https://github.com/yaml/go-yaml/blob/v2.4.2/LICENSE,Apache-2.0
7681
gomodules.xyz/jsonpatch/v2,v2.4.0,https://github.com/gomodules/jsonpatch/blob/v2.4.0/v2/LICENSE,Apache-2.0
77-
google.golang.org/genproto/googleapis/api/httpbody,v0.0.0-20260209200024-4cfbd4190f57,https://github.com/googleapis/go-genproto/blob/4cfbd4190f57/googleapis/api/LICENSE,Apache-2.0
82+
google.golang.org/genproto/googleapis/api,v0.0.0-20260209200024-4cfbd4190f57,https://github.com/googleapis/go-genproto/blob/4cfbd4190f57/googleapis/api/LICENSE,Apache-2.0
7883
google.golang.org/genproto/googleapis/rpc,v0.0.0-20260209200024-4cfbd4190f57,https://github.com/googleapis/go-genproto/blob/4cfbd4190f57/googleapis/rpc/LICENSE,Apache-2.0
7984
google.golang.org/grpc,v1.79.3,https://github.com/grpc/grpc-go/blob/v1.79.3/LICENSE,Apache-2.0
8085
google.golang.org/protobuf,v1.36.11,https://github.com/protocolbuffers/protobuf-go/blob/v1.36.11/LICENSE,BSD-3-Clause

api/v1/mdb/mongodb_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,14 @@ func (m *MongoDB) CalculateFeatureCompatibilityVersion() string {
16781678
return fcv.CalculateFeatureCompatibilityVersion(m.Spec.Version, m.Status.FeatureCompatibilityVersion, m.Spec.FeatureCompatibilityVersion)
16791679
}
16801680

1681+
func (m *MongoDB) ShardNames() []string {
1682+
shardNames := make([]string, m.Spec.ShardCount)
1683+
for shardIdx := 0; shardIdx < m.Spec.ShardCount; shardIdx++ {
1684+
shardNames[shardIdx] = m.ShardRsName(shardIdx)
1685+
}
1686+
return shardNames
1687+
}
1688+
16811689
func (m *MongoDbSpec) IsInChangeVersion(lastSpec *MongoDbSpec) bool {
16821690
if lastSpec != nil && (lastSpec.Version != m.Version) {
16831691
return true

api/v1/mdb/mongodb_validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func specWithExactlyOneSchema(d DbCommonSpec) v1.ValidationResult {
419419
}
420420

421421
if count != 1 {
422-
return v1.ValidationError("must validate one and only one schema")
422+
return v1.ValidationError("either spec.cloudManager or spec.opsManager can be set")
423423
}
424424
return v1.ValidationSuccess()
425425
}

0 commit comments

Comments
 (0)