-
Notifications
You must be signed in to change notification settings - Fork 148
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
K8SPSMDB-1164: Allow creating user with $external database #1690
Merged
+417
−107
Merged
Changes from 12 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
281ea28
Update crds.
inelpandzic 6e85b24
Generate custom user pass.
inelpandzic b91a8a1
Update e2e test.
inelpandzic 2e90cb9
Fix check
inelpandzic f204fad
Remove check
inelpandzic 1780fb8
Log
inelpandzic 5dec493
Fix
inelpandzic b9c3932
Propper pass key.
inelpandzic 579342f
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 1de4b2c
Refactor and fix external db user creation.
inelpandzic 7eeb1ba
Update e2e test.
inelpandzic 75c1edc
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 79d8181
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 0c83355
Update e2e tests.
inelpandzic 0bc1914
Make sure if external DB user is created that we don't handle user
inelpandzic 42e16f1
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 965cc40
Fix custom-users-roles-sharded test.
inelpandzic 5e4d011
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 1c33033
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 5330f06
Order roles for getUser.
inelpandzic 9be37ca
Fix getRole order.
inelpandzic 9a99799
Fix getRole roles order.
inelpandzic a4fa535
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 6ea2dda
Refactor
inelpandzic d05e2e1
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic 6394cce
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic e7ddd29
Merge branch 'main' into K8SPSMDB-1164-external-user-db
inelpandzic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18731,7 +18731,6 @@ spec: | |
type: array | ||
required: | ||
- name | ||
- passwordSecretRef | ||
- roles | ||
type: object | ||
type: array | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19413,7 +19413,6 @@ spec: | |
type: array | ||
required: | ||
- name | ||
- passwordSecretRef | ||
- roles | ||
type: object | ||
type: array | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19413,7 +19413,6 @@ spec: | |
type: array | ||
required: | ||
- name | ||
- passwordSecretRef | ||
- roles | ||
type: object | ||
type: array | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19413,7 +19413,6 @@ spec: | |
type: array | ||
required: | ||
- name | ||
- passwordSecretRef | ||
- roles | ||
type: object | ||
type: array | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
switched to db $external | ||
{ | ||
"_id" : "$external.user-external", | ||
"user" : "user-external", | ||
"db" : "$external", | ||
"roles" : [ | ||
{ | ||
"role" : "clusterAdmin", | ||
"db" : "admin" | ||
}, | ||
{ | ||
"role" : "userAdminAnyDatabase", | ||
"db" : "admin" | ||
} | ||
], | ||
"mechanisms" : [ | ||
"external" | ||
] | ||
} | ||
bye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
switched to db admin | ||
{ | ||
"_id" : "admin.user-gen", | ||
"user" : "user-gen", | ||
"db" : "admin", | ||
"roles" : [ | ||
{ | ||
"role" : "clusterAdmin", | ||
"db" : "admin" | ||
}, | ||
{ | ||
"role" : "userAdminAnyDatabase", | ||
"db" : "admin" | ||
} | ||
], | ||
"mechanisms" : [ | ||
"SCRAM-SHA-1", | ||
"SCRAM-SHA-256" | ||
] | ||
} | ||
bye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19413,7 +19413,6 @@ spec: | |
type: array | ||
required: | ||
- name | ||
- passwordSecretRef | ||
- roles | ||
type: object | ||
type: array | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why we don't create the secret object if user just wants to customize its name. Was it like this in the spec? @spron-in @eleo007
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what do you mean by "user just wants to customize its name", but how this behaves is like this:
passwordSecretRef.name
we will look for that secret. If we don't find it we will fail creating that user.passwordSecretRef.name
, we will create secret{cluster-name}-custom-user-secret
, generate a password for the user and set it by the key named after user name.And yes, I'll add this to the spec as well.