From 4a77eab5f39ce4aca189bacae82097027242af3f Mon Sep 17 00:00:00 2001 From: Keegan Mullaney Date: Thu, 28 Jan 2021 23:36:38 -0800 Subject: [PATCH] fix cinfo and error msgs --- cki.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cki.sh b/cki.sh index 92826a9..5a9184c 100755 --- a/cki.sh +++ b/cki.sh @@ -205,13 +205,15 @@ cki_go() { read -rep "Enter namespace resources to describe : " -i 'role rolebinding service sa sts pvc pod' nsres # cluster info - info=('version --short' 'get cs -A' 'get netpol -A -o wide' 'api-versions' 'api-resources -o wide' 'get apiservices.apiregistration.k8s.io') + cinfo=('version --short' 'get cs -A' 'get netpol -A -o wide' 'api-versions' 'api-resources -o wide' 'get apiservices.apiregistration.k8s.io') for ci in "${cinfo[@]}" do cki_echo "${ci}" kubectl $ci done >k8s-info.log 2>&1 + RET=$? + lkm_error "There were some errors in k8s-info.log" lkm_success "Successfully created: k8s-info.log" lkm_msg2 "${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} (33%)\r" @@ -222,6 +224,8 @@ cki_go() { kubectl describe $(kubectl get $cr -o name) done >k8s-resources.yaml 2>&1 + RET=$? + lkm_error "There were some errors in k8s-resources.yaml" lkm_success "Successfully created: k8s-resources.yaml" lkm_msg2 "${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} (66%)\r" @@ -232,6 +236,8 @@ cki_go() { kubectl describe $(kubectl get $nr -o name -n $nspace) -n $nspace done >>k8s-resources.yaml 2>&1 + RET=$? + lkm_error "There were some errors in k8s-resources.yaml" lkm_success "Successfully appended to: k8s-resources.yaml" lkm_msg2 "${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} ${YELLOW_CHK} ${BLUE_CHK} ${GREEN_CHK} (100%)\r" echo -ne '\n'