Skip to content

Commit e81a040

Browse files
committed
roachtest: add reset to cluster interface
Previously, the reset command was only available via the roachprod CLI. This change adds the reset command to the cluster interface. Epic: None Release note: None
1 parent daa6733 commit e81a040

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

pkg/cmd/roachtest/cluster.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,6 +1852,12 @@ func (c *clusterImpl) doDestroy(ctx context.Context, l *logger.Logger) <-chan st
18521852
return ch
18531853
}
18541854

1855+
func (c *clusterImpl) Reset(
1856+
ctx context.Context, l *logger.Logger, nodes option.NodeListOption,
1857+
) error {
1858+
return roachprod.Reset(l, c.MakeNodes(nodes))
1859+
}
1860+
18551861
func (c *clusterImpl) addLabels(labels map[string]string) error {
18561862
// N.B. we must sanitize the values; e.g., some test names can exceed the maximum length (63 chars in GCE).
18571863
// N.B. we don't sanitize the keys; unlike values, they are typically _not_ (dynamically) generated.

pkg/cmd/roachtest/cluster/cluster_interface.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ type Cluster interface {
160160
) error
161161
PopulateEtcHosts(ctx context.Context, l *logger.Logger) error
162162

163+
// VM management
164+
165+
Reset(ctx context.Context, l *logger.Logger, nodes option.NodeListOption) error
166+
163167
// Methods whose inclusion on this interface is purely historical.
164168
// These should be removed over time.
165169

pkg/cmd/roachtest/clusterstats/mock_cluster_generated_test.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)