Repository navigation
fix(kaexporter): PVO11Y-5728 use ServiceAccount token authentication - #1376
Conversation
Remove the unused KA_TOKEN fallback while retaining token-file overrides and rotation. Read the KubeArchive endpoint from a ConfigMap and document the deployment contract. Jira: https://redhat.atlassian.net/browse/PVO11Y-5728 Validation: CGO_ENABLED=0 go test ./...; yamllint config/exporters/monitoring/kaexporter/base; kustomize build config/exporters/monitoring/kaexporter/base Assisted-by: OpenAI Codex Signed-off-by: Faisal Al-Rayes <falrayes@redhat.com>
PR Summary by QodoUse ServiceAccount token authentication for kaexporter
AI Description
Merge Risk
|
|
🤖 Review · Commit: |
Code Review by Qodo 1. Exporter pods cannot start
|
|
🤖 Finished Review · ✅ Success · Started 11:06 AM UTC · Completed 11:25 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.67 |
|
Risk Assessment: moderate (2/5) DetailsTier 1 and Tier 2 signals are essentially unchanged from the prior assessment (7 files, 167 lines, medium blast radius, no CI/dependency/protected-path changes, 0.43 test ratio, known author, zero recent churn, single-author area, aging files); re-review anchoring preserves the prior score of 2 (moderate), appropriate for a targeted ServiceAccount token authentication refactor with decent test coverage. Previous runRisk Assessment: moderate (2/5) DetailsTier 1 signals (7 files, 164 lines, medium blast radius, no CI/dependency/protected-path changes, 0.43 test ratio, known author) and Tier 2 signals (zero churn, single-author area, no regressions, but several aging files at 4-5 months) are essentially unchanged from the prior assessment; re-review anchoring preserves the prior score of 2 (moderate), appropriate for a targeted authentication refactor with decent test coverage touching stable but aging code. Previous run (2)Risk Assessment: moderate (2/5) DetailsSmall targeted authentication refactor (7 files, 159 lines) with no CI/dependency/protected-path changes, good test coverage, and a known non-first-time author; moderate blast radius and aging files (3-5 months old) in a low-churn single-author area keep the score at 2. Previous run (3)Risk Assessment: moderate (2/5) DetailsSmall targeted authentication refactor (7 files, 159 lines) with no CI/dependency/protected-path changes, good test coverage, and a known non-first-time author; moderate blast radius and aging files (3-5 months old) in a low-churn single-author area keep the score at 2. |
ReviewFindingsHigh
Medium
Low
Next steps:
Previous runReviewFindingsHigh
Medium
Low
Next steps:
Previous run (2)ReviewFindingsHigh
Medium
Low
Next steps:
Previous run (3)ReviewFindingsHigh
Medium
Low
Next steps:
|
|
/retest |
1 similar comment
|
/retest |
Escape the operator-supplied token path before logging. Document a narrowly scoped G703 exception because KA_TOKEN_FILE intentionally permits custom paths controlled by the deployment operator. Validation: gosec v2.28.0 no longer reports G703 or G706 in token resolution; CGO_ENABLED=0 go test ./... passes. Jira: https://redhat.atlassian.net/browse/PVO11Y-5728 Assisted-by: OpenAI Codex Signed-off-by: Faisal Al-Rayes <falrayes@redhat.com>
6720151 to
53bdc25
Compare
|
🤖 Finished Review · ✅ Success · Started 3:35 PM UTC · Completed 3:50 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.61 |
|
/retest |
|
🤖 Finished Review · ✅ Success · Started 11:43 AM UTC · Completed 11:57 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.32 |
|
/retest |
Describe custom token mounts, administrator control of the token path, and rotation behavior without relying on migration context. Validation: formatting and diff checks pass; G703/G706 findings match the previous scan, with no token-resolution findings. Jira: https://redhat.atlassian.net/browse/PVO11Y-5728 Assisted-by: OpenAI Codex Signed-off-by: Faisal Al-Rayes <falrayes@redhat.com>
699f4d8 to
9c3d9c5
Compare
|
🤖 Review · Commit: |
Use kaTokenFileEnvVar consistently in token resolution and tests. Validation: CGO_ENABLED=0 go test ./exporters/kaexporter/...; git diff --check. Jira: https://redhat.atlassian.net/browse/PVO11Y-5728 Assisted-by: OpenAI Codex Signed-off-by: Faisal Al-Rayes <falrayes@redhat.com>
|
🤖 Review · Commit: |
Scope the G101 exception to the KA_TOKEN_FILE environment variable name, which contains no credential. Validation: gosec v2.28.0 confirms the new G101 finding is removed with no additional findings; formatting and diff checks pass. Jira: https://redhat.atlassian.net/browse/PVO11Y-5728 Assisted-by: OpenAI Codex Signed-off-by: Faisal Al-Rayes <falrayes@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 3:10 PM UTC · Completed 3:27 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.83 |
addressed/resolved all comments
|
/retest |
Remove the unused
KA_TOKENenvironment fallback and use the mounted ServiceAccount token, retainingKA_TOKEN_FILEoverrides and rotation support. ReadKA_HOSTfrom thekaexporter-endpointConfigMap and update the documentation and authentication tests.Staging deployment migration: redhat-appstudio/infra-deployments#15685
PVO11Y-5728