GoogleContainerTools / GoogleContainerTools/skaffold

Skaffold metrics sometimes emits incorrect/meaningless error code

Open
#6,609 1 comment 0 reactions 0 assignees View on GitHub
area/metrics kind/bug priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
Skaffold attaches valid error code, or at least UKNOWN_ERROR when it fails.

### Actual behavior
Skaffold attaches error code 0, which indicates no error, in some scenarios

### Information

Saw error `could not push image "image-name":...`, inspected metrics output and saw
```json
[
{
"ConfigCount": 1,
"ExitCode": 1,
"BuildArtifacts": 1,
"Command": "dev",
"Version": "v1.28.0",
"OS": "darwin",
"Arch": "amd64",
"PlatformType": "local",
"User": "",
"Deployers": [
"kubectl"
],
"EnumFlags": {},
"Builders": {
"docker": 1
},
"BuildDependencies": {},
"HelmReleasesCount": 0,
"SyncType": {},
"DevIterations": [
{
"Intent": "error",
"ErrorCode": 506
}
],
"StartTime": "2021-09-15T10:50:01.456785-07:00",
"Duration": 25759361674,
"ErrorCode": 0
}
]
```
"ErrorCode" is set to 0 when running into an error with pushing.

### Steps to reproduce the behavior

1. Turn off internet connection (This will prevent skaffold uploading metrics and deleting local file and create a push error)
2. Run skaffold dev in `examples/getting-started`
3. inspect output file `~/.skaffold/metrics`

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.