Merge pull request #123652 from dims/ensure-gcp-instance-names-are-a-max-of-63-characters

Ensure GCP instance names are a max of 63 characters
This commit is contained in:
Kubernetes Prow Robot 2024-03-03 11:58:53 -08:00 committed by GitHub
commit ccb5dd3b57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -644,7 +644,9 @@ func (g *GCERunner) imageToInstanceName(imageConfig *internalGCEImage) string {
}
// For benchmark test, node name has the format 'machine-image-uuid' to run
// different machine types with the same image in parallel
return imageConfig.machine + "-" + imageConfig.image + "-" + uuid.New().String()[:8]
name := imageConfig.machine + "-" + imageConfig.image + "-" + uuid.New().String()[:8]
// Sometimes the image is too long, we need instance names to have a max length of 63
return name[:63]
}
func (g *GCERunner) registerGceHostIP(host string) error {