Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/static-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func loadStaticNMState(fsys fs.FS, env *env.EnvInputs, nmstateDir string, imageS
imageName := strings.TrimSuffix(f.Name(), ".yaml") + suffix

isInitramfs := !strings.HasSuffix(imageName, ".iso")
url, err := imageServer.ServeImage(imageName, "", ign, isInitramfs, true)
url, err := imageServer.ServeImage(imageName, "", "", ign, isInitramfs, true)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/static-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ func (f *fakeImageFileSystem) Seek(offset int64, whence int) (int64, error) { re
func (f *fakeImageFileSystem) Readdir(n int) ([]fs.FileInfo, error) { return nil, nil }
func (f *fakeImageFileSystem) Open(name string) (http.File, error) { return nil, nil }
func (f *fakeImageFileSystem) FileSystem() http.FileSystem { return f }
func (f *fakeImageFileSystem) ServeImage(name string, arch string, ignitionContent []byte, initrd, static bool) (string, error) {
func (f *fakeImageFileSystem) ServeImage(name string, arch string, stream string, ignitionContent []byte, initrd, static bool) (string, error) {
f.imagesServed = append(f.imagesServed, name)
return "", nil
}
func (f *fakeImageFileSystem) ServeKernel(arch string) (string, error) { return "", nil }
func (f *fakeImageFileSystem) RemoveImage(name string) {}
func (f *fakeImageFileSystem) HasImagesForArchitecture(arch string) bool { return true }
func (f *fakeImageFileSystem) ServeKernel(arch string, stream string) (string, error) { return "", nil }
func (f *fakeImageFileSystem) RemoveImage(name string) {}
func (f *fakeImageFileSystem) HasImagesForArchitecture(arch string) bool { return true }

func TestLoadStaticNMState(t *testing.T) {
fifs := &fakeImageFileSystem{imagesServed: []string{}}
Expand Down
1 change: 1 addition & 0 deletions pkg/imagehandler/imagefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type imageFile struct {
name string
size int64
arch string
stream string
ignitionContent []byte
imageReader isoeditor.ImageReader
initramfs bool
Expand Down
4 changes: 2 additions & 2 deletions pkg/imagehandler/imagefilesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ func (f *imageFileSystem) Open(name string) (http.File, error) {

var baseImage baseFile
if im.kernel {
baseImage = f.getKernel(im.arch)
baseImage = f.getKernel(im.arch, im.stream)
} else {
baseImage = f.getBaseImage(im.arch, im.initramfs)
baseImage = f.getBaseImage(im.arch, im.stream, im.initramfs)
}

if err := im.Init(baseImage); err != nil {
Expand Down
Loading