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

switch to go:embed #719

Open
cyphar opened this issue May 1, 2021 · 2 comments
Open

switch to go:embed #719

cyphar opened this issue May 1, 2021 · 2 comments

Comments

@cyphar
Copy link
Member

cyphar commented May 1, 2021

The internet requirement of the validate subcommand has been a fairly regular annoyance when using this tool in CI jobs and the like (where it's possible for the GET to fail intermittently), not to mention that it means you can't do any config validation in an air-gapped setup.

In the past, using gojsonschema's support for embedded data was ruled out because it was too annoying to maintain, but now that Go 1.16 has the embed package with //go:embed it seems that we should be able to implement this in a fairly painless way.

@kolyshkin
Copy link
Contributor

One problem is, the validation is done against a specific schema version. Which one do we embed? Say we do latest tagged (1.0.2 for now). What if version in config differs? Do we require internet in this case? Should we fall back to validating against the version we have (with a warning)?

Related: I just found out that anything before 1.0.2 is not possible with latest gojsonschema, so it won't be possible to validate against spec < 1.0.2.

@kolyshkin
Copy link
Contributor

kolyshkin commented Oct 20, 2021

Related: I just found out that anything before 1.0.2 is not possible with latest gojsonschema, so it won't be possible to validate against spec < 1.0.2.

See 61f09ec #733

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

No branches or pull requests

2 participants