specify pod name and hostname in indexed job

Kubernetes-commit: e64e34e0298d27d4099b632f5b7c1ba38fc66561
This commit is contained in:
Mengxue Zhang 2021-04-29 03:33:36 +00:00 committed by Kubernetes Publisher
parent f0b4663d4c
commit 15750850e0
1 changed files with 3 additions and 3 deletions

View File

@ -43,12 +43,12 @@ const (
// TODO: make this flexible for non-core resources with alternate naming rules.
maxNameLength = 63
randomLength = 5
maxGeneratedNameLength = maxNameLength - randomLength
MaxGeneratedNameLength = maxNameLength - randomLength
)
func (simpleNameGenerator) GenerateName(base string) string {
if len(base) > maxGeneratedNameLength {
base = base[:maxGeneratedNameLength]
if len(base) > MaxGeneratedNameLength {
base = base[:MaxGeneratedNameLength]
}
return fmt.Sprintf("%s%s", base, utilrand.String(randomLength))
}