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

Lowercase constants in template #695

Open
2 tasks
meganwolf0 opened this issue Oct 1, 2024 · 1 comment
Open
2 tasks

Lowercase constants in template #695

meganwolf0 opened this issue Oct 1, 2024 · 1 comment
Labels
blocked Blocked by other dependencies possible-bug Something may not be working

Comments

@meganwolf0
Copy link
Collaborator

Environment

Device and OS:
App version:
Kubernetes distro:
Kubernetes version:
provider:

  • kyverno
  • opa

Steps to reproduce

When a config file contains a constants sub-key that is not all lowercase, and it's referenced in a case-senstive way, the templating render will fail

e.g., lula-config.yaml

constants:
  myKey: some-value

ref.yaml

valueOfMyKey: {{ .const.myKey }}

lula tools template -f ref.yaml

Expected result

valueOfMyKey: some-value

Actual Result

Error: executing "template" at <.const.myKey>: map has no entry for key "myKey"
(because viper converts myKey -> mykey)

Visual Proof (screenshots, videos, text, etc)

Severity/Priority

Additional Context

Associated Viper issue: spf13/viper#1014

@meganwolf0 meganwolf0 added the possible-bug Something may not be working label Oct 1, 2024
@github-actions github-actions bot added the triage Awaiting triage from the team label Oct 1, 2024
@brandtkeller brandtkeller removed the triage Awaiting triage from the team label Oct 7, 2024
@brandtkeller
Copy link
Member

Discussed the options for handling case-sensitivity or debugging and error output.

@brandtkeller brandtkeller added the blocked Blocked by other dependencies label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by other dependencies possible-bug Something may not be working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants