Merge pull request #6892 from zexi/hotfix/ignore-etcd-not-found-error

ignore common etcd endpoint not found error
This commit is contained in:
yunion-ci-robot
2020-06-21 11:20:38 +08:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -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 {
+4
View File
@@ -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 {