Skip to content

Commit

Permalink
Merge branch 'main' into K8SPSMDB-1013-mongo-7-0
Browse files Browse the repository at this point in the history
  • Loading branch information
inelpandzic authored Mar 25, 2024
2 parents 11b0bb2 + c697fa7 commit 2bf739e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions e2e-tests/monitoring-2-0/run
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ wait_for_delete "pod/${cluster}-mongos-0"
wait_for_delete "pod/${cluster}-rs0-0"
wait_for_delete "pod/${cluster}-cfg-0"

desc 'check if services are not deleted'

kubectl_bin get svc $cluster-rs0
kubectl_bin get svc $cluster-cfg
kubectl_bin get svc $cluster-mongos

does_node_id_exists_in_pmm=($(does_node_id_exists "${nodeList[@]}"))
for instance in "${does_node_id_exists_in_pmm[@]}"; do
if [ -n "$instance" ]; then
Expand Down
4 changes: 4 additions & 0 deletions pkg/controller/perconaservermongodb/psmdb_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,10 @@ func (r *ReconcilePerconaServerMongoDB) reconcileMongos(ctx context.Context, cr
}

func (r *ReconcilePerconaServerMongoDB) removeOutdatedMongosSvc(ctx context.Context, cr *api.PerconaServerMongoDB) error {
if cr.Spec.Pause && cr.Spec.Sharding.Enabled {
return nil
}

svcNames := make(map[string]struct{}, cr.Spec.Sharding.Mongos.Size)
if cr.Spec.Sharding.Mongos.Expose.ServicePerPod {
for i := 0; i < int(cr.Spec.Sharding.Mongos.Size); i++ {
Expand Down

0 comments on commit 2bf739e

Please sign in to comment.