carvel-dev / carvel-dev/kbld

kbld with flag --json swallows error

Open
#455 0 comments 0 reactions 0 assignees View on GitHub
bug carvel accepted good first issue
Dominant language
Go
Stars
329
Forks
52
PR merge metrics
No merged PRs in 30d

Description

**What steps did you take:**
I have config.yaml
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: kbld-nginx
spec:
selector:
matchLabels:
app: kbld-nginx
template:
metadata:
labels:
app: kbld-nginx
spec:
containers:
- name: my-app
image: nginxix
```
And it is throwing error when run kbld command without `--json` flag:
```
$ kbld -f nginx/config.yml
kbld: Error:
- Resolving image 'nginxix': GET https://index.docker.io/v2/library/nginxix/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/nginxix Type:repository]]
```

While it will exit without printing any error message or any log if will run with flag `--json`

**What happened:**
When we run kbld command with flag `--json` it is exiting without printing any error message or any log in case of failure.

**What did you expect:**
When we run kbld command with flag `--json` it should print error message in case of failure.

**Anything else you would like to add:**
[Additional information that will assist in solving the issue.]

**Environment:**

- kbld version (use `kbld --version`):
- Docker registry used (e.g. `Docker HUB`):
- OS (e.g. from `/etc/os-release`):

If building images using `docker`:
- Docker CLI Version (e.g. `docker version`)

If building images using `buildkit`:
- Buildkit version (e.g. `kubectl buildkit version`):
- Kubernetes version (e.g. `kubectl version`):

If building images using `pack`
- Pack Version (e.g. `pack version`):

---
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 failure with the provided nginx/config.yml and the kbld command using --json, then trace the CLI entry point that handles image-resolution errors and JSON output. Done means the command reports the registry error when --json is enabled, while preserving the existing non-JSON behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.