From bdfe3ff6e901eac3da6928c86a571c8c34d4600f Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Fri, 8 Mar 2024 11:12:18 +0800 Subject: [PATCH] minio.Enable is not configured to use MinIO, therefore the image server is not checked --- tools/component/component.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/component/component.go b/tools/component/component.go index 34d3dff6b..0c47cf34a 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -102,6 +102,12 @@ func main() { if !check.flag { err = check.function(check.config) if err != nil { + if check.name == "Minio" { + if errors.Is(err, errMinioNotEnabled) { + fmt.Println("minio.Enable is not configured to use MinIO, therefore the image server is not checked") + checks[index].flag = true + } + } allSuccess = false component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error())) if !strings.Contains(errs.Unwrap(err).Error(), "connection refused") && @@ -125,6 +131,8 @@ func main() { os.Exit(-1) } +var errMinioNotEnabled = errors.New("minio.Enable is not configured to use MinIO") + // checkMongo checks the MongoDB connection without retries func checkMongo(config *config.GlobalConfig) error { mongoStu := &component.Mongo{ @@ -155,7 +163,7 @@ func checkRedis(config *config.GlobalConfig) error { func checkMinio(config *config.GlobalConfig) error { // Check if MinIO is enabled if config.Object.Enable != "minio" { - return errs.Wrap(errors.New("minio.Enable is empty")) + return errs.Wrap(errMinioNotEnabled) } minio := &component.Minio{ ApiURL: config.Object.ApiURL,