配置上传到nacos

Former-commit-id: f58ef1f91fb197ba9dd88cdd6ba2bd0a8b67d653
This commit is contained in:
张威 2023-05-14 10:46:55 +08:00
parent 8b68433d14
commit d60545db01
3 changed files with 3 additions and 2 deletions

View File

@ -32,4 +32,5 @@ type Config struct {
ModelArtsRpcConf zrpc.RpcClientConf ModelArtsRpcConf zrpc.RpcClientConf
CephRpcConf zrpc.RpcClientConf CephRpcConf zrpc.RpcClientConf
OctopusRpcConf zrpc.RpcClientConf OctopusRpcConf zrpc.RpcClientConf
NexusUrl string
} }

View File

@ -28,7 +28,7 @@ func NewImageListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ImageLi
func (l *ImageListLogic) ImageList() (resp *types.ImageListResp, err error) { func (l *ImageListLogic) ImageList() (resp *types.ImageListResp, err error) {
client := &http.Client{} 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) req, err := http.NewRequest("GET", url, nil)
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -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) { func (l *ImageTagsLogic) ImageTags(req *types.ImageTagsReq) (resp *types.ImageTagsResp, err error) {
client := &http.Client{} 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) httpReq, err := http.NewRequest("GET", url, nil)
if err != nil { if err != nil {
return nil, err return nil, err