diff --git a/api/v1/mongodbcommunity_types_test.go b/api/v1/mongodbcommunity_types_test.go index 938e3671e..19b365527 100644 --- a/api/v1/mongodbcommunity_types_test.go +++ b/api/v1/mongodbcommunity_types_test.go @@ -282,35 +282,6 @@ func TestGetScramCredentialsSecretName(t *testing.T) { }, "scram-credential-secret-name-1-scram-credentials", }, - { - MongoDBUser{ - Name: "mdb-2", - DB: "admin", - Roles: []Role{ - // roles on testing db for general connectivity - { - DB: "testing", - Name: "readWrite", - }, - { - DB: "testing", - Name: "clusterAdmin", - }, - // admin roles for reading FCV - { - DB: "admin", - Name: "readWrite", - }, - { - DB: "admin", - Name: "clusterAdmin", - }, - }, - ScramCredentialsSecretName: "scram-credential-secret-name-2", - ConnectionStringSecretNamespace: "other-namespace", - }, - "scram-credential-secret-name-2-scram-credentials", - }, } for _, tt := range testusers { diff --git a/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml b/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml index 9c5b82a16..7e1727787 100644 --- a/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml +++ b/config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml @@ -429,9 +429,9 @@ spec: TODO: Add other useful fields. apiVersion, kind, uid?' type: string type: object + x-kubernetes-map-type: atomic enabled: type: boolean - x-kubernetes-map-type: atomic optional: description: Optional configures if TLS should be required or optional for connections diff --git a/controllers/replicaset_controller_test.go b/controllers/replicaset_controller_test.go index 122946bfe..aac79b07b 100644 --- a/controllers/replicaset_controller_test.go +++ b/controllers/replicaset_controller_test.go @@ -4,12 +4,13 @@ import ( "context" "encoding/json" "fmt" - "github.com/mongodb/mongodb-kubernetes-operator/pkg/authentication/x509" "os" "reflect" "testing" "time" + "github.com/mongodb/mongodb-kubernetes-operator/pkg/authentication/x509" + "github.com/mongodb/mongodb-kubernetes-operator/pkg/util/constants" "github.com/mongodb/mongodb-kubernetes-operator/pkg/kube/statefulset" @@ -673,7 +674,7 @@ func assertConnectionStringSecretPorts(t *testing.T, c k8sClient.Client, mdb mdb connectionStringSecret := corev1.Secret{} scramUsers := mdb.GetAuthUsers() require.Len(t, scramUsers, 1) - secretNamespacedName := types.NamespacedName{Name: scramUsers[0].ConnectionStringSecretName, Namespace: mdb.Namespace} + secretNamespacedName := types.NamespacedName{Name: scramUsers[0].ConnectionStringSecretName, Namespace: scramUsers[0].ConnectionStringSecretNamespace} err := c.Get(context.TODO(), secretNamespacedName, &connectionStringSecret) require.NoError(t, err) require.Contains(t, connectionStringSecret.Data, "connectionString.standard") diff --git a/pkg/authentication/authtypes/authtypes.go b/pkg/authentication/authtypes/authtypes.go index 3dfd4a1ef..12d7b0cbb 100644 --- a/pkg/authentication/authtypes/authtypes.go +++ b/pkg/authentication/authtypes/authtypes.go @@ -71,7 +71,6 @@ type User struct { ConnectionStringSecretName string // ConnectionStringSecretNamespace is the namespace of the secret object created by the operator which exposes the connection strings for the user. - // +optional ConnectionStringSecretNamespace string `json:"connectionStringSecretNamespace,omitempty"` // ConnectionStringOptions contains connection string options for this user