refactoring kubectl command.
substituting backtics
@@ -140,10 +140,10 @@ echo "-------------------------------------"
# Check no tls-dex cert conflict issue
# Check the pod name
-target_cert_manager_pod=`kubectl get pods -n cert-manager -o name --no-headers=true | grep -vE 'webhook|cainjector' | cut -b 5-`
+target_cert_manager_pod=$(kubectl get pod -n cert-manager -lapp=cert-manager -o jsonpath="{.items[0].metadata.name}")
# Counting logs of undesired message
-check_dex_log=`kubectl logs ${target_cert_manager_pod} -n cert-manager | grep '"secret"="dex-tls" "message"="unexpected managed Secret Owner Reference field on Secret --enable-certificate-owner-ref=true"' | wc -l`
+check_dex_log=$(kubectl logs ${target_cert_manager_pod} -n cert-manager | grep '"secret"="dex-tls" "message"="unexpected managed Secret Owner Reference field on Secret --enable-certificate-owner-ref=true"' | wc -l)
# Exiting with count of bad logs if more than 10 are found
if [ $check_dex_log -gt 10 ]; then
