Reducing overly nested Vendir paths
I've recently been using the pattern I described to combine Renovate and Vendir to sync files in a number of repos, as a means to track OpenAPI spec dependencies.
However, one thing I've found a bit painful is that when using Vendir to track these dependencies, the directory structure gets very nested.
For instance, with config such as:
# via https://github.com/rootlyhq/rootly-go/blob/61c86b8660b6f25d1e8d8638417de173350dfb61/vendir.yml
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: .vendored
contents:
- path: rootly-api
http:
url: https://rootly-heroku.s3.amazonaws.com/swagger/v1/swagger.jsonThis leads to .vendored/rootly-api/swagger.json being the full OpenAPI spec path.
Getting rather frustrated about this - while working on ecosystems-go - I sought some help from Claude Sonnet 4.5 after digging through GitHub Issues to no avail, and noticed a config option newRootPath that I'd missed before.
With this config, we can replace the above with:
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: .vendored
contents:
- path: rootly-api
- path: rootly-api.json
newRootPath: swagger.json
http:
url: https://rootly-heroku.s3.amazonaws.com/swagger/v1/swagger.jsonThis will now download the spec as .vendored/rootly-api.json which is a bit more reasonable.
