@@ -349,10 +349,19 @@ func startup(ctx context.Context, s *state.State, t *tui.TUI) error { //nolint:r
349349 return err
350350 }
351351
352+ // Sometimes the system may not be able to immediately check the provider for any updates.
353+ // One such example is when Operations Center is installed and the underlying IncusOS system
354+ // is registered to it as the provider. We need to wait until the Operations Center
355+ // application has started, otherwise any update check will fail.
356+ delayInitialUpdateCheck , err := checkDelayInitialUpdate (ctx , s )
357+ if err != nil {
358+ return err
359+ }
360+
352361 // Perform network configuration.
353362 slog .InfoContext (ctx , "Bringing up the network" )
354363
355- err = systemd .ApplyNetworkConfiguration (ctx , s , s .System .Network .Config , 30 * time .Second , s .OS .SuccessfulBoot , providers .Refresh )
364+ err = systemd .ApplyNetworkConfiguration (ctx , s , s .System .Network .Config , 30 * time .Second , s .OS .SuccessfulBoot , providers .Refresh , delayInitialUpdateCheck )
356365 if err != nil {
357366 return err
358367 }
@@ -397,15 +406,6 @@ func startup(ctx context.Context, s *state.State, t *tui.TUI) error { //nolint:r
397406 return err
398407 }
399408
400- // Sometimes the system may not be able to immediately check the provider for any updates.
401- // One such example is when Operations Center is installed and the underlying IncusOS system
402- // is registered to it as the provider. We need to wait until the Operations Center
403- // application has started, otherwise any update check will fail.
404- delayInitialUpdateCheck , err := checkDelayInitialUpdate (ctx , s )
405- if err != nil {
406- return err
407- }
408-
409409 if ! delayInitialUpdateCheck {
410410 // Perform an initial blocking check for updates before proceeding.
411411 updateChecker (ctx , s , t , p , true , false )
0 commit comments