Recommended refactors

- make sure spec sets new cache dir
- move clean out of api
- capture warewulfconf.Paths.Cachedir+"/warewulf" in once place
- split Clean() into multiple functions
- remove WriteFileAbs

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-10-25 17:46:42 -06:00
parent ff84974506
commit fbd5ca9895
11 changed files with 54 additions and 64 deletions

View File

@@ -16,7 +16,7 @@ import (
)
func ImportDocker(uri string, name string, sCtx *types.SystemContext) error {
OciBlobCacheDir := path.Join(warewulfconf.Get().Paths.Cachedir + "/warewulf")
OciBlobCacheDir := warewulfconf.Get().Paths.OciBlobCachedir()
err := os.MkdirAll(OciBlobCacheDir, 0755)
if err != nil {