mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-25 13:33:41 +00:00
bug: Ensure data source is ready during reset (#1310)
Signed-off-by: mudler <mudler@c3os.io>
This commit is contained in:
committed by
Itxaka
parent
936b538cca
commit
e5e595be4c
@@ -64,6 +64,8 @@ func Reset(dir ...string) error {
|
|||||||
lock.Lock()
|
lock.Lock()
|
||||||
args := []string{"reset"}
|
args := []string{"reset"}
|
||||||
|
|
||||||
|
ensureDataSourceReady()
|
||||||
|
|
||||||
bus.Manager.Publish(sdk.EventBeforeReset, sdk.EventPayload{}) //nolint:errcheck
|
bus.Manager.Publish(sdk.EventBeforeReset, sdk.EventPayload{}) //nolint:errcheck
|
||||||
|
|
||||||
optsArgs := optsToArgs(options)
|
optsArgs := optsToArgs(options)
|
||||||
@@ -96,7 +98,9 @@ func Reset(dir ...string) error {
|
|||||||
|
|
||||||
bus.Manager.Publish(sdk.EventAfterReset, sdk.EventPayload{}) //nolint:errcheck
|
bus.Manager.Publish(sdk.EventAfterReset, sdk.EventPayload{}) //nolint:errcheck
|
||||||
|
|
||||||
pterm.Info.Println("Rebooting in 60 seconds, press Enter to abort...")
|
if !agentConfig.Fast {
|
||||||
|
pterm.Info.Println("Rebooting in 60 seconds, press Enter to abort...")
|
||||||
|
}
|
||||||
|
|
||||||
// We don't close the lock, as none of the following actions are expected to return
|
// We don't close the lock, as none of the following actions are expected to return
|
||||||
lock2 := sync.Mutex{}
|
lock2 := sync.Mutex{}
|
||||||
|
Reference in New Issue
Block a user