-
Notifications
You must be signed in to change notification settings - Fork 151
feat!: support setting the username for the relational database #891
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
feat!: support setting the username for the relational database #891
Conversation
✅ Deploy Preview for kamaji-documentation canceled.
|
First tests look promising. We are base36 encoding the UUIDs we have in our namespaces + cluster names to generate schema+username. |
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.
A small requested change, since we need to set default values as we're doing with the scheme:
kamaji/internal/webhook/handlers/tcp_defaults.go
Lines 75 to 78 in 382d327
if len(tcp.Spec.DataStoreSchema) == 0 { | |
dss := strings.ReplaceAll(fmt.Sprintf("%s_%s", tcp.GetNamespace(), tcp.GetName()), "-", "_") | |
tcp.Spec.DataStoreSchema = dss | |
} |
Overall proposed changes are good, thanks for contributing to Kamaji!
3c3198a
to
3404da9
Compare
3404da9
to
e5ae3b4
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.
Happy to welcome you as a new Kamaji contributor: LGTM, thanks for jumping on this quickly!
default: | ||
// this can only happen on TCP creations when the webhook is not installed | ||
return fmt.Errorf("cannot build datastore storage config, username must either exist in Spec or Status") |
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.
Well done for handling any edge case like this! 👍🏻
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.
Well, it was copy+paste from code handling the schema :-D
I started hitting this after this landed.
using a mostly default Kamaji Helm deployment and etcd. |
Did you update the CRDs? |
Exactly, CRDs must updated: I marked this PR as breaking ( I'm trying to implement an Helm Chart to manage Kamaji CRDs so they can be updated programmatically and avoid these potential "bugs". |
Here's what happened: my cluster nodes come and go a lot, so I think the running Kamaji controller pod got a new version. |
As I said before, Helm doesn't provide a native way to manage CRDs, and using I just proposed a change to manage CRDs natively with #894: in this way, you can manage CRDs in parity with the code. |
fixes #889