From 968aefd1bf203ee9292cda98607d2e26226db41c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sun, 3 Mar 2024 09:27:36 -0500 Subject: [PATCH] Ensure GCP instance names are a max of 63 characters Signed-off-by: Davanum Srinivas --- test/e2e_node/remote/gce/gce_runner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e_node/remote/gce/gce_runner.go b/test/e2e_node/remote/gce/gce_runner.go index 8e9e7d8ecdb..b3264c2da1d 100644 --- a/test/e2e_node/remote/gce/gce_runner.go +++ b/test/e2e_node/remote/gce/gce_runner.go @@ -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 {