carvel-dev / carvel-dev/vendir

vendir sync --json swallows error

Open
#357 8 comments 1 reaction 0 assignees View on GitHub
bug carvel-accepted
Dominant language
Go
Stars
399
Forks
73
Avg merge
2h 53m
Merged PRs (30d)
2

Description

**What steps did you take:**
- have a vendir.yaml that produces an error, eg
```
vendir: Error: Syncing directory 'foo':
Copying another directory contents into directory 'bar': lstat ../src/foo: no such file or directory
```
- run `vendir sync`: produces a nice error
- run `vendir sync --json`

**What happened:**
produces no error, but does exit with code 1

**What did you expect:**
error message like without `--json`, in json and/or to stderr

**Environment:**

- vendir version (execute `vendir --version`): vendir version 0.38.0
- OS (e.g. from `/etc/os-release`): debian bookworm

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with a vendir.yaml that references the missing ../src/foo path, then compare vendir sync with vendir sync --json. Trace the sync command's JSON error handling and add coverage for the failed sync case. Done means the JSON mode reports the error in JSON and/or on stderr while retaining exit code 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.