Skip to content

Commit

Permalink
code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tejal29 committed Oct 21, 2020
1 parent 50914bf commit 39e554e
Show file tree
Hide file tree
Showing 10 changed files with 360 additions and 324 deletions.
2 changes: 1 addition & 1 deletion cmd/skaffold/app/cmd/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func createNewRunner(opts config.SkaffoldOptions) (runner.Runner, *latest.Skaffo

runner, err := runner.NewForConfig(runCtx)
if err != nil {
event.SkaffoldInitFailed(err)
event.InititializationFailed(err)
return nil, nil, fmt.Errorf("creating runner: %w", err)
}

Expand Down
62 changes: 31 additions & 31 deletions docs/content/en/api/skaffold.swagger.json

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions docs/content/en/docs/references/api/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ It is one of MetaEvent, BuildEvent, DeployEvent, PortEvent, StatusCheckEvent, Re
| fileSyncEvent | [FileSyncEvent](#proto.FileSyncEvent) | | describes the sync status. |
| debuggingContainerEvent | [DebuggingContainerEvent](#proto.DebuggingContainerEvent) | | describes the appearance or disappearance of a debugging container |
| devLoopEvent | [DevLoopEvent](#proto.DevLoopEvent) | | describes a start and end of a dev loop. |
| sessionEndEvent | [SessionEndEvent](#proto.SessionEndEvent) | | describes a skaffold session complete event |
| terminationEvent | [TerminationEvent](#proto.TerminationEvent) | | describes a skaffold termination event |



Expand Down Expand Up @@ -516,22 +516,6 @@ will be sent with the new status.



<a name="proto.SessionEndEvent"></a>
#### SessionEndEvent
`SessionEndEvent` marks the end of the skaffold session


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| status | [string](#string) | | status oneof: Completed or Failed |
| err | [ActionableErr](#proto.ActionableErr) | | actionable error message |







<a name="proto.State"></a>
#### State
`State` represents the current state of the Skaffold components
Expand Down Expand Up @@ -652,6 +636,22 @@ Suggestion defines the action a user needs to recover from an error.



<a name="proto.TerminationEvent"></a>
#### TerminationEvent
`SessionEndEvent` marks the end of the skaffold session


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| status | [string](#string) | | status oneof: Completed or Failed |
| err | [ActionableErr](#proto.ActionableErr) | | actionable error message |







<a name="proto.TriggerRequest"></a>
#### TriggerRequest

Expand Down Expand Up @@ -806,25 +806,25 @@ For Cancelled Error code, use range 800 to 850.
| BUILD_UNKNOWN | 506 | Build failed due to unknown reason |
| DEVINIT_UNKNOWN | 507 | Dev Init failed due to unknown reason |
| CLEANUP_UNKNOWN | 508 | Cleanup failed due to unknown reason |
| INIT_UNKNOWN | 510 | Skaffold Session Init failed due to unknown reason |
| INIT_UNKNOWN | 510 | Initialization of the Skaffold session failed due to unknown reason(s) |
| SYNC_INIT_ERROR | 601 | File Sync Initialize failure |
| DEVINIT_REGISTER_BUILD_DEPS | 701 | Failed to configure watcher for build dependencies in dev loop |
| DEVINIT_REGISTER_TEST_DEPS | 702 | Failed to configure watcher for test dependencies in dev loop |
| DEVINIT_REGISTER_DEPLOY_DEPS | 703 | Failed to configure watcher for deploy dependencies in dev loop |
| DEVINIT_REGISTER_CONFIG_DEP | 704 | Failed to configure watcher for Skaffold configuration file. |
| STATUSCHECK_USER_CANCELLED | 800 | User cancelled the skaffold dev run |
| STATUSCHECK_DEADLINE_EXCEEDED | 801 | Deadline for status check exceeded |
| BUILD_CANCELLED | 802 | Build cancelled due to user cancellation or one or more build failed. |
| BUILD_CANCELLED | 802 | Build Cancelled |
| DEPLOY_CANCELLED | 803 | Deploy cancelled due to user cancellation or one or more deployers failed. |
| INIT_CREATE_TAGGER_ERROR | 901 | |
| INIT_MINIKUBE_PAUSED_ERROR | 902 | |
| INIT_MINIKUBE_NOT_RUNNING_ERROR | 903 | |
| INIT_CREATE_BUILDER_ERROR | 904 | |
| INIT_CREATE_DEPLOYER_ERROR | 905 | |
| INIT_CREATE_TEST_DEP_ERROR | 906 | |
| INIT_CACHE_ERROR | 907 | |
| INIT_CREATE_WATCH_TRIGGER_ERROR | 908 | |
| INIT_CREATE_ARTIFACT_DEP_ERROR | 909 | |
| INIT_CREATE_TAGGER_ERROR | 901 | Skaffold was unable to create the configured tagger |
| INIT_MINIKUBE_PAUSED_ERROR | 902 | Skaffold was unable to start as Minikube appears to be paused |
| INIT_MINIKUBE_NOT_RUNNING_ERROR | 903 | Skaffold was unable to start as Minikube appears to be stopped |
| INIT_CREATE_BUILDER_ERROR | 904 | Skaffold was unable to create a configured image builder |
| INIT_CREATE_DEPLOYER_ERROR | 905 | Skaffold was unable to create a configured deployer |
| INIT_CREATE_TEST_DEP_ERROR | 906 | Skaffold was unable to create a configured test |
| INIT_CACHE_ERROR | 907 | Skaffold encountered an error validating the artifact cache |
| INIT_CREATE_WATCH_TRIGGER_ERROR | 908 | Skaffold encountered an error when configuring file watching |
| INIT_CREATE_ARTIFACT_DEP_ERROR | 909 | Skaffold encountered an error when evaluating artifact dependencies |



Expand All @@ -836,13 +836,13 @@ Enum for Suggestion codes
| Name | Number | Description |
| ---- |:------:| ----------- |
| NIL | 0 | default nil suggestion. This is usually set when no error happens. |
| ADD_DEFAULT_REPO | 100 | Build error suggestion codes |
| CHECK_DEFAULT_REPO | 101 | |
| CHECK_DEFAULT_REPO_GLOBAL_CONFIG | 102 | |
| GCLOUD_DOCKER_AUTH_CONFIGURE | 103 | |
| DOCKER_AUTH_CONFIGURE | 104 | |
| CHECK_GCLOUD_PROJECT | 105 | |
| CHECK_DOCKER_RUNNING | 106 | |
| ADD_DEFAULT_REPO | 100 | Add Default Repo |
| CHECK_DEFAULT_REPO | 101 | Verify Default Repo |
| CHECK_DEFAULT_REPO_GLOBAL_CONFIG | 102 | Verify default repo in the global config |
| GCLOUD_DOCKER_AUTH_CONFIGURE | 103 | run gcloud docker auth configure |
| DOCKER_AUTH_CONFIGURE | 104 | Run docker auth configure |
| CHECK_GCLOUD_PROJECT | 105 | Verify Gcloud Project |
| CHECK_DOCKER_RUNNING | 106 | Check if docker is running |
| CHECK_CONTAINER_LOGS | 301 | Container run error |
| CHECK_READINESS_PROBE | 302 | Pod Health check error |
| CHECK_CONTAINER_IMAGE | 303 | Check Container image |
Expand All @@ -855,9 +855,9 @@ Enum for Suggestion codes
| ADDRESS_NODE_NOT_READY | 406 | Node not ready error |
| ADDRESS_FAILED_SCHEDULING | 407 | Scheduler failure error |
| CHECK_HOST_CONNECTION | 408 | Cluster Connectivity error |
| START_MINIKUBE | 501 | Minikube Suggestions |
| UNPAUSE_MINIKUBE | 502 | |
| OPEN_ISSUE | 900 | Open Issue Suggestion |
| START_MINIKUBE | 501 | Minikube is stopped: use `minikube start` |
| UNPAUSE_MINIKUBE | 502 | Minikube is paused: use `minikube unpause` |
| OPEN_ISSUE | 900 | Open an issue so this situation can be diagnosed |


<!-- end enums -->
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pkg/skaffold/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,10 @@ func BuildSequenceFailed(err error) {
handler.stateLock.Unlock()
}

func SkaffoldInitFailed(err error) {
func InititializationFailed(err error) {
handler.handle(&proto.Event{
EventType: &proto.Event_SessionEndEvent{
SessionEndEvent: &proto.SessionEndEvent{
EventType: &proto.Event_TerminationEvent{
TerminationEvent: &proto.TerminationEvent{
Status: Failed,
Err: sErrors.ActionableErr(sErrors.Init, err),
},
Expand Down
Loading

0 comments on commit 39e554e

Please sign in to comment.