Skip to content

Commit

Permalink
Better detect OCI cached dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Sep 27, 2023
1 parent d6053f7 commit 21b1602
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/fab/cnc/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,14 @@ func (op *SyncOCI) Build(basedir string) error {

skip := true

info, err := os.Stat(path)
info, err := os.Stat(filepath.Join(path, "index.json"))
if os.IsNotExist(err) {
skip = false
slog.Debug("File is missing", "name", path)
} else if err != nil {
return errors.Wrapf(err, "error statting file %s", path)
} else if !info.IsDir() {
return errors.Errorf("dir expected but file found %s", path)
} else if info.IsDir() {
return errors.Errorf("file expected but dir found %s", path)
} else {
slog.Debug("File is present", "name", path)
}
Expand Down

0 comments on commit 21b1602

Please sign in to comment.