diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-03-12 19:15:25 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-03-12 19:18:50 +0000 |
| commit | 6240456e2d113ce1b7fe7bb43bf769035f23d465 (patch) | |
| tree | d4e37f4319d5207868868e4d71249acd32a594b8 | |
| parent | c2eeba33360b0941ff2a89f44712e9212066f786 (diff) | |
| download | meta-virtualization-6240456e2d113ce1b7fe7bb43bf769035f23d465.tar.gz | |
container-registry: use FEATURE_PACKAGES for IMAGE_FEATURES validation
Move FEATURE_PACKAGES_container-registry from container-image-host.bb
to meta-virt-container.inc so it is available to all image recipes.
image.bbclass check_image_features() auto-discovers FEATURE_PACKAGES_*
variables as valid image features (line 72), so defining the variable
globally is sufficient — no IMAGE_FEATURES[validitems] needed.
This avoids the signature pollution that IMAGE_FEATURES[validitems]
causes when set globally, while allowing container-registry to be
used as an IMAGE_FEATURES value in any image recipe.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | conf/distro/include/meta-virt-container.inc | 10 | ||||
| -rw-r--r-- | recipes-extended/images/container-image-host.bb | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/conf/distro/include/meta-virt-container.inc b/conf/distro/include/meta-virt-container.inc index d3e91eef..6472d855 100644 --- a/conf/distro/include/meta-virt-container.inc +++ b/conf/distro/include/meta-virt-container.inc | |||
| @@ -40,3 +40,13 @@ | |||
| 40 | 40 | ||
| 41 | CONTAINER_RO_REMOVE ?= " ${@bb.utils.contains('VIRTUAL-RUNTIME_container_engine', 'podman', 'shadow', '', d)}" | 41 | CONTAINER_RO_REMOVE ?= " ${@bb.utils.contains('VIRTUAL-RUNTIME_container_engine', 'podman', 'shadow', '', d)}" |
| 42 | ROOTFS_RO_UNNEEDED:remove = "${CONTAINER_RO_REMOVE}" | 42 | ROOTFS_RO_UNNEEDED:remove = "${CONTAINER_RO_REMOVE}" |
| 43 | |||
| 44 | # Container registry IMAGE_FEATURES support. | ||
| 45 | # Defining FEATURE_PACKAGES_container-registry globally makes | ||
| 46 | # "container-registry" a valid IMAGE_FEATURES value for any image | ||
| 47 | # recipe (image.bbclass check_image_features auto-discovers | ||
| 48 | # FEATURE_PACKAGES_* variables). This avoids IMAGE_FEATURES[validitems] | ||
| 49 | # which pollutes signatures when set globally. | ||
| 50 | # Default is empty (validation only); container-image-host.bb sets the | ||
| 51 | # actual packages. | ||
| 52 | FEATURE_PACKAGES_container-registry ?= "" | ||
diff --git a/recipes-extended/images/container-image-host.bb b/recipes-extended/images/container-image-host.bb index 723f0cf5..596b62e0 100644 --- a/recipes-extended/images/container-image-host.bb +++ b/recipes-extended/images/container-image-host.bb | |||
| @@ -84,10 +84,9 @@ REQUIRED_DISTRO_FEATURES:append = " ${@bb.utils.contains('VIRTUAL-RUNTIME_contai | |||
| 84 | # of the host name to make it unique | 84 | # of the host name to make it unique |
| 85 | IMAGE_FEATURES[validitems] += "virt-unique-hostname" | 85 | IMAGE_FEATURES[validitems] += "virt-unique-hostname" |
| 86 | IMAGE_FEATURES[validitems] += "container-tools" | 86 | IMAGE_FEATURES[validitems] += "container-tools" |
| 87 | IMAGE_FEATURES[validitems] += "container-registry" | ||
| 88 | |||
| 89 | # Container registry configuration packages (opt-in via IMAGE_FEATURES += "container-registry") | 87 | # Container registry configuration packages (opt-in via IMAGE_FEATURES += "container-registry") |
| 90 | # Requires CONTAINER_REGISTRY_URL and/or DOCKER_REGISTRY_INSECURE to be set | 88 | # Requires CONTAINER_REGISTRY_URL and/or DOCKER_REGISTRY_INSECURE to be set |
| 89 | # (overrides empty default from meta-virt-container.inc) | ||
| 91 | FEATURE_PACKAGES_container-registry = "\ | 90 | FEATURE_PACKAGES_container-registry = "\ |
| 92 | ${@bb.utils.contains_any('VIRTUAL-RUNTIME_container_engine', 'docker docker-moby', 'docker-registry-config', '', d)} \ | 91 | ${@bb.utils.contains_any('VIRTUAL-RUNTIME_container_engine', 'docker docker-moby', 'docker-registry-config', '', d)} \ |
| 93 | ${@bb.utils.contains_any('VIRTUAL-RUNTIME_container_engine', 'podman containerd cri-o', 'container-oci-registry-config', '', d)} \ | 92 | ${@bb.utils.contains_any('VIRTUAL-RUNTIME_container_engine', 'podman containerd cri-o', 'container-oci-registry-config', '', d)} \ |
