Discover owning CronJob from PxL script
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.
- a user creates a Deployment which creates ReplicaSets which creates Pods.
- 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.