CiscoDevNet / appdynamics-charts

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

Unwelcome change in behavior for Cluster Agent Name by using `clusterAgent.appName` value #38

Open joshwright10 opened 1 year ago

joshwright10 commented 1 year ago

Version v1.9.0 of the Cluster Agent Helm Chart used to make the Cluster Agent Name using the syntax "%s-%s" .Release.Name "appdynamics-cluster-agent" this was changed in v1.10.0 to derive the name using .Values.clusterAgent.appName.

Kubernetes does not allow uppercase letters in the resource name and we are passing in an uppercase value from an external source. This change in behavior therefore caused the upgrade to fail. I suggest that this be handled in the template to force the value to be lowercase, rather than requiring external systems to do this in advance.

https://github.com/CiscoDevNet/appdynamics-charts/blob/12257197ab9f27488c7b46dc796f0200b7450bc6/cluster-agent/templates/cluster-agent.yaml#LL5C8-L5C8

Error

Error: UPGRADE FAILED: failed to create resource: Clusteragent.cluster.appdynamics.com "MHRDEV02-K8S-01-appdynamics" is invalid: metadata.name: Invalid value: "MHRDEV02-K8S-01-appdynamics": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is 'a-z0-9?(.a-z0-9?)*')

However, I don't believe that the Cluster Agent Name should be derived from this value at all. In our scenario, the clusterAgent.appName is different per cluster, and we do not want the Cluster Agent Name changing based on this value.

Why not do something similar to other popular charts which use the _helpers.tpl and the fullname function (see other popular Helm Charts like prometheus and argo-cd as examples).