Skip to content

Aggregate metadata for ownership chain and use annotations for runtime risks#33

Merged
piceri merged 4 commits intomainfrom
annotation-runtime-risk
Feb 13, 2026
Merged

Aggregate metadata for ownership chain and use annotations for runtime risks#33
piceri merged 4 commits intomainfrom
annotation-runtime-risk

Conversation

@piceri
Copy link
Contributor

@piceri piceri commented Feb 10, 2026

This PR:

  • Add a metadata client to the controller
  • Uses aggregateMetadata to get metadata for the pod and all of its supported owners
    • We currently only support ReplicaSets and Deployments
    • Only done for add/update events
  • Any annotations for a pod or any of its owners can have a key of github.com/runtime-risks to declare runtime risks

@piceri piceri marked this pull request as ready for review February 10, 2026 17:10
@piceri piceri requested a review from a team as a code owner February 10, 2026 17:10
Copilot AI review requested due to automatic review settings February 10, 2026 17:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds runtime risk tracking to the deployment tracker by aggregating metadata from pods and their ownership chain (ReplicaSets and Deployments). The implementation reads runtime risk annotations from Kubernetes resources and includes them in deployment records sent to the artifact metadata API.

Changes:

  • Added RuntimeRisk type system with validation and support for four risk categories (critical-resource, internet-exposed, lateral-movement, sensitive-data)
  • Implemented metadata aggregation that walks the pod ownership chain to collect runtime risk annotations
  • Updated RBAC permissions to allow reading ReplicaSet metadata

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/deploymentrecord/record.go Added RuntimeRisk type, constants, validation function, and updated DeploymentRecord to include runtime risks
internal/controller/controller.go Added metadata client, implemented ownership chain traversal with aggregateMetadata, and integrated runtime risk collection into recordContainer
cmd/deployment-tracker/main.go Created metadata client and passed it to controller initialization
deploy/manifest.yaml Added RBAC permissions for reading ReplicaSets and updated example cluster name
README.md Documented runtime risks feature and supported risk values
.gitignore Added .idea/ directory for JetBrains IDEs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@piceri piceri force-pushed the annotation-runtime-risk branch from cafc98e to a3b0d86 Compare February 12, 2026 22:13
@piceri piceri force-pushed the annotation-runtime-risk branch from a3b0d86 to 65a5729 Compare February 13, 2026 16:47
Copy link

@ajbeattie ajbeattie left a comment

Choose a reason for hiding this comment

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

LGTM!

@piceri piceri merged commit 3793af8 into main Feb 13, 2026
6 checks passed
@piceri piceri deleted the annotation-runtime-risk branch February 13, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants