debian-forge-composer/vendor/github.com/osbuild/images/pkg/image/archive.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

51 lines
1.4 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 Archive struct {
Base
Platform platform.Platform
OSCustomizations manifest.OSCustomizations
Environment environment.Environment
ImgTypeCustomizations manifest.OSCustomizations
Filename string
Compression string
OSVersion string
}
func NewArchive() *Archive {
return &Archive{
Base: NewBase("archive"),
}
}
func (img *Archive) 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
osPipeline.OSVersion = img.OSVersion
tarPipeline := manifest.NewTar(buildPipeline, osPipeline, "archive")
compressionPipeline := GetCompressionPipeline(img.Compression, buildPipeline, tarPipeline)
compressionPipeline.SetFilename(img.Filename)
return compressionPipeline.Export(), nil
}