From 515f497e6d5c0a102f913693fc8d4ed5eefd4ebb Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Mon, 10 Jun 2024 11:15:03 -0700 Subject: [PATCH] fix: skip removing layers that no longer exist --- server/manifest.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/manifest.go b/server/manifest.go index d0675724..61dd1ab4 100644 --- a/server/manifest.go +++ b/server/manifest.go @@ -3,6 +3,7 @@ package server import ( "crypto/sha256" "encoding/json" + "errors" "fmt" "io" "log/slog" @@ -43,7 +44,9 @@ func (m *Manifest) Remove() error { func (m *Manifest) RemoveLayers() error { for _, layer := range append(m.Layers, m.Config) { - if err := layer.Remove(); err != nil { + if err := layer.Remove(); errors.Is(err, os.ErrNotExist) { + slog.Debug("layer does not exist", "digest", layer.Digest) + } else if err != nil { return err } }