@@ -175,41 +175,28 @@ func newUpCmd(opts *Options) *cobra.Command {
175175 }
176176 ui .stepDone ("pod readiness" , "ready" )
177177
178- if err := session .SaveActiveSession (sn ); err != nil {
179- return err
180- }
181- ui .stepDone ("active session" , sn )
182- if err := session .ClearShutdownRequest (sn ); err != nil {
183- ui .warnf ("failed to clear prior shutdown request: %v" , err )
184- }
185-
186178 ui .section ("Setup" )
187179 sshSummary := "disabled"
188180 effectiveSSHPort := sshRemotePortForMode (cfg , sshMode )
189181 if effectiveSSHPort > 0 {
190182 keyPath , keyErr := defaultSSHKeyPath (cfg )
191183 if keyErr != nil {
192- ui .warnf ("failed to resolve SSH key path: %v" , keyErr )
193- sshSummary = "degraded (key path error)"
184+ return fmt .Errorf ("resolve SSH key path: %w" , keyErr )
194185 } else {
195186 if err := ensureSSHKeyOnPod (opts , cfg , ns , pod , keyPath , sshMode ); err != nil {
196- ui .warnf ("failed to setup SSH key in pod: %v" , err )
197- sshSummary = "degraded (key setup failed)"
187+ return fmt .Errorf ("setup SSH key in pod: %w" , err )
198188 }
199- if err := waitForSSHDReady (opts , cfg , ns , pod , sshMode , 20 * time .Second ); err != nil {
200- ui .warnf ("sshd not ready yet: %v" , err )
201- sshSummary = "degraded (sshd not ready)"
189+ if err := waitForSSHDReady (opts , cfg , ns , pod , sshMode , waitTimeout ); err != nil {
190+ return fmt .Errorf ("wait for SSH service: %w" , err )
202191 }
203192 alias := sshHostAlias (sn )
204193 if _ , cfgErr := ensureSSHConfigEntry (alias , sn , ns , cfg .Spec .SSH .User , effectiveSSHPort , keyPath , cfgPath , cfg .Spec .Ports ); cfgErr != nil {
205- ui .warnf ("failed to update ~/.ssh/config: %v" , cfgErr )
206- sshSummary = "degraded (ssh config update failed)"
194+ return fmt .Errorf ("update ~/.ssh/config: %w" , cfgErr )
207195 } else {
208196 // Force-refresh managed master so forward rules are always current after `okdev up`.
209197 _ = stopManagedSSHForward (alias )
210198 if err := startManagedSSHForwardWithForwards (alias , cfg .Spec .Ports , cfg .Spec .SSH ); err != nil {
211- ui .warnf ("failed to start managed SSH/port-forwards: %v" , err )
212- sshSummary = "degraded (managed forward failed)"
199+ return fmt .Errorf ("start managed SSH/port-forwards: %w" , err )
213200 } else {
214201 sshSummary = "ssh " + alias
215202 ui .stepDone ("ssh" , sshSummary )
@@ -223,8 +210,7 @@ func newUpCmd(opts *Options) *cobra.Command {
223210 if cfg .Spec .Sync .Engine == "" || cfg .Spec .Sync .Engine == "syncthing" {
224211 logPath , started , err := startDetachedSyncthingSync (opts , upDefaultSyncMode , sn , ns , cfgPath )
225212 if err != nil {
226- ui .warnf ("failed to start syncthing background sync: %v" , err )
227- syncSummary = "degraded (start failed)"
213+ return fmt .Errorf ("start syncthing background sync: %w" , err )
228214 } else {
229215 syncModeSymbol = modeSymbol (upDefaultSyncMode )
230216 syncPathSummary := syncPairsSummary (syncPairs , syncModeSymbol )
@@ -289,6 +275,13 @@ func newUpCmd(opts *Options) *cobra.Command {
289275 }
290276 }
291277 }
278+ if err := session .SaveActiveSession (sn ); err != nil {
279+ return err
280+ }
281+ ui .stepDone ("active session" , sn )
282+ if err := session .ClearShutdownRequest (sn ); err != nil {
283+ ui .warnf ("failed to clear prior shutdown request: %v" , err )
284+ }
292285
293286 ui .printWarnings ()
294287 ui .printReadyCard (sn , ns , pod , sshSummary , syncSummary , cfg .Spec .Ports , syncPairs , syncModeSymbol )
0 commit comments