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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bakito
Copy link

@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

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
1 participant