-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Truncate UI service name if over 63 characters #2311
base: master
Are you sure you want to change the base?
Truncate UI service name if over 63 characters #2311
Conversation
Signed-off-by: Jacob Salway <[email protected]>
60bb78d
to
af3400d
Compare
/assign @ChenYi015 @ImpSy |
|
||
// Truncate the name and append a hash to ensure uniqueness while staying below the limit | ||
hash := fmt.Sprintf("%x", md5.Sum([]byte(preferredName))) | ||
return fmt.Sprintf("%s-%s-ui-svc", app.Name[:47], hash[:8]) | ||
} | ||
|
||
func GetDefaultUIIngressName(app *v1beta2.SparkApplication) string { |
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 should do the same for this function
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.
Done
} | ||
|
||
// Truncate the name and append a hash to ensure uniqueness while staying below the limit | ||
hash := fmt.Sprintf("%x", md5.Sum([]byte(preferredName))) |
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.
wdyt about reusing the first 8 character from the submissionID (app.Status.SubmissionID
) instead ?
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 a bad idea either as that's a UUID. Truncating the name and appending its hash was the first approach that came to mind as I've seen it in other systems/software for truncation.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Jacob Salway <[email protected]>
94ba78b
to
4719b0c
Compare
Purpose of this PR
Truncate the UI service name while appending a hash to ensure uniqueness if longer than 63 characters.
Close #2300
Change Category
Checklist