Answer architecture round 11: a source states its mount in a field its manifest, its labels and its file reads share, so the mount can come before or after the manifest; the README says a stand-in for the places is a record with a format
This commit is contained in:
@@ -35,7 +35,7 @@ func (s Source) Manifest() (Manifest, error) {
|
||||
if err := s.check(); err != nil {
|
||||
return Manifest{}, err
|
||||
}
|
||||
b, err := fs.ReadFile(s.fsys, ManifestFile)
|
||||
b, err := fs.ReadFile(s.fsys, path.Join(s.at, ManifestFile))
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
return Manifest{}, nil
|
||||
}
|
||||
@@ -50,12 +50,7 @@ func (s Source) Manifest() (Manifest, error) {
|
||||
}
|
||||
|
||||
// ManifestPath is the manifest's path as errors name it.
|
||||
func (s Source) ManifestPath() string {
|
||||
if m, isMounted := s.fsys.(mounted); isMounted {
|
||||
return s.labelled(path.Join(m.at, ManifestFile))
|
||||
}
|
||||
return s.labelled(ManifestFile)
|
||||
}
|
||||
func (s Source) ManifestPath() string { return s.labelled(path.Join(s.at, ManifestFile)) }
|
||||
|
||||
// decodeManifest decodes a manifest, refusing any key or shape it does not define, and
|
||||
// reports every mistake: first each entry's own, in path order, then each parent naming
|
||||
|
||||
Reference in New Issue
Block a user