]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc-oci: support index files with multiple manifests
authorFelix Abecassis <fabecassis@nvidia.com>
Fri, 1 Dec 2017 06:51:57 +0000 (22:51 -0800)
committerFelix Abecassis <fabecassis@nvidia.com>
Fri, 1 Dec 2017 06:51:57 +0000 (22:51 -0800)
Previously, the output would contain "null" strings in this case.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
templates/lxc-oci.in

index b3a65e9a1863adc41d6651124102254309d9b363..6689f053c844e1c335c16b8aae1a13dca8835d60 100755 (executable)
@@ -63,7 +63,7 @@ getconfigpath() {
        basedir="$1"
        q="$2"
 
-       digest=`cat "${basedir}/index.json" | jq -c -r --arg q "$q" '.manifests[] | if .annotations."org.opencontainers.image.ref.name" == $q then .digest else null end'`
+       digest=`cat "${basedir}/index.json" | jq -c -r --arg q "$q" '.manifests[] | if .annotations."org.opencontainers.image.ref.name" == $q then .digest else empty end'`
        if [ -z "${digest}" ]; then
                echo "$q not found in index.json" >&2
                return