Merge pull request #2131 from anderbubble/docs-omnibus

Documentation improvements omnibus
This commit is contained in:
Christian Goll
2026-03-19 09:06:40 +01:00
committed by GitHub
59 changed files with 1009 additions and 241 deletions

View File

@@ -54,7 +54,7 @@ func getImages() usecase.Interactor {
}
})
u.SetTitle("Get images")
u.SetDescription("Get all node images")
u.SetDescription("Get all OS images")
u.SetTags("Image")
return u
}
@@ -74,7 +74,7 @@ func getImageByName() usecase.Interactor {
}
})
u.SetTitle("Get an image")
u.SetDescription("Get a node image by its name")
u.SetDescription("Get an OS image by its name")
u.SetTags("Image")
return u
}
@@ -110,7 +110,7 @@ func importImage() usecase.Interactor {
}
})
u.SetTitle("Import an image")
u.SetDescription("Import a node image from an OCI registry")
u.SetDescription("Import an OS image from an OCI registry")
u.SetTags("Image")
return u
@@ -146,7 +146,7 @@ func deleteImage() usecase.Interactor {
return image_api.ImageDelete(cdp)
})
u.SetTitle("Delete an image")
u.SetDescription("Delete an existing node image")
u.SetDescription("Delete an existing OS image")
u.SetTags("Image")
return u
@@ -156,7 +156,7 @@ func updateImage() usecase.Interactor {
type renameImageInput struct {
Name string `path:"name" required:"true" description:"Name of image to update"`
NewName string `json:"name" description:"New name to rename the image to"`
Build bool `query:"build" default:"true" description:"Build the image image after renaming, default:'true'"`
Build bool `query:"build" default:"true" description:"Build the OS image after renaming, default:'true'"`
}
u := usecase.NewInteractor(func(ctx context.Context, input renameImageInput, output *Image) error {
@@ -179,7 +179,7 @@ func updateImage() usecase.Interactor {
return nil
})
u.SetTitle("Update or rename an image")
u.SetDescription("Update or rename an existing node image")
u.SetDescription("Update or rename an existing OS image")
u.SetTags("Image")
return u
@@ -188,7 +188,7 @@ func updateImage() usecase.Interactor {
func buildImage() usecase.Interactor {
type buildImageInput struct {
Name string `path:"name" required:"true" description:"Name of image to build"`
Force bool `query:"force" default:"false" description:"Build the image image even if it appears unnecessary, default:'false'"`
Force bool `query:"force" default:"false" description:"Build the OS image even if it appears unnecessary, default:'false'"`
}
u := usecase.NewInteractor(func(ctx context.Context, input buildImageInput, output *Image) error {
@@ -206,7 +206,7 @@ func buildImage() usecase.Interactor {
return nil
})
u.SetTitle("Build an image")
u.SetDescription("Build a node image")
u.SetDescription("Build an OS image")
u.SetTags("Image")
return u

View File

@@ -101,13 +101,13 @@ func (of *OverlayFile) readContents() (string, error) {
fullPath := of.FullPath()
f, err := os.ReadFile(fullPath)
if err != nil {
wwlog.Warn("os.ReadFile err %w", err)
wwlog.Warn("os.ReadFile err %v", err)
return "", err
}
// Populate the permissions, uid, and gid.
s, err := os.Stat(fullPath)
if err != nil {
wwlog.Warn("os.Stat err %w", err)
wwlog.Warn("os.Stat err %v", err)
return "", err
}
fileMode := s.Mode()

View File

@@ -82,7 +82,7 @@ func DaemonStatus() error {
} else {
err := process.Signal(syscall.Signal(0))
if err != nil {
return fmt.Errorf("failed to send process SIGCONT: %w", err)
return fmt.Errorf("failed to send signal 0 (process existence check): %w", err)
} else {
wwlog.Serv("Warewulf server is running at PID: %d", pid)
}

View File

@@ -6,6 +6,7 @@ import (
"path"
"github.com/warewulf/warewulf/internal/pkg/image"
"github.com/warewulf/warewulf/internal/pkg/util"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
@@ -38,20 +39,20 @@ func HandleEfiBoot(w http.ResponseWriter, req *http.Request) {
case "grub.efi", "grub-tpm.efi", "grubx64.efi", "grubia32.efi", "grubaa64.efi", "grubarm.efi":
stageFile = image.GrubFind(imageName)
if stageFile == "" {
wwlog.Error("could't find grub*.efi for %s", imageName)
wwlog.Error("couldn't find grub*.efi for %s", imageName)
w.WriteHeader(http.StatusNotFound)
return
}
case "grub.cfg":
stageFile = path.Join(ctx.conf.Paths.Sysconfdir, "warewulf/grub/grub.cfg.ww")
tmplData = buildTemplateVars(ctx.conf, ctx.rinfo, ctx.remoteNode)
if stageFile == "" {
wwlog.Error("could't find grub.cfg template for %s", imageName)
if !util.IsFile(stageFile) {
wwlog.Error("couldn't find grub.cfg template for %s", imageName)
w.WriteHeader(http.StatusNotFound)
return
}
default:
wwlog.ErrorExc(fmt.Errorf("could't find efiboot file: %s", ctx.rinfo.efifile), "")
wwlog.ErrorExc(fmt.Errorf("couldn't find efiboot file: %s", ctx.rinfo.efifile), "")
w.WriteHeader(http.StatusNotFound)
return
}

View File

@@ -97,7 +97,7 @@ func RunServer() error {
auth := warewulfconf.NewAuthentication()
if util.IsFile(conf.Paths.AuthenticationConf()) {
if err := auth.Read(conf.Paths.AuthenticationConf()); err != nil {
wwlog.Warn("%w\n", err)
wwlog.Warn("%v", err)
}
}