mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
improve code
This commit is contained in:
@@ -92,8 +92,11 @@ func (rp *remotePuller) Name() string {
|
||||
}
|
||||
|
||||
func (rp *remotePuller) Pull(image string) ([]byte, error) {
|
||||
// TODO(runcom): should we check if the image is already pulled with ImageStatus?
|
||||
_, err := rp.imageService.PullImage(&runtimeapi.ImageSpec{Image: image}, nil)
|
||||
imageStatus, err := rp.imageService.ImageStatus(&runtimeapi.ImageSpec{Image: image})
|
||||
if err == nil && imageStatus != nil {
|
||||
return nil, nil
|
||||
}
|
||||
_, err = rp.imageService.PullImage(&runtimeapi.ImageSpec{Image: image}, nil)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user