Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDP-186802: Add connection string options #1324

Merged
merged 13 commits into from
Jul 10, 2023

Conversation

lucian-tosa
Copy link
Contributor

Example:

  apiVersion: mongodbcommunity.mongodb.com/v1
  kind: MongoDBCommunity
  metadata:
    name: example-mongodb
  spec:
    members: 3
    type: ReplicaSet
    version: "6.0.5"
    security:
      authentication:
        modes: ["SCRAM"]
    users:
      - name: my-user
        db: admin
        passwordSecretRef:
          name: my-user-password
        roles:
          - name: clusterAdmin
            db: admin
          - name: userAdminAnyDatabase
            db: admin
        scramCredentialsSecretName: my-scram
        additionalConnectionStringConfig:
          readPreference: secondary
    additionalMongodConfig:
      storage.wiredTiger.engineConfig.journalCompressor: zlib
    additionalConnectionStringConfig:
      readPreference: primary
  • In this example, the connection string for my-user will have as a connection string option readPreference=secondary by overriding the resource option.
  • Any options included will not be validated and using the connection strings with incorrect options will fail.

Closes #1134

All Submissions:

  • Have you opened an Issue before filing this PR?
  • Have you signed our CLA?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

@lucian-tosa lucian-tosa marked this pull request as ready for review July 4, 2023 15:10
@lucian-tosa lucian-tosa marked this pull request as draft July 4, 2023 15:16
@lucian-tosa lucian-tosa marked this pull request as ready for review July 4, 2023 17:36
@lucian-tosa lucian-tosa self-assigned this Jul 4, 2023
@lucian-tosa lucian-tosa added the go Pull requests that update Go code label Jul 4, 2023
Copy link
Collaborator

@slaskawi slaskawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few questions and a suggestion but overall - great work 💪 LGTM!

api/v1/mongodbcommunity_types.go Show resolved Hide resolved
api/v1/mongodbcommunity_types.go Show resolved Hide resolved
api/v1/mongodbcommunity_types_test.go Outdated Show resolved Hide resolved
@slaskawi
Copy link
Collaborator

slaskawi commented Jul 6, 2023 via email

Copy link
Member

@mircea-cosbuc mircea-cosbuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work

@lucian-tosa lucian-tosa merged commit 9e4e2a5 into master Jul 10, 2023
50 checks passed
@lucian-tosa lucian-tosa deleted the add-connection-string-options branch July 10, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional flags to autogenerated connection string
3 participants