From 7d0b73e452c95ac82d29e853e83423bf1437ea54 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Mon, 28 Jul 2025 18:57:01 -0600 Subject: [PATCH] Address copilot review from #1945 Signed-off-by: Jonathon Anderson --- internal/pkg/overlay/overlay.go | 6 +++--- internal/pkg/warewulfd/api/overlay.go | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/pkg/overlay/overlay.go b/internal/pkg/overlay/overlay.go index 433b424a..0365c47b 100644 --- a/internal/pkg/overlay/overlay.go +++ b/internal/pkg/overlay/overlay.go @@ -66,7 +66,7 @@ func (overlay Overlay) Rootfs() string { // // Returns: // - The full path to the specified file in the overlay's rootfs. -// If the specified path does not exist in the overlay, the empty string is returned. +// If the specified path is not contained within the overlay, the empty string is returned. func (overlay Overlay) File(filePath string) string { rootfs := overlay.Rootfs() fullPath := path.Join(rootfs, filePath) @@ -122,7 +122,7 @@ func (overlay Overlay) AddFile(filePath string, content []byte, parents bool, fo if err != nil { return fmt.Errorf("failed to clone distribution overlay '%s' to site overlay: %w", overlay.Name(), err) } - // replace the overlay with newly creatd siteOverlay + // replace the overlay with newly created siteOverlay overlay = siteOverlay } @@ -168,7 +168,7 @@ func (overlay Overlay) DeleteFile(filePath string, force, cleanup bool) error { if err != nil { return fmt.Errorf("failed to clone distribution overlay '%s' to site overlay: %w", overlay.Name(), err) } - // replace the overlay with newly creatd siteOverlay + // replace the overlay with newly created siteOverlay overlay = siteOverlay } diff --git a/internal/pkg/warewulfd/api/overlay.go b/internal/pkg/warewulfd/api/overlay.go index ea01981e..ee8126fb 100644 --- a/internal/pkg/warewulfd/api/overlay.go +++ b/internal/pkg/warewulfd/api/overlay.go @@ -302,9 +302,6 @@ func addOverlayFile() usecase.Interactor { if input.Path == "" { return status.Wrap(fmt.Errorf("must specify a path"), status.InvalidArgument) } - if input.Content == "" { - return status.Wrap(fmt.Errorf("content should not be empty"), status.InvalidArgument) - } if relPath, err := url.QueryUnescape(input.Path); err != nil { return fmt.Errorf("failed to decode path: %v: %w", input.Path, err) } else {