Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert back to Errcode #4112

Merged
merged 2 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions docs/content/en/api/skaffold.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"type": "string"
},
{
"name": "event.buildEvent.statusCode",
"name": "event.buildEvent.errCode",
"description": " - UNKNOWN_ERROR: Could not determine error and phase\n - STATUSCHECK_SUCCESS: Status Check Success\n - STATUSCHECK_IMAGE_PULL_ERR: Container image pull error\n - STATUSCHECK_CONTAINER_CREATING: Container creating error\n - STATUSCHECK_RUN_CONTAINER_ERR: Container run error\n - STATUSCHECK_CONTAINER_TERMINATED: Container is already terminated\n - STATUSCHECK_CONTAINER_RESTARTING: Container restarting error\n - STATUSCHECK_NODE_MEMORY_PRESSURE: Node memory pressure error\n - STATUSCHECK_NODE_DISK_PRESSURE: Node disk pressure error\n - STATUSCHECK_NODE_NETWORK_UNAVAILABLE: Node network unavailable error\n - STATUSCHECK_NODE_PID_PRESSURE: Node PID pressure error\n - STATUSCHECK_NODE_UNSCHEDULABLE: Node unschedulable error\n - STATUSCHECK_NODE_UNREACHABLE: Node unreachable error\n - STATUSCHECK_NODE_NOT_READY: Node not ready error\n - STATUSCHECK_UNKNOWN: Status Check error unknown\n - STATUSCHECK_UNKNOWN_UNSCHEDULABLE: Container is unschedulable due to unknown reasons\n - STATUSCHECK_CONTAINER_WAITING_UNKNOWN: Container is waiting due to unknown reason\n - DEPLOY_UNKNOWN: Deploy failed due to unknown reason\n - SYNC_UNKNOWN: SYNC failed due to known reason\n - BUILD_UNKNOWN: Build failed due to unknown reason\n - DEVINIT_UNKNOWN: Dev Init failed due to unknown reason\n - CLEANUP_UNKNOWN: Cleanup failed due to unknown reason\n - SYNC_INIT_ERROR: File Sync Initialize failure\n - DEVINIT_REGISTER_BUILD_DEPS: Failed to configure watcher for build dependencies in dev loop\n - DEVINIT_REGISTER_TEST_DEPS: Failed to configure watcher for test dependencies in dev loop\n - DEVINIT_REGISTER_DEPLOY_DEPS: Failed to configure watcher for deploy dependencies in dev loop\n - DEVINIT_REGISTER_CONFIG_DEP: Failed to configure watcher for Skaffold configuration file.",
"in": "query",
"required": false,
Expand Down Expand Up @@ -145,7 +145,7 @@
"type": "string"
},
{
"name": "event.deployEvent.statusCode",
"name": "event.deployEvent.errCode",
"description": " - UNKNOWN_ERROR: Could not determine error and phase\n - STATUSCHECK_SUCCESS: Status Check Success\n - STATUSCHECK_IMAGE_PULL_ERR: Container image pull error\n - STATUSCHECK_CONTAINER_CREATING: Container creating error\n - STATUSCHECK_RUN_CONTAINER_ERR: Container run error\n - STATUSCHECK_CONTAINER_TERMINATED: Container is already terminated\n - STATUSCHECK_CONTAINER_RESTARTING: Container restarting error\n - STATUSCHECK_NODE_MEMORY_PRESSURE: Node memory pressure error\n - STATUSCHECK_NODE_DISK_PRESSURE: Node disk pressure error\n - STATUSCHECK_NODE_NETWORK_UNAVAILABLE: Node network unavailable error\n - STATUSCHECK_NODE_PID_PRESSURE: Node PID pressure error\n - STATUSCHECK_NODE_UNSCHEDULABLE: Node unschedulable error\n - STATUSCHECK_NODE_UNREACHABLE: Node unreachable error\n - STATUSCHECK_NODE_NOT_READY: Node not ready error\n - STATUSCHECK_UNKNOWN: Status Check error unknown\n - STATUSCHECK_UNKNOWN_UNSCHEDULABLE: Container is unschedulable due to unknown reasons\n - STATUSCHECK_CONTAINER_WAITING_UNKNOWN: Container is waiting due to unknown reason\n - DEPLOY_UNKNOWN: Deploy failed due to unknown reason\n - SYNC_UNKNOWN: SYNC failed due to known reason\n - BUILD_UNKNOWN: Build failed due to unknown reason\n - DEVINIT_UNKNOWN: Dev Init failed due to unknown reason\n - CLEANUP_UNKNOWN: Cleanup failed due to unknown reason\n - SYNC_INIT_ERROR: File Sync Initialize failure\n - DEVINIT_REGISTER_BUILD_DEPS: Failed to configure watcher for build dependencies in dev loop\n - DEVINIT_REGISTER_TEST_DEPS: Failed to configure watcher for test dependencies in dev loop\n - DEVINIT_REGISTER_DEPLOY_DEPS: Failed to configure watcher for deploy dependencies in dev loop\n - DEVINIT_REGISTER_CONFIG_DEP: Failed to configure watcher for Skaffold configuration file.",
"in": "query",
"required": false,
Expand Down Expand Up @@ -256,7 +256,7 @@
"type": "string"
},
{
"name": "event.statusCheckEvent.statusCode",
"name": "event.statusCheckEvent.errCode",
"description": " - UNKNOWN_ERROR: Could not determine error and phase\n - STATUSCHECK_SUCCESS: Status Check Success\n - STATUSCHECK_IMAGE_PULL_ERR: Container image pull error\n - STATUSCHECK_CONTAINER_CREATING: Container creating error\n - STATUSCHECK_RUN_CONTAINER_ERR: Container run error\n - STATUSCHECK_CONTAINER_TERMINATED: Container is already terminated\n - STATUSCHECK_CONTAINER_RESTARTING: Container restarting error\n - STATUSCHECK_NODE_MEMORY_PRESSURE: Node memory pressure error\n - STATUSCHECK_NODE_DISK_PRESSURE: Node disk pressure error\n - STATUSCHECK_NODE_NETWORK_UNAVAILABLE: Node network unavailable error\n - STATUSCHECK_NODE_PID_PRESSURE: Node PID pressure error\n - STATUSCHECK_NODE_UNSCHEDULABLE: Node unschedulable error\n - STATUSCHECK_NODE_UNREACHABLE: Node unreachable error\n - STATUSCHECK_NODE_NOT_READY: Node not ready error\n - STATUSCHECK_UNKNOWN: Status Check error unknown\n - STATUSCHECK_UNKNOWN_UNSCHEDULABLE: Container is unschedulable due to unknown reasons\n - STATUSCHECK_CONTAINER_WAITING_UNKNOWN: Container is waiting due to unknown reason\n - DEPLOY_UNKNOWN: Deploy failed due to unknown reason\n - SYNC_UNKNOWN: SYNC failed due to known reason\n - BUILD_UNKNOWN: Build failed due to unknown reason\n - DEVINIT_UNKNOWN: Dev Init failed due to unknown reason\n - CLEANUP_UNKNOWN: Cleanup failed due to unknown reason\n - SYNC_INIT_ERROR: File Sync Initialize failure\n - DEVINIT_REGISTER_BUILD_DEPS: Failed to configure watcher for build dependencies in dev loop\n - DEVINIT_REGISTER_TEST_DEPS: Failed to configure watcher for test dependencies in dev loop\n - DEVINIT_REGISTER_DEPLOY_DEPS: Failed to configure watcher for deploy dependencies in dev loop\n - DEVINIT_REGISTER_CONFIG_DEP: Failed to configure watcher for Skaffold configuration file.",
"in": "query",
"required": false,
Expand Down Expand Up @@ -342,7 +342,7 @@
"type": "string"
},
{
"name": "event.fileSyncEvent.statusCode",
"name": "event.fileSyncEvent.errCode",
"description": " - UNKNOWN_ERROR: Could not determine error and phase\n - STATUSCHECK_SUCCESS: Status Check Success\n - STATUSCHECK_IMAGE_PULL_ERR: Container image pull error\n - STATUSCHECK_CONTAINER_CREATING: Container creating error\n - STATUSCHECK_RUN_CONTAINER_ERR: Container run error\n - STATUSCHECK_CONTAINER_TERMINATED: Container is already terminated\n - STATUSCHECK_CONTAINER_RESTARTING: Container restarting error\n - STATUSCHECK_NODE_MEMORY_PRESSURE: Node memory pressure error\n - STATUSCHECK_NODE_DISK_PRESSURE: Node disk pressure error\n - STATUSCHECK_NODE_NETWORK_UNAVAILABLE: Node network unavailable error\n - STATUSCHECK_NODE_PID_PRESSURE: Node PID pressure error\n - STATUSCHECK_NODE_UNSCHEDULABLE: Node unschedulable error\n - STATUSCHECK_NODE_UNREACHABLE: Node unreachable error\n - STATUSCHECK_NODE_NOT_READY: Node not ready error\n - STATUSCHECK_UNKNOWN: Status Check error unknown\n - STATUSCHECK_UNKNOWN_UNSCHEDULABLE: Container is unschedulable due to unknown reasons\n - STATUSCHECK_CONTAINER_WAITING_UNKNOWN: Container is waiting due to unknown reason\n - DEPLOY_UNKNOWN: Deploy failed due to unknown reason\n - SYNC_UNKNOWN: SYNC failed due to known reason\n - BUILD_UNKNOWN: Build failed due to unknown reason\n - DEVINIT_UNKNOWN: Dev Init failed due to unknown reason\n - CLEANUP_UNKNOWN: Cleanup failed due to unknown reason\n - SYNC_INIT_ERROR: File Sync Initialize failure\n - DEVINIT_REGISTER_BUILD_DEPS: Failed to configure watcher for build dependencies in dev loop\n - DEVINIT_REGISTER_TEST_DEPS: Failed to configure watcher for test dependencies in dev loop\n - DEVINIT_REGISTER_DEPLOY_DEPS: Failed to configure watcher for deploy dependencies in dev loop\n - DEVINIT_REGISTER_CONFIG_DEP: Failed to configure watcher for Skaffold configuration file.",
"in": "query",
"required": false,
Expand Down Expand Up @@ -614,7 +614,7 @@
"err": {
"type": "string"
},
"statusCode": {
"errCode": {
"$ref": "#/definitions/protoStatusCode"
}
},
Expand Down Expand Up @@ -737,7 +737,7 @@
"err": {
"type": "string"
},
"statusCode": {
"errCode": {
"$ref": "#/definitions/protoStatusCode"
}
},
Expand Down Expand Up @@ -854,7 +854,7 @@
"err": {
"type": "string"
},
"statusCode": {
"errCode": {
"$ref": "#/definitions/protoStatusCode"
}
},
Expand Down Expand Up @@ -1033,7 +1033,7 @@
"err": {
"type": "string"
},
"statusCode": {
"errCode": {
"$ref": "#/definitions/protoStatusCode"
}
},
Expand Down
8 changes: 4 additions & 4 deletions docs/content/en/docs/references/api/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If the build fails, an error will be attached to the event.
| artifact | [string](#string) | | artifact name |
| status | [string](#string) | | artifact build status oneof: InProgress, Completed, Failed |
| err | [string](#string) | | error when build status is Failed. |
| statusCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |
| errCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |



Expand Down Expand Up @@ -197,7 +197,7 @@ anytime a deployment starts or completes, successfully or not.
| ----- | ---- | ----- | ----------- |
| status | [string](#string) | | deployment status oneof: InProgress, Completed, Failed |
| err | [string](#string) | | error when status is Failed |
| statusCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |
| errCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |



Expand Down Expand Up @@ -320,7 +320,7 @@ FileSyncEvent describes the sync status.
| image | [string](#string) | | the container image to which files are sycned. |
| status | [string](#string) | | status of file sync. one of: Not Started, In progress, Succeeded, Failed. |
| err | [string](#string) | | error in case of status failed. |
| statusCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |
| errCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |



Expand Down Expand Up @@ -563,7 +563,7 @@ will be sent with the new status.
| status | [string](#string) | | |
| message | [string](#string) | | |
| err | [string](#string) | | |
| statusCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |
| errCode | [StatusCode](#proto.StatusCode) | | status code representing success or failure |



Expand Down
12 changes: 6 additions & 6 deletions pkg/skaffold/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func DeployInProgress() {
// DeployFailed notifies that non-fatal errors were encountered during a deployment.
func DeployFailed(err error) {
statusCode := sErrors.ErrorCodeFromError(sErrors.Deploy, err)
handler.handleDeployEvent(&proto.DeployEvent{Status: Failed, Err: err.Error(), StatusCode: statusCode})
handler.handleDeployEvent(&proto.DeployEvent{Status: Failed, Err: err.Error(), ErrCode: statusCode})
}

// DeployEvent notifies that a deployment of non fatal interesting errors during deploy.
Expand All @@ -184,9 +184,9 @@ func StatusCheckEventSucceeded() {
func StatusCheckEventFailed(err error) {
statusCode := sErrors.ErrorCodeFromError(sErrors.StatusCheck, err)
handler.handleStatusCheckEvent(&proto.StatusCheckEvent{
Status: Failed,
Err: err.Error(),
StatusCode: statusCode,
Status: Failed,
Err: err.Error(),
ErrCode: statusCode,
})
}

Expand Down Expand Up @@ -240,7 +240,7 @@ func BuildInProgress(imageName string) {
// BuildFailed notifies that a build has failed.
func BuildFailed(imageName string, err error) {
statusCode := sErrors.ErrorCodeFromError(sErrors.Build, err)
handler.handleBuildEvent(&proto.BuildEvent{Artifact: imageName, Status: Failed, Err: err.Error(), StatusCode: statusCode})
handler.handleBuildEvent(&proto.BuildEvent{Artifact: imageName, Status: Failed, Err: err.Error(), ErrCode: statusCode})
}

// BuildComplete notifies that a build has completed.
Expand Down Expand Up @@ -283,7 +283,7 @@ func FileSyncInProgress(fileCount int, image string) {
// FileSyncFailed notifies that a file sync has failed.
func FileSyncFailed(fileCount int, image string, err error) {
statusCode := sErrors.ErrorCodeFromError(sErrors.FileSync, err)
handler.handleFileSyncEvent(&proto.FileSyncEvent{FileCount: int32(fileCount), Image: image, Status: Failed, Err: err.Error(), StatusCode: statusCode})
handler.handleFileSyncEvent(&proto.FileSyncEvent{FileCount: int32(fileCount), Image: image, Status: Failed, Err: err.Error(), ErrCode: statusCode})
}

// FileSyncSucceeded notifies that a file sync has succeeded.
Expand Down
Loading