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

Use absolute import paths #154

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

malcolmholmes
Copy link
Collaborator

Due to legacy support for hidden fields, Grizzly does not load Jsonnet files directly - it loads its own Jsonnet, which imports the referenced jsonnet.

This means that the path to the lib and vendor directories will actually be the current directory, not the directory in which the loaded jsonnet file resides.

This PR makes those paths absolute and relative to the jsonnet file's directory, and fixes this issue.

@malcolmholmes malcolmholmes merged commit c7b2395 into master Aug 16, 2021
@ywwg
Copy link
Contributor

ywwg commented Aug 23, 2021

The way this is written, if the path specified in opts.JsonnetPaths is already absolute (begins with "/"), this will still join with the cwd, resulting in an invalid path. I think this can be fixed by using testing for !filepath.IsAbs before doing the operation.

@malcolmholmes
Copy link
Collaborator Author

@ywwg Fix a bug, add a bug...

Thanks for the (valid) observation. Fancy rolling a quick PR?

@ywwg
Copy link
Contributor

ywwg commented Aug 24, 2021

np: #156

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.

None yet

3 participants