-
Notifications
You must be signed in to change notification settings - Fork 67
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
Allow creation & deletion of users with the operator #29
Conversation
I'm wondering about the secret structure and how it's likely to be used, including potentially conforming to provisioned service secret specification to allow for ducktyping. In particular, I suspect that we would like to have the secret contain both username and password fields (potentially decoupling the resource name from the username). |
This Secret is owned by the User controller, and so is deleted when the User object is deleted. The reference to the Secret is presented in the Status of the User.
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.
See comments. Overall looks good
Question: what would happen if the created credential secret was modified (.data or annotations/labels)? Does that trigger a reconcile() since the controller is watching object? Would you ended up having a newly generated user secret as a result of that? |
What I'd like to happen is it triggers the reconcile, and is treated as the ultimate source of truth. So a new secret is not created, and the password hash of the user is regenerated and updated if the secret data was changed. Having said that, what happens if the data for the username is changed? You then would be left with a User object that is tied to a Secret containing credentials for a different user. Not quite sure how to deal with that just yet. |
The corev1 Secret interface takes the raw fields and stores them as base64-encoded values - there is no need to pre-encode them oneself.
Thanks @ChunyiLyu !
This brings it in line wiht the cluster operator, rather than using standard encoding
This PR allows for the creation & deletion of users. Update of users & their credentials is not currently supported.
TODOs:
- Generate a Secret containing the credentials for the user- We can make the user controller own the generated Secret, so that any updates to it will trigger the User controller to reconcile again- Add a Status to the User object, with a.status.credentials
key pointing to a credentials SecretThis closes #3
Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed