Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Yaml in configmap injection #8104

Closed
b-odonoghue opened this issue Jan 7, 2020 · 4 comments · Fixed by #8179
Closed

Invalid Yaml in configmap injection #8104

b-odonoghue opened this issue Jan 7, 2020 · 4 comments · Fixed by #8179
Assignees
Labels
bug Used to indicate a potential bug docs

Comments

@b-odonoghue
Copy link

b-odonoghue commented Jan 7, 2020

Hello,

It looks like there is an error in the in the configmap example documentaion which can be found here

There is a block that currently shows

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-configmap
agent-config
    app: app-example
data:
  config.hcl: |

But that is clearly invalid yaml, though I am honestly not sure what the correct form is.

Adding a colon is wrong as agent-config is not something that Kubernetes understands.

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-configmap
agent-config:
    app: app-example
data:
  config.hcl: |
@michelvocks michelvocks added bug Used to indicate a potential bug docs labels Jan 7, 2020
@AndrewSav
Copy link

There are also unescaped quotes in the same yaml at:

contents" = "{{- with secret "database/creds/db-app" -}}postgres://{{ .Data.username }}:{{ .Data.password }}@postgres:5432/mydb?sslmode=disable{{- end }}"

@spangenberg spangenberg self-assigned this Jan 17, 2020
@spangenberg
Copy link
Contributor

@AndrewSav the unescaped quotes in the {{- ... -}} are fine as they only get used in the preprocessor.

@AndrewSav
Copy link

AndrewSav commented Jan 17, 2020

Hello, @spangenberg did you try it, or you just think it should work? Because I tried and it does not. Escaping them does.

Also: what is "the preprocessor" you are referring to?

@spangenberg
Copy link
Contributor

Hi @AndrewSav, thanks for the quick response.
I mistakenly thought it was using go templates and not consul templates.
I'll also address this in my PR.
Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants