What happened?
Context: operator/internal/controller/common/component/utils.ComputePCLQPodTemplateHash
Hash is computed using:
fmt.Fprintf(podTemplateSpecHasher, "%v", dump.ForHash(podTemplateSpec))
which converts the entire PodTemplateSpec to unstructured format using deep reflection. This is called every time in getLabels() during reconciliation, even when the template hasn't changed. This adds significant load on CPU resource and even does re-computation when it can be completely avoided.
What did you expect to happen?
Hash computation should only happen when something has changed in the fields that are used to compute the hash.
Environment
- Grove version: Since v0.1.0-alpha.1