Skip to content

Commit

Permalink
ignore common etcd endpoint not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Jun 21, 2020
1 parent 183180e commit e9da102
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/compute/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions pkg/hostman/host_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e9da102

Please sign in to comment.