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
11 changes: 11 additions & 0 deletions cmd/lk/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,17 @@ func dashboardBaseURL() string {
return dashboardURL
}

// viewCommandHint returns the command to re-open a simulation run, carrying
// over --server-url when the run lives somewhere other than the default cloud
// API (e.g. staging), so the printed command targets the same environment.
func viewCommandHint(runID string) string {
hint := "lk agent simulate --view " + runID
if serverURL != cloudAPIServerURL {
hint += " --server-url " + serverURL
}
return hint
}

func simulationDashboardURL(projectID, runID string) string {
if projectID == "" || runID == "" {
return ""
Expand Down
4 changes: 2 additions & 2 deletions cmd/lk/simulate_tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ func runSimulateTUI(config *simulateConfig) error {
}

if m.config.mode == modeView {
fmt.Fprintf(os.Stderr, "To re-open this simulation, run: lk agent simulate --view %s\n", m.config.viewModeRunID)
fmt.Fprintf(os.Stderr, "To re-open this simulation, run: %s\n", viewCommandHint(m.config.viewModeRunID))
} else if m.runID != "" && !m.runFinished {
cancelSimulationRun(config.client, m.runID)
} else if m.runID != "" {
fmt.Fprintf(os.Stderr, "To re-open this simulation, run: lk agent simulate --view %s\n", m.runID)
fmt.Fprintf(os.Stderr, "To re-open this simulation, run: %s\n", viewCommandHint(m.runID))
}

if runErr != nil {
Expand Down
Loading