fix(host): move the hostInstance.Init() step after InitAuth (#23624)

This commit is contained in:
Zexi Li
2025-10-29 14:00:33 +08:00
committed by GitHub
parent 6a18b70168
commit 002b37f6a1
+5 -5
View File
@@ -88,6 +88,11 @@ func (host *SHostService) RunService() {
log.Fatalf("failed set qemuimg preallocation to %s: %s", options.HostOptions.Qcow2Preallocation, err)
}
app_common.InitAuth(&options.HostOptions.CommonOptions, func() {
log.Infof("Auth complete!!")
})
common_options.StartOptionManager(&options.HostOptions.CommonOptions, options.HostOptions.ConfigSyncPeriodSeconds, "", "", common_options.OnCommonOptionsChange)
hostInstance := hostinfo.Instance()
if err := hostInstance.Init(app.GetContext()); err != nil {
log.Errorf("Host instance init error: %s, wait 3 minutes to retry", err)
@@ -95,11 +100,6 @@ func (host *SHostService) RunService() {
log.Fatalf("Host instance init error: %s, reboot now", err)
}
app_common.InitAuth(&options.HostOptions.CommonOptions, func() {
log.Infof("Auth complete!!")
})
common_options.StartOptionManager(&options.HostOptions.CommonOptions, options.HostOptions.ConfigSyncPeriodSeconds, "", "", common_options.OnCommonOptionsChange)
deployclient.Init(options.HostOptions.DeployServerSocketPath)
if err := storageman.Init(hostInstance); err != nil {
log.Fatalf("Storage manager init error: %v", err)