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
Allow kadet inventory function to return a lazy inventory #848
Comments
Using 0.31.0rc0 I now get My adoption can be found here: Moep90/kapitan-reference@0fb8bab $ kapitan compile
Rendered inventory (0.25s)
Unknown (Non-Kapitan) Error occurred
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/linuxbrew/.linuxbrew/opt/python@3.7/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kapitan-0.31.0rc0-py3.7.egg/kapitan/targets.py", line 466, in compile_target
input_compiler.compile_obj(comp_obj, ext_vars, **kwargs)
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kapitan-0.31.0rc0-py3.7.egg/kapitan/inputs/base.py", line 56, in compile_obj
self.compile_input_path(input_path, comp_obj, ext_vars, **kwargs)
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kapitan-0.31.0rc0-py3.7.egg/kapitan/inputs/base.py", line 78, in compile_input_path
**kwargs,
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kapitan-0.31.0rc0-py3.7.egg/kapitan/inputs/kadet.py", line 129, in compile_file
output_obj = kadet_module.main(input_params)
File "/home/danny/github-repos/kapitan-reference/components/generators/kubernetes/__init__.py", line 1402, in main
return globals()[function](input_params)
File "/home/danny/github-repos/kapitan-reference/components/generators/kubernetes/__init__.py", line 1386, in generate_manifests
component_manifests = generate_component_manifests(input_params)
File "/home/danny/github-repos/kapitan-reference/components/generators/kubernetes/__init__.py", line 1267, in generate_component_manifests
workload = Workload(name=name, component=component)
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kadet/__init__.py", line 44, in __init__
self.body()
File "/home/danny/github-repos/kapitan-reference/components/generators/kubernetes/__init__.py", line 755, in body
workload.add_volume_claims(component.volume_claims)
File "/home/danny/github-repos/kapitan-reference/components/generators/kubernetes/__init__.py", line 54, in add_volume_claims
self.root.spec.volumeClaimTemplates += [value]
File "box/box.py", line 286, in box.box.Box.__iadd__
box.exceptions.BoxTypeError: Box can only merge two boxes or a box and a dictionary.
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kapitan-0.31.0rc0-py3.7.egg/kapitan/targets.py", line 134, in compile_targets
[p.get() for p in pool.imap_unordered(worker, target_objs) if p]
File "/home/danny/.env3_kapitan/lib/python3.7/site-packages/kapitan-0.31.0rc0-py3.7.egg/kapitan/targets.py", line 134, in <listcomp>
[p.get() for p in pool.imap_unordered(worker, target_objs) if p]
File "/home/linuxbrew/.linuxbrew/opt/python@3.7/lib/python3.7/multiprocessing/pool.py", line 748, in next
raise value
box.exceptions.BoxTypeError: Box can only merge two boxes or a box and a dictionary.
Box can only merge two boxes or a box and a dictionary. |
@Moep90 is this using a particular version of generators? |
From my perspective it can be resolved. Inventory is still more strict. But in a fair amount I guess. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Since the move to the external kadet package, the default inventory function is now strict e.g. if an attribute key is not found the root, it will raise KeyError.
This brings back the original 'lazy' behavior by allowing to call
inventory(lazy=True)
in the kadet input typeThe text was updated successfully, but these errors were encountered: