diff --git a/blob/local_store.go b/blob/local_store.go index 418b154..76f7924 100644 --- a/blob/local_store.go +++ b/blob/local_store.go @@ -109,6 +109,11 @@ func (l *LocalStore) List(ctx context.Context) ([]ID, error) { } for _, binFileEntry := range dir { + if binFileEntry.IsDir() { + // Do not include directories + continue + } + idString, isBin := strings.CutSuffix(binFileEntry.Name(), ".bin") if !isBin { // Do not include files that don't end in .bin diff --git a/integration/singularity/id_map.go b/integration/singularity/id_map.go index faed2e6..f7bac18 100644 --- a/integration/singularity/id_map.go +++ b/integration/singularity/id_map.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "os" - "path" "path/filepath" "strconv" @@ -22,7 +21,7 @@ func newIDMap(dir string) *idMap { } func (im *idMap) path(blobID blob.ID) string { - return path.Join(im.dir, blobID.String()+".id") + return filepath.Join(im.dir, blobID.String()+".id") } // Inserts a blob ID to Singularity ID mapping. @@ -53,7 +52,7 @@ func (im *idMap) insert(blobID blob.ID, singularityID int64) error { // Maps blob ID to Singularity ID. Returns blob.ErrBlobNotFound if no mapping // exists. func (im *idMap) get(blobID blob.ID) (int64, error) { - fileIDString, err := os.ReadFile(filepath.Join(im.dir, blobID.String()+".id")) + fileIDString, err := os.ReadFile(im.path(blobID)) if err != nil { if errors.Is(err, os.ErrNotExist) { return 0, blob.ErrBlobNotFound diff --git a/integration/singularity/store.go b/integration/singularity/store.go index dddb4a4..917b084 100644 --- a/integration/singularity/store.go +++ b/integration/singularity/store.go @@ -421,6 +421,7 @@ func (s *Store) PassGet(w http.ResponseWriter, r *http.Request, id blob.ID) { return } + logger.Errorw("Could not get singularity file ID", "err", err) http.Error(w, "", http.StatusInternalServerError) return }