-
Notifications
You must be signed in to change notification settings - Fork 982
Factories fail when empty YaML files are passed #1794
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
Comments
WIP tests log: Works if empty Fails if empty |
Yep, problem is Discussed it the other day with Julio, and as long as we're consistent and users know what to expect, either solution works each with its own drawbacks
|
Came here with the same comments. I'd be tempted to remove
Explicit is better than implicit Wdyt? |
Agree, I would also drop a comment in our example files, stating that the file should either be valid or be removed altogether. So users know what to expect. |
After a couple of tests, a empty file can be "fixed" with
|
That's genius. So we just append |
nope, does not work
|
you got it reversed - should be
|
|
I was thinking we can add that to any empty file
|
I would go with removing |
harder to understand than an explicit comment saying something like
|
You missed on +1 from me to:
|
It's part of the yaml spec, so not really a trick. But agreed, it's more obscure than just a comment |
Absolutely, the whole issue is |
🤦 |
IMHO we should do both. |
+1 Simo |
And we do this for all modules exposing a factory, and add the comment to YAMLs in the doc examples too, right? Otherwise we'll have this same discussion all over again in a few months... |
SG. Editing the original post to extend scope, and will TAL later today. |
Fixed by #1812 |
Factories fail when empty YaML files are passed.
Some factories mitigate the problem by using
try(yamldecode())
, which however masks potential parse errors.original message below:
getting the following error when applying 02-networking stage with empty YAML files for firewall rules
example files:
2-networking-b-vpn/data/hierarchical-ingress-rules.yaml
2-networking-b-vpn/data/firewall-rules/dev/rules.yaml
cc @aaarel
The text was updated successfully, but these errors were encountered: