From d60545db018d9d786597cd1b642eb604b8bc6c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A8=81?= <894646498@qq.com> Date: Sun, 14 May 2023 10:46:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=8A=E4=BC=A0=E5=88=B0na?= =?UTF-8?q?cos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: f58ef1f91fb197ba9dd88cdd6ba2bd0a8b67d653 --- adaptor/PCM-CORE/api/internal/config/config.go | 1 + adaptor/PCM-CORE/api/internal/logic/image/imagelistlogic.go | 2 +- adaptor/PCM-CORE/api/internal/logic/image/imagetagslogic.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/adaptor/PCM-CORE/api/internal/config/config.go b/adaptor/PCM-CORE/api/internal/config/config.go index 1a862052..21e0d04c 100644 --- a/adaptor/PCM-CORE/api/internal/config/config.go +++ b/adaptor/PCM-CORE/api/internal/config/config.go @@ -32,4 +32,5 @@ type Config struct { ModelArtsRpcConf zrpc.RpcClientConf CephRpcConf zrpc.RpcClientConf OctopusRpcConf zrpc.RpcClientConf + NexusUrl string } diff --git a/adaptor/PCM-CORE/api/internal/logic/image/imagelistlogic.go b/adaptor/PCM-CORE/api/internal/logic/image/imagelistlogic.go index b9c6faed..cab880f0 100644 --- a/adaptor/PCM-CORE/api/internal/logic/image/imagelistlogic.go +++ b/adaptor/PCM-CORE/api/internal/logic/image/imagelistlogic.go @@ -28,7 +28,7 @@ func NewImageListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ImageLi func (l *ImageListLogic) ImageList() (resp *types.ImageListResp, err error) { client := &http.Client{} - url := fmt.Sprintf("%s/repository/%s/v2/_catalog", "http://10.101.15.175:8081", "pcm") + url := fmt.Sprintf("%s/repository/%s/v2/_catalog", l.svcCtx.Config.NexusUrl, "pcm") req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err diff --git a/adaptor/PCM-CORE/api/internal/logic/image/imagetagslogic.go b/adaptor/PCM-CORE/api/internal/logic/image/imagetagslogic.go index afc4bea5..72484687 100644 --- a/adaptor/PCM-CORE/api/internal/logic/image/imagetagslogic.go +++ b/adaptor/PCM-CORE/api/internal/logic/image/imagetagslogic.go @@ -28,7 +28,7 @@ func NewImageTagsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ImageTa func (l *ImageTagsLogic) ImageTags(req *types.ImageTagsReq) (resp *types.ImageTagsResp, err error) { client := &http.Client{} - url := fmt.Sprintf("%s/repository/%s/v2/%s/tags/list", "http://10.101.15.175:8081", "pcm", req.Name) + url := fmt.Sprintf("%s/repository/%s/v2/%s/tags/list", l.svcCtx.Config.NexusUrl, "pcm", req.Name) httpReq, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err