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

Add deep-merge of values, and allow empty values file #812

Merged

Conversation

Lingkar
Copy link
Contributor

@Lingkar Lingkar commented Dec 20, 2024

Allow empty YAML values files.
Perform a deep merge instead of shallow, for better helm values patching.

(I was unable to locally run the tests, would like to check via the pipeline)

@allenporter
Copy link
Owner

Hello, appreciate the contribution!

I'd like there to be tests reproducing the problem you've run into here. Can you tell me more about why you were unable to run the tests?

@Lingkar
Copy link
Contributor Author

Lingkar commented Dec 20, 2024

@allenporter Seems like the issue was related to missing system dependency kyverno.
I will add some issue specific tests, will notify you when ready.

@Lingkar
Copy link
Contributor Author

Lingkar commented Dec 20, 2024

@allenporter I have updated the values tests to include an empty values and a patch values config.
Please let me know if I am missing anything else!

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.53%. Comparing base (3739b3c) to head (eb82ea9).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #812      +/-   ##
==========================================
+ Coverage   93.50%   93.53%   +0.02%     
==========================================
  Files          20       20              
  Lines        2294     2304      +10     
==========================================
+ Hits         2145     2155      +10     
  Misses        149      149              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@allenporter allenporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, though I have some minor nits. Also there are lint errors so you'll want to check those. Running run the pre-commit before committing can help catch those.

If the yaml lint doesn't like this and it can't be tested that way easily, you can also use test_values.py since it has some existing tests for this function.

flux_local/values.py Outdated Show resolved Hide resolved
flux_local/values.py Outdated Show resolved Hide resolved
@Lingkar
Copy link
Contributor Author

Lingkar commented Dec 23, 2024

@allenporter Thanks for the pre-commit tip! Might be a good idea to update the CONTRIBUTING.md with the system dependency kyverno and the usage of pre-commit?

I have processed the feedback in the PR.
When running pre-commit run --all-files I got some additional files which got updated, I left those out of my commits as unsure if I am supposed to run the pre-commit tool on all-files or just on the changed files in my PR.

@allenporter
Copy link
Owner

@allenporter Thanks for the pre-commit tip! Might be a good idea to update the CONTRIBUTING.md with the system dependency kyverno and the usage of pre-commit?

As for the pre-commit, yes, good idea, feel free to send a change to update it.
I think I may want to just drop kyverno support so we can leave that out and i'll remove it separatly. Thanks for this suggestion.

I have processed the feedback in the PR. When running pre-commit run --all-files I got some additional files which got updated, I left those out of my commits as unsure if I am supposed to run the pre-commit tool on all-files or just on the changed files in my PR.

Let's stick with just the files in this PR.

@allenporter
Copy link
Owner

Thanks for the contribution @Lingkar 💯

@allenporter allenporter merged commit e429a37 into allenporter:main Dec 23, 2024
25 checks passed
@allenporter
Copy link
Owner

I've released this as 6.1.0 and it's causing some HelmReleases to break https://github.com/onedr0p/home-ops/actions/runs/12473136322/job/34813129881

@allenporter
Copy link
Owner

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

Successfully merging this pull request may close these issues.

3 participants