talos/api/common/common.proto
Andrey Smirnov 6a0e652f0c fix: correctly transport gRPC errors from apid
Before these changes, errors were always sent as strings, so if original
error was gRPC error (which is almost always the case for apid), it is
formatted as string and original fields (like code) are lost in the
formatted string.

With this change, apid sends errors as official `grpc.Status` protobuf
structure, and client decodes that into Go grpc.Status based error.

This change is backwards and forwards compatible.

This should fix more cases when integration tests were not able to
ignore grpc `transport is closing` errors when they were sent as strings
from the apid endpoint.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-12-23 11:08:51 -08:00

47 lines
941 B
Protocol Buffer

syntax = "proto3";
package common;
option go_package = "github.com/talos-systems/talos/pkg/machinery/api/common";
import "google/protobuf/any.proto";
import "google/rpc/status.proto";
enum Code {
FATAL = 0;
LOCKED = 1;
}
message Error {
Code code = 1;
string message = 2;
repeated google.protobuf.Any details = 3;
}
// Common metadata message nested in all reply message types
message Metadata {
// hostname of the server response comes from (injected by proxy)
string hostname = 1;
// error is set if request failed to the upstream (rest of response is
// undefined)
string error = 2;
// error as gRPC Status
google.rpc.Status status = 3;
}
message Data {
Metadata metadata = 1;
bytes bytes = 2;
}
message DataResponse { repeated Data messages = 1; }
message Empty { Metadata metadata = 1; }
message EmptyResponse { repeated Empty messages = 1; }
enum ContainerDriver {
CONTAINERD = 0;
CRI = 1;
}