Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
irajdeep committed Jan 15, 2024
1 parent b949ee6 commit 16d2c45
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 33 deletions.
29 changes: 0 additions & 29 deletions api/v1/mongodbcommunity_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions controllers/replicaset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion pkg/authentication/authtypes/authtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16d2c45

Please sign in to comment.