From d66bc11bc7707a7e1dd2b3671d12055e6d79b669 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 14 Nov 2022 20:51:43 +0100 Subject: [PATCH] distro/rhel9: update tar image type to new definition Add the image function and remove the pipeline function. Remove the build package set. --- internal/distro/rhel9/bare_metal.go | 3 +-- internal/distro/rhel9/images.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/internal/distro/rhel9/bare_metal.go b/internal/distro/rhel9/bare_metal.go index 5331e49bc..30e49775b 100644 --- a/internal/distro/rhel9/bare_metal.go +++ b/internal/distro/rhel9/bare_metal.go @@ -13,7 +13,6 @@ var ( filename: "root.tar.xz", mimeType: "application/x-tar", packageSets: map[string]packageSetFunc{ - buildPkgsKey: distroBuildPackageSet, osPkgsKey: func(t *imageType) rpmmd.PackageSet { return rpmmd.PackageSet{ Include: []string{"policycoreutils", "selinux-policy-targeted"}, @@ -24,7 +23,7 @@ var ( packageSetChains: map[string][]string{ osPkgsKey: {osPkgsKey, blueprintPkgsKey}, }, - pipelines: tarPipelines, + image: tarImage, buildPipelines: []string{"build"}, payloadPipelines: []string{"os", "root-tar"}, exports: []string{"root-tar"}, diff --git a/internal/distro/rhel9/images.go b/internal/distro/rhel9/images.go index 11352920f..60b3842d4 100644 --- a/internal/distro/rhel9/images.go +++ b/internal/distro/rhel9/images.go @@ -354,3 +354,23 @@ func imageInstallerImage(workload workload.Workload, return img, nil } + +func tarImage(workload workload.Workload, + t *imageType, + customizations *blueprint.Customizations, + options distro.ImageOptions, + packageSets map[string]rpmmd.PackageSet, + containers []container.Spec, + rng *rand.Rand) (image.ImageKind, error) { + + img := image.NewArchive() + img.Platform = t.platform + img.OSCustomizations = osCustomizations(t, packageSets[osPkgsKey], options, containers, customizations) + img.Environment = t.environment + img.Workload = workload + + img.Filename = t.Filename() + + return img, nil + +}