Skip to content

Validate no-environment should perform transform/filter VRL checks #15037

@sbalmos

Description

@sbalmos

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

Vector validate --no-environment should perform VRL syntax checks of transforms and filters, to catch VRL errors in CI/CD-based config generation scenarios.

Attempted Solutions

A partial workaround exists as discussed in #13726. However, this only covers a hacky rewrite of sinks, not sources, and also requires the installation of the yq utility. The idea of having vector validate running against a whole Helm chart file is out of scope - this is merely a reference general idea/workaround.

Proposal

Currently, performing a validate --no-environment does very basic validations of the provided config. Notably, it does not perform validation of any transform VRL or filter conditions. This seems to be a critical gap in CI/CD situations. For reference, I generate the Vector config from templates in Ansible, save to a temporary file, and attempt to perform a vector validate --no-environment to sanity/syntax check the file before the config contents are embedded into a Helm chart values file. The --no-environment flag performed no syntax checking, leaving an any-to-string type mismatch error in a transform until the Helm chart was deployed, causing a pod error.

--no-environment should bypass environmental checks (env vars, connecting to sources/sinks, etc), but still perform VRL validation.

References

No response

Version

0.24.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain: configAnything related to configuring Vectordomain: vrlAnything related to the Vector Remap Language

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions