dynatrace-operator
dynatrace-operator copied to clipboard
Change logic in WorkLoad retrieval when OwnerReference of Pod is no Controller
Description
Respective ticket: https://dt-rnd.atlassian.net/browse/K8S-9998
Because we normally assign the podName to the workload info in a certain corner case (when we have a ownerreference which is no controller) it can occur that the DT_WORKLOAD_KIND env var is set to empty.
This is fixed by simply using GenerateName instead of Name.
How can this be tested?
- unit tests
- I am not really sure how to properly test it otherwise at it seems to be a corner case which needs special set up