aws / aws/eks-charts

Load Balancer Controller: defaultTags with special YAML characters

Open
#1,301 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Mustache
Stars
1.3k
Forks
1.1k
Avg merge
22m
Merged PRs (30d)
5

Description

**Describe the bug**

The Load Balancer Controller helm [deployment.yaml ](https://github.com/aws/eks-charts/blob/2942cdce0d98bd257822c64520779a05c25df2c2/stable/aws-load-balancer-controller/templates/deployment.yaml#L154C9-L156C19) processes `.Values.defaultTags` :
```
{{- if .Values.defaultTags }}
- --default-tags={{ include "aws-load-balancer-controller.convertMapToCsv" .Values.defaultTags | trimSuffix "," }}
{{- end }}
```
I'm noticing that default tag values with special yaml characters don't get properly handled when the helm template strips out the quoting.

It doesn't seem to matter that properly-quoted values are passed to the values file (in my case via terraform's `yamlencode()` function)...
```
resource "helm_release" "lbc" {
# ... other config ...

values = [yamlencode({
defaultTags = { "slackHandle" = "@jd", "createdAt" = "2026-01-19T17:11:15Z" }
})]

}
```
...because the template rendering step occurs after, turning valid YAML into invalid YAML.

**Steps to reproduce**
```
cat <<'EOF' | helm template test aws-load-balancer-controller --repo https://aws.github.io/eks-charts -f - --debug 2>&1 | grep -A 50 "deployment.yaml" | head -60
clusterName: test
defaultTags:
Owner: "github: @jeff-d"
simple: value
EOF
# Source: aws-load-balancer-controller/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-aws-load-balancer-controller
namespace: default
labels:
app.kubernetes.io/managed-by: Helm
helm.sh/chart: aws-load-balancer-controller-3.0.0
app.kubernetes.io/name: aws-load-balancer-controller
app.kubernetes.io/instance: test
app.kubernetes.io/version: "v3.0.0"
spec:

replicas: 2

revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/name: aws-load-balancer-controller
app.kubernetes.io/instance: test
template:
metadata:
labels:
app.kubernetes.io/name: aws-load-balancer-controller
app.kubernetes.io/instance: test
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
spec:
serviceAccountName: test-aws-load-balancer-controller
volumes:
- name: cert
secret:
defaultMode: 420
secretName: aws-load-balancer-tls
securityContext:
fsGroup: 65534
containers:
- name: aws-load-balancer-controller
args:
- --cluster-name=test
- --ingress-class=alb
- --default-tags=Owner=github: @jeff-d,simple=value
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
image: "public.ecr.aws/eks/aws-load-balancer-controller:v3.0.0"
imagePullPolicy: IfNotPresent
volumeMounts:
--
Error: YAML parse error on aws-load-balancer-controller/templates/deployment.yaml: error converting YAML to JSON: yaml: line 43: found character that cannot start any token
```

**Expected outcome**
```
containers:
- name: aws-load-balancer-controller
args:
- --cluster-name=test
- --ingress-class=alb
- "--default-tags=Owner=github: @jeff-d,simple=value"
```

**Environment**

* Chart name: aws-load-balancer-controller
* Chart version: 3.0.0 (App version: v3.0.0)
* Kubernetes version: v1.35.0
* Using EKS: yes (EKS version: 1.35)

**Additional Context**:

Contributor guide

Open the contributing guide

Research direction

Start with stable/aws-load-balancer-controller/templates/deployment.yaml around the defaultTags argument and the convertMapToCsv helper. Run the helm template reproduction from the issue, then verify that special-character tag values produce a quoted argument and that the rendered manifest passes YAML parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.