carvel-dev / carvel-dev/vendir

Feature request: support file relocation/rename

Open
#14 6 comments 3 reactions 0 assignees View on GitHub
carvel-accepted discussion priority/awaiting-more-evidence
Dominant language
Go
Stars
399
Forks
73
Avg merge
2h 53m
Merged PRs (30d)
2

Description

I would like `vendir` to strip/rename paths

```
- path: vendor/k8s
contents:
- path: eduk8s
git:
url: https://github.com/eduk8s/eduk8s
ref: 20.08.04.1
includePaths:
- resources/crds-v1/**/*
- resources/operator/**/*
```

and this ends up creating:

```
vendor/k8s/eduk8s/resources/crds-v1
vendor/k8s/eduk8s/resources/operator
```

but I would want:
```
vendor/k8s/eduk8s/resources/
```
everything just in this dir.

The use case is:

I’m collecting the k8s resource definitions from multiple sources to then process them with ytt and apply them with kapp, and have a consistent directory structure. When I get stuff from github releases I just get the files I need in the root of the path, when I get it this other way it ends in subdirectories, and hence dir layout is not really consistent

Contributor guide

Open the contributing guide

Research direction

Start by tracing vendir's handling of the `path` and `includePaths` configuration for Git sources. Compare the generated directory tree with the examples in the issue, and define completion as placing the selected `resources/crds-v1` and `resources/operator` contents under the requested `vendor/k8s/eduk8s/resources/` layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.