2023-06-08 09:42:48 +00:00
|
|
|
function kubectlgetall {
|
|
|
|
local namespace="${1}"
|
|
|
|
shift
|
|
|
|
|
2023-06-13 14:26:00 +00:00
|
|
|
for res in $(
|
2023-06-08 09:42:48 +00:00
|
|
|
kubectl api-resources --verbs=list --namespaced -o name |
|
|
|
|
grep -v "events.events.k8s.io" |
|
|
|
|
grep -v "events" |
|
|
|
|
sort | uniq
|
|
|
|
); do
|
2023-06-13 14:26:00 +00:00
|
|
|
echo "Resource: ${res}" >&2
|
|
|
|
|
|
|
|
kubectl \
|
|
|
|
-n ${namespace} \
|
|
|
|
get --ignore-not-found \
|
|
|
|
"${res}" \
|
|
|
|
"${@}"
|
2023-06-08 09:42:48 +00:00
|
|
|
done
|
|
|
|
}
|