From 2e389077fa7be8638ec005d560b1fce8312c3cfe Mon Sep 17 00:00:00 2001 From: Josh Kneubuhl Date: Thu, 4 Aug 2022 06:45:47 -0400 Subject: [PATCH] allow a node registration to have been previously created. This allows for multiple 'network up' targets to be run. Signed-off-by: Josh Kneubuhl --- test-network-k8s/scripts/test_network.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test-network-k8s/scripts/test_network.sh b/test-network-k8s/scripts/test_network.sh index 069a4b2a..b50b4b8a 100755 --- a/test-network-k8s/scripts/test_network.sh +++ b/test-network-k8s/scripts/test_network.sh @@ -46,13 +46,19 @@ function create_node_local_MSP() { local ca_name=${org}-ca # Register the node admin + rc=0 fabric-ca-client register \ --id.name ${id_name} \ --id.secret ${id_secret} \ --id.type ${node_type} \ --url https://${ca_name}.${DOMAIN} \ --tls.certfiles $TEMP_DIR/cas/${ca_name}/tlsca-cert.pem \ - --mspdir $TEMP_DIR/enrollments/${org}/users/${RCAADMIN_USER}/msp + --mspdir $TEMP_DIR/enrollments/${org}/users/${RCAADMIN_USER}/msp \ + || rc=$? # trap error code from registration without exiting the network driver script" + + if [ $rc -eq 1 ]; then + echo "CA admin was (probably) previously registered - continuing" + fi # Enroll the node admin user from within k8s. This will leave the certificates available on a volume share in the # cluster for access by the nodes when launching in a container.