Add kpod push
command
Push an image to a specified location, such as to an atomic registry or a local directory Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
parent
ab1fef9e1f
commit
680f7a6106
16 changed files with 1848 additions and 57 deletions
|
@ -2,11 +2,15 @@
|
|||
|
||||
load helpers
|
||||
|
||||
IMAGE="alpine"
|
||||
IMAGE="alpine:latest"
|
||||
ROOT="$TESTDIR/crio"
|
||||
RUNROOT="$TESTDIR/crio-run"
|
||||
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT --storage-driver vfs"
|
||||
|
||||
function teardown() {
|
||||
cleanup_test
|
||||
}
|
||||
|
||||
@test "kpod version test" {
|
||||
run ${KPOD_BINARY} version
|
||||
echo "$output"
|
||||
|
@ -117,3 +121,72 @@ KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT --storage-driver vfs"
|
|||
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "kpod push to containers/storage" {
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS pull "$IMAGE"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS push "$IMAGE" containers-storage:[$ROOT]busybox:test
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run crioctl image remove "$IMAGE"
|
||||
run crioctl image remove busybox:test
|
||||
stop_crio
|
||||
}
|
||||
|
||||
@test "kpod push to directory" {
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS pull "$IMAGE"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run mkdir /tmp/busybox
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS push "$IMAGE" dir:/tmp/busybox
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run crioctl image remove "$IMAGE"
|
||||
run rm -rf /tmp/busybox
|
||||
stop_crio
|
||||
}
|
||||
|
||||
@test "kpod push to docker archive" {
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS pull "$IMAGE"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS push "$IMAGE" docker-archive:/tmp/busybox-archive:1.26
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
rm /tmp/busybox-archive
|
||||
run crioctl image remove "$IMAGE"
|
||||
stop_crio
|
||||
}
|
||||
|
||||
@test "kpod push to oci without compression" {
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS pull "$IMAGE"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run mkdir /tmp/oci-busybox
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS push --disable-compression "$IMAGE" oci:/tmp/oci-busybox
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run rm -rf /tmp/oci-busybox
|
||||
run crioctl image remove "$IMAGE"
|
||||
stop_crio
|
||||
}
|
||||
|
||||
@test "kpod push without signatures" {
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS pull "$IMAGE"
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run mkdir /tmp/busybox
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} $KPOD_OPTIONS push --remove-signatures "$IMAGE" dir:/tmp/busybox
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run rm -rf /tmp/busybox
|
||||
run crioctl image remove "$IMAGE"
|
||||
stop_crio
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue