mi: correctness fixes for unmarshal, resource leak, and test robustness (#2501)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2026-10-07 17:59:40 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 049cab563b
commit 6cdc9db241
9 changed files with 711 additions and 154 deletions
+2 -1
View File
@@ -249,7 +249,8 @@ func (c *Collection) Build(ctx context.Context, logger *slog.Logger) error {
errors.Is(err, pdh.NewPdhError(pdh.CstatusNoObject)) ||
errors.Is(err, pdh.NewPdhError(pdh.CstatusNoCounter)) ||
errors.Is(err, mi.MI_RESULT_INVALID_OPERATION_TIMEOUT) ||
errors.Is(err, mi.MI_RESULT_INVALID_NAMESPACE) {
errors.Is(err, mi.MI_RESULT_INVALID_NAMESPACE) ||
errors.Is(err, mi.MI_RESULT_INVALID_CLASS) {
logger.LogAttrs(ctx, slog.LevelWarn, "couldn't initialize collector", slog.Any("err", err))
continue