Skip to content

serviceAccount annotations and labels are wrongly formatted #1405

@ldimitrov

Description

@ldimitrov

🐞 Bug report

Describe the bug

I tried to install the helm chart and needed to configure an annotation for the service account so that it can access an s3 bucket. But I got an error:

Helm upgrade failed: YAML parse error on operator/templates/rbac/serviceaccount.yaml: error converting YAML to JSON: yaml: line 9: mapping values are not allowed in this context

Then I saw this recent commit https://github.com/secureCodeBox/secureCodeBox/pull/1302/files#diff-002a5fbebb62d0b4a0b23564626190ffa44ca38ea7aa083f11aed87560cd8751 and here some auto fixes and linting was applied, which actually cause the bug.

In Version 3.14.3 the operator/templates/rbac/serviceaccount.yaml looked like this:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ .Values.serviceAccount.name }}
  annotations:
    {{ .Values.serviceAccount.annotations | toYaml | indent 4}}
  labels:
    {{ .Values.serviceAccount.labels | toYaml | indent 4 }}

And with the linting the new lines were removed and now it looks like this:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{.Values.serviceAccount.name}}
  annotations: {{.Values.serviceAccount.annotations | toYaml | indent 4}}
  labels: {{.Values.serviceAccount.labels | toYaml | indent 4}}

Steps To Reproduce

  1. Install secureCodeBox via helm chart version 3.15.0
  2. or check repository and use helm template values.yaml . --debug > test.yaml and see the output and wrongly formatted serviceAccount.annotations

Expected behavior

We should be able to configure annotations and labels for service accounts.

System (please complete the following information):

  • secureCodeBox Version/Release 3.15.0
  • Kubernetes Version [command: kubectl version] - v1.25.2

Screenshots / Logs

Helm upgrade failed: YAML parse error on operator/templates/rbac/serviceaccount.yaml: error converting YAML to JSON: yaml: line 9: mapping values are not allowed in this context

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions