test-network-k8s: Support for Loading images for rest sample to KIND

This patch supports for pulling all images to the local docker cache
and loading to KIND.

Also, this adds the missing docker image pulling (couchdb) for Fabric.

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This commit is contained in:
Tatsuya Sato 2022-04-11 06:43:17 +00:00
parent 40bfa49a80
commit 36ff1c46e3
3 changed files with 31 additions and 4 deletions

BIN
test-network-k8s/kubectl Normal file

Binary file not shown.

View file

@ -174,6 +174,11 @@ elif [ "${MODE}" == "chaincode" ]; then
elif [ "${MODE}" == "anchor" ]; then
update_anchor_peers $@
elif [ "${MODE}" == "load-images-for-rest-easy" ]; then
log "Loading images for fabric-rest-sample to KIND:"
load_docker_images_for_rest_sample
log "🏁 - Images loaded."
elif [ "${MODE}" == "rest-easy" ]; then
log "Launching fabric-rest-sample application:"
launch_rest_sample

View file

@ -13,6 +13,7 @@ function pull_docker_images() {
docker pull ${FABRIC_CONTAINER_REGISTRY}/fabric-peer:$FABRIC_VERSION
docker pull ${FABRIC_CONTAINER_REGISTRY}/fabric-tools:$FABRIC_VERSION
docker pull ghcr.io/hyperledgendary/fabric-ccaas-asset-transfer-basic:latest
docker pull couchdb:3.2.1
pop_fn
}
@ -26,10 +27,29 @@ function load_docker_images() {
kind load docker-image ${FABRIC_CONTAINER_REGISTRY}/fabric-tools:$FABRIC_VERSION
kind load docker-image ghcr.io/hyperledgendary/fabric-ccaas-asset-transfer-basic:latest
kind load docker-image couchdb:3.2.1
pop_fn
pop_fn
}
function pull_docker_images_for_rest_sample() {
push_fn "Pulling docker images for fabric-rest-sample"
docker pull ghcr.io/hyperledger/fabric-rest-sample:latest
docker pull redis:6.2.5
pop_fn
}
function load_docker_images_for_rest_sample() {
push_fn "Loading docker images for fabric-rest-sample to KIND control plane"
kind load docker-image ghcr.io/hyperledgendary/fabric-ccaas-asset-transfer-basic:latest
kind load docker-image redis:6.2.5
pop_fn
}
function apply_nginx_ingress() {
push_fn "Launching ingress controller"
@ -181,8 +201,10 @@ function kind_init() {
launch_docker_registry
if [ "${STAGE_DOCKER_IMAGES}" == true ]; then
pull_docker_images
load_docker_images
pull_docker_images
load_docker_images
pull_docker_images_for_rest_sample
load_docker_images_for_rest_sample
fi
wait_for_cert_manager