Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions agent/app/service/app_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,15 @@ func upgradeInstall(req request.AppInstallUpgrade) error {
err = buserr.WithNameAndErr("ErrDockerPullImage", "", err)
return err
}
exist, err := dockerCLi.ImageExists(image)
if err != nil {
err = buserr.WithNameAndErr("ErrDockerPullImage", "", err)
return err
}
if !exist {
err = buserr.WithNameAndErr("ErrDockerPullImage", "", fmt.Errorf("image %s not found", image))
return err
}
t.LogSuccess(i18n.GetMsgByKey("PullImage"))
}
}
Expand Down
6 changes: 6 additions & 0 deletions agent/utils/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ func (c Client) PullImageWithProcessAndOptions(task *task.Task, imageName string
}
return err
}
if msg, ok := progress["errorDetail"]; ok {
return fmt.Errorf("image pull failed, err: %v", msg)
}
if msg, ok := progress["error"]; ok {
return fmt.Errorf("image pull failed, err: %v", msg)
}
status, _ := progress["status"].(string)
if status == "Downloading" || status == "Extracting" {
logProcess(progress, task)
Expand Down
Loading