From 07ed69bc37fd147257e9b5fe45492b1323df1d52 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Tue, 25 Jul 2023 10:30:14 -0400 Subject: [PATCH] remove reduandant err var --- server/images.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/images.go b/server/images.go index 9be097d1..370a5e6d 100644 --- a/server/images.go +++ b/server/images.go @@ -738,8 +738,6 @@ func PullModel(name string, regOpts *RegistryOptions, fn func(api.ProgressRespon return nil } -var errModelNotFound = fmt.Errorf("model not found") - func pullModelManifest(mp ModelPath, regOpts *RegistryOptions) (*ManifestV2, error) { url := fmt.Sprintf("%s/v2/%s/manifests/%s", mp.Registry, mp.GetNamespaceRepository(), mp.Tag) headers := map[string]string{ @@ -756,7 +754,7 @@ func pullModelManifest(mp ModelPath, regOpts *RegistryOptions) (*ManifestV2, err // Check for success: For a successful upload, the Docker registry will respond with a 201 Created if resp.StatusCode != http.StatusOK { if resp.StatusCode == http.StatusNotFound { - return nil, errModelNotFound + return nil, fmt.Errorf("model not found") } body, _ := io.ReadAll(resp.Body) return nil, fmt.Errorf("on pull registry responded with code %d: %s", resp.StatusCode, body)