debian-forge-composer/vendor/github.com/osbuild/images/pkg/image/container.go
Sanne Raymaekers d578c87ee0 go.mod: bump images to v0.178.0
Changes with 0.178.0
----------------
  - Update osbuild dependency commit ID to latest (osbuild/images#1763)
    - Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger
  - many: drop `ISORootKickstart` (osbuild/images#1769)
    - Author: Simon de Vlieger, Reviewers: Brian C. Lane, Tomáš Hozza
  - many: drop the workload.Workload type entirely (osbuild/images#1770)
    - Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza
  - platform: drop hardcoded platforms and rename PlatformConf (osbuild/images#1739)
    - Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger
  - rhel: fix openscap profile allowlists (HMS-9095) (osbuild/images#1778)
    - Author: Sanne Raymaekers, Reviewers: Michael Vogt, Simon de Vlieger

— Somewhere on the Internet, 2025-08-21
2025-08-21 17:40:55 +02:00

46 lines
1.3 KiB
Go

package image
import (
"math/rand"
"github.com/osbuild/images/internal/environment"
"github.com/osbuild/images/pkg/artifact"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/platform"
"github.com/osbuild/images/pkg/rpmmd"
"github.com/osbuild/images/pkg/runner"
)
type BaseContainer struct {
Base
Platform platform.Platform
OSCustomizations manifest.OSCustomizations
Environment environment.Environment
ImgTypeCustomizations manifest.OSCustomizations
Filename string
}
func NewBaseContainer() *BaseContainer {
return &BaseContainer{
Base: NewBase("base-container"),
}
}
func (img *BaseContainer) InstantiateManifest(m *manifest.Manifest,
repos []rpmmd.RepoConfig,
runner runner.Runner,
rng *rand.Rand) (*artifact.Artifact, error) {
buildPipeline := addBuildBootstrapPipelines(m, runner, repos, nil)
buildPipeline.Checkpoint()
osPipeline := manifest.NewOS(buildPipeline, img.Platform, repos)
osPipeline.OSCustomizations = img.OSCustomizations
osPipeline.Environment = img.Environment
osPipeline.ImgTypeCustomizations = img.ImgTypeCustomizations
ociPipeline := manifest.NewOCIContainer(buildPipeline, osPipeline)
ociPipeline.SetFilename(img.Filename)
artifact := ociPipeline.Export()
return artifact, nil
}