Skip to content

Commit 0381c65

Browse files
Bob DillMihir Shah
Bob Dill
authored and
Mihir Shah
committed
update to remove -a option from kubectl get pod and kubectl get pods. (#100)
1 parent ff63248 commit 0381c65

11 files changed

+31
-31
lines changed

cs-offerings/scripts/create/chaincode_install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ echo "Creating chaincodeinstall pod"
6060
echo "Running: kubectl create -f ${KUBECONFIG_FOLDER}/chaincode_install.yaml"
6161
kubectl create -f ${KUBECONFIG_FOLDER}/chaincode_install.yaml
6262

63-
while [ "$(kubectl get pod -a chaincodeinstall | grep chaincodeinstall | awk '{print $3}')" != "Completed" ]; do
63+
while [ "$(kubectl get pod chaincodeinstall | grep chaincodeinstall | awk '{print $3}')" != "Completed" ]; do
6464
echo "Waiting for chaincodeinstall container to be Completed"
6565
sleep 1;
6666
done
6767

68-
if [ "$(kubectl get pod -a chaincodeinstall | grep chaincodeinstall | awk '{print $3}')" == "Completed" ]; then
68+
if [ "$(kubectl get pod chaincodeinstall | grep chaincodeinstall | awk '{print $3}')" == "Completed" ]; then
6969
echo "Install Chaincode Completed Successfully"
7070
fi
7171

72-
if [ "$(kubectl get pod -a chaincodeinstall | grep chaincodeinstall | awk '{print $3}')" != "Completed" ]; then
72+
if [ "$(kubectl get pod chaincodeinstall | grep chaincodeinstall | awk '{print $3}')" != "Completed" ]; then
7373
echo "Install Chaincode Failed"
7474
fi

cs-offerings/scripts/create/chaincode_instantiate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ echo "Creating chaincodeinstantiate pod"
6868
echo "Running: kubectl create -f ${KUBECONFIG_FOLDER}/chaincode_instantiate.yaml"
6969
kubectl create -f ${KUBECONFIG_FOLDER}/chaincode_instantiate.yaml
7070

71-
while [ "$(kubectl get pod -a chaincodeinstantiate | grep chaincodeinstantiate | awk '{print $3}')" != "Completed" ]; do
71+
while [ "$(kubectl get pod chaincodeinstantiate | grep chaincodeinstantiate | awk '{print $3}')" != "Completed" ]; do
7272
echo "Waiting for chaincodeinstantiate container to be Completed"
7373
sleep 1;
7474
done
7575

76-
if [ "$(kubectl get pod -a chaincodeinstantiate | grep chaincodeinstantiate | awk '{print $3}')" == "Completed" ]; then
76+
if [ "$(kubectl get pod chaincodeinstantiate | grep chaincodeinstantiate | awk '{print $3}')" == "Completed" ]; then
7777
echo "Instantiate Chaincode Completed Successfully"
7878
fi
7979

80-
if [ "$(kubectl get pod -a chaincodeinstantiate | grep chaincodeinstantiate | awk '{print $3}')" != "Completed" ]; then
80+
if [ "$(kubectl get pod chaincodeinstantiate | grep chaincodeinstantiate | awk '{print $3}')" != "Completed" ]; then
8181
echo "Instantiate Chaincode Failed"
8282
fi

cs-offerings/scripts/create/create_blockchain.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,28 @@ while [ "${NUMPENDING}" != "0" ]; do
6565
sleep 1
6666
done
6767

68-
UTILSSTATUS=$(kubectl get pods -a utils | grep utils | awk '{print $3}')
68+
UTILSSTATUS=$(kubectl get pods utils | grep utils | awk '{print $3}')
6969
while [ "${UTILSSTATUS}" != "Completed" ]; do
7070
echo "Waiting for Utils pod to start completion. Status = ${UTILSSTATUS}"
7171
if [ "${UTILSSTATUS}" == "Error" ]; then
7272
echo "There is an error in utils pod. Please run 'kubectl logs utils' or 'kubectl describe pod utils'."
7373
exit 1
7474
fi
75-
UTILSSTATUS=$(kubectl get pods -a utils | grep utils | awk '{print $3}')
75+
UTILSSTATUS=$(kubectl get pods utils | grep utils | awk '{print $3}')
7676
done
7777

7878

79-
UTILSCOUNT=$(kubectl get pods -a utils | grep "0/3" | grep "Completed" | wc -l | awk '{print $1}')
79+
UTILSCOUNT=$(kubectl get pods utils | grep "0/3" | grep "Completed" | wc -l | awk '{print $1}')
8080
while [ "${UTILSCOUNT}" != "1" ]; do
81-
UTILSLEFT=$(kubectl get pods -a utils | grep utils | awk '{print $2}')
81+
UTILSLEFT=$(kubectl get pods utils | grep utils | awk '{print $2}')
8282
echo "Waiting for all containers in Utils pod to complete. Left = ${UTILSLEFT}"
83-
UTILSSTATUS=$(kubectl get pods -a utils | grep utils | awk '{print $3}')
83+
UTILSSTATUS=$(kubectl get pods utils | grep utils | awk '{print $3}')
8484
if [ "${UTILSSTATUS}" == "Error" ]; then
8585
echo "There is an error in utils pod. Please run 'kubectl logs utils' or 'kubectl describe pod utils'."
8686
exit 1
8787
fi
8888
sleep 1
89-
UTILSCOUNT=$(kubectl get pods -a utils | grep "0/3" | grep "Completed" | wc -l | awk '{print $1}')
89+
UTILSCOUNT=$(kubectl get pods utils | grep "0/3" | grep "Completed" | wc -l | awk '{print $1}')
9090
done
9191

9292
echo "Waiting for 15 seconds for peers and orderer to settle"

cs-offerings/scripts/create/create_channel.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ echo "Creating createchannel pod"
3535
echo "Running: kubectl create -f ${KUBECONFIG_FOLDER}/create_channel.yaml"
3636
kubectl create -f ${KUBECONFIG_FOLDER}/create_channel.yaml
3737

38-
while [ "$(kubectl get pod -a createchannel | grep createchannel | awk '{print $3}')" != "Completed" ]; do
38+
while [ "$(kubectl get pod createchannel | grep createchannel | awk '{print $3}')" != "Completed" ]; do
3939
echo "Waiting for createchannel container to be Completed"
4040
sleep 1;
4141
done
4242

43-
if [ "$(kubectl get pod -a createchannel | grep createchannel | awk '{print $3}')" == "Completed" ]; then
43+
if [ "$(kubectl get pod createchannel | grep createchannel | awk '{print $3}')" == "Completed" ]; then
4444
echo "Create Channel Completed Successfully"
4545
fi
4646

47-
if [ "$(kubectl get pod -a createchannel | grep createchannel | awk '{print $3}')" != "Completed" ]; then
47+
if [ "$(kubectl get pod createchannel | grep createchannel | awk '{print $3}')" != "Completed" ]; then
4848
echo "Create Channel Failed"
4949
fi

cs-offerings/scripts/create/create_composer-playground.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ echo "Creating composer-card-import pod"
3434
echo "Running: kubectl create -f ${KUBECONFIG_FOLDER}/composer-card-import.yaml"
3535
kubectl create -f ${KUBECONFIG_FOLDER}/composer-card-import.yaml
3636

37-
while [ "$(kubectl get pod -a composer-card-import | grep composer-card-import | awk '{print $3}')" != "Completed" ]; do
37+
while [ "$(kubectl get pod composer-card-import | grep composer-card-import | awk '{print $3}')" != "Completed" ]; do
3838
echo "Waiting for composer-card-import container to be Completed"
3939
sleep 1;
4040
done
4141

42-
if [ "$(kubectl get pod -a composer-card-import | grep composer-card-import | awk '{print $3}')" == "Completed" ]; then
42+
if [ "$(kubectl get pod composer-card-import | grep composer-card-import | awk '{print $3}')" == "Completed" ]; then
4343
echo "Composer Card Import Completed Successfully"
4444
fi
4545

46-
if [ "$(kubectl get pod -a composer-card-import | grep composer-card-import | awk '{print $3}')" != "Completed" ]; then
46+
if [ "$(kubectl get pod composer-card-import | grep composer-card-import | awk '{print $3}')" != "Completed" ]; then
4747
echo "Composer Card Import Failed"
4848
fi
4949

cs-offerings/scripts/create/join_channel.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ echo "Creating joinchannel pod"
5151
echo "Running: kubectl create -f ${KUBECONFIG_FOLDER}/join_channel.yaml"
5252
kubectl create -f ${KUBECONFIG_FOLDER}/join_channel.yaml
5353

54-
while [ "$(kubectl get pod -a joinchannel | grep joinchannel | awk '{print $3}')" != "Completed" ]; do
54+
while [ "$(kubectl get pod joinchannel | grep joinchannel | awk '{print $3}')" != "Completed" ]; do
5555
echo "Waiting for joinchannel container to be Completed"
5656
sleep 1;
5757
done
5858

59-
if [ "$(kubectl get pod -a joinchannel | grep joinchannel | awk '{print $3}')" == "Completed" ]; then
59+
if [ "$(kubectl get pod joinchannel | grep joinchannel | awk '{print $3}')" == "Completed" ]; then
6060
echo "Join Channel Completed Successfully"
6161
fi
6262

63-
if [ "$(kubectl get pod -a joinchannel | grep joinchannel | awk '{print $3}')" != "Completed" ]; then
63+
if [ "$(kubectl get pod joinchannel | grep joinchannel | awk '{print $3}')" != "Completed" ]; then
6464
echo "Join Channel Failed"
6565
fi

cs-offerings/scripts/delete/delete_blockchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ else
4747
fi
4848

4949
echo "Deleting blockchain deployments"
50-
if [ "$(kubectl get pods -a | grep couchdb | wc -l | awk '{print $1}')" != "0" ]; then
50+
if [ "$(kubectl get pods | grep couchdb | wc -l | awk '{print $1}')" != "0" ]; then
5151
# Use the yaml file with couchdb
5252
echo "Running: kubectl delete -f ${KUBECONFIG_FOLDER}/blockchain-couchdb.yaml"
5353
kubectl delete -f ${KUBECONFIG_FOLDER}/blockchain-couchdb.yaml

cs-offerings/scripts/delete/delete_chaincode-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ echo "Preparing yaml for chaincodeinstall pod"
2121
sed -e "s/%PEER_ADDRESS%/${PEER_ADDRESS}/g" -e "s/%PEER_MSPID%/${PEER_MSPID}/g" -e "s|%MSP_CONFIGPATH%|${MSP_CONFIGPATH}|g" -e "s/%CHAINCODE_NAME%/${CHAINCODE_NAME}/g" -e "s/%CHAINCODE_VERSION%/${CHAINCODE_VERSION}/g" ${KUBECONFIG_FOLDER}/chaincode_install.yaml.base > ${KUBECONFIG_FOLDER}/chaincode_install.yaml
2222

2323
echo "Deleting Existing Install Chaincode Pod"
24-
if [ "$(kubectl get pods -a | grep chaincodeinstall | wc -l | awk '{print $1}')" != "0" ]; then
24+
if [ "$(kubectl get pods | grep chaincodeinstall | wc -l | awk '{print $1}')" != "0" ]; then
2525
echo "Running: kubectl delete -f ${KUBECONFIG_FOLDER}/chaincode_install.yaml"
2626
kubectl delete -f ${KUBECONFIG_FOLDER}/chaincode_install.yaml
2727

2828
# Wait for the pod to be deleted
29-
while [ "$(kubectl get pods -a | grep chaincodeinstall | wc -l | awk '{print $1}')" != "0" ]; do
29+
while [ "$(kubectl get pods | grep chaincodeinstall | wc -l | awk '{print $1}')" != "0" ]; do
3030
echo "Waiting for old install chaincode Pod to be deleted"
3131
sleep 1;
3232
done

cs-offerings/scripts/delete/delete_chaincode-instantiate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ echo "Preparing yaml for chaincode instantiate delete"
2121
sed -e "s/%CHANNEL_NAME%/${CHANNEL_NAME}/g" -e "s/%PEER_ADDRESS%/${PEER_ADDRESS}/g" -e "s/%PEER_MSPID%/${PEER_MSPID}/g" -e "s|%MSP_CONFIGPATH%|${MSP_CONFIGPATH}|g" -e "s/%CHAINCODE_NAME%/${CHAINCODE_NAME}/g" -e "s/%CHAINCODE_VERSION%/${CHAINCODE_VERSION}/g" ${KUBECONFIG_FOLDER}/chaincode_instantiate.yaml.base > ${KUBECONFIG_FOLDER}/chaincode_instantiate.yaml
2222

2323
echo "Deleting Existing Instantiate Chaincode Pod"
24-
if [ "$(kubectl get pods -a | grep chaincodeinstantiate | wc -l | awk '{print $1}')" != "0" ]; then
24+
if [ "$(kubectl get pods | grep chaincodeinstantiate | wc -l | awk '{print $1}')" != "0" ]; then
2525
echo "Running: kubectl delete -f ${KUBECONFIG_FOLDER}/chaincode_instantiate.yaml"
2626
kubectl delete -f ${KUBECONFIG_FOLDER}/chaincode_instantiate.yaml
2727

2828
# Wait for the pod to be deleted
29-
while [ "$(kubectl get pods -a | grep chaincodeinstantiate | wc -l | awk '{print $1}')" != "0" ]; do
29+
while [ "$(kubectl get pods | grep chaincodeinstantiate | wc -l | awk '{print $1}')" != "0" ]; do
3030
echo "Waiting for old instantiate chaincode Pod to be deleted"
3131
sleep 1;
3232
done

cs-offerings/scripts/delete/delete_channel-pods.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ echo "Preparing yaml for createchannel pod for deletion"
1818
sed -e "s/%PEER_ADDRESS%/${PEER_ADDRESS}/g" -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
1919

2020
echo "Deleting Existing Create Channel Pod"
21-
if [ "$(kubectl get pods -a | grep createchannel | wc -l | awk '{print $1}')" != "0" ]; then
21+
if [ "$(kubectl get pods | grep createchannel | wc -l | awk '{print $1}')" != "0" ]; then
2222
echo "Running: kubectl delete -f ${KUBECONFIG_FOLDER}/create_channel.yaml"
2323
kubectl delete -f ${KUBECONFIG_FOLDER}/create_channel.yaml
2424

2525
# Wait for the pod to be deleted
26-
while [ "$(kubectl get pods -a | grep createchannel | wc -l | awk '{print $1}')" != "0" ]; do
26+
while [ "$(kubectl get pods | grep createchannel | wc -l | awk '{print $1}')" != "0" ]; do
2727
echo "Waiting for old Create Channel Pod to be deleted"
2828
sleep 1;
2929
done
@@ -37,13 +37,13 @@ fi
3737
echo "Preparing yaml for joinchannel pod for deletion"
3838
sed -e "s/%PEER_ADDRESS%/${PEER_ADDRESS}/g" -e "s/%CHANNEL_NAME%/${CHANNEL_NAME}/g" -e "s/%PEER_MSPID%/${PEER_MSPID}/g" -e "s|%MSP_CONFIGPATH%|${MSP_CONFIGPATH}|g" ${KUBECONFIG_FOLDER}/join_channel.yaml.base > ${KUBECONFIG_FOLDER}/join_channel.yaml
3939

40-
if [ "$(kubectl get pods -a | grep joinchannel | wc -l | awk '{print $1}')" != "0" ]; then
40+
if [ "$(kubectl get pods | grep joinchannel | wc -l | awk '{print $1}')" != "0" ]; then
4141
echo "Deleting Existing joinchannel pods"
4242
echo "Running: kubectl delete -f ${KUBECONFIG_FOLDER}/join_channel.yaml"
4343
kubectl delete -f ${KUBECONFIG_FOLDER}/join_channel.yaml
4444

4545
# Wait for the pod to be deleted
46-
while [ "$(kubectl get pods -a | grep joinchannel | wc -l | awk '{print $1}')" != "0" ]; do
46+
while [ "$(kubectl get pods | grep joinchannel | wc -l | awk '{print $1}')" != "0" ]; do
4747
echo "Waiting for old Join Channel to be deleted"
4848
sleep 1;
4949
done

cs-offerings/scripts/wipe_shared.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ else
99
kubectl create -f ../kube-configs/wipe_shared.yaml
1010
fi
1111

12-
while [ "$(kubectl get pod -a wipeshared | grep wipeshared | awk '{print $3}')" != "Completed" ]; do
12+
while [ "$(kubectl get pod wipeshared | grep wipeshared | awk '{print $3}')" != "Completed" ]; do
1313
echo "Waiting for the shared folder to be erased"
1414
sleep 1;
1515
done

0 commit comments

Comments
 (0)