fix: detect Holmes triage config errors
This commit is contained in:
parent
b404121eab
commit
1f4c2ce16f
|
|
@ -2083,6 +2083,7 @@ doctor_k8s() {
|
||||||
local prompt_file
|
local prompt_file
|
||||||
local holmes_stdout
|
local holmes_stdout
|
||||||
local holmes_stderr
|
local holmes_stderr
|
||||||
|
local holmes_combined
|
||||||
local arg
|
local arg
|
||||||
|
|
||||||
require_debian_server "doctor-k8s"
|
require_debian_server "doctor-k8s"
|
||||||
|
|
@ -2208,6 +2209,13 @@ EOF
|
||||||
printf 'Holmes triage skipped by --no-holmes.\n' >"${holmes_stdout}"
|
printf 'Holmes triage skipped by --no-holmes.\n' >"${holmes_stdout}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
holmes_combined="$(cat "${holmes_stdout}" "${holmes_stderr}" 2>/dev/null || true)"
|
||||||
|
if [[ "${run_holmes}" == "true" && "${holmes_status}" == "0" ]] &&
|
||||||
|
printf '%s\n' "${holmes_combined}" |
|
||||||
|
grep -Eiq 'validation error|invalid config|extra inputs are not permitted|traceback|exception|error:'; then
|
||||||
|
holmes_status=1
|
||||||
|
fi
|
||||||
|
|
||||||
cat >"${artifact_dir}/triage.md" <<EOF
|
cat >"${artifact_dir}/triage.md" <<EOF
|
||||||
# Jeannie Kubernetes Doctor
|
# Jeannie Kubernetes Doctor
|
||||||
|
|
||||||
|
|
@ -2221,6 +2229,10 @@ EOF
|
||||||
## Holmes read-only triage
|
## Holmes read-only triage
|
||||||
|
|
||||||
$(sed -n '1,160p' "${holmes_stdout}" 2>/dev/null || true)
|
$(sed -n '1,160p' "${holmes_stdout}" 2>/dev/null || true)
|
||||||
|
|
||||||
|
## Holmes stderr
|
||||||
|
|
||||||
|
$(sed -n '1,120p' "${holmes_stderr}" 2>/dev/null || true)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
python3 - "${artifact_dir}/summary.json" "${artifact_dir}" "${kubeconfig}" "${api_status}" "${node_not_ready_count}" "${problem_pods_count}" "${holmes_status}" "${run_holmes}" <<'PY'
|
python3 - "${artifact_dir}/summary.json" "${artifact_dir}" "${kubeconfig}" "${api_status}" "${node_not_ready_count}" "${problem_pods_count}" "${holmes_status}" "${run_holmes}" <<'PY'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue