-
Notifications
You must be signed in to change notification settings - Fork 203
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
Support user specified MySQLServer secrets #1625
Conversation
d804ee2
to
f3b7fd5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1625 +/- ##
==========================================
+ Coverage 64.65% 66.61% +1.96%
==========================================
Files 203 204 +1
Lines 12696 14760 +2064
==========================================
+ Hits 8209 9833 +1624
- Misses 3760 4170 +410
- Partials 727 757 +30
Continue to review full report at Codecov.
|
a65f826
to
090cddd
Compare
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.
Looks good, only minor comments.
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.
This looks great. I wonder whether there's a way to have a change to the secret trigger a reconcile?
if len(instance.Spec.ReplicaProperties.SourceServerId) == 0 { | ||
instance.Status.Message = "Replica requested but source server unspecified" | ||
return true, nil | ||
} | ||
} | ||
|
||
adminCreds, err := m.GetUserProvidedAdminCredentials(ctx, instance) |
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.
Should we make this resource reconcile when the secret is updated? Are people going to expect the user details to be updated in that case? (Is updating the credentials like that supported in ARM?)
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.
We probably should, yes. It's a bit of feature creep because we didn't support rolling credentials before (since the user couldn't specify them). I was thinking to avoid it as part of this PR based on the "feature creep" logic but probably should do better.
I'll look into implementing this but may do it as a separate PR as it'll have another set of tests ensuring that the update actually works, and the actual watching of that secret may add some complexity.
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've filed #1634 - will follow up with a separate PR tackling that.
- The specified secret must be a Kubernetes secret. - The specified secret must contain a "username" and "password" field. - The specified secret must be in the same namespace as the MySQLServer. - If the specified secret doesn't exist, reconciliation will be blocked until the secret does exist. Once the secret is created, reconciliation will continue as normal. - The operator does not make the user specified secret owned by the MySQLServer. - The operator still creates a secret containing connection string details and username/password for the server. This secret is named as it was before. This means that the customer specified username and password are consumed to create this secret, but other resources such as MySQLUser still consume the generated secret file.
090cddd
to
4b696e4
Compare
Closes #1590
until the secret does exist. Once the secret is created, reconciliation
will continue as normal.
the MySQLServer.
and username/password for the server. This secret is named as it was
before. This means that the customer specified username and password
are consumed to create this secret, but other resources such as MySQLUser
still consume the generated secret file.
If applicable: