Skip to content

fix(results): allow retention-policy-agent egress to the API server - #4030

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
enarha:fix-network-policy-results-retention-agent
Sep 4, 2026
Merged

fix(results): allow retention-policy-agent egress to the API server#4030
tekton-robot merged 1 commit into
tektoncd:mainfrom
enarha:fix-network-policy-results-retention-agent

Conversation

@enarha

@enarha enarha commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The results-retention-policy-agent NetworkPolicy allowed egress to DNS and the database, but not to the Kubernetes API server. The agent uses a ConfigMap watcher (informer) to load its schedule and retention settings from tekton-results-config-results-retention-policy, which requires talking to the API server, not just Postgres/DNS.

Assisted-by: Claude noreply@anthropic.com

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

The results-retention-policy-agent NetworkPolicy allowed egress to
DNS and the database, but not to the Kubernetes API server. The
agent uses a ConfigMap watcher (informer) to load its schedule and
retention settings from tekton-results-config-results-retention-policy,
which requires talking to the API server, not just Postgres/DNS.

Signed-off-by: Emil Natan <ena@redhat.com>
Assisted-by: Claude <noreply@anthropic.com>
@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Sep 3, 2026
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 3, 2026
@enarha
enarha requested a balanced review from Copilot September 3, 2026 14:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused policy correction follows existing helpers and includes appropriate test coverage.

Pull request overview

Allows the Results retention-policy agent to reach the Kubernetes API server for ConfigMap watches.

Changes:

  • Adds API-server egress to the retention agent’s NetworkPolicy.
  • Tests the new unrestricted egress rule.
File summaries
File Description
pkg/reconciler/kubernetes/tektonresult/networkpolicies.go Adds API-server egress.
pkg/reconciler/kubernetes/tektonresult/networkpolicies_test.go Verifies the added rule.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.44%. Comparing base (d1d928c) to head (a456b83).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4030   +/-   ##
=======================================
  Coverage   26.44%   26.44%           
=======================================
  Files         465      465           
  Lines       24991    24992    +1     
=======================================
+ Hits         6609     6610    +1     
  Misses      17661    17661           
  Partials      721      721           
Flag Coverage Δ
unit-tests 26.44% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkhelil

jkhelil commented Sep 3, 2026

Copy link
Copy Markdown
Member

/approve

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jkhelil

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 3, 2026
@pratap0007

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2026
@tekton-robot
tekton-robot merged commit e3ad274 into tektoncd:main Sep 4, 2026
17 checks passed
@jkhelil

jkhelil commented Sep 4, 2026

Copy link
Copy Markdown
Member

/cherry-pick release-v0.81.x

@tekton-robot

Copy link
Copy Markdown
Contributor

Cherry-pick to release-v0.81.x successful!

A new pull request has been created to cherry-pick this change to release-v0.81.x.

PR: #4038

Please review and merge the cherry-pick PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants