Skip to content

Commit 525b3a1

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongodb-kubernetes into fix-openshift-tests
2 parents b3ce074 + dd5f1d8 commit 525b3a1

16 files changed

+81
-89
lines changed

.evergreen.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ patch_aliases:
236236
variant_tags: [ "e2e_smoke_release_test_suite" ]
237237
task_tags: [ "patch-run" ]
238238
- alias: "patch-run-cloudqa"
239-
variant_tags: [ "cloudqa" ]
239+
variant_tags: [ "cloudqa_non_static" ]
240240
task: ".*"
241241

242242
# Triggered whenever the GitHub PR is created
@@ -1296,7 +1296,7 @@ buildvariants:
12961296
## MongoDB build variants
12971297
- name: e2e_mdb_kind_ubi_cloudqa
12981298
display_name: e2e_mdb_kind_ubi_cloudqa
1299-
tags: [ "e2e_test_suite", "cloudqa" ]
1299+
tags: [ "e2e_test_suite", "cloudqa", "cloudqa_non_static" ]
13001300
run_on:
13011301
- ubuntu2204-medium
13021302
<<: *base_no_om_image_dependency
@@ -1305,7 +1305,7 @@ buildvariants:
13051305

13061306
- name: e2e_custom_domain_mdb_kind_ubi_cloudqa
13071307
display_name: e2e_custom_domain_mdb_kind_ubi_cloudqa
1308-
tags: [ "e2e_test_suite", "cloudqa" ]
1308+
tags: [ "e2e_test_suite", "cloudqa", "cloudqa_non_static" ]
13091309
run_on:
13101310
- ubuntu2204-large
13111311
<<: *base_no_om_image_dependency
@@ -1314,7 +1314,7 @@ buildvariants:
13141314

13151315
- name: e2e_static_mdb_kind_ubi_cloudqa
13161316
display_name: e2e_static_mdb_kind_ubi_cloudqa
1317-
tags: [ "e2e_test_suite", "cloudqa" ]
1317+
tags: [ "e2e_test_suite", "cloudqa", "static" ]
13181318
run_on:
13191319
- ubuntu2204-medium
13201320
<<: *base_no_om_image_dependency
@@ -1323,7 +1323,7 @@ buildvariants:
13231323

13241324
- name: e2e_static_custom_domain_mdb_kind_ubi_cloudqa
13251325
display_name: e2e_static_custom_domain_mdb_kind_ubi_cloudqa
1326-
tags: [ "e2e_test_suite", "cloudqa" ]
1326+
tags: [ "e2e_test_suite", "cloudqa", "static" ]
13271327
run_on:
13281328
- ubuntu2204-large
13291329
depends_on:
@@ -1343,7 +1343,7 @@ buildvariants:
13431343

13441344
- name: e2e_mdb_openshift_ubi_cloudqa
13451345
display_name: e2e_mdb_openshift_ubi_cloudqa
1346-
tags: [ "e2e_openshift_test_suite", "cloudqa" ]
1346+
tags: [ "e2e_openshift_test_suite", "cloudqa", "cloudqa_non_static" ]
13471347
depends_on:
13481348
- name: build_operator_ubi
13491349
variant: init_test_run
@@ -1363,7 +1363,7 @@ buildvariants:
13631363
# in evergreen for all variants matching e2e_static-*, but we do not want to run openshift variants on every pr.
13641364
- name: e2e_openshift_static_mdb_ubi_cloudqa
13651365
display_name: e2e_openshift_static_mdb_ubi_cloudqa
1366-
tags: [ "e2e_openshift_test_suite", "cloudqa" ]
1366+
tags: [ "e2e_openshift_test_suite", "cloudqa", "static" ]
13671367
depends_on:
13681368
- name: build_operator_ubi
13691369
variant: init_test_run
@@ -1394,7 +1394,7 @@ buildvariants:
13941394
# Isolated Ops Manager Tests for 6.0 version
13951395
- name: e2e_static_om60_kind_ubi
13961396
display_name: e2e_static_om60_kind_ubi
1397-
tags: [ "e2e_test_suite" ]
1397+
tags: [ "e2e_test_suite", "static" ]
13981398
run_on:
13991399
- ubuntu2204-medium
14001400
<<: *base_om6_dependency
@@ -1416,7 +1416,7 @@ buildvariants:
14161416

14171417
- name: e2e_static_om70_kind_ubi
14181418
display_name: e2e_static_om70_kind_ubi
1419-
tags: [ "e2e_test_suite" ]
1419+
tags: [ "e2e_test_suite", "static" ]
14201420
run_on:
14211421
- ubuntu2204-medium
14221422
<<: *base_om7_dependency
@@ -1439,7 +1439,7 @@ buildvariants:
14391439

14401440
- name: e2e_static_om80_kind_ubi
14411441
display_name: e2e_static_om80_kind_ubi
1442-
tags: [ "e2e_test_suite" ]
1442+
tags: [ "e2e_test_suite", "static" ]
14431443
run_on:
14441444
- ubuntu2204-medium
14451445
<<: *base_om8_dependency
@@ -1527,7 +1527,7 @@ buildvariants:
15271527

15281528
- name: e2e_static_smoke_arm
15291529
display_name: e2e_smoke_arm
1530-
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1530+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite", "static" ]
15311531
run_on:
15321532
- ubuntu2204-arm64-large
15331533
allowed_requesters: [ "patch", "github_tag" ]
@@ -1537,7 +1537,7 @@ buildvariants:
15371537

15381538
- name: e2e_static_smoke_ibm_z
15391539
display_name: e2e_static_smoke_ibm_z
1540-
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1540+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite", "static" ]
15411541
run_on:
15421542
- rhel9-zseries-small
15431543
- rhel9-zseries-large
@@ -1560,7 +1560,7 @@ buildvariants:
15601560

15611561
- name: e2e_static_smoke_ibm_power
15621562
display_name: e2e_static_smoke_ibm_power
1563-
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1563+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite", "static" ]
15641564
run_on:
15651565
- rhel9-power-small
15661566
- rhel9-power-large
@@ -1583,7 +1583,7 @@ buildvariants:
15831583

15841584
- name: e2e_static_smoke
15851585
display_name: e2e_static_smoke
1586-
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite" ]
1586+
tags: [ "e2e_test_suite", "e2e_smoke_release_test_suite", "static" ]
15871587
run_on:
15881588
- ubuntu2204-large
15891589
allowed_requesters: [ "patch", "github_tag" ]
@@ -1595,7 +1595,7 @@ buildvariants:
15951595

15961596
- name: e2e_multi_cluster_kind
15971597
display_name: e2e_multi_cluster_kind
1598-
tags: [ "e2e_test_suite", "cloudqa"]
1598+
tags: [ "e2e_test_suite", "cloudqa", "cloudqa_non_static"]
15991599
run_on:
16001600
- ubuntu2204-large
16011601
<<: *base_om6_dependency
@@ -1604,7 +1604,7 @@ buildvariants:
16041604

16051605
- name: e2e_static_multi_cluster_kind
16061606
display_name: e2e_static_multi_cluster_kind
1607-
tags: [ "e2e_test_suite", "cloudqa"]
1607+
tags: [ "e2e_test_suite", "cloudqa", "static"]
16081608
run_on:
16091609
- ubuntu2204-large
16101610
<<: *base_om6_dependency
@@ -1613,7 +1613,7 @@ buildvariants:
16131613

16141614
- name: e2e_multi_cluster_2_clusters
16151615
display_name: e2e_multi_cluster_2_clusters
1616-
tags: [ "e2e_test_suite", "cloudqa"]
1616+
tags: [ "e2e_test_suite", "cloudqa", "cloudqa_non_static"]
16171617
run_on:
16181618
- ubuntu2204-large
16191619
<<: *base_om6_dependency
@@ -1622,7 +1622,7 @@ buildvariants:
16221622

16231623
- name: e2e_static_multi_cluster_2_clusters
16241624
display_name: e2e_static_multi_cluster_2_clusters
1625-
tags: [ "e2e_test_suite", "cloudqa"]
1625+
tags: [ "e2e_test_suite", "cloudqa", "static"]
16261626
run_on:
16271627
- ubuntu2204-large
16281628
<<: *base_om6_dependency
@@ -1640,7 +1640,7 @@ buildvariants:
16401640

16411641
- name: e2e_static_multi_cluster_om_appdb
16421642
display_name: e2e_static_multi_cluster_om_appdb
1643-
tags: [ "e2e_test_suite" ]
1643+
tags: [ "e2e_test_suite", "static" ]
16441644
run_on:
16451645
- ubuntu2204-large
16461646
<<: *base_om6_dependency
@@ -1660,7 +1660,7 @@ buildvariants:
16601660

16611661
- name: e2e_operator_kind_ubi_cloudqa
16621662
display_name: e2e_operator_kind_ubi_cloudqa
1663-
tags: [ "e2e_test_suite", "cloudqa" ]
1663+
tags: [ "e2e_test_suite", "cloudqa", "cloudqa_non_static" ]
16641664
run_on:
16651665
- ubuntu2204-large
16661666
<<: *base_no_om_image_dependency
@@ -1669,7 +1669,7 @@ buildvariants:
16691669

16701670
- name: e2e_static_operator_kind_ubi_cloudqa
16711671
display_name: e2e_static_operator_kind_ubi_cloudqa
1672-
tags: [ "e2e_test_suite", "cloudqa" ]
1672+
tags: [ "e2e_test_suite", "cloudqa", "static" ]
16731673
run_on:
16741674
- ubuntu2204-large
16751675
<<: *base_no_om_image_dependency
@@ -1678,7 +1678,7 @@ buildvariants:
16781678

16791679
- name: e2e_operator_no_webhook_roles_cloudqa
16801680
display_name: e2e_operator_no_webhook_roles_cloudqa
1681-
tags: [ "e2e_test_suite", "cloudqa" ]
1681+
tags: [ "e2e_test_suite", "cloudqa", "cloudqa_non_static" ]
16821682
run_on:
16831683
- ubuntu2204-large
16841684
<<: *base_no_om_image_dependency
@@ -1712,7 +1712,7 @@ buildvariants:
17121712

17131713
- name: e2e_static_kind_olm_ubi
17141714
display_name: e2e_static_kind_olm_ubi
1715-
tags: [ "e2e_test_suite" ]
1715+
tags: [ "e2e_test_suite", "static" ]
17161716
run_on:
17171717
- ubuntu2204-large
17181718
depends_on:

.github/workflows/preview_release_notes.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ jobs:
2929
id: generate_release_notes
3030
run: python -m scripts.release.release_notes -s $INITIAL_COMMIT_SHA -v $INITIAL_VERSION -o release_notes_tmp.md
3131
env:
32-
INITIAL_COMMIT_SHA: ${{ vars.RELEASE_INITIAL_COMMIT_SHA }}
33-
INITIAL_VERSION: ${{ vars.RELEASE_INITIAL_VERSION }}
32+
# We can not use environments set via GitHub UI because they will
33+
# not be available in the pull requests running from forks.
34+
INITIAL_COMMIT_SHA: 9ed5f98fc70c5b3442f633d2393265fb8a2aba0c
35+
INITIAL_VERSION: 1.3.0
3436
- name: Add disclaimer to release notes preview
3537
run: |
3638
echo -e "_:warning: (this preview might not be accurate if the PR is not rebased on current master branch)_\n" > release_notes_preview.md

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ spec:
8787
- name: OPS_MANAGER_IMAGE_PULL_POLICY
8888
value: Always
8989
- name: AGENT_IMAGE
90-
value: "quay.io/mongodb/mongodb-agent:108.0.2.8729-1"
90+
value: "quay.io/mongodb/mongodb-agent:108.0.12.8846-1"
9191
- name: MDB_AGENT_IMAGE_REPOSITORY
9292
value: "quay.io/mongodb/mongodb-agent"
9393
- name: MONGODB_IMAGE

controllers/operator/authentication_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ func TestUpdateOmAuthentication_NoAuthenticationEnabled(t *testing.T) {
9191

9292
kubeClient, omConnectionFactory := mock.NewDefaultFakeClient(rs)
9393
r := newReplicaSetReconciler(ctx, kubeClient, nil, "", "", false, false, omConnectionFactory.GetConnectionFunc)
94-
r.updateOmAuthentication(ctx, conn, processNames, rs, "", "", "", false, zap.S())
94+
agentCertSecretSelector := rs.GetSecurity().AgentClientCertificateSecretName(rs.Name)
95+
r.updateOmAuthentication(ctx, conn, processNames, rs, agentCertSecretSelector, "", "", false, zap.S())
9596

9697
ac, _ := conn.ReadAutomationConfig()
9798

@@ -112,7 +113,8 @@ func TestUpdateOmAuthentication_EnableX509_TlsNotEnabled(t *testing.T) {
112113

113114
kubeClient, omConnectionFactory := mock.NewDefaultFakeClient(rs)
114115
r := newReplicaSetReconciler(ctx, kubeClient, nil, "", "", false, false, omConnectionFactory.GetConnectionFunc)
115-
status, isMultiStageReconciliation := r.updateOmAuthentication(ctx, conn, []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, "", "", "", false, zap.S())
116+
agentCertSecretSelector := rs.GetSecurity().AgentClientCertificateSecretName(rs.Name)
117+
status, isMultiStageReconciliation := r.updateOmAuthentication(ctx, conn, []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, agentCertSecretSelector, "", "", false, zap.S())
116118

117119
assert.True(t, status.IsOK(), "configuring both options at once should not result in a failed status")
118120
assert.True(t, isMultiStageReconciliation, "configuring both tls and x509 at once should result in a multi stage reconciliation")
@@ -124,7 +126,8 @@ func TestUpdateOmAuthentication_EnableX509_WithTlsAlreadyEnabled(t *testing.T) {
124126
omConnectionFactory := om.NewCachedOMConnectionFactoryWithInitializedConnection(om.NewMockedOmConnection(deployment.CreateFromReplicaSet("fake-mongoDBImage", false, rs)))
125127
kubeClient := mock.NewDefaultFakeClientWithOMConnectionFactory(omConnectionFactory, rs)
126128
r := newReplicaSetReconciler(ctx, kubeClient, nil, "", "", false, false, omConnectionFactory.GetConnectionFunc)
127-
status, isMultiStageReconciliation := r.updateOmAuthentication(ctx, omConnectionFactory.GetConnection(), []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, "", "", "", false, zap.S())
129+
agentCertSecretSelector := rs.GetSecurity().AgentClientCertificateSecretName(rs.Name)
130+
status, isMultiStageReconciliation := r.updateOmAuthentication(ctx, omConnectionFactory.GetConnection(), []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, agentCertSecretSelector, "", "", false, zap.S())
128131

129132
assert.True(t, status.IsOK(), "configuring x509 when tls has already been enabled should not result in a failed status")
130133
assert.False(t, isMultiStageReconciliation, "if tls is already enabled, we should be able to configure x509 is a single reconciliation")
@@ -140,7 +143,8 @@ func TestUpdateOmAuthentication_AuthenticationIsNotConfigured_IfAuthIsNotSet(t *
140143
kubeClient := mock.NewDefaultFakeClientWithOMConnectionFactory(omConnectionFactory, rs)
141144
r := newReplicaSetReconciler(ctx, kubeClient, nil, "", "", false, false, omConnectionFactory.GetConnectionFunc)
142145

143-
status, _ := r.updateOmAuthentication(ctx, omConnectionFactory.GetConnection(), []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, "", "", "", false, zap.S())
146+
agentCertSecretSelector := rs.GetSecurity().AgentClientCertificateSecretName(rs.Name)
147+
status, _ := r.updateOmAuthentication(ctx, omConnectionFactory.GetConnection(), []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, agentCertSecretSelector, "", "", false, zap.S())
144148
assert.True(t, status.IsOK(), "no authentication should have been configured")
145149

146150
ac, _ := omConnectionFactory.GetConnection().ReadAutomationConfig()
@@ -211,7 +215,8 @@ func TestUpdateOmAuthentication_EnableX509_FromEmptyDeployment(t *testing.T) {
211215
r := newReplicaSetReconciler(ctx, kubeClient, nil, "", "", false, false, omConnectionFactory.GetConnectionFunc)
212216
createAgentCSRs(t, ctx, 1, r.client, certsv1.CertificateApproved)
213217

214-
status, isMultiStageReconciliation := r.updateOmAuthentication(ctx, omConnectionFactory.GetConnection(), []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, "", "", "", false, zap.S())
218+
agentCertSecretSelector := rs.GetSecurity().AgentClientCertificateSecretName(rs.Name)
219+
status, isMultiStageReconciliation := r.updateOmAuthentication(ctx, omConnectionFactory.GetConnection(), []string{"my-rs-0", "my-rs-1", "my-rs-2"}, rs, agentCertSecretSelector, "", "", false, zap.S())
215220
assert.True(t, status.IsOK(), "configuring x509 and tls when there are no processes should not result in a failed status")
216221
assert.False(t, isMultiStageReconciliation, "if we are enabling tls and x509 at once, this should be done in a single reconciliation")
217222
}

controllers/operator/common_controller.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ func getSubjectFromCertificate(cert string) (string, error) {
407407
// enables/disables authentication. If the authentication can't be fully configured, a boolean value indicating that
408408
// an additional reconciliation needs to be queued up to fully make the authentication changes is returned.
409409
// Note: updateOmAuthentication needs to be called before reconciling other auth related settings.
410-
func (r *ReconcileCommonController) updateOmAuthentication(ctx context.Context, conn om.Connection, processNames []string, ar authentication.AuthResource, agentCertSecretName string, caFilepath string, clusterFilePath string, isRecovering bool, log *zap.SugaredLogger) (status workflow.Status, multiStageReconciliation bool) {
410+
func (r *ReconcileCommonController) updateOmAuthentication(ctx context.Context, conn om.Connection, processNames []string, ar authentication.AuthResource, agentCertSecretSelector corev1.SecretKeySelector, caFilepath string, clusterFilePath string, isRecovering bool, log *zap.SugaredLogger) (status workflow.Status, multiStageReconciliation bool) {
411411
// don't touch authentication settings if resource has not been configured with them
412412
if ar.GetSecurity() == nil || ar.GetSecurity().Authentication == nil {
413413
return workflow.OK(), false
@@ -480,17 +480,13 @@ func (r *ReconcileCommonController) updateOmAuthentication(ctx context.Context,
480480

481481
log.Debugf("Using authentication options %+v", authentication.Redact(authOpts))
482482

483-
agentSecretSelector := ar.GetSecurity().AgentClientCertificateSecretName(ar.GetName())
484-
if agentCertSecretName != "" {
485-
agentSecretSelector.Name = agentCertSecretName
486-
}
487483
wantToEnableAuthentication := ar.GetSecurity().Authentication.Enabled
488484
if wantToEnableAuthentication && canConfigureAuthentication(ac, ar.GetSecurity().Authentication.GetModes(), log) {
489485
log.Info("Configuring authentication for MongoDB resource")
490486

491487
if ar.GetSecurity().ShouldUseX509(ac.Auth.AutoAuthMechanism) || ar.GetSecurity().ShouldUseClientCertificates() {
492488
agentSecret := &corev1.Secret{}
493-
if err := r.client.Get(ctx, kube.ObjectKey(ar.GetNamespace(), agentSecretSelector.Name), agentSecret); client.IgnoreNotFound(err) != nil {
489+
if err := r.client.Get(ctx, kube.ObjectKey(ar.GetNamespace(), agentCertSecretSelector.Name), agentSecret); client.IgnoreNotFound(err) != nil {
494490
return workflow.Failed(err), false
495491
}
496492
// If the agent secret is of type TLS, we can find the certificate under the standard key,
@@ -500,10 +496,10 @@ func (r *ReconcileCommonController) updateOmAuthentication(ctx context.Context,
500496
//
501497
// Important: In multi cluster it is working with the TLS secret in the central cluster, hence below selector update.
502498
if agentSecret.Type == corev1.SecretTypeTLS {
503-
agentSecretSelector.Key = corev1.TLSCertKey
499+
agentCertSecretSelector.Key = corev1.TLSCertKey
504500
}
505501

506-
authOpts, err = r.configureAgentSubjects(ctx, ar.GetNamespace(), agentSecretSelector, authOpts, log)
502+
authOpts, err = r.configureAgentSubjects(ctx, ar.GetNamespace(), agentCertSecretSelector, authOpts, log)
507503
if err != nil {
508504
return workflow.Failed(xerrors.Errorf("error configuring agent subjects: %w", err)), false
509505
}
@@ -534,17 +530,17 @@ func (r *ReconcileCommonController) updateOmAuthentication(ctx context.Context,
534530
return workflow.OK(), true
535531
} else {
536532
agentSecret := &corev1.Secret{}
537-
if err := r.client.Get(ctx, kube.ObjectKey(ar.GetNamespace(), agentSecretSelector.Name), agentSecret); client.IgnoreNotFound(err) != nil {
533+
if err := r.client.Get(ctx, kube.ObjectKey(ar.GetNamespace(), agentCertSecretSelector.Name), agentSecret); client.IgnoreNotFound(err) != nil {
538534
return workflow.Failed(err), false
539535
}
540536

541537
if agentSecret.Type == corev1.SecretTypeTLS {
542-
agentSecretSelector.Name = fmt.Sprintf("%s%s", agentSecretSelector.Name, certs.OperatorGeneratedCertSuffix)
538+
agentCertSecretSelector.Name = fmt.Sprintf("%s%s", agentCertSecretSelector.Name, certs.OperatorGeneratedCertSuffix)
543539
}
544540

545541
// Should not fail if the Secret object with agent certs is not found.
546542
// It will only exist on x509 client auth enabled deployments.
547-
userOpts, err := r.readAgentSubjectsFromSecret(ctx, ar.GetNamespace(), agentSecretSelector, log)
543+
userOpts, err := r.readAgentSubjectsFromSecret(ctx, ar.GetNamespace(), agentCertSecretSelector, log)
548544
err = client.IgnoreNotFound(err)
549545
if err != nil {
550546
return workflow.Failed(err), true

controllers/operator/construct/database_construction.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ func buildDatabaseStatefulSetConfigurationFunction(mdb databaseStatefulSetSource
466466
appLabelKey: opts.ServiceName,
467467
}
468468

469-
annotationFunc := statefulset.WithAnnotations(defaultPodAnnotations(opts.CertificateHash))
469+
annotationFunc := statefulset.WithAnnotations(defaultStatefulSetAnnotations(opts.CertificateHash))
470470
podTemplateAnnotationFunc := podtemplatespec.NOOP()
471471

472472
annotationFunc = statefulset.Apply(
@@ -1057,11 +1057,8 @@ func DatabaseStartupProbe() probes.Modification {
10571057
)
10581058
}
10591059

1060-
func defaultPodAnnotations(certHash string) map[string]string {
1060+
func defaultStatefulSetAnnotations(certHash string) map[string]string {
10611061
return map[string]string{
1062-
// This annotation is necessary to trigger a pod restart
1063-
// if the certificate secret is out of date. This happens if
1064-
// existing certificates have been replaced/rotated/renewed.
10651062
certs.CertHashAnnotationKey: certHash,
10661063
}
10671064
}

controllers/operator/mongodbmultireplicaset_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,8 @@ func (r *ReconcileMongoDbMultiReplicaSet) updateOmDeploymentRs(ctx context.Conte
758758

759759
caFilePath := fmt.Sprintf("%s/ca-pem", util.TLSCaMountPath)
760760

761-
// We do not provide an agentCertSecretName on purpose because then we will default to the non pem secret on the central cluster.
762-
// Below method has special code handling reading certificates from the central cluster in that case.
763-
status, additionalReconciliationRequired := r.updateOmAuthentication(ctx, conn, rs.GetProcessNames(), &mrs, "", caFilePath, internalClusterPath, isRecovering, log)
761+
agentCertSecretName := mrs.GetSecurity().AgentClientCertificateSecretName(mrs.GetName())
762+
status, additionalReconciliationRequired := r.updateOmAuthentication(ctx, conn, rs.GetProcessNames(), &mrs, agentCertSecretName, caFilePath, internalClusterPath, isRecovering, log)
764763
if !status.IsOK() && !isRecovering {
765764
return xerrors.Errorf("failed to enable Authentication for MongoDB Multi Replicaset")
766765
}

0 commit comments

Comments
 (0)