Add artifact quadlet unit type support

RFE: Add artifact quadlet unit type #25778

Signed-off-by: Odilon Sousa <osousa@redhat.com>
This commit is contained in:
Odilon Sousa
2025-09-23 14:58:09 -03:00
parent 1671029517
commit 34254cd1d0
11 changed files with 368 additions and 11 deletions

View File

@@ -396,6 +396,8 @@ func generateUnitsInfoMap(units []*parser.UnitFile) map[string]*quadlet.UnitInfo
// types), but still breaks the dependency cycle between .volume and .build ([Volume] can
// have Image=some.build, and [Build] can have Volume=some.volume:/some-volume)
resourceName = quadlet.GetBuiltImageName(unit)
case strings.HasSuffix(unit.Filename, ".artifact"):
serviceName = quadlet.GetArtifactServiceName(unit)
case strings.HasSuffix(unit.Filename, ".pod"):
containers = make([]string, 0)
// Prefill resouceNames for .pod files.
@@ -550,6 +552,9 @@ func process() bool {
service, err = quadlet.ConvertImage(unit, unitsInfoMap, isUserFlag)
case strings.HasSuffix(unit.Filename, ".build"):
service, warnings, err = quadlet.ConvertBuild(unit, unitsInfoMap, isUserFlag)
case strings.HasSuffix(unit.Filename, ".artifact"):
warnIfAmbiguousName(unit, quadlet.ArtifactGroup)
service, err = quadlet.ConvertArtifact(unit, unitsInfoMap, isUserFlag)
case strings.HasSuffix(unit.Filename, ".pod"):
service, warnings, err = quadlet.ConvertPod(unit, unit.Filename, unitsInfoMap, isUserFlag)
default: