mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-13 01:13:40 +08:00
Changing length check.
This commit is contained in:

committed by
rushtehrani

parent
68e7b6b10f
commit
2a88ff8234
@@ -9,7 +9,7 @@ import (
|
||||
func GenerateK8sValidName(input string) (string, error) {
|
||||
re, _ := regexp.Compile(`[^a-zA-Z0-9-]{1,}`)
|
||||
cleanUp := strings.ToLower(re.ReplaceAllString(input, `-`))
|
||||
if len(cleanUp) > 63 {
|
||||
if len(cleanUp) > 30 {
|
||||
return "", errors.New("Length of string exceeds 63, invalid for k8s.")
|
||||
}
|
||||
return strings.ToLower(re.ReplaceAllString(input, `-`)), nil
|
||||
|
Reference in New Issue
Block a user