From 8cb2803dc861508b2bb8b8155a0696130e6eb9e8 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Fri, 10 Mar 2023 08:47:38 -0500 Subject: [PATCH] roachtest: fix clusterImpl.IsLocal() 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 --- pkg/cmd/roachtest/cluster.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/roachtest/cluster.go b/pkg/cmd/roachtest/cluster.go index 70e6320e1d76..214c77793d78 100644 --- a/pkg/cmd/roachtest/cluster.go +++ b/pkg/cmd/roachtest/cluster.go @@ -39,6 +39,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec" "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test" "github.com/cockroachdb/cockroach/pkg/roachprod" + "github.com/cockroachdb/cockroach/pkg/roachprod/config" "github.com/cockroachdb/cockroach/pkg/roachprod/install" "github.com/cockroachdb/cockroach/pkg/roachprod/logger" "github.com/cockroachdb/cockroach/pkg/roachprod/prometheus" @@ -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 {