Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic protos
Browse files Browse the repository at this point in the history
MarlonGamez committed Feb 18, 2021
1 parent a481dac commit 73ecc82
Showing 2 changed files with 916 additions and 0 deletions.
97 changes: 97 additions & 0 deletions proto/v2/markdown.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: "gRPC API"
linkTitle: "gRPC API"
weight: 30
---
<!--
******
WARNING!!!

The file docs/content/en/docs/references/api/grpc.md is generated based on proto/markdown.tmpl,
and generated with ./hack/generate_proto.sh!
Please edit the template file and not the markdown one directly!

******
-->
This is a generated reference for the [Skaffold API]({{"{{"}}<relref "/docs/design/api">{{"}}"}}) gRPC layer.

We also generate the [reference doc for the HTTP layer]({{"{{"}}<relref "/docs/references/api/swagger">{{"}}"}}).

{{range .Files}}
{{$file_name := .Name}}
<a name="{{.Name}}"></a>

## {{.Name}}

You can find the source for {{.Name}} [on Github](https://github.com/GoogleContainerTools/skaffold/blob/master/proto/{{.Name}}).

{{.Description}}

### Services
{{range .Services}}
<a name="{{.FullName}}"></a>

#### {{.Name}}
{{.Description}}

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
{{range .Methods -}}
| {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType}}){{if .ResponseStreaming}} stream{{end}} | {{nobr .Description}} |
{{end}}
{{end}} <!-- end services -->


### Data types

{{range .Messages}}

<a name="{{.FullName}}"></a>
#### {{.LongName}}
{{.Description}}

{{if .HasFields}}
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
{{range .Fields -}}
| {{.Name}} | [{{.LongType}}](#{{.FullType}}) | {{.Label}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}
{{end}}

{{if .HasExtensions}}
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- |:------:| ----------- |
{{range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}
{{end}}

{{end}} <!-- end messages -->

{{range .Enums}}
<a name="{{.FullName}}"></a>

### {{.LongName}}
{{.Description}}

| Name | Number | Description |
| ---- |:------:| ----------- |
{{range .Values -}}
| {{.Name}} | {{.Number}} | {{nobr .Description}} |
{{end}}

{{end}} <!-- end enums -->

{{if .HasExtensions}}
<a name="{{$file_name}}-extensions"></a>

### File-level Extensions
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- |:------:| ----------- |
{{range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} |
{{end}}
{{end}} <!-- end HasExtensions -->


{{end}}
819 changes: 819 additions & 0 deletions proto/v2/skaffold.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,819 @@
syntax = "proto3";
package proto;

import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";

message StateResponse {
State state = 1;
}

message Response {
string msg = 1;
}

message Request {
string name = 1;
}

// `State` represents the current state of the Skaffold components
message State {
BuildState buildState = 1;
DeployState deployState = 2;
reserved 3; // field 3 is obsolete
map<int32, PortEvent> forwardedPorts = 4;
StatusCheckState statusCheckState = 5;
FileSyncState fileSyncState = 6;
repeated DebuggingContainerEvent debuggingContainers = 7;
Metadata metadata = 8;
TestState testState = 9;
}

message Metadata {
BuildMetadata build = 1;
DeployMetadata deploy = 2;
TestMetadata test = 3;
// Additional key value pairs to describe the build pipeline
map<string, string> additional = 99;
}

message BuildMetadata {
message ImageBuilder {
BuilderType type = 1;
int32 count = 2;
}
int32 numberOfArtifacts = 1;
repeated ImageBuilder builders= 2;
BuildType type = 3;
// Additional key value pairs to describe the deploy pipeline
map<string, string> additional = 99;
}

// TestMetadata describes the test pipeline
message TestMetadata {
message Tester {
TesterType type = 1;
int32 count = 2;
}
repeated Tester Testers = 1;
}

message DeployMetadata {
message Deployer {
DeployerType type = 1;
int32 count = 2;
}
repeated Deployer deployers = 1;
ClusterType cluster = 2;
}

// `BuildState` maps Skaffold artifacts to their current build states
message BuildState {
// A map of `artifact name -> build-state`.
// Artifact name is defined in the `skaffold.yaml`.
// The `build-state` can be: <br>
// - `"Not started"`: not yet started <br>
// - `"In progress"`: build started <br>
// - `"Complete"`: build succeeded <br>
// - `"Failed"`: build failed
map<string, string> artifacts = 1;
bool autoTrigger = 2;
StatusCode statusCode = 3;
}

// `TestState` describes the current state of the test
message TestState {
// Status of the current test
string status = 1;
// Teststate status code
StatusCode statusCode = 2;
}

// `DeployState` describes the status of the current deploy
message DeployState {
string status = 1;
bool autoTrigger = 2;
StatusCode statusCode = 3;
}

// `StatusCheckState` describes the state of status check of current deployed resources.
message StatusCheckState {
string status = 1;
// A map of `resource name -> status-check-state`. Where `resource-name` is the kubernetes resource name.
// The `status-check-state` can be <br>
// - `"Not started"`: indicates that `status-check` has just started. <br>
// - `"In progress"`: InProgress is sent after every resource check is complete. <br>
// - `"Succeeded"`:
// - `"Failed"`:
map<string, string> resources = 2;
// StatusCheck statusCode
StatusCode statusCode = 3;

}

// `FileSyncState` contains the status of the current file sync
message FileSyncState {
string status = 1;
bool autoTrigger = 2;
}

// `Event` describes an event in the Skaffold process.
// It is one of MetaEvent, BuildEvent, TestEvent, DeployEvent, PortEvent, StatusCheckEvent, ResourceStatusCheckEvent, FileSyncEvent, or DebuggingContainerEvent.
message Event {
oneof event_type {
MetaEvent metaEvent = 1; // contains general information regarding Skaffold like version info
BuildEvent buildEvent = 2; // describes if the build status per artifact. Status could be one of "InProgress", "Completed" or "Failed".
DeployEvent deployEvent = 3; // describes if the deployment has started, is in progress or is complete.
PortEvent portEvent = 4; // describes each port forwarding event.
StatusCheckEvent statusCheckEvent = 5; // describes if the Status check has started, is in progress, has succeeded or failed.
ResourceStatusCheckEvent resourceStatusCheckEvent = 6; // indicates progress for each kubernetes deployment.
FileSyncEvent fileSyncEvent = 7; // describes the sync status.
DebuggingContainerEvent debuggingContainerEvent = 8; // describes the appearance or disappearance of a debugging container
DevLoopEvent devLoopEvent = 9; // describes a start and end of a dev loop.
TerminationEvent terminationEvent = 10; // describes a skaffold termination event
TestEvent TestEvent = 11; // describes if the test has started, is in progress or is complete.
}
}

// `TerminationEvent` marks the end of the skaffold session
message TerminationEvent {
string status = 1; // status oneof: Completed or Failed
ActionableErr err = 2; // actionable error message
}

// `DevLoopEvent` marks the start and end of a dev loop.
message DevLoopEvent {
int32 iteration = 1; // dev loop iteration. 0 represents initialization loop.
string status = 2; // dev loop status oneof: In Progress, Completed, Failed
ActionableErr err = 3; // actionable error message
}

// `ActionableErr` defines an error that occurred along with an optional list of suggestions
message ActionableErr {
StatusCode errCode = 1; // error code representing the error
string message = 2; // message describing the error.
repeated Suggestion suggestions = 3; // list of suggestions
}

// `MetaEvent` provides general information regarding Skaffold
message MetaEvent {
string entry = 1; // entry, for example: `"Starting Skaffold: {Version:v0.39.0-16-g5bb7c9e0 ConfigVersion:skaffold/v1 GitVersion: GitCommit:5bb7c9e078e4d522a5ffc42a2f1274fd17d75902 GitTreeState:dirty BuildDate01:29Z GoVersion:go1.13rc1 Compiler:gc Platform:linux/amd64}"`
Metadata metadata = 2; // Metadata describing skaffold pipeline
}

// `SkaffoldLogEvent` represents a piece of output that comes from a skaffold run, for example: "Generating tags...", "Step 1/3 : FROM gcr.io/distroless/base"
message SkaffoldLogEvent {
string task_id = 1; // id of the task of skaffold that this log came from
string subtask_id = 2; // id of the subtask that the log came from
string origin = 3; // which tool the output came from ex: skaffold, docker
logLevel level = 4; // log level
string message = 5; // contents of the log
}

// `ApplicationLogEvent` represents a log that comes from one of the pods running in the user's application.
message ApplicationLogEvent {
string containerName = 1; // container that the log came from
string podName = 2; // pod that the log came from
string message = 3; // contents of the log
}

// `TaskEvent` represent the different larger phases of a skaffold session, for example Build, Deploy, etc.
// If a phase fails, an actionable error will be attached
message TaskEvent {
tring id = 1; // will be used by SkaffoldLog to link it to a task. Follows the form "{task_name}-{iteration-number}"
string task = 2; // task name oneof: Tag, Build, Test, Deploy, StatusCheck, PortForward, DevLoop
int32 iteration = 3; // which dev/debug iteration is currently running
string status = 4; // artifact build status oneof: InProgress, Completed, Failed
ActionableErr actionableErr = 5; // actionable error message
}

// `BuildSubtaskvent` describes the build status per artifact, and will be emitted by Skaffold anytime a build starts or finishes, successfully or not.
// If the build fails, an error will be attached to the event.
message BuildSubtaskEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
string artifact = 3; // artifact name
string status = 4; // artifact build status oneof: InProgress, Completed, Failed
ActionableErr actionableErr = 5; // actionable error message
}

// `TestSubtaskEvent` represents the status of a test, and is emitted by Skaffold
// anytime a test starts or completes, successfully or not.
message TestSubtaskEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
string status = 3; // test status oneof: InProgress, Completed, Failed
ActionableErr actionableErr = 4; // actionable error message
}

// `DeploySubtaskEvent` represents the status of a deployment, and is emitted by Skaffold
// anytime a deployment starts or completes, successfully or not.
message DeploySubtaskEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
string status = 3; // deployment status oneof: InProgress, Completed, Failed
ActionableErr actionableErr = 4; // actionable error message
}

// A Resource StatusCheck Event, indicates progress for each kubernetes deployment.
// For every resource, there will be exactly one event with `status` *Succeeded* or *Failed* event.
// There can be multiple events with `status` *Pending*.
// Skaffold polls for resource status every 0.5 second. If the resource status changes, an event with `status` “Pending”, “Complete” and “Failed”
// will be sent with the new status.
message StatusCheckSubtaskEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
string resource = 3; // id of the subtask which will be used in SkaffoldLog
string status = 4; // id of the task of skaffold that this event came from
string message = 5;
StatusCode statusCode = 6;
ActionableErr actionableErr = 7; // actionable error message
}

// PortForwardEvent Event describes each port forwarding event.
message PortForwardEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
int32 localPort = 3; // local port for forwarded resource
int32 remotePort = 4; // Deprecated. Uses targetPort.intVal.
string podName = 5; // pod name if port forwarded resourceType is Pod
string containerName = 6; // container name if specified in the kubernetes spec
string namespace = 7; // the namespace of the resource to port forward.
string portName = 8;
string resourceType = 9; // resource type e.g. "pod", "service".
string resourceName = 10; // name of the resource to forward.
string address = 11; // address on which to bind
IntOrString targetPort = 12; // target port is the resource port that will be forwarded.
}

// FileSyncEvent describes the sync status.
message FileSyncEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
int32 fileCount = 3; // number of files synced
string image = 4; // the container image to which files are sycned.
string status = 5; // status of file sync. one of: Not Started, In progress, Succeeded, Failed.
string err = 6; // Deprecated. Use actionableErr.message. error in case of status failed.
StatusCode errCode = 7; //// Deprecated. Use actionableErr.errCode. status code representing success or failure
ActionableErr actionableErr = 8; // actionable error message
}

// DebuggingContainerEvent is raised when a debugging container is started or terminated
message DebuggingContainerEvent {
string id = 1; // id of the subtask which will be used in SkaffoldLog
string task_id = 2; // id of the task of skaffold that this event came from
string status = 3; // the container status oneof: Started, Terminated
string podName = 4; // the pod name with the debugging container
string containerName = 5; // the name of the container configured for debugging
string namespace = 6; // the namespace of the debugging container

string artifact = 7; // the corresponding artifact's image name
string runtime = 8; // the detected language runtime
string workingDir = 9; // the working directory in the container image
map<string,uint32> debugPorts = 10; // the exposed debugging-related ports
}

// LogEntry describes an event and a string description of the event.
message LogEntry {
google.protobuf.Timestamp timestamp = 1; // timestamp of the event.
Event event = 2; // the actual event that is one of
string entry = 3; // description of the event.
}

message UserIntentRequest {
Intent intent = 1;
}

message TriggerRequest {
TriggerState state = 1;
}

// TriggerState represents trigger state for a given phase.
message TriggerState {
oneof val {
bool enabled = 1; // enable or disable a trigger state
}
}

// Intent represents user intents for a given phase.
message Intent {
bool build = 1; // in case skaffold dev is ran with autoBuild=false, a build intent enables building once
bool sync = 2; // in case skaffold dev is ran with autoSync=false, a sync intent enables file sync once
bool deploy = 3; // in case skaffold dev is ran with autoDeploy=false, a deploy intent enables deploys once
}

// Suggestion defines the action a user needs to recover from an error.
message Suggestion {
SuggestionCode suggestionCode = 1; // code representing a suggestion
string action = 2; // action represents the suggestion action
}

// IntOrString is a type that can hold an int32 or a string.
message IntOrString {
int32 type = 1; // type of stored value
int32 intVal = 2; // int value
string strVal = 3; // string value
}

// Describes all the methods for the Skaffold API
service SkaffoldV2Service {

// Returns the state of the current Skaffold execution
rpc GetState (google.protobuf.Empty) returns (State) {
option (google.api.http) = {
get: "/v2/state"
};
}

// Returns all the events of the current Skaffold execution from the start
rpc Events (google.protobuf.Empty) returns (stream LogEntry) {
option (google.api.http) = {
get: "/v2/events"
};
}

// Allows for a single execution of some or all of the phases (build, sync, deploy) in case autoBuild, autoDeploy or autoSync are disabled.
rpc Execute (UserIntentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v2/execute"
body: "intent"
};
}

// Allows for enabling or disabling automatic build trigger
rpc AutoBuild (TriggerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: "/v2/build/auto_execute"
body: "state"
};
}

// Allows for enabling or disabling automatic sync trigger
rpc AutoSync (TriggerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: "/v2/sync/auto_execute"
body: "state"
};
}

// Allows for enabling or disabling automatic deploy trigger
rpc AutoDeploy (TriggerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: "/v2/deploy/auto_execute"
body: "state"
};
}

// EXPERIMENTAL. It allows for custom events to be implemented in custom builders for example.
rpc Handle (Event) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v2/events/handle"
body: "*"
};
}

}

// Enum indicating builders used
enum BuilderType {
// Could not determine builder type
UNKNOWN_BUILDER_TYPE = 0;
// JIB Builder
JIB = 1;
// Bazel Builder
BAZEL = 2;
// Buildpacks Builder
BUILDPACKS = 3;
// Custom Builder
CUSTOM = 4;
// Kaniko Builder
KANIKO = 5;
// Docker Builder
DOCKER = 6;
}

// Enum indicating build type i.e. local, cluster vs GCB
enum BuildType {
// Could not determine Build Type
UNKNOWN_BUILD_TYPE = 0;
// Cluster Build
CLUSTER = 1;
// GCB Build
GCB = 2;
// Local Build
LOCAL = 3;
}

// Enum indicating test tools used
enum TesterType {
// Could not determine Test Type
UNKNOWN_TEST_TYPE = 0;
// Unit tests
UNIT = 1;
// Container Structure tests
CONTAINER_STRUCTURE_TEST = 2;
}

// Enum indicating deploy tools used
enum DeployerType {
// Could not determine Deployer Type
UNKNOWN_DEPLOYER_TYPE = 0;
// Helm Deployer
HELM = 1;
// Kustomize Deployer
KUSTOMIZE = 2;
// Kubectl Deployer
KUBECTL = 3;
}

// Enum indicating cluster type the application is deployed to
enum ClusterType {
// Could not determine Cluster Type
UNKNOWN_CLUSTER_TYPE = 0;
// Minikube Cluster
MINIKUBE = 1;
// GKE cluster
GKE = 2;
// All Cluster except Minikube and GKE
OTHER = 3;
}

// Enum for Status codes<br>
// These error codes are prepended by Phase Name e.g.
// INIT, BUILD, TEST, DEPLOY, STATUSCHECK, DEVINIT<br>
// For Success Error codes, use range 200 to 250.<br>
// For Unknown error codes, use range 500 to 600.<br>
// For Cancelled Error code, use range 800 to 850.<br>
enum StatusCode {
// A default status code for events that do not have an associated phase.
// Typically seen with the DevEndEvent event on success.
OK = 0;

// Success codes

// Status Check Success
STATUSCHECK_SUCCESS = 200;
// Build Success
BUILD_SUCCESS = 201;
// Deploy Success
DEPLOY_SUCCESS = 202;
// Test Success
TEST_SUCCESS = 203;

// Build Errors

// Build error due to push access denied
BUILD_PUSH_ACCESS_DENIED = 101;
// Build error due to GCP project not found.
BUILD_PROJECT_NOT_FOUND = 102;
// Docker build error due to docker daemon not running
BUILD_DOCKER_DAEMON_NOT_RUNNING = 103;
// Build error due to user application code, e.g. compilation error, dockerfile error etc
BUILD_USER_ERROR = 104;
// Build error due to docker not available
BUILD_DOCKER_UNAVAILABLE = 105;
// Docker build error due to user not authorized to perform the action
BUILD_DOCKER_UNAUTHORIZED = 106;
// Docker system build error
BUILD_DOCKER_SYSTEM_ERR = 107;
// Docker build error due to Docker build container is already in the desired state
BUILD_DOCKER_NOT_MODIFIED_ERR = 108;
// Docker build error indicating a feature not supported
BUILD_DOCKER_NOT_IMPLEMENTED_ERR = 109;
// Docker build error indicates that for given build, data was lost or there is data corruption
BUILD_DOCKER_DATA_LOSS_ERR = 110;
// Docker build error indicates user is forbidden to perform the build or step/action.
BUILD_DOCKER_FORBIDDEN_ERR = 111;
// Docker build error due to some internal error and docker container state conflicts with the requested action and can't be performed
BUILD_DOCKER_CONFLICT_ERR = 112;
// Docker build error indicates the requested object does not exist
BUILD_DOCKER_ERROR_NOT_FOUND = 113;
// Docker build error indication invalid parameter sent to docker command
BUILD_DOCKER_INVALID_PARAM_ERR = 114;
// Docker build failed due to dockerfile not found
BUILD_DOCKERFILE_NOT_FOUND = 115;
// Docker build failed due `cacheFrom` user config error
BUILD_DOCKER_CACHE_FROM_PULL_ERR = 116;
// Build error due to digest for built artifact could not be retrieved from docker daemon.
BUILD_DOCKER_GET_DIGEST_ERR = 117;
// Build error due to digest for built artifact could not be retrieved from registry.
BUILD_REGISTRY_GET_DIGEST_ERR = 118;
// Build error indicating unknown Jib plugin type. Should be one of [maven, gradle]
BUILD_UNKNOWN_JIB_PLUGIN_TYPE = 119;
// Build error determining dependency for jib gradle project.
BUILD_JIB_GRADLE_DEP_ERR = 120;
// Build error determining dependency for jib gradle project.
BUILD_JIB_MAVEN_DEP_ERR = 121;
// Docker build error when listing containers.
INIT_DOCKER_NETWORK_LISTING_CONTAINERS = 122;
// Docker build error indicating an invalid container name (or id).
INIT_DOCKER_NETWORK_INVALID_CONTAINER_NAME = 123;
// Docker build error indicating the container referenced does not exists in the docker context used.
INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST = 124;


// Container errors

// Container image pull error
STATUSCHECK_IMAGE_PULL_ERR = 300;
// Container creating error
STATUSCHECK_CONTAINER_CREATING = 301;
// Container run error
STATUSCHECK_RUN_CONTAINER_ERR = 302;
// Container is already terminated
STATUSCHECK_CONTAINER_TERMINATED = 303;
// Deployment waiting for rollout
STATUSCHECK_DEPLOYMENT_ROLLOUT_PENDING = 304;
// Container restarting error
STATUSCHECK_CONTAINER_RESTARTING = 356;
// Readiness probe failed
STATUSCHECK_UNHEALTHY = 357;

// K8 infra errors

// Node memory pressure error
STATUSCHECK_NODE_MEMORY_PRESSURE = 400;
// Node disk pressure error
STATUSCHECK_NODE_DISK_PRESSURE = 401;
// Node network unavailable error
STATUSCHECK_NODE_NETWORK_UNAVAILABLE = 402;
// Node PID pressure error
STATUSCHECK_NODE_PID_PRESSURE = 403;
// Node unschedulable error
STATUSCHECK_NODE_UNSCHEDULABLE= 404;
// Node unreachable error
STATUSCHECK_NODE_UNREACHABLE = 405;
// Node not ready error
STATUSCHECK_NODE_NOT_READY= 406;
// Scheduler failure error
STATUSCHECK_FAILED_SCHEDULING = 407;
// Kubectl connection error
STATUSCHECK_KUBECTL_CONNECTION_ERR = 409;
// Kubectl process killed error
STATUSCHECK_KUBECTL_PID_KILLED = 410;

// 408 is skipped as STATUSCHECK_UNHEALTH code renumbered as 357

// Kubectl client fetch err
STATUSCHECK_KUBECTL_CLIENT_FETCH_ERR = 411;
STATUSCHECK_DEPLOYMENT_FETCH_ERR = 412;

// Pod States

// Pod Initializing
STATUSCHECK_POD_INITIALIZING = 451;

// Unknown Error Codes

// Could not determine error and phase
UNKNOWN_ERROR = 500;
// Status Check error unknown
STATUSCHECK_UNKNOWN = 501;
// Container is unschedulable due to unknown reasons
STATUSCHECK_UNKNOWN_UNSCHEDULABLE = 502;
// Container is waiting due to unknown reason
STATUSCHECK_CONTAINER_WAITING_UNKNOWN = 503;
// Container event reason unknown
STATUSCHECK_UNKNOWN_EVENT = 509;

// Deploy failed due to unknown reason
DEPLOY_UNKNOWN = 504;
// SYNC failed due to known reason
SYNC_UNKNOWN = 505;
// Build failed due to unknown reason
BUILD_UNKNOWN= 506;
// Dev Init failed due to unknown reason
DEVINIT_UNKNOWN = 507;
// Cleanup failed due to unknown reason
CLEANUP_UNKNOWN = 508;
// Initialization of the Skaffold session failed due to unknown reason(s)
INIT_UNKNOWN = 510 ;
// Build failed due to docker unknown error
BUILD_DOCKER_UNKNOWN = 511;
// Test failed due to unknown reason
TEST_UNKNOWN = 512;


// FILE_SYNC Failures

// File Sync Initialize failure
SYNC_INIT_ERROR = 601;


// DevInit Errors

// Failed to configure watcher for build dependencies in dev loop
DEVINIT_REGISTER_BUILD_DEPS = 701;
// Failed to configure watcher for test dependencies in dev loop
DEVINIT_REGISTER_TEST_DEPS = 702;
// Failed to configure watcher for deploy dependencies in dev loop
DEVINIT_REGISTER_DEPLOY_DEPS = 703;
// Failed to configure watcher for Skaffold configuration file.
DEVINIT_REGISTER_CONFIG_DEP = 704;
// Failed to configure watcher for build dependencies for a base image with v1 manifest.
DEVINIT_UNSUPPORTED_V1_MANIFEST = 705;

// Timeout or User Cancellation Errors

// User cancelled the skaffold dev run
STATUSCHECK_USER_CANCELLED = 800;
// Deadline for status check exceeded
STATUSCHECK_DEADLINE_EXCEEDED = 801;
// Build Cancelled
BUILD_CANCELLED = 802;
// Deploy cancelled due to user cancellation or one or more deployers failed.
DEPLOY_CANCELLED = 803;
// Docker build cancelled.
BUILD_DOCKER_CANCELLED = 804;
// Build error due to docker deadline was reached before the docker action completed
BUILD_DOCKER_DEADLINE = 805;

// Skaffold Initialization Phase session errors

// Skaffold was unable to create the configured tagger
INIT_CREATE_TAGGER_ERROR = 901;
// Skaffold was unable to start as Minikube appears to be paused
INIT_MINIKUBE_PAUSED_ERROR = 902;
// Skaffold was unable to start as Minikube appears to be stopped
INIT_MINIKUBE_NOT_RUNNING_ERROR = 903;
// Skaffold was unable to create a configured image builder
INIT_CREATE_BUILDER_ERROR = 904;
// Skaffold was unable to create a configured deployer
INIT_CREATE_DEPLOYER_ERROR = 905;
// Skaffold was unable to create a configured test
INIT_CREATE_TEST_DEP_ERROR = 906;
// Skaffold encountered an error validating the artifact cache
INIT_CACHE_ERROR = 907;
// Skaffold encountered an error when configuring file watching
INIT_CREATE_WATCH_TRIGGER_ERROR = 908;
// Skaffold encountered an error when evaluating artifact dependencies
INIT_CREATE_ARTIFACT_DEP_ERROR = 909;

// Deploy errors

// Unable to connect to cluster
DEPLOY_CLUSTER_CONNECTION_ERR = 1001;
// Could not retrieve debug helpers.
DEPLOY_DEBUG_HELPER_RETRIEVE_ERR = 1002;
// Deploy clean up error
DEPLOY_CLEANUP_ERR = 1003;
// Unable to apply helm labels.
DEPLOY_HELM_APPLY_LABELS = 1004;
// Deploy error due to user deploy config for helm deployer
DEPLOY_HELM_USER_ERR = 1005;
// Helm error when no build result is found of value specified in helm `artifactOverrides`
DEPLOY_NO_MATCHING_BUILD = 1006;
// Unable to get helm client version
DEPLOY_HELM_VERSION_ERR = 1007;
// Helm version not supported.
DEPLOY_HELM_MIN_VERSION_ERR = 1008;
// Unable to retrieve kubectl version
DEPLOY_KUBECTL_VERSION_ERR = 1109;
// User specified offline mode for rendering but remote manifests presents.
DEPLOY_KUBECTL_OFFLINE_MODE_ERR =1010;
// Error waiting for previous version deletion before next version is active.
DEPLOY_ERR_WAITING_FOR_DELETION = 1011;
// Error reading manifests
DEPLOY_READ_MANIFEST_ERR = 1012;
// Error reading remote manifests
DEPLOY_READ_REMOTE_MANIFEST_ERR = 1013;
// Errors listing manifests
DEPLOY_LIST_MANIFEST_ERR = 1014;
// Deploy error due to user deploy config for kubectl deployer
DEPLOY_KUBECTL_USER_ERR = 1015;
// Deploy error due to user deploy config for kustomize deployer
DEPLOY_KUSTOMIZE_USER_ERR = 1016;
// Error replacing a built artifact in the manifests
DEPLOY_REPLACE_IMAGE_ERR = 1017;
// Error transforming a manifest during skaffold debug
DEPLOY_TRANSFORM_MANIFEST_ERR = 1018;
// Error setting user specified additional labels.
DEPLOY_SET_LABEL_ERR = 1019;
// Error writing hydrated kubernetes manifests.
DEPLOY_MANIFEST_WRITE_ERR = 1020;
// Error getting images from a kubernetes manifest.
DEPLOY_PARSE_MANIFEST_IMAGES_ERR = 1021;
// Helm config `createNamespace` not available
DEPLOY_HELM_CREATE_NS_NOT_AVAILABLE = 1022;

// Test errors

// Error expanding paths
TEST_USER_CONFIG_ERR = 1101;
// Error running container-structure-test
TEST_CST_USER_ERR = 1102;
// Unable to docker pull image
TEST_IMG_PULL_ERR = 1103;
}

// Enum for Suggestion codes
enum SuggestionCode {
// default nil suggestion.
// This is usually set when no error happens.
NIL = 0;

// Build error suggestion codes

// Add Default Repo
ADD_DEFAULT_REPO = 100;
// Verify Default Repo
CHECK_DEFAULT_REPO = 101;
// Verify default repo in the global config
CHECK_DEFAULT_REPO_GLOBAL_CONFIG = 102;
// run gcloud docker auth configure
GCLOUD_DOCKER_AUTH_CONFIGURE = 103;
// Run docker auth configure
DOCKER_AUTH_CONFIGURE = 104;
// Verify Gcloud Project
CHECK_GCLOUD_PROJECT = 105;
// Check if docker is running
CHECK_DOCKER_RUNNING = 106;
// Fix User Build Error
FIX_USER_BUILD_ERR = 107;
// Docker build internal error, try again
DOCKER_BUILD_RETRY = 108;
// Fix `cacheFrom` config for given artifact and try again
FIX_CACHE_FROM_ARTIFACT_CONFIG = 109;
// Fix `dockerfile` config for a given artifact and try again.
FIX_SKAFFOLD_CONFIG_DOCKERFILE = 110;
// Use a supported Jib plugin type
FIX_JIB_PLUGIN_CONFIGURATION = 111;
// Docker build network invalid docker container name (or id).
FIX_DOCKER_NETWORK_CONTAINER_NAME = 112;
// Docker build network container not existing in the current context.
CHECK_DOCKER_NETWORK_CONTAINER_RUNNING = 113;

// Deploy error suggestion codes

// Check cluster connection
CHECK_CLUSTER_CONNECTION = 201;
// Check minikube status
CHECK_MINIKUBE_STATUS = 202;
// Install helm tool
INSTALL_HELM = 203;
// Upgrade helm tool
UPGRADE_HELM = 204;
// Fix helm `releases.artifactOverrides` config to match with `build.artiofacts`
FIX_SKAFFOLD_CONFIG_HELM_ARTIFACT_OVERRIDES = 205;
// Upgrade helm version to v3.2.0 and higher.
UPGRADE_HELM32 = 206;
// Set `releases.createNamespace` to false.
FIX_SKAFFOLD_CONFIG_HELM_CREATE_NAMESPACE = 207;

// Install kubectl tool
INSTALL_KUBECTL = 220;

// Container Run time error

// Container run error
CHECK_CONTAINER_LOGS = 301;
// Pod Health check error
CHECK_READINESS_PROBE = 302;
// Check Container image
CHECK_CONTAINER_IMAGE = 303;


// Common infra errors

// Node pressure error
ADDRESS_NODE_MEMORY_PRESSURE = 400;
// Node disk pressure error
ADDRESS_NODE_DISK_PRESSURE = 401;
// Node network unavailable error
ADDRESS_NODE_NETWORK_UNAVAILABLE = 402;
// Node PID pressure error
ADDRESS_NODE_PID_PRESSURE = 403;
// Node unschedulable error
ADDRESS_NODE_UNSCHEDULABLE = 404;
// Node unreachable error
ADDRESS_NODE_UNREACHABLE = 405;
// Node not ready error
ADDRESS_NODE_NOT_READY = 406;
// Scheduler failure error
ADDRESS_FAILED_SCHEDULING = 407;
// Cluster Connectivity error
CHECK_HOST_CONNECTION = 408;

// Minikube Suggestions

// Minikube is stopped: use `minikube start`
START_MINIKUBE = 501;
// Minikube is paused: use `minikube unpause`
UNPAUSE_MINIKUBE = 502;


// Dev Phase error suggestions

// Run Docker pull for the image with v1 manifest and try again.
RUN_DOCKER_PULL = 551;


// Render Error suggestion codes

// Rerun with correct offline flag value.
SET_RENDER_FLAG_OFFLINE_FALSE = 600;

// Open an issue so this situation can be diagnosed
OPEN_ISSUE = 900;
}

0 comments on commit 73ecc82

Please sign in to comment.