1
0
mirror of https://github.com/goharbor/harbor.git synced 2026-10-24 21:59:32 +03:00
Files
harbor/tests/apitests/python/library/containerd.py
stonezdj(Daojun Zhang) ee96bb779b Add proxy cache from dockerhub, harbor, jfrog (#23121)
default to run proxy cache from harbor
    add SKIP_PROXY_CACHE setting to skip run proxy cache testcase in github action incase
    registry.goharbor.io unstable

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-20 21:03:23 +08:00

18 lines
555 B
Python

# -*- coding: utf-8 -*-
import base
import json
import docker_api
def ctr_images_pull(username, password, oci):
command = ["ctr", "images", "pull", "-k", "--snapshotter", "native", "-u", username+":"+password, oci]
ret = base.run_command(command)
def ctr_images_list(oci_ref = None):
command = ["ctr", "images", "list", "--q"]
ret = base.run_command(command)
if oci_ref is not None and oci_ref not in ret.split("\n"):
raise Exception(r" Get OCI ref failed, expected ref is [{}], but return ref list is [{}]".format (ret))