Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/cli/dataset_rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ Exit codes:
func runDatasetRm(ctx context.Context, a runDatasetRmArgs) error {
p := a.Printer
p.Banner("tracebloc", "delete a pushed dataset")
p.Para(`This permanently removes a dataset you pushed earlier: it drops the table from
the cluster and deletes the dataset's files on the shared storage. It can't be
undone — re-pushing the data is the only way back.`)

// 1. Validate the name before we build any PVC path from it
// (push.PlanTeardown panics on an unsafe name by design).
Expand Down Expand Up @@ -160,6 +163,7 @@ func runDatasetRm(ctx context.Context, a runDatasetRmArgs) error {
return &exitError{code: 3, err: errors.New(
"refusing to delete without confirmation: pass --yes or run on a terminal")}
}
p.PromptHint("This drops the table and removes the files listed above — there's no undo. Pass --yes next time to skip this prompt.")
ok, err := a.Prompter.Confirm(fmt.Sprintf("Delete %q and its files?", a.Table), false)
if err != nil {
if errors.Is(err, errInteractiveCancelled) {
Expand Down
1 change: 1 addition & 0 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ what's planned next.`,
p.Banner("tracebloc", "declarative data ingestion for your cluster")
p.Section("Get started")
p.Infof("tracebloc dataset push ./data — stage + ingest a dataset (guided if you omit flags)")
p.Infof("tracebloc dataset rm <table> — delete a pushed dataset (its table + files)")
p.Infof("tracebloc cluster info — check the CLI can reach your cluster")
p.Infof("tracebloc ingest validate f.yaml — validate an ingest.yaml locally")
p.Hintf("Add --help to any command for the full flag list.")
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestRootCmd_HomeScreen(t *testing.T) {
if err := root.Execute(); err != nil {
t.Fatalf("bare root failed: %v\n%s", err, out.String())
}
for _, want := range []string{"tracebloc", "dataset push", "cluster info"} {
for _, want := range []string{"tracebloc", "dataset push", "dataset rm", "cluster info"} {
if !strings.Contains(out.String(), want) {
t.Errorf("home screen missing %q:\n%s", want, out.String())
}
Expand Down
Loading