cmd/coordinator: don't use underscores in GCE VM names

We want them in our host keys, but GCE doesn't accept them, so
normalize them to dashes.

Fixes golang/go#22905

Change-Id: I1136eea50483db0adccc289f0f133ab3b0458cb7
Reviewed-on: https://go-review.googlesource.com/80299
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-11-28 18:19:17 +00:00
Родитель ecb2bc44b4
Коммит 6a84aa6258
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -297,6 +297,7 @@ func (p *gceBuildletPool) GetBuildlet(ctx context.Context, hostType string, lg l
}
instName := "buildlet-" + strings.TrimPrefix(hostType, "host-") + "-rn" + randHex(7)
instName = strings.Replace(instName, "_", "-", -1) // Issue 22905; can't use underscores in GCE VMs
p.setInstanceUsed(instName, true)
gceBuildletSpan := lg.CreateSpan("create_gce_buildlet", instName)