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

feat: enable relative jsonnet imports by setting a path-aware importer #1044

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thevilledev
Copy link
Contributor

  • Introduce a new PathAwareParser interface that extends Parser with SetPath(path string).
  • Update parseConfigurations to detect if a parser implements PathAwareParser, and call SetPath(path).
  • Implement SetPath in the Jsonnet parser, setting the JPath (library path) to the file’s directory.
  • Add tests to ensure that relative imports in Jsonnet now work as expected.

Fixes #939

- Introduce a new `PathAwareParser` interface that extends `Parser` with `SetPath(path string)`.
- Update `parseConfigurations` to detect if a parser implements `PathAwareParser`, and call `SetPath(path)`.
- Implement `SetPath` in the Jsonnet parser, setting the JPath to the file’s directory.
- Add tests to ensure that relative imports in Jsonnet now work as expected.

Signed-off-by: Ville Vesilehto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jsonnet parser cannot handle relative imports
1 participant