Skip to content

Commit

Permalink
fix: [CI-14221]: fix gcp instance name issue (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
devkimittal authored Sep 10, 2024
1 parent 24a37a1 commit 94fc1a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/drivers/google/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,11 @@ func getInstanceName(runner, pool string) string {
namePrefix := strings.ReplaceAll(runner, " ", "")
randStr, _ := randStringRunes(randStrLen)
name := strings.ToLower(fmt.Sprintf("%s-%s-%s-%s", namePrefix, pool, uniuri.NewLen(8), randStr)) //nolint:gomnd
return substrSuffix(name, maxInstanceNameLen)
trimmedName := substrSuffix(name, maxInstanceNameLen)
if trimmedName[0] == '-' {
trimmedName = "d" + trimmedName[1:]
}
return trimmedName
}

func shouldRetry(err error) bool {
Expand Down

0 comments on commit 94fc1a2

Please sign in to comment.