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

tk env list failures if there is a main.jsonnet file in the external library that also imports library #1106

Open
pszulc1 opened this issue Jul 18, 2024 · 0 comments

Comments

@pszulc1
Copy link

pszulc1 commented Jul 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant