pixie icon indicating copy to clipboard operation
pixie copied to clipboard

Discover owning CronJob from PxL script

Open rosenhouse opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. When gathering http_events data, it is helpful to know the name of the controlling resource. In some cases, there are 2 levels of controllers, e.g.

  1. a user creates a Deployment which creates ReplicaSets which creates Pods.
  2. a user creates a CronJob which creates Jobs which create Pods

In example (1), a PxL script can use the pod_id_to_deployment_name function to get the controlling Deployment.

However for example (2), there is no current way to get the controlling CronJob.

Describe the solution you'd like A pod_id_to_cronjob_name function. When the pod isn't controlled by a CronJob, it returns the empty string.

Describe alternatives you've considered The owner_references returned by this function returns the intermediate Job owner. We can string-parse that Job's name to infer a CronJob, but that is brittle.

rosenhouse avatar Jul 05 '23 19:07 rosenhouse