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
7 changes: 6 additions & 1 deletion cmd/image-builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ func cmdManifestWrapper(pbar progress.ProgressBar, cmd *cobra.Command, args []st
if err != nil {
return nil, err
}
bootcDefaultFs, err := cmd.Flags().GetString("bootc-default-fs")
if err != nil {
return nil, err
}
var rpmDownloader osbuild.RpmDownloader
if useLibrepo {
rpmDownloader = osbuild.RpmDownloaderLibrepo
Expand Down Expand Up @@ -255,7 +259,7 @@ func cmdManifestWrapper(pbar progress.ProgressBar, cmd *cobra.Command, args []st

var img *imagefilter.Result
if bootcRef != "" {
distro, err := bootc.NewBootcDistro(bootcRef, nil)
distro, err := bootc.NewBootcDistro(bootcRef, &bootc.DistroOptions{DefaultFs: bootcDefaultFs})
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -556,6 +560,7 @@ operating systems like Fedora, CentOS and RHEL with easy customizations support.
manifestCmd.Flags().String("bootc-ref", "", `bootc container ref`)
manifestCmd.Flags().String("bootc-build-ref", "", `bootc build container ref`)
manifestCmd.Flags().String("bootc-installer-payload-ref", "", `bootc installer payload ref`)
manifestCmd.Flags().String("bootc-default-fs", "", `default filesystem to use for the bootc install (e.g. ext4)`)
manifestCmd.Flags().Bool("use-librepo", true, `use librepo to download packages (disable if you use old versions of osbuild)`)
manifestCmd.Flags().Bool("with-sbom", false, `export SPDX SBOM document`)
manifestCmd.Flags().Bool("ignore-warnings", false, `ignore warnings during manifest generation`)
Expand Down
25 changes: 25 additions & 0 deletions test/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,28 @@ def test_manifest_honors_rpmmd_cache(tmp_path, build_container):
"--rpmmd-cache", "/rpmmd_cache",
], text=True)
assert len(list(rpmmd_cache.rglob("repomd.xml"))) > 0


@pytest.mark.parametrize("bootc_ref,defaultfs", [
("quay.io/fedora/fedora-bootc:42", "ext4"),
("quay.io/centos-bootc/centos-bootc:stream10", ""),
("quay.io/centos-bootc/centos-bootc:stream9", ""),
])
def test_container_manifest_bootc_smoke(build_container, bootc_ref, defaultfs):
subprocess.check_call(["podman", "pull", bootc_ref])
bootc_default_fs = []
if defaultfs:
bootc_default_fs = ["--bootc-default-fs", defaultfs]
output = subprocess.check_output(podman_run + [
build_container,
"manifest",
"qcow2",
"--bootc-ref", bootc_ref,
] + bootc_default_fs, text=True)
manifest = json.loads(output)
assert manifest["version"] == "2"
if defaultfs:
pipeline = [p for p in manifest["pipelines"] if p["name"] == "image"][0]
mkfs_stages = [st for st in pipeline["stages"]
if st["type"] == f"org.osbuild.mkfs.{defaultfs}"]
assert mkfs_stages
Loading