Skip to content

Commit

Permalink
roachtest: fix clusterImpl.IsLocal()
Browse files Browse the repository at this point in the history
Previously, c.IsLocal() would always return false because local clusters
have a time based suffix. This patch changes c.IsLocal() to return true if the
cluster name is prefixed with "local".

Epic: none

Release note: none
  • Loading branch information
msbutler committed Mar 10, 2023
1 parent 01e14f6 commit 0a4da2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"context"
gosql "database/sql"
"fmt"
"github.com/cockroachdb/cockroach/pkg/roachprod/config"
"io"
"io/fs"
"net"
Expand Down Expand Up @@ -2382,8 +2383,7 @@ func (c *clusterImpl) MakeNodes(opts ...option.Option) string {
}

func (c *clusterImpl) IsLocal() bool {
// FIXME: I think radu made local more flexible and local is a prefix?
return c.name == "local"
return config.IsLocalClusterName(c.name)
}

func (c *clusterImpl) IsSecure() bool {
Expand Down

0 comments on commit 0a4da2f

Please sign in to comment.