Skip to content

Commit

Permalink
Check length of instance name before truncating
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
  • Loading branch information
dims committed Mar 3, 2024
1 parent d45d803 commit c61b2a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e_node/remote/gce/gce_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,10 @@ func (g *GCERunner) imageToInstanceName(imageConfig *internalGCEImage) string {
// different machine types with the same image in parallel
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]
if len(name) > 63 {
return name[:63]
}
return name
}

func (g *GCERunner) registerGceHostIP(host string) error {
Expand Down

0 comments on commit c61b2a3

Please sign in to comment.