From e33c66ca6c8cc1d2881a56fe617841fecfdffc96 Mon Sep 17 00:00:00 2001 From: luhaoling <2198702716@qq.com> Date: Fri, 2 Feb 2024 20:23:24 +0800 Subject: [PATCH] fix: fix the minio nil error --- pkg/common/discoveryregister/zookeeper/zookeeper.go | 2 +- tools/component/component.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/common/discoveryregister/zookeeper/zookeeper.go b/pkg/common/discoveryregister/zookeeper/zookeeper.go index 0082e9833..9c58807c1 100644 --- a/pkg/common/discoveryregister/zookeeper/zookeeper.go +++ b/pkg/common/discoveryregister/zookeeper/zookeeper.go @@ -45,7 +45,7 @@ func NewZookeeperDiscoveryRegister() (discoveryregistry.SvcDiscoveryRegistry, er openkeeper.WithLogger(log.NewZkLogger()), ) if err != nil { - uriFormat := "address:%s, username :%s, password :%s, schema:%s." + uriFormat := "address:%s, username:%s, password:%s, schema:%s." errInfo := fmt.Sprintf(uriFormat, config.Config.Zookeeper.ZkAddr, config.Config.Zookeeper.Username, diff --git a/tools/component/component.go b/tools/component/component.go index c0f3aebba..bd6007015 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -15,6 +15,7 @@ package main import ( + "errors" "flag" "fmt" "github.com/IBM/sarama" @@ -125,7 +126,7 @@ func checkMinio() error { // Check if MinIO is enabled if config.Config.Object.Enable != "minio" { - return nil + return errs.Wrap(errors.New("minio.Enable is empty")) } minio := &component.Minio{ ApiURL: config.Config.Object.ApiURL,