Skip to content
This repository was archived by the owner on Nov 17, 2021. It is now read-only.

Import external json file with --tla-code not working #297

Open
irizzant opened this issue Apr 2, 2021 · 0 comments
Open

Import external json file with --tla-code not working #297

irizzant opened this issue Apr 2, 2021 · 0 comments

Comments

@irizzant
Copy link

irizzant commented Apr 2, 2021

I have the following scenario.

Let's consider the simplest test.jsonnet file containing:

function(env) env

And the following env.json file:

{
  custom: ''
}

If I invoke the following:

jsonnet --tla-code env="(import 'env.json') + {custom: 'value'}" test.jsonnet

I get:

{
   "custom": "value"
}

If I invoke the following:

kubecfg --tla-code env="(import 'env.json') + {custom: 'value'}" show test.jsonnet

I get:

ERROR Error reading test.jsonnet: RUNTIME ERROR: Could not get candidate URLs for when importing env.json (imported from <top-level-arg:env>): Invalid import dir "<top-level-arg:env>": parse "<top-level-arg:env>": first path segment in URL cannot contain colon
        <top-level-arg:env>:1:2-19      $
        file:///tmp/test.jsonnet:1:15-18        function <anonymous>
        Top-level function
@irizzant irizzant changed the title Import with --tla-code not working Import external file with --tla-code not working Apr 2, 2021
@irizzant irizzant changed the title Import external file with --tla-code not working Import external json file with --tla-code not working Apr 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant