Skip to content

ROX-28590: [POC] (04) Pod-to-Deployment resolution - #22114

Draft
robbycochran wants to merge 1 commit into
rc-security-event-03-sensor-crdfrom
rc-security-event-04-resolver
Draft

ROX-28590: [POC] (04) Pod-to-Deployment resolution#22114
robbycochran wants to merge 1 commit into
rc-security-event-03-sensor-crdfrom
rc-security-event-04-resolver

Conversation

@robbycochran

Copy link
Copy Markdown
Contributor

Description

POC branch 4/9. Resolves PolicyReport Pod subjects to ACS Deployments via ParentHierarchy.TopLevelParents() and DeploymentStore. Adds resolution outcome metrics (resolved, unresolved, error).

AI-assisted development.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Cluster-validated: deployed, created PolicyReport, confirmed resolution metrics show resolved outcomes.

Share ParentHierarchy between deploymentHandler and PolicyReport
dispatcher via NewDispatcherRegistry. resolveSubject walks the
ownership chain (Pod → ReplicaSet → Deployment) using
TopLevelParents, then looks up the ACS Deployment by UID.

Still dry-run — returns nil, records resolution metrics
(rox_sensor_policyreport_resolution_total) with outcomes:
resolved, unresolved, error.

Tests cover: resolved pod, unresolved pod, non-pod subject,
multiple owners, owner not in store, transitive ownership.

AI-assisted.
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 78f55ee. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.12.x-517-g78f55eeaff

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.31579% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.31%. Comparing base (ac239fe) to head (78f55ee).

Files with missing lines Patch % Lines
...etes/listener/resources/policyreport/dispatcher.go 85.29% 4 Missing and 1 partial ⚠️
sensor/kubernetes/listener/resources/dispatcher.go 0.00% 3 Missing ⚠️
...ensor/kubernetes/listener/resources/deployments.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           rc-security-event-03-sensor-crd   #22114   +/-   ##
================================================================
  Coverage                            51.30%   51.31%           
================================================================
  Files                                 2853     2853           
  Lines                               178114   178146   +32     
================================================================
+ Hits                                 91385    91419   +34     
- Misses                               78715    78719    +4     
+ Partials                              8014     8008    -6     
Flag Coverage Δ
go-unit-tests 51.31% <76.31%> (+<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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant