CiscoDevNet / appdynamics-charts

Helm charts for AppDynamics
https://appdynamics.github.io/appdynamics-charts/
Apache License 2.0
21 stars 38 forks source link

Fixes empty fields generated in agent manifests #29

Open agmimidi opened 2 years ago

agmimidi commented 2 years ago

The way the templating for the cluster-agent is defined now, will always create a tolerations, labels and nodeSelector fields regardless if these fields have values defined for them or not. These fields on the final manifest will just be empty. labels: {} nodeSelector: {} tolerations: []

While this does not cause issues when the agent is deployed directly via Helm (e.g. via helm install) it does cause issues when deployed via ArgoCD. Argo will try and deploy the manifest (generated using helm template) with the empty fields included, but the final manifest on the cluster will omit this fields. As a result, Argo will identify a diff between the desired and applied manifest and try to apply it again. This results in a sync loop which drains resources from the argoCD deployment.

This pull request adds some if statements on the cluster-agent template, and omits these fields if they are undefined in the provided values file.