Skip to content

Commit

Permalink
Merge pull request kubernetes#123659 from dims/check-length-of-instan…
Browse files Browse the repository at this point in the history
…ce-name-before-truncating

Check length of instance name before truncating
  • Loading branch information
k8s-ci-robot committed Mar 4, 2024
2 parents ee5eca2 + c61b2a3 commit d756b0a
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 d756b0a

Please sign in to comment.