# more efficient than forking to check history every time
if[ -n "$KUBERNETES_CLI"];then
case"$KUBERNETES_CLI" in
kubectl)opts+=("${kubectl_opts[@]}")
kubectl)opts+=("${kubectl_opts[@]:-}")
;;
oc)opts+=("${oc_opts[@]}")
oc)opts+=("${oc_opts[@]:-}")
;;
*)echo"invalid command '$KUBERNETES_CLI' listed in \$KUBERNETES_CLI (must be either 'kubectl' or 'oc' depending on whether you are using straight Kubernetes or OpenShift). Fix the variable or unset it to auto-detect when calling the k() function"
return
@ -251,7 +251,7 @@ k(){
openshift)command oc "${oc_opts[@]}""$@"
exportKUBERNETES_CLI=oc
;;
k8s|*)command kubectl "${kubectl_opts[@]}""$@"
k8s|*)command kubectl "${kubectl_opts[@]:-}""$@"
exportKUBERNETES_CLI=kubectl
;;
esac
@ -390,7 +390,7 @@ watchpods(){
echo
echo'Pods:'
echo
kubectl " "${kubectl_opts[@]}" " get pods " "${k8s_get_pod_opts[@]}" " 2>&1
kubectl " "${kubectl_opts[@]:-}" " get pods " "${k8s_get_pod_opts[@]:-}" " 2>&1
@ -26,6 +26,8 @@ Installs the Helm Charts from one or more Kustomize kustomization.yaml files usi
All arguments are passed straight to yq and must be kustomization.yaml files or valid --options
If SKIP_EXISTING_HELM_INSTALLATIONS is set to any value, then will skip those installations (useful for CI/CD retries without failing on existing installation from previous run)
If SKIP_ERRORS is set to any value, will ignore failures to install each helm chart, such as webhooks failing to contact cert-manager (useful for CI/CD runs where you just want the charts installed to test outdated release versions such as https://github.com/HariSekhon/Kubernetes-configs/actions/workflows/kustomize-nova.yaml)
Uses adjacent script kustomize_parse_helm_charts.sh and is used in CI/CD GitHub Actions for repo:
@ -49,17 +51,33 @@ type -P yq &>/dev/null || "$srcdir/setup/install_yq.sh"
# if there are no repositories to show will return exit code 1 so || :