From a9ddf73fcbca6cccc80a087db264f007afb45184 Mon Sep 17 00:00:00 2001 From: nam Date: Tue, 30 Jul 2024 13:57:08 +0200 Subject: [PATCH 1/2] fix json naming of auditLogRotate --- api/v1/mongodbcommunity_types.go | 2 +- api/v1/zz_generated.deepcopy.go | 5 +++++ test/e2e/mongodbtests/mongodbtests.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/v1/mongodbcommunity_types.go b/api/v1/mongodbcommunity_types.go index cd91000c1..f1e7f8710 100644 --- a/api/v1/mongodbcommunity_types.go +++ b/api/v1/mongodbcommunity_types.go @@ -374,7 +374,7 @@ type AgentConfiguration struct { LogRotate *automationconfig.CrdLogRotate `json:"logRotate,omitempty"` // +optional // AuditLogRotate if enabled, will enable AuditLogRotate for all processes. - AuditLogRotate *automationconfig.CrdLogRotate `json:"AuditLogRotate,omitempty"` + AuditLogRotate *automationconfig.CrdLogRotate `json:"auditLogRotate,omitempty"` // +optional // SystemLog configures system log of mongod SystemLog *automationconfig.SystemLog `json:"systemLog,omitempty"` diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 40a547fef..bf58f2b77 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -34,6 +34,11 @@ func (in *AgentConfiguration) DeepCopyInto(out *AgentConfiguration) { *out = new(automationconfig.CrdLogRotate) **out = **in } + if in.AuditLogRotate != nil { + in, out := &in.AuditLogRotate, &out.AuditLogRotate + *out = new(automationconfig.CrdLogRotate) + **out = **in + } if in.SystemLog != nil { in, out := &in.SystemLog, &out.SystemLog *out = new(automationconfig.SystemLog) diff --git a/test/e2e/mongodbtests/mongodbtests.go b/test/e2e/mongodbtests/mongodbtests.go index be14a3c30..b52e8639e 100644 --- a/test/e2e/mongodbtests/mongodbtests.go +++ b/test/e2e/mongodbtests/mongodbtests.go @@ -800,7 +800,7 @@ func ConnectionStringSecretIsCleanedUp(ctx context.Context, mdb *mdbv1.MongoDBCo return func(t *testing.T) { connectionStringSecret := corev1.Secret{} newErr := e2eutil.TestClient.Get(ctx, types.NamespacedName{Name: removedConnectionString, Namespace: mdb.Namespace}, &connectionStringSecret) - + assert.EqualError(t, newErr, fmt.Sprintf("secrets \"%s\" not found", removedConnectionString)) } } From 302230a650bb5b8d82958343f3e298bb6cdfc807 Mon Sep 17 00:00:00 2001 From: nam Date: Tue, 30 Jul 2024 13:57:31 +0200 Subject: [PATCH 2/2] fix json naming of auditLogRotate --- .../bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml b/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml index 95d8e4c32..e7c3faa69 100644 --- a/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml +++ b/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml @@ -74,7 +74,7 @@ spec: description: AgentConfiguration sets options for the MongoDB automation agent properties: - AuditLogRotate: + auditLogRotate: description: AuditLogRotate if enabled, will enable AuditLogRotate for all processes. properties: