From ca61494297aac5788fa14667eb6914f2bf64d8d0 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Sun, 19 Jan 2025 14:27:22 -0700 Subject: [PATCH] Change image provision directory to "images" Previous name (before #1641) was "container." New name (from #1641) was "image" but a plural name seems better. Signed-off-by: Jonathon Anderson --- internal/app/wwctl/image/copy/main_test.go | 2 +- internal/app/wwctl/image/exec/main_test.go | 12 ++++++------ internal/pkg/image/config.go | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/app/wwctl/image/copy/main_test.go b/internal/app/wwctl/image/copy/main_test.go index 9784a12c..fb0b77ac 100644 --- a/internal/app/wwctl/image/copy/main_test.go +++ b/internal/app/wwctl/image/copy/main_test.go @@ -28,6 +28,6 @@ func Test_Copy(t *testing.T) { baseCmd.SetArgs([]string{"-b", "test-image", "test-image-copy"}) err := baseCmd.Execute() assert.NoError(t, err) - assert.FileExists(t, path.Join(env.BaseDir, testenv.WWProvisiondir, "image", "test-image-copy.img")) + assert.FileExists(t, path.Join(env.BaseDir, testenv.WWProvisiondir, "images", "test-image-copy.img")) }) } diff --git a/internal/app/wwctl/image/exec/main_test.go b/internal/app/wwctl/image/exec/main_test.go index 4f7eb3af..ef863f6f 100644 --- a/internal/app/wwctl/image/exec/main_test.go +++ b/internal/app/wwctl/image/exec/main_test.go @@ -82,8 +82,8 @@ func Test_Exec(t *testing.T) { nodeName = "" Build = true SyncUser = false - os.Remove(env.GetPath("/srv/warewulf/image/test.img")) - os.Remove(env.GetPath("/srv/warewulf/image/test.img.gz")) + os.Remove(env.GetPath("/srv/warewulf/images/test.img")) + os.Remove(env.GetPath("/srv/warewulf/images/test.img.gz")) }() cmd := GetCommand() cmd.SetArgs(tt.args) @@ -95,11 +95,11 @@ func Test_Exec(t *testing.T) { assert.NotEmpty(t, out.String()) assert.Contains(t, out.String(), tt.stdout) if tt.build { - assert.FileExists(t, env.GetPath("/srv/warewulf/image/test.img")) - assert.FileExists(t, env.GetPath("/srv/warewulf/image/test.img.gz")) + assert.FileExists(t, env.GetPath("/srv/warewulf/images/test.img")) + assert.FileExists(t, env.GetPath("/srv/warewulf/images/test.img.gz")) } else { - assert.NoFileExists(t, env.GetPath("/srv/warewulf/image/test.img")) - assert.NoFileExists(t, env.GetPath("/srv/warewulf/image/test.img.gz")) + assert.NoFileExists(t, env.GetPath("/srv/warewulf/images/test.img")) + assert.NoFileExists(t, env.GetPath("/srv/warewulf/images/test.img.gz")) } }) } diff --git a/internal/pkg/image/config.go b/internal/pkg/image/config.go index 4b271399..164a74f3 100644 --- a/internal/pkg/image/config.go +++ b/internal/pkg/image/config.go @@ -25,7 +25,7 @@ func RunDir(name string) string { func ImageParentDir() string { conf := warewulfconf.Get() - return path.Join(conf.Paths.WWProvisiondir, "image") + return path.Join(conf.Paths.WWProvisiondir, "images") } func ImageFile(name string) string {