Generate content of metadata.name and introduce display name #290
Labels
No labels
API
Billing
UI/UX
dependencies
bug
change
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
servala/servala-portal#290
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stories
As the control plane, I want to have unique resource names
Implementation Notes
We currently directly allow the portal user to set the content of
metadata.name. This is a very crucial field in the control-plane and it's immutable. To increase the system stability and prevent bad naming, we will generate this value now and let the user set a display name.metadata.nameServiceInstancemodel; this is used to work with the resource in the control-planeServiceInstancemodel as the display name.servala.com/displayNameName generation
Input read: https://gnugat.github.io/2018/06/15/short-identifier.html
We could use plain old UUID, but this is not human friendly for the poor ops guy for debugging in the middle of the night on the control plane.
Proposal: Do a SHA256 on the name used when creating the service instance and use the first 8 characters of the SHA sum. Alternative: Use https://github.com/hnimminh/human-readable-id
Generate content of metadata.nameto Generate content of metadata.name and introduce display nameI think this is a good call. We could additionally use some (hard-coded in the project settings, maybe) prefix/suffix, so that it's always clear that you're looking at an instance ID when passing one around? I really like how the Stripe API prefixes all their IDs so that it's clear what is currently being referred to (e.g. in their API, event IDs are always
evt_LONG_ID, etc).Yes, let's do it that way. Use a dash
-for separation.To not cause any collisions, we also need to take the organization name into consideration when calculating the hash:
sha256($instanceName+$organizationName)Do we enforce per-organisation uniqueness on display names?
Per service type, yes. Different services can have the same name.