Skip to content

refactor(processor/k8s): Improve configuration and API client setup#831

Merged
gfieni merged 4 commits into
masterfrom
refactor/k8s-preprocessor-config
May 19, 2026
Merged

refactor(processor/k8s): Improve configuration and API client setup#831
gfieni merged 4 commits into
masterfrom
refactor/k8s-preprocessor-config

Conversation

@gfieni
Copy link
Copy Markdown
Contributor

@gfieni gfieni commented May 18, 2026

PR overview:

  • Move monitor agent configuration into a dataclass.
  • Build Kubernetes API client configuration explicitly for local, cluster, and manual modes.
  • Move Kubernetes API client creation into the monitor agent process instead of the constructor.
  • Validate manual Kubernetes API host and bearer token settings.
  • Add a retry delay to prevent a tight fetch/watch/error loop when API queries fail.

@gfieni gfieni self-assigned this May 18, 2026
@gfieni gfieni requested a review from a team as a code owner May 18, 2026 10:26
Comment thread src/powerapi/processor/pre/k8s/monitor_agent.py Fixed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 70.96774% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.02%. Comparing base (496156d) to head (8879f69).

Files with missing lines Patch % Lines
src/powerapi/processor/pre/k8s/monitor_agent.py 63.82% 17 Missing ⚠️
src/powerapi/processor/pre/k8s/actor.py 83.33% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #831      +/-   ##
==========================================
- Coverage   72.12%   72.02%   -0.10%     
==========================================
  Files          90       90              
  Lines        2999     3003       +4     
==========================================
  Hits         2163     2163              
- Misses        836      840       +4     
Files with missing lines Coverage Δ
src/powerapi/cli/generator.py 89.04% <100.00%> (+0.05%) ⬆️
...werapi/processor/pre/k8s/metadata_cache_manager.py 100.00% <100.00%> (ø)
src/powerapi/processor/pre/k8s/actor.py 84.00% <83.33%> (-3.10%) ⬇️
src/powerapi/processor/pre/k8s/monitor_agent.py 55.33% <63.82%> (-0.45%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gfieni gfieni force-pushed the refactor/k8s-preprocessor-config branch from ec0cfa3 to 8879f69 Compare May 19, 2026 12:07
@gfieni gfieni merged commit 5bebb39 into master May 19, 2026
12 checks passed
@gfieni gfieni deleted the refactor/k8s-preprocessor-config branch May 19, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants