Address unhandled deadcode issues

- Fix `make deadcode` to properly fail GitHub checks
- Resolve "dead" code by refactoring other code to use it

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-05-10 11:26:11 -06:00
parent 29dc9da041
commit b5d72fb393
4 changed files with 3 additions and 12 deletions

View File

@@ -230,14 +230,8 @@ func ImageList() (imageInfo []*wwapiv1.ImageInfo, err error) {
if err == nil {
modTime = uint64(imageStat.ModTime().Unix())
}
imgSize := 0
if imgF, err := os.Stat(image.ImageFile(source)); err == nil {
imgSize = int(imgF.Size())
}
imgCSize := 0
if imgFC, err := os.Stat(image.ImageFile(source) + ".gz"); err == nil {
imgCSize = int(imgFC.Size())
}
imgSize := image.ImageSize(source)
imgCSize := image.CompressedImageSize(source)
imageInfo = append(imageInfo, &wwapiv1.ImageInfo{
Name: source,
NodeCount: uint32(nodemap[source]),