Return image references in ImageStatus()
The image's canonical reference is a name with a digest of the image's manifest, so compute and return that value as the image's reference in ImageStatus() and in ContainerStatus(). We don't auto-store a name based on the image digest when we pull one by tag, but then CRI doesn't need us to do that. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
parent
beef44840e
commit
3f2bc09231
6 changed files with 94 additions and 54 deletions
|
@ -105,7 +105,7 @@ cp "$CONMON_BINARY" "$TESTDIR/conmon"
|
|||
|
||||
PATH=$PATH:$TESTDIR
|
||||
|
||||
# Make sure we have a copy of the redis:latest image.
|
||||
# Make sure we have a copy of the redis:alpine image.
|
||||
if ! [ -d "$ARTIFACTS_PATH"/redis-image ]; then
|
||||
mkdir -p "$ARTIFACTS_PATH"/redis-image
|
||||
if ! "$COPYIMG_BINARY" --import-from=docker://redis:alpine --export-to=dir:"$ARTIFACTS_PATH"/redis-image --signature-policy="$INTEGRATION_ROOT"/policy.json ; then
|
||||
|
@ -115,10 +115,10 @@ if ! [ -d "$ARTIFACTS_PATH"/redis-image ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# TODO: remove the code below for redis digested image id when
|
||||
# https://github.com/kubernetes-incubator/cri-o/issues/531 is complete
|
||||
# as the digested reference will be auto-stored when pulling the tag
|
||||
# above
|
||||
# TODO: remove the code below for pulling redis:alpine using a canonical reference once
|
||||
# https://github.com/kubernetes-incubator/cri-o/issues/531 is complete and we can
|
||||
# pull the image using a tagged reference and then subsequently find the image without
|
||||
# having to explicitly record the canonical reference as one of the image's names
|
||||
if ! [ -d "$ARTIFACTS_PATH"/redis-image-digest ]; then
|
||||
mkdir -p "$ARTIFACTS_PATH"/redis-image-digest
|
||||
if ! "$COPYIMG_BINARY" --import-from=docker://redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b --export-to=dir:"$ARTIFACTS_PATH"/redis-image-digest --signature-policy="$INTEGRATION_ROOT"/policy.json ; then
|
||||
|
@ -235,11 +235,11 @@ function start_crio() {
|
|||
"$BIN2IMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --source-binary "$PAUSE_BINARY"
|
||||
fi
|
||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --image-name=redis:alpine --import-from=dir:"$ARTIFACTS_PATH"/redis-image --add-name=docker.io/library/redis:alpine --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||
# TODO: remove the code below for redis:alpine digested image id when
|
||||
# https://github.com/kubernetes-incubator/cri-o/issues/531 is complete
|
||||
# as the digested reference will be auto-stored when pulling the tag
|
||||
# above
|
||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --image-name=redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b --import-from=dir:"$ARTIFACTS_PATH"/redis-image-digest --add-name=docker.io/library/redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||
# TODO: remove the code below for copying redis:alpine in using a canonical reference once
|
||||
# https://github.com/kubernetes-incubator/cri-o/issues/531 is complete and we can
|
||||
# copy the image using a tagged reference and then subsequently find the image without
|
||||
# having to explicitly record the canonical reference as one of the image's names
|
||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --image-name=redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b --import-from=dir:"$ARTIFACTS_PATH"/redis-image-digest --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --image-name=mrunalp/oom --import-from=dir:"$ARTIFACTS_PATH"/oom-image --add-name=docker.io/library/mrunalp/oom --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --image-name=mrunalp/image-volume-test --import-from=dir:"$ARTIFACTS_PATH"/image-volume-test-image --add-name=docker.io/library/mrunalp/image-volume-test --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||
"$COPYIMG_BINARY" --root "$TESTDIR/crio" $STORAGE_OPTIONS --runroot "$TESTDIR/crio-run" --image-name=busybox:latest --import-from=dir:"$ARTIFACTS_PATH"/busybox-image --add-name=docker.io/library/busybox:latest --signature-policy="$INTEGRATION_ROOT"/policy.json
|
||||
|
@ -262,29 +262,17 @@ function start_crio() {
|
|||
crictl pull redis:alpine
|
||||
fi
|
||||
REDIS_IMAGEID=$(crictl inspecti redis:alpine | head -1 | sed -e "s/ID: //g")
|
||||
run crictl inspecti redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b
|
||||
if [ "$status" -ne 0 ] ; then
|
||||
crictl pull redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b
|
||||
fi
|
||||
REDIS_IMAGEID_DIGESTED=$(crictl inspecti redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b | head -1 | sed -e "s/ID: //g")
|
||||
run crictl inspecti mrunalp/oom
|
||||
if [ "$status" -ne 0 ] ; then
|
||||
crictl pull mrunalp/oom
|
||||
fi
|
||||
#
|
||||
#
|
||||
#
|
||||
# TODO: remove the code below for redis digested image id when
|
||||
# https://github.com/kubernetes-incubator/cri-o/issues/531 is complete
|
||||
# as the digested reference will be auto-stored when pulling the tag
|
||||
# above
|
||||
#
|
||||
#
|
||||
#
|
||||
REDIS_IMAGEID_DIGESTED="redis@sha256:03789f402b2ecfb98184bf128d180f398f81c63364948ff1454583b02442f73b"
|
||||
run crictl inspecti $REDIS_IMAGEID_DIGESTED
|
||||
if [ "$status" -ne 0 ]; then
|
||||
crictl pull $REDIS_IMAGEID_DIGESTED
|
||||
fi
|
||||
#
|
||||
#
|
||||
#
|
||||
run crictl inspecti runcom/stderr-test
|
||||
OOM_IMAGEID=$(crictl inspecti mrunalp/oom | head -1 | sed -e "s/ID: //g")
|
||||
run crioctl image status --id=runcom/stderr-test
|
||||
if [ "$status" -ne 0 ] ; then
|
||||
crictl pull runcom/stderr-test:latest
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue