diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e82fe7b..320c5eb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remove NodeInfo (in-memory-only) data structure, consolidating onto NodeConf. #916 - Replace `defaults.conf` with settings on the default profile. #917 - Switched from yaml.v2 to yaml.v3 #1462 +- Make OCIBlobCache a seperate path and point it to `/var/cache` #1459 ### Removed diff --git a/Variables.mk b/Variables.mk index 58a895e8..77c8f160 100644 --- a/Variables.mk +++ b/Variables.mk @@ -34,6 +34,7 @@ SYSCONFDIR ?= $(PREFIX)/etc DATADIR ?= $(PREFIX)/share MANDIR ?= $(DATADIR)/man DOCDIR ?= $(DATADIR)/doc +CACHEDIR ?= /var/cache ifeq ($(USE_LSB_PATHS),true) SRVDIR ?= /srv diff --git a/internal/pkg/config/buildconfig.go.in b/internal/pkg/config/buildconfig.go.in index 0b1b3195..e0294117 100644 --- a/internal/pkg/config/buildconfig.go.in +++ b/internal/pkg/config/buildconfig.go.in @@ -6,6 +6,7 @@ type BuildConfig struct { Bindir string `default:"@BINDIR@"` Sysconfdir string `default:"@SYSCONFDIR@"` Localstatedir string `default:"@LOCALSTATEDIR@"` + Cachedir string `default:"@CACHEDIR@"` Ipxesource string `default:"@IPXESOURCE@"` Srvdir string `default:"@SRVDIR@"` Firewallddir string `default:"@FIREWALLDDIR@"` diff --git a/internal/pkg/config/root_test.go b/internal/pkg/config/root_test.go index 4511e47d..7d185fdf 100644 --- a/internal/pkg/config/root_test.go +++ b/internal/pkg/config/root_test.go @@ -16,7 +16,6 @@ func TestDefaultRootConf(t *testing.T) { assert.True(t, conf.Warewulf.AutobuildOverlays) assert.True(t, conf.Warewulf.EnableHostOverlay) assert.False(t, conf.Warewulf.Syslog) - assert.NotEmpty(t, conf.Warewulf.DataStore) assert.True(t, conf.DHCP.Enabled) assert.Equal(t, "default", conf.DHCP.Template) @@ -43,7 +42,6 @@ func TestDefaultRootConf(t *testing.T) { assert.NotEmpty(t, conf.Paths.Bindir) assert.NotEmpty(t, conf.Paths.Sysconfdir) - assert.NotEmpty(t, conf.Warewulf.DataStore) assert.NotEmpty(t, conf.Paths.Localstatedir) assert.NotEmpty(t, conf.Paths.Srvdir) assert.NotEmpty(t, conf.Paths.Firewallddir) @@ -52,6 +50,7 @@ func TestDefaultRootConf(t *testing.T) { assert.NotEmpty(t, conf.Paths.WWChrootdir) assert.NotEmpty(t, conf.Paths.WWProvisiondir) assert.NotEmpty(t, conf.Paths.WWClientdir) + assert.NotEmpty(t, conf.Paths.Cachedir) } func TestInitializedFromFile(t *testing.T) { diff --git a/internal/pkg/container/imprt.go b/internal/pkg/container/imprt.go index e1ae82b0..80c7848e 100644 --- a/internal/pkg/container/imprt.go +++ b/internal/pkg/container/imprt.go @@ -16,7 +16,7 @@ import ( ) func ImportDocker(uri string, name string, sCtx *types.SystemContext) error { - OciBlobCacheDir := warewulfconf.Get().Warewulf.DataStore + "/oci" + OciBlobCacheDir := path.Join(warewulfconf.Get().Paths.Cachedir + "/warewulf") err := os.MkdirAll(OciBlobCacheDir, 0755) if err != nil {