Skip to content

Commit

Permalink
Merge pull request #103208 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.1-103191

release-23.1: roachprod: fix regression in propagateDiskLabels
  • Loading branch information
srosenberg committed May 12, 2023
2 parents 1a908d9 + 77a5bd3 commit aecf1f1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/roachprod/vm/gce/gcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -866,15 +866,16 @@ func propagateDiskLabels(
argsPrefix = append(argsPrefix, "--project", project)

for zone, zoneHosts := range zoneToHostNames {
argsPrefix = append(argsPrefix, "--zone", zone)
zoneArg := []string{"--zone", zone}

for _, host := range zoneHosts {
host := host
hostName := host

g.Go(func() error {
args := append([]string(nil), argsPrefix...)
bootDiskArgs := append([]string(nil), argsPrefix...)
bootDiskArgs = append(bootDiskArgs, zoneArg...)
// N.B. boot disk has the same name as the host.
bootDiskArgs := append(args, host)
bootDiskArgs = append(bootDiskArgs, hostName)
cmd := exec.Command("gcloud", bootDiskArgs...)

output, err := cmd.CombinedOutput()
Expand All @@ -886,9 +887,10 @@ func propagateDiskLabels(

if !opts.SSDOpts.UseLocalSSD {
g.Go(func() error {
args := append([]string(nil), argsPrefix...)
persistentDiskArgs := append([]string(nil), argsPrefix...)
persistentDiskArgs = append(persistentDiskArgs, zoneArg...)
// N.B. additional persistent disks are suffixed with the offset, starting at 1.
persistentDiskArgs := append(args, fmt.Sprintf("%s-1", host))
persistentDiskArgs = append(persistentDiskArgs, fmt.Sprintf("%s-1", hostName))
cmd := exec.Command("gcloud", persistentDiskArgs...)

output, err := cmd.CombinedOutput()
Expand Down

0 comments on commit aecf1f1

Please sign in to comment.