helm: fix a memory leak resulting from too many k8s client instantiations by misberner · Pull Request #6026 · operator-framework/operator-sdk
See operator-framework/helm-operator-plugins#198 for a detailed description of the issue. This commit ports over the relevant changes.
I assume that eventually, the generic helm-operator code in this repo should depend on github.com/operator-framework/helm-operator-plugins. However, because the latter repo is still marked as experimental, and importing it would result in a large number of accidental dependency changes, I have decided to merely copy code over.
I've tried to minimize changes to both the copied code as well as the existing code in this repo. Because the bulk of the code is copied, I don't think replicating tests would be useful, but I can see if I can copy them over if it turns out to be not too much effort.
Description of the change: Fix a memory leak in the Helm operator code.
Motivation for the change: Excessive memory usage of Helm operators (2GB+)
Checklist
If the pull request includes user-facing changes, extra documentation is required:
-
Add a new changelog fragment inchangelog/fragments(seechangelog/fragments/00-template.yaml) -
Add or update relevant sections of the docs website inwebsite/content/en/docs