Apply garage layout prior to putting bootstrap

This commit is contained in:
Brian Picciano 2022-11-15 20:11:47 +01:00
parent b1fa3be970
commit 877e519821

View File

@ -136,19 +136,6 @@ func runDaemonPmuxOnce(
return bootstrap.Bootstrap{}, fmt.Errorf("waiting for nebula/garage to start up: %w", err) return bootstrap.Bootstrap{}, fmt.Errorf("waiting for nebula/garage to start up: %w", err)
} }
err = doOnce(ctx, func(ctx context.Context) error {
if err := hostBootstrap.PutGarageBoostrapHost(ctx); err != nil {
logger.Error(ctx, "updating host info in garage", err)
return err
}
return nil
})
if err != nil {
return bootstrap.Bootstrap{}, fmt.Errorf("updating host info in garage: %w", err)
}
if len(daemonConfig.Storage.Allocations) > 0 { if len(daemonConfig.Storage.Allocations) > 0 {
err := doOnce(ctx, func(ctx context.Context) error { err := doOnce(ctx, func(ctx context.Context) error {
@ -165,6 +152,19 @@ func runDaemonPmuxOnce(
} }
} }
err = doOnce(ctx, func(ctx context.Context) error {
if err := hostBootstrap.PutGarageBoostrapHost(ctx); err != nil {
logger.Error(ctx, "updating host info in garage", err)
return err
}
return nil
})
if err != nil {
return bootstrap.Bootstrap{}, fmt.Errorf("updating host info in garage: %w", err)
}
ticker := time.NewTicker(3 * time.Minute) ticker := time.NewTicker(3 * time.Minute)
defer ticker.Stop() defer ticker.Stop()