Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
agent_state_summary: Properly handle nodes without reports/responses
previously, when running `pe_status_check::agent_state_summary`, the result didn't only contain the certnames, but also additional data:` without this patch (one unresponsive node, one without reports at all): ```json { "noop": [ ], "corrective_changes": [ ], "used_cached_catalog": [ ], "failed": [ ], "changed": [ ], "unresponsive": [ { "certname": "pe.tim", "latest_report_noop": false, "latest_report_corrective_change": false, "cached_catalog_status": "not_used", "latest_report_status": "unchanged", "report_timestamp": "2024-12-05T13:41:55.483Z" } ], "no_report": [ "agent.tim" ], "responsive": [ "pe.tim" ], "unhealthy": [ { "certname": "pe.tim", "latest_report_noop": false, "latest_report_corrective_change": false, "cached_catalog_status": "not_used", "latest_report_status": "unchanged", "report_timestamp": "2024-12-05T13:41:55.483Z" }, "agent.tim" ], "unhealthy_counter": 2, "healthy_counter": 1, "total_counter": 2 } ``` To reproduce, do on the agent: ``` puppet ssl submit_request puppet ssl download_cert puppet facts upload ``` Now on the puppetserver: ``` puppet query nodes[certname,report_timestamp]{} ``` gives you: ```json [ { "certname": "pe.tim", "report_timestamp": "2024-12-05T13:11:55.884Z" }, { "certname": "agent.tim", "report_timestamp": null } ] ``` with this patch: ```json { "noop": [ ], "corrective_changes": [ ], "used_cached_catalog": [ ], "failed": [ ], "changed": [ ], "unresponsive": [ "pe.tim" ], "no_report": [ "agent.tim" ], "responsive": [ ], "unhealthy": [ "pe.tim", "agent.tim" ], "unhealthy_counter": 2, "healthy_counter": 0, "total_counter": 2 } ```
- Loading branch information