kapicorp / kapitan

Generic templated configuration management for Kubernetes, Terraform and other things
https://kapitan.dev
Apache License 2.0
1.83k stars 199 forks source link

[bug]: KapitanInputTypeKadetConfig inherits prune from KapitanInputTypeBaseConfig #1257

Closed JordanLloydHall closed 3 weeks ago

JordanLloydHall commented 3 weeks ago

Description of the bug

After adding Pydantic types for Inventory, the assumption was introduced that Kadet Input in Kapitan should always prune objects before serialization to a file. However, there are many cases for which this is not the case, such as Flux's ImageRepository, where it is expected that the object is empty.

Steps to reproduce

1. Use Kadet as input for an object with an empty dictionary as a value to a key.
2. Run `kapitan compile`.
3. See that neither the key nor value appears in the compiled directory.

What happened?

The key (with an empty dict as a value) should be in the compiled directory.

Additional context

This was introduced in PR #1234. Specifically in line 36 of kapitan/inventory/model/input_types.py.

Version (kapitan)

master

Version (kapitan)

I use kapitan directly (pip, docker)

Python virtual environment

OS information

No response

Relevant log output

No response

ademariag commented 3 weeks ago

Thank you @JordanLloydHall , this was unintentional caused by the migration. after testing I will release a new fix version

JordanLloydHall commented 3 weeks ago

Thank you @JordanLloydHall , this was unintentional caused by the migration. after testing I will release a new fix version

Thank you for your great work on this project!