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
24 changes: 21 additions & 3 deletions cli/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,19 @@ func runDeploy(cmd *cobra.Command, args []string) error {
// Full for a cluster admin, who the wizard also lets pick admin-less.
// Anyone else is offered the admin-less stack (deploy_adminless.go)
// rather than walked into a refusal halfway through.
// The platform line comes first, before the first question.
account := "admin-less profile (--adminless)"
if !deployAdminless {
admin, ok := clusterAdminFn(context.Background())
switch {
case ok && admin:
account = "cluster admin"
case ok:
account = "not cluster admin"
default:
account = "cluster admin not confirmed"
}
printPlatform(target, account)
if ok && admin && wizard {
if err := profileFormFn(); err != nil {
return err
Expand All @@ -233,6 +244,8 @@ func runDeploy(cmd *cobra.Command, args []string) error {
}
deployAdminless = true
}
} else {
printPlatform(target, account)
}
if deployAdminless {
if err := applyAdminlessProfile(context.Background(), cmd); err != nil {
Expand Down Expand Up @@ -329,7 +342,6 @@ func runDeploy(cmd *cobra.Command, args []string) error {
output.Error(fmt.Sprintf("Introspection failed: %v", err))
return err
}
PrintPhaseItem(fmt.Sprintf("Platform: %s (%s)", report.Provider, report.ProviderBasis))
}

// ── Versions and scope ───────────────────────────────────────────────
Expand Down Expand Up @@ -443,7 +455,7 @@ func runDeploy(cmd *cobra.Command, args []string) error {
var p *tea.Program
if isTesting {
p = tea.NewProgram(dashboard, tea.WithoutRenderer(), tea.WithInput(nil))
} else if IsInteractive() {
} else if IsInteractive() && !accessibleUI() {
p = tea.NewProgram(dashboard, tea.WithAltScreen())
}
dl = &DashboardController{p: p}
Expand Down Expand Up @@ -503,7 +515,13 @@ func runDeploy(cmd *cobra.Command, args []string) error {
}()

if p != nil {
if _, err := p.Run(); err != nil {
final, err := p.Run()
// The window is gone: what the deploy still says goes to the terminal.
dl.closed.Store(true)
if m, ok := final.(deployDashboardModel); ok && m.interrupted {
output.Warn("Deploy window closed; the deploy goes on and prints below. Ctrl-C again stops kates, which can leave a Helm release half-applied.")
}
if err != nil {
// The dashboard is cosmetic; the deploy goroutine is real work.
// Returning here used to orphan it mid-helm — the process exited
// while installs were in flight, leaving releases half-applied.
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/deploy_adminless.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func runProfileForm() error {
huh.NewOption("Admin-less — Kafka, Connect, MirrorMaker 2, Apicurio, Kafka UI, Kates; no chaos engineering", true),
).
Value(&deployAdminless),
)).WithTheme(ThemeKates()).Run()
)).WithTheme(ThemeKates()).WithAccessible(accessibleUI()).Run()
}

// The flags the profile leaves out: each installs something cluster-scoped.
Expand Down
Loading
Loading