mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
Merge pull request #6892 from zexi/hotfix/ignore-etcd-not-found-error
ignore common etcd endpoint not found error
This commit is contained in:
@@ -43,6 +43,7 @@ import (
|
||||
_ "yunion.io/x/onecloud/pkg/compute/storagedrivers"
|
||||
_ "yunion.io/x/onecloud/pkg/compute/tasks"
|
||||
"yunion.io/x/onecloud/pkg/controller/autoscaling"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
_ "yunion.io/x/onecloud/pkg/multicloud/loader"
|
||||
)
|
||||
|
||||
@@ -180,6 +181,9 @@ func initDefaultEtcdClient(opts *common_options.DBOptions) error {
|
||||
func initEtcdLockOpts(opts *options.ComputeOptions) error {
|
||||
etcdEndpoint, err := app_common.FetchEtcdServiceInfo()
|
||||
if err != nil {
|
||||
if errors.Cause(err) == httperrors.ErrNotFound {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "fetch etcd service info")
|
||||
}
|
||||
if etcdEndpoint != nil {
|
||||
|
||||
@@ -43,6 +43,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/hostman/storageman/diskhandlers"
|
||||
"yunion.io/x/onecloud/pkg/hostman/storageman/storagehandler"
|
||||
"yunion.io/x/onecloud/pkg/hostman/system_service"
|
||||
"yunion.io/x/onecloud/pkg/httperrors"
|
||||
"yunion.io/x/onecloud/pkg/util/procutils"
|
||||
"yunion.io/x/onecloud/pkg/util/sysutils"
|
||||
)
|
||||
@@ -170,6 +171,9 @@ func (host *SHostService) initHandlers(app *appsrv.Application) {
|
||||
func (host *SHostService) initEtcdConfig() error {
|
||||
etcdEndpoint, err := app_common.FetchEtcdServiceInfo()
|
||||
if err != nil {
|
||||
if errors.Cause(err) == httperrors.ErrNotFound {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "fetch etcd service info")
|
||||
}
|
||||
if etcdEndpoint == nil {
|
||||
|
||||
Reference in New Issue
Block a user