Skip to content

Commit

Permalink
roachprod: fix nil pointer panic
Browse files Browse the repository at this point in the history
In cockroachdb#36488 I sloppily snuck in a check to deal with races uploading keys
which I clearly did not test.

Release note: None
  • Loading branch information
ajwerner committed Apr 4, 2019
1 parent 71d2c4c commit 2321108
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 2321108

Please sign in to comment.