requires
jqCLI
oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'
| # Install OpenShift 3.11 cli | |
| brew install https://raw.githubusercontent.com/cblecker/homebrew-core/d1092419e5113b296a6b1d7ecd2bf6673d39f0a2/Formula/openshift-cli.rb | |
| # ID = /var/lib/origin/openshift.local.volumes/plugins/kubernetes.io/cinder/mounts/[ID] | |
| oc get pv -o json | jq -r '[.items[] | {name:.spec.claimRef.name, namespace:.spec.claimRef.namespace, volumeID:.spec.cinder.volumeID}]' | grep -n2 [ID] | |
| # ElasticSearch get incides | |
| oc -n openshift-logging rsh $(oc -n openshift-logging get po -l component=es -o name) es_util --query=_cat/indices -XCURL |
requires
jqCLI
oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'
| $ FILE=/some/path/to/file.txt | |
| ################################### | |
| ### Remove matching suffix pattern | |
| ################################### | |
| $ echo ${FILE%.*} # remove ext | |
| /some/path/to/file | |
| $ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts |