Skip to content
Merged
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
15 changes: 14 additions & 1 deletion pkg/distro/bootc/bootc.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type BootcImageType struct {

name string
export string
// file extension
ext string
}

func (d *BootcDistro) SetBuildContainer(imgref string) (err error) {
Expand Down Expand Up @@ -194,7 +196,7 @@ func (t *BootcImageType) Arch() distro.Arch {
}

func (t *BootcImageType) Filename() string {
return "disk"
return fmt.Sprintf("disk.%s", t.ext)
}

func (t *BootcImageType) MIMEType() string {
Expand Down Expand Up @@ -402,30 +404,41 @@ func NewBootcDistro(imgref string) (bd *BootcDistro, err error) {
arch: common.Must(arch.FromString(archStr)),
}
// TODO: add iso image types, see bootc-image-builder
//
// Note that the file extension is hardcoded in
// pkg/image/bootc_disk.go, we have no way to access
// it here so we need to duplicate it
// XXX: find a way to avoid this duplication
ba.addImageTypes(
BootcImageType{
name: "ami",
export: "image",
ext: "raw",
},
BootcImageType{
name: "qcow2",
export: "qcow2",
ext: "qcow2",
},
BootcImageType{
name: "raw",
export: "image",
ext: "raw",
},
BootcImageType{
name: "vmdk",
export: "vmdk",
ext: "vmdk",
},
BootcImageType{
name: "vhd",
export: "bpc",
ext: "vhd",
},
BootcImageType{
name: "gce",
export: "gce",
ext: "tar.gz",
},
)
bd.addArches(ba)
Expand Down
1 change: 1 addition & 0 deletions pkg/distro/bootc/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func NewTestBootcImageType() *BootcImageType {
arch: a,
name: "qcow2",
export: "qcow2",
ext: "qcow2",
}
a.addImageTypes(*imgType)

Expand Down
Loading