Skip to content

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

@pszulc1

Description

@pszulc1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In discussion

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions