GoogleContainerTools / GoogleContainerTools/skaffold

Feature request: --format flag for skaffold diagnose

Open
#5,878 1 comment 1 reaction 0 assignees View on GitHub
area/diagnose area/errors kind/feature-request priority/p2 source/partnerships
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

`skaffold diagnose --yaml-only` is extremely useful for identifying issues with potentially complicated skaffold configurations. It would be fantastic if there were a way to get the errors in json format for easy consumption.

### Input Yaml

```yaml
apiVersion: skaffold/v2beta4
kind: Config
build:
tagPolicy:
sha256: {}
artifacts:
- image: java-hello-world
context: .
docker:
target: mm
deploy:
kubectl:
manifests:
- ./kubernetes-manifests/**.yaml
profiles:
- name: cloudbuild
some-invalid-yaml
build:
googleCloudBuild: {}
- name: dockerfile
build:
artifacts:
- image: java-hello-world
```

### Current output

![Screen Shot 2021-05-20 at 2 55 40 PM](https://user-images.githubusercontent.com/8933338/119033687-82b5ca80-b97b-11eb-98fe-3dd53b312c1d.png)

### Proposed Output

`skaffold diagnose -f skaffold.yaml --yaml-only --format json` might output the following json

```json
{
"errors": [{
"line": 18,
"message": "could not find expected ':'"
}]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.