Skip to content

[backport release-1.21] propagate module context to nelm logs#807

Merged
ldmonster merged 1 commit into
release-1.21from
backport/nelm-module-log-context-release-1.21
Jul 17, 2026
Merged

[backport release-1.21] propagate module context to nelm logs#807
ldmonster merged 1 commit into
release-1.21from
backport/nelm-module-log-context-release-1.21

Conversation

@diyliv

@diyliv diyliv commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Cherry-pick d582982 ("propagate module context to nelm logs") from main to release-1.21.

The fix propagates the module name through context to nelm internal log messages, so progress tables, resource tracking, and other nelm internal logs show the correct module field instead of a frozen one from whichever module initialized the singleton first.

Changes:

  • pkg/helm/helm.go — call nelm.InitDefaultLogger(helmopts.Logger) during helm client factory init
  • pkg/helm/nelm/logger.go — add moduleAttr(ctx) helper, thread it through all log methods
  • pkg/helm/nelm/nelm.go — extract InitDefaultLogger, add contextWithModule/moduleFromContext, pass module context to all nelm action calls
  • pkg/helm/nelm/nelm_test.go — add tests for module-in-context logging and singleton logger behavior

Why do we need it, and what problem does it solve?

nelm internal log messages (progress tables, resource tracking) print a frozen module field from whichever module initialized the nelm client singleton first. This makes debugging and monitoring unreliable — log messages from nelm operations are attributed to the wrong module.

Changelog entries

section: addon-operator
type: fix
summary: Propagate module context to nelm internal logs for correct per-operation attribution.
impact_level: low

Signed-off-by: diyliv <onlogn081@gmail.com>
@diyliv diyliv self-assigned this Jul 17, 2026
@diyliv diyliv added release-note/bug Something isn't working bug Something isn't working and removed release-note/bug Something isn't working labels Jul 17, 2026
@ldmonster
ldmonster merged commit 7cd863e into release-1.21 Jul 17, 2026
13 of 15 checks passed
@ldmonster
ldmonster deleted the backport/nelm-module-log-context-release-1.21 branch July 17, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants