Skip to content

Commit 9321e79

Browse files
committed
fix(up): keep managed ssh forwards after command exit
1 parent f64dab1 commit 9321e79

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

internal/cli/up.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,6 @@ func newUpCmd(opts *Options) *cobra.Command {
117117
stopMaintenance := startSessionMaintenanceWithClient(k, cfg, ns, sn, cmd.OutOrStdout(), true, true)
118118
defer stopMaintenance()
119119

120-
stopBackgrounds := make([]func(), 0, 1)
121-
defer func() {
122-
for _, stop := range stopBackgrounds {
123-
stop()
124-
}
125-
}()
126-
127120
if cfg.Spec.SSH.LocalPort > 0 && cfg.Spec.SSH.RemotePort > 0 {
128121
keyPath, keyErr := defaultSSHKeyPath(cfg)
129122
if keyErr != nil {
@@ -139,7 +132,6 @@ func newUpCmd(opts *Options) *cobra.Command {
139132
} else if err := startManagedSSHForward(alias); err != nil {
140133
fmt.Fprintf(cmd.ErrOrStderr(), "warning: failed to start managed SSH/port-forwards: %v\n", err)
141134
} else {
142-
stopBackgrounds = append(stopBackgrounds, func() { _ = stopManagedSSHForward(alias) })
143135
if len(cfg.Spec.Ports) > 0 {
144136
fmt.Fprintf(cmd.OutOrStdout(), "Background SSH tunnel + port-forwards active via %s\n", alias)
145137
} else {

0 commit comments

Comments
 (0)