You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tk env list gives RUNTIME ERROR: couldn't open import ... if there is a main.jsonnet file in the external library installed using jb (i.e. in ./vendor/some-library-name) that imports other external library file.
To reproduce:
cd$(mktemp -d)
tk init -f --k8s 1.28
jb install github.com/pszulc1/trivial-lib-1@test-case-error
tk env list
Error: finding environments: Errors occurred during parallel processing:
- /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa/main.jsonnet:
evaluating jsonnet in path '/tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa/main.jsonnet': RUNTIME ERROR: couldn't open import "testonnet/main.libsonnet": no match locally or in the Jsonnet library paths /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa/main.jsonnet:1:14-47 thunk <test> from <$> /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa/main.jsonnet:3:1-5 /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa:2:17-102 thunk <main> from <$> /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa:30:11-15 thunk from <$> /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa:6:21-27 thunk from <thunk from <function <noDataEnv>>> <std>:31:26-27 thunk from <function <anonymous>> <std>:31:17-28 function <anonymous> /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa:6:8-28 thunk from <function <noDataEnv>> <std>:1613:20-21 thunk from <function <anonymous>> <std>:32:25-26 thunk from <function <anonymous>> <std>:32:16-27 function <anonymous> <std>:1613:8-22 function <anonymous> /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa:(5:3)-(28:4) function <noDataEnv> /tmp/tmp.u1AmiHytZ4/vendor/github.com/pszulc1/trivial-lib-1/aaa:30:1-16 $ During evaluation
The error relates to the ./vendor/trivial-lib-1/aaa/main.jsonnet file, which refers to a library that exists in the ./vendor folder.
There always seems to be a problem with tk if there is a vendor in the path to the main.jsonnet file that imports the library.
Renaming the main.jsonnet file bypasses the error.
I'm using tk version v0.27.1.
The text was updated successfully, but these errors were encountered:
tk show environments/default does not complain since it does not do a full search for all files with the name main.jsonnet. I'm not completely sure if there is really a usecase for searching for such files also within the lib and vendor folders since main.jsonnet files should never be imported (that's what main.libsonnet files are there for).
So I see two issues here:
aaa is importing a main.jsonnet
Tanka is looking in places for main.jsonnet files that are usually not there to store environments
Looking internally at where we run that command regularly I see that we limit it to the ./environments dir, so that's why we haven't hit that issue.
I'm not sure how much we can do, perhaps improve the error message? The directory layout is a convention and theoretically it could be that Tanka environments live in ./vendor 🤷♂️
tk env list
givesRUNTIME ERROR: couldn't open import ...
if there is amain.jsonnet
file in the external library installed usingjb
(i.e. in./vendor/some-library-name
) that imports other external library file.To reproduce:
The error relates to the
./vendor/trivial-lib-1/aaa/main.jsonnet
file, which refers to a library that exists in the./vendor
folder.There always seems to be a problem with
tk
if there is avendor
in the path to themain.jsonnet
file that imports the library.Renaming the
main.jsonnet
file bypasses the error.I'm using
tk version v0.27.1
.The text was updated successfully, but these errors were encountered: