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

MSSQL allow to define different databases for login an user #192

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

bakito
Copy link
Contributor

@bakito bakito commented Sep 19, 2024

Description of your changes

When a MSSQL user is created in a database other than the master database. The USER needs to created in the dedicated database, but the LOGIN needs to be created in the master database.

This is also mentioned here: #158 (comment)

This pull request adds the possibility to define an additional database, where the login object is created in.
The already existing database fields are used for the user statements.

If the newly introduced loginDatabase is not set, the database field is used for both operations as before.

Fixes #158

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

The application was built and deployed in an existing cluster. Where the User rewource was configured to use the loginDatabase: master and databaseRef that is pointing to a Database resource.

apiVersion: mssql.sql.crossplane.io/v1alpha1
kind: User
metadata:
  name: sql-example-user
spec:
  forProvider:
    loginDatabase: master
    databaseRef:
      name: test-db
    passwordSecretRef:
      key: password
      name: sql-example-user-pw
      namespace: crossplane-system
  writeConnectionSecretToRef:
    name: sql-example-user-connection-secret
    namespace: crossplane-system

Signed-off-by: bakito <github@bakito.ch>
@bakito
Copy link
Contributor Author

bakito commented Nov 3, 2024

@turkenh sorry to bother you, but who can review this PR?

@bakito
Copy link
Contributor Author

bakito commented Nov 28, 2024

@Duologic thank you for approving the pipeline. I updated the branch to hopefully also get the publish-artifacts action become green.

Could you please re-approve the pipelines to run?

thx

@Duologic Duologic merged commit 414c206 into crossplane-contrib:master Nov 28, 2024
7 checks passed
@bakito bakito deleted the login-db branch November 28, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSSQL database user
2 participants