8000 Incorrect handling of empty/null variables · Issue #1217 · kluctl/kluctl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Incorrect handling of empty/null variables #1217

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

Open
funbiscuit opened this issue Nov 14, 2024 · 1 comment
Open

Incorrect handling of empty/null variables #1217

funbiscuit opened this issue Nov 14, 2024 · 1 comment

Comments

@funbiscuit
Copy link

Operating system

Manjaro with 6.6.19 kernel

Kluctl Version

2.25.1

Kubernetes Version

v1.30.4+k3s1

kubectl Version

v1.30.3

Bug description

When using empty or null variables kluctl incorretly substitutes them in templates

Steps to reproduce

.kluctl.yaml

discriminator: app-{{ target.name }}

targets:
  - name: local

deployment.yaml

deployments:
  - path: app
    vars:
      - file: vars.yaml

vars.yaml

testVar1:
testVar2: ""
testVar3: null

app/namespace.yaml

apiVersion: v1
kind: Namespace
metadata:
  labels:
    label1: {{ testVar1 }}
    label2: {{ testVar2 }}
    label3: {{ testVar3 }}
  name: app

If we render this project with kluctl render then rendered namespace will have following yaml:

apiVersion: v1
kind: Namespace
metadata:
  labels:
    label1: None
    label2: 
    label3: None
  name: app

So every variable is rendered wrong. testVar1 and testVar3 from null value became "None" string and testVar2 from "" empty string became null value,

Relevant log output

No response

@funbiscuit funbiscuit changed the title Incorrect handling of empty/null vartiables Incorrect handling of empty/null variables Nov 14, 2024
@ammgws
Copy link
ammgws commented Jan 18, 2025

I was set to use kluctl until seeing this. I wonder if it's reproducible in other projects using jinja2 like ansible...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0