Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.2: roachprod: fix regression in propagateDiskLabels #103210

Merged
merged 1 commit into from
May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions pkg/roachprod/vm/gce/gcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,15 +573,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 @@ -593,9 +594,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