stages: add ostree.deploy.container stage

This stage is similar to ostree.deploy, but deploys from a container
image rather than from an OSTree commit by using the `ostree container
image deploy` command. An example stage definition could look like:

```
  - type: org.osbuild.ostree.deploy.container
    options:
      osname: fedora-coreos
      target_imgref: ostree-remote-registry:fedora:quay.io/fedora/fedora-coreos:stable
      mounts:
	- /boot
	- /boot/efi
      kernel_opts:
	- rw
	- console=tty0
	- console=ttyS0
	- ignition.platform.id=qemu
	- '$ignition_firstboot'
    inputs:
      images:
	type: org.osbuild.containers
	origin: org.osbuild.source
	mpp-resolve-images:
	  images:
	    - source: quay.io/fedora/fedora-coreos
	      tag: stable
```

Co-authored-by: Dusty Mabe <dusty@dustymabe.com>
This commit is contained in:
Luke Yang 2023-08-23 16:10:32 -04:00 committed by Dusty Mabe
parent 49acf488af
commit f9a039d068
2 changed files with 146 additions and 1 deletions

View file

@ -1546,10 +1546,12 @@ class ManifestFileV2(ManifestFile):
embed_data(ip, mpp)
def _process_container(self, stage):
if stage.get("type", "") != "org.osbuild.skopeo":
if stage.get("type", "") not in \
["org.osbuild.skopeo", "org.osbuild.ostree.deploy.container"]:
return
inputs = element_enter(stage, "inputs", {})
inputs_images = element_enter(inputs, "images", {})
if inputs_images.get("type", "") != "org.osbuild.containers":