Merge pull request #123659 from dims/check-length-of-instance-name-before-truncating
Check length of instance name before truncating
This commit is contained in:
commit
d756b0a1c0
@ -646,8 +646,11 @@ func (g *GCERunner) imageToInstanceName(imageConfig *internalGCEImage) string {
|
|||||||
// different machine types with the same image in parallel
|
// different machine types with the same image in parallel
|
||||||
name := 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
|
// Sometimes the image is too long, we need instance names to have a max length of 63
|
||||||
|
if len(name) > 63 {
|
||||||
return name[:63]
|
return name[:63]
|
||||||
}
|
}
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
func (g *GCERunner) registerGceHostIP(host string) error {
|
func (g *GCERunner) registerGceHostIP(host string) error {
|
||||||
instance, err := getGCEInstance(host)
|
instance, err := getGCEInstance(host)
|
||||||
|
Loading…
Reference in New Issue
Block a user