use GetImageUserInfo

This commit is contained in:
GLYASAI 2020-04-15 19:17:30 +08:00
parent be6d0fe14b
commit fcbb34e3f3

View File

@ -68,11 +68,7 @@ func (e *exectorManager) pluginImageBuild(task *pb.TaskMessage) {
}
func (e *exectorManager) run(t *model.BuildPluginTaskBody, logger event.Logger) error {
hubUser, hubPass := t.ImageInfo.HubUser, t.ImageInfo.HubPassword
if hubUser == "" || hubPass == "" {
hubUser = builder.REGISTRYUSER
hubPass = builder.REGISTRYPASS
}
hubUser, hubPass := builder.GetImageUserInfo(t.ImageInfo.HubUser, t.ImageInfo.HubPassword)
if _, err := sources.ImagePull(e.DockerClient, t.ImageURL, hubUser, hubPass, logger, 10); err != nil {
logrus.Errorf("pull image %v error, %v", t.ImageURL, err)
logger.Error("拉取镜像失败", map[string]string{"step": "builder-exector", "status": "failure"})