Skip to content

Commit

Permalink
Merge #36550
Browse files Browse the repository at this point in the history
36550: roachprod: fix nil pointer panic when uploading a key pair r=ajwerner a=ajwerner

In #36488 I sloppily added in a check to deal with races uploading keys which I clearly did not test.

Fixes cause of a skipped AWS test https://teamcity.cockroachdb.com/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=1220242&_focus=4713 from last night. 

Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
craig[bot] and ajwerner committed Apr 4, 2019
2 parents 94a9b8b + 2321108 commit 999bc6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/roachprod/vm/aws/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (p *Provider) sshKeyImport(keyName string, region string) error {
err = p.runJSONCommand(args, &data)
// If two roachprod instances run at the same time with the same key, they may
// race to upload the key pair.
if strings.Contains(err.Error(), "InvalidKeyPair.Duplicate") {
if err == nil || strings.Contains(err.Error(), "InvalidKeyPair.Duplicate") {
return nil
}
return err
Expand Down

0 comments on commit 999bc6c

Please sign in to comment.