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
32 changes: 0 additions & 32 deletions internal/workload/custom.go

This file was deleted.

40 changes: 0 additions & 40 deletions internal/workload/workload.go

This file was deleted.

49 changes: 24 additions & 25 deletions pkg/distro/generic/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"strings"

"github.com/osbuild/blueprint/pkg/blueprint"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/customizations/anaconda"
"github.com/osbuild/images/pkg/customizations/bootc"
Expand Down Expand Up @@ -439,7 +438,7 @@ func ostreeDeploymentCustomizations(

// IMAGES

func diskImage(workload workload.Workload,
func diskImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -457,7 +456,7 @@ func diskImage(workload workload.Workload,
}

img.Environment = &t.ImageTypeYAML.Environment
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.Compression = t.ImageTypeYAML.Compression
if bp.Minimal {
// Disable weak dependencies if the 'minimal' option is enabled
Expand Down Expand Up @@ -487,7 +486,7 @@ func diskImage(workload workload.Workload,
return img, nil
}

func tarImage(workload workload.Workload,
func tarImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -507,7 +506,7 @@ func tarImage(workload workload.Workload,
d := t.arch.distro

img.Environment = &t.ImageTypeYAML.Environment
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.Compression = t.ImageTypeYAML.Compression
img.OSVersion = d.OsVersion()

Expand All @@ -516,7 +515,7 @@ func tarImage(workload workload.Workload,
return img, nil
}

func containerImage(workload workload.Workload,
func containerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -534,14 +533,14 @@ func containerImage(workload workload.Workload,
}

img.Environment = &t.ImageTypeYAML.Environment
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations

img.Filename = t.Filename()

return img, nil
}

func liveInstallerImage(workload workload.Workload,
func liveInstallerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -552,7 +551,7 @@ func liveInstallerImage(workload workload.Workload,
img := image.NewAnacondaLiveInstaller()

img.Platform = t.platform
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.ExtraBasePackages = packageSets[installerPkgsKey]

d := t.arch.distro
Expand Down Expand Up @@ -585,7 +584,7 @@ func liveInstallerImage(workload workload.Workload,
return img, nil
}

func imageInstallerImage(workload workload.Workload,
func imageInstallerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -612,7 +611,7 @@ func imageInstallerImage(workload workload.Workload,
img.Kickstart.Timezone = &img.OSCustomizations.Timezone

img.Platform = t.platform
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations

img.ExtraBasePackages = packageSets[installerPkgsKey]

Expand Down Expand Up @@ -655,7 +654,7 @@ func imageInstallerImage(workload workload.Workload,
return img, nil
}

func iotCommitImage(workload workload.Workload,
func iotCommitImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand Down Expand Up @@ -683,15 +682,15 @@ func iotCommitImage(workload workload.Workload,
}

img.Environment = &t.ImageTypeYAML.Environment
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.OSTreeParent = parentCommit
img.OSVersion = d.OsVersion()
img.Filename = t.Filename()

return img, nil
}

func bootableContainerImage(workload workload.Workload,
func bootableContainerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -713,7 +712,7 @@ func bootableContainerImage(workload workload.Workload,
}

img.Environment = &t.ImageTypeYAML.Environment
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.OSTreeParent = parentCommit
img.OSVersion = d.OsVersion()
img.Filename = t.Filename()
Expand All @@ -731,7 +730,7 @@ func bootableContainerImage(workload workload.Workload,
return img, nil
}

func iotContainerImage(workload workload.Workload,
func iotContainerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -758,7 +757,7 @@ func iotContainerImage(workload workload.Workload,

img.ContainerLanguage = img.OSCustomizations.Language
img.Environment = &t.ImageTypeYAML.Environment
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.OSTreeParent = parentCommit
img.OSVersion = d.OsVersion()
img.ExtraContainerPackages = packageSets[containerPkgsKey]
Expand All @@ -767,7 +766,7 @@ func iotContainerImage(workload workload.Workload,
return img, nil
}

func iotInstallerImage(workload workload.Workload,
func iotInstallerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand Down Expand Up @@ -837,7 +836,7 @@ func iotInstallerImage(workload workload.Workload,
return img, nil
}

func iotImage(workload workload.Workload,
func iotImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -859,7 +858,7 @@ func iotImage(workload workload.Workload,
img.OSTreeDeploymentCustomizations = deploymentConfig

img.Platform = t.platform
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations

img.Remote = ostree.Remote{
Name: t.ImageTypeYAML.OSTree.RemoteName,
Expand All @@ -885,7 +884,7 @@ func iotImage(workload workload.Workload,
return img, nil
}

func iotSimplifiedInstallerImage(workload workload.Workload,
func iotSimplifiedInstallerImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -907,7 +906,7 @@ func iotSimplifiedInstallerImage(workload workload.Workload,
rawImg.OSTreeDeploymentCustomizations = deploymentConfig

rawImg.Platform = t.platform
rawImg.Workload = workload
rawImg.ImgTypeCustomizations = imgTypeCustomizations
rawImg.Remote = ostree.Remote{
Name: t.OSTree.RemoteName,
}
Expand All @@ -928,7 +927,7 @@ func iotSimplifiedInstallerImage(workload workload.Workload,

img := image.NewOSTreeSimplifiedInstaller(rawImg, customizations.InstallationDevice)
img.ExtraBasePackages = packageSets[installerPkgsKey]
// img.Workload = workload
// img.ImgTypeCustomizations = imgTypeCustomizations
img.Platform = t.platform
img.Filename = t.Filename()
if bpFDO := customizations.GetFDO(); bpFDO != nil {
Expand Down Expand Up @@ -970,7 +969,7 @@ func iotSimplifiedInstallerImage(workload workload.Workload,
}

// Make an Anaconda installer boot.iso
func netinstImage(workload workload.Workload,
func netinstImage(imgTypeCustomizations manifest.OSCustomizations,
t *imageType,
bp *blueprint.Blueprint,
options distro.ImageOptions,
Expand All @@ -987,7 +986,7 @@ func netinstImage(workload workload.Workload,
}

img.Platform = t.platform
img.Workload = workload
img.ImgTypeCustomizations = imgTypeCustomizations
img.ExtraBasePackages = packageSets[installerPkgsKey]

var err error
Expand Down
15 changes: 6 additions & 9 deletions pkg/distro/generic/imagetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/osbuild/blueprint/pkg/blueprint"
"github.com/osbuild/images/internal/common"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/container"
"github.com/osbuild/images/pkg/datasizes"
"github.com/osbuild/images/pkg/disk"
Expand All @@ -21,7 +20,7 @@ import (
"github.com/osbuild/images/pkg/rpmmd"
)

type imageFunc func(workload workload.Workload, t *imageType, bp *blueprint.Blueprint, options distro.ImageOptions, packageSets map[string]rpmmd.PackageSet, containers []container.SourceSpec, rng *rand.Rand) (image.ImageKind, error)
type imageFunc func(imgTypeCustomizations manifest.OSCustomizations, t *imageType, bp *blueprint.Blueprint, options distro.ImageOptions, packageSets map[string]rpmmd.PackageSet, containers []container.SourceSpec, rng *rand.Rand) (image.ImageKind, error)

type isoLabelFunc func(t *imageType) string

Expand Down Expand Up @@ -258,15 +257,13 @@ func (t *imageType) Manifest(bp *blueprint.Blueprint,
installFromRepos := blueprint.RepoCustomizationsInstallFromOnly(customRepos)
payloadRepos = append(payloadRepos, installFromRepos...)

cw := &workload.Custom{
BaseWorkload: workload.BaseWorkload{
Repos: payloadRepos,
},
Packages: bp.GetPackagesEx(false),
EnabledModules: bp.GetEnabledModules(),
cw := manifest.OSCustomizations{
ExtraBaseRepos: payloadRepos,
BasePackages: bp.GetPackagesEx(false),
BaseModules: bp.GetEnabledModules(),
}
if services := bp.Customizations.GetServices(); services != nil {
cw.Services = services.Enabled
cw.EnabledServices = services.Enabled
cw.DisabledServices = services.Disabled
cw.MaskedServices = services.Masked
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/image/anaconda_live_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"math/rand"

"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/datasizes"
Expand All @@ -20,7 +19,7 @@ type AnacondaLiveInstaller struct {
Platform platform.Platform
InstallerCustomizations manifest.InstallerCustomizations
Environment environment.Environment
Workload workload.Workload
ImgTypeCustomizations manifest.OSCustomizations

ExtraBasePackages rpmmd.PackageSet

Expand Down
3 changes: 1 addition & 2 deletions pkg/image/anaconda_net_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"math/rand"

"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/customizations/anaconda"
Expand All @@ -21,7 +20,7 @@ type AnacondaNetInstaller struct {
Platform platform.Platform
InstallerCustomizations manifest.InstallerCustomizations
Environment environment.Environment
Workload workload.Workload
ImgTypeCustomizations manifest.OSCustomizations

ExtraBasePackages rpmmd.PackageSet

Expand Down
5 changes: 2 additions & 3 deletions pkg/image/anaconda_tar_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"path/filepath"

"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/internal/workload"
"github.com/osbuild/images/pkg/arch"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/customizations/anaconda"
Expand Down Expand Up @@ -44,7 +43,7 @@ type AnacondaTarInstaller struct {
OSCustomizations manifest.OSCustomizations
InstallerCustomizations manifest.InstallerCustomizations
Environment environment.Environment
Workload workload.Workload
ImgTypeCustomizations manifest.OSCustomizations

ExtraBasePackages rpmmd.PackageSet

Expand Down Expand Up @@ -164,7 +163,7 @@ func (img *AnacondaTarInstaller) InstantiateManifest(m *manifest.Manifest,
osPipeline := manifest.NewOS(buildPipeline, img.Platform, repos)
osPipeline.OSCustomizations = img.OSCustomizations
osPipeline.Environment = img.Environment
osPipeline.Workload = img.Workload
osPipeline.ImgTypeCustomizations = img.ImgTypeCustomizations

isoTreePipeline := manifest.NewAnacondaInstallerISOTree(buildPipeline, anacondaPipeline, rootfsImagePipeline, bootTreePipeline)
// TODO: the partition table is required - make it a ctor arg or set a default one in the pipeline
Expand Down
Loading
Loading