Move cimfs OS build compat check

to the operation functions instead of init()

Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
This commit is contained in:
Kirtana Ashok 2024-01-03 16:05:08 -08:00
parent f8b07365d2
commit a8d39666d4
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ func init() {
}
if !cimfs.IsCimFSSupported() {
return nil, fmt.Errorf("host windows version doesn't support CimFS")
return nil, fmt.Errorf("host windows version doesn't support CimFS: %w", plugin.ErrSkipPlugin)
}
ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
return NewCimDiff(md.(*metadata.DB).ContentStore())

View File

@ -70,7 +70,7 @@ func init() {
// NewCimFSSnapshotter returns a new CimFS based windows snapshotter
func NewCimFSSnapshotter(root string) (snapshots.Snapshotter, error) {
if !cimfs.IsCimFSSupported() {
return nil, fmt.Errorf("host windows version doesn't support CimFS")
return nil, fmt.Errorf("host windows version doesn't support CimFS: %w", plugin.ErrSkipPlugin)
}
baseSn, err := newBaseSnapshotter(root)