IBM-Blockchain-Archive / ibm-container-service

IBM Blockchain Platform for Developers on IBM Container Service
Apache License 2.0
89 stars 74 forks source link

create_channel.sh tries to replace non-existent %PEER_MSPID% references #94

Open DazWilkin opened 6 years ago

DazWilkin commented 6 years ago

https://github.com/IBM-Blockchain/ibm-container-service/blob/ff63248a583c4e548181d347d02fe3fe63b644ee/cs-offerings/scripts/create/create_channel.sh#L32

Script attempts to replace non-existent references to %PEER_MSPID% in ${KUBECONFIG_FOLDER}/create_channel.yaml.base.

Recommend: -- Remove redundant sed expression -- Consider replacing -e with --expression= for additional clarity

sed \
-e "s/%CHANNEL_NAME%/${CHANNEL_NAME}/g" \
-e "s/%PEER_MSPID%/${PEER_MSPID}/g" \
${KUBECONFIG_FOLDER}/create_channel.yaml.base > ${KUBECONFIG_FOLDER}/create_channel.yaml

Becomes:

sed \
--expression="s/%CHANNEL_NAME%/${CHANNEL_NAME}/g" \
${KUBECONFIG_FOLDER}/create_channel.yaml.base > ${KUBECONFIG_FOLDER}/create_channel.yaml