mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Fix dumping logs with logexporter
This commit is contained in:
parent
7496c64b46
commit
0316faba9d
@ -365,10 +365,14 @@ function dump_nodes_with_logexporter() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
failed_nodes=()
|
failed_nodes=()
|
||||||
|
# The following if is needed, because defaulting for empty arrays
|
||||||
|
# seems to treat them as non-empty with single empty string.
|
||||||
|
if [[ -n "${NON_LOGEXPORTED_NODES:-}" ]]; then
|
||||||
for node in "${NON_LOGEXPORTED_NODES[@]:-}"; do
|
for node in "${NON_LOGEXPORTED_NODES[@]:-}"; do
|
||||||
echo "Logexporter didn't succeed on node ${node}. Queuing it for logdump through SSH."
|
echo "Logexporter didn't succeed on node ${node}. Queuing it for logdump through SSH."
|
||||||
failed_nodes+=("${node}")
|
failed_nodes+=("${node}")
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Delete the logexporter resources and dump logs for the failed nodes (if any) through SSH.
|
# Delete the logexporter resources and dump logs for the failed nodes (if any) through SSH.
|
||||||
"${KUBECTL}" get pods --namespace "${logexporter_namespace}" || true
|
"${KUBECTL}" get pods --namespace "${logexporter_namespace}" || true
|
||||||
|
Loading…
Reference in New Issue
Block a user