carvel-dev / carvel-dev/vendir

vendir succeeds when includePath list item does not exist?

Open
#114 2 comments 0 reactions 0 assignees View on GitHub
awaiting-input discussion
Dominant language
Go
Stars
399
Forks
73
Avg merge
2h 53m
Merged PRs (30d)
2

Description

imho this is a bug, but I'm asking first in case this is a "functions as designed". If it is functioning as designed, then might I humbly request that design be revisited.

I have a config which is similar to what is shown below (git repos are different)

```
---
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: .vendir
contents:
- path: service
git:
url: git@github.com:org/software.git
ref: 40ef6a
includePaths:
- k8s/modules/base/*
- this/*
- does/not/exist/*
```

I can guarantee that there are files in the first list item (the k8s path). The other two paths I made up.

When I run `vendir sync`, the output that I get is

```
Fetching: .vendir + service (git from git@github.com:org/software.git@40ef6a)

--> git init
...bunch of git command output here...

Lock config

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
- git:
commitTitle: 'fix: remove sharder annotations'
sha: 40ef6a85a4fa84a23a0193db9ea2773ba3b5614e
path: service
path: .vendir
kind: LockConfig

Succeeded
```

I can verify this is successful with the output of `$?` as well

```
$ echo $?
0
```

Is this expected behavior?

If so, I think this can very likely lead to some (bad) unintended consequences. The worst being that the end-user trusts that vendir will arrange some files correctly, when it actually doesn't.

For example, consider kubernetes manifests via `ytt` being vendir'd. Due to "reasons" (network hiccup, fat fingered path, path not existing at a particular version, etc) the paths include invalid paths. vendir produces a set of files and ignores the paths it couldn't find. k8s app gets deployed without a subset of content. The world spirals into chaos.

Thoughts?

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported configuration with vendir sync, including existing and nonexistent includePaths such as k8s/modules/base/* and does/not/exist/*. Start by tracing how includePaths are handled during git content fetching. Done should establish and verify the intended behavior for missing paths, including whether sync reports an error instead of succeeding silently.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
cli, devtools
Issue type
Bug
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.