chore: minor comments in common proto

This commit is contained in:
Pasha Sviderski
2026-10-28 17:28:23 +10:00
parent 7f68e1f838
commit df493d0b60
3 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -87,7 +87,8 @@ type Metadata struct {
MachineName string `protobuf:"bytes,5,opt,name=machine_name,json=machineName,proto3" json:"machine_name,omitempty"` MachineName string `protobuf:"bytes,5,opt,name=machine_name,json=machineName,proto3" json:"machine_name,omitempty"`
// Address of the machine the response came from. // Address of the machine the response came from.
MachineAddr string `protobuf:"bytes,1,opt,name=machine_addr,json=machineAddr,proto3" json:"machine_addr,omitempty"` MachineAddr string `protobuf:"bytes,1,opt,name=machine_addr,json=machineAddr,proto3" json:"machine_addr,omitempty"`
// error is set if the request to upstream failed. The rest of the response is undefined. // error is set if the request to upstream failed. The rest of the response apart from this metadata message
// is undefined.
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
// error as a gRPC Status message. // error as a gRPC Status message.
Status *status.Status `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Status *status.Status `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
+2 -1
View File
@@ -18,7 +18,8 @@ message Metadata {
// Address of the machine the response came from. // Address of the machine the response came from.
string machine_addr = 1; string machine_addr = 1;
// error is set if the request to upstream failed. The rest of the response is undefined. // error is set if the request to upstream failed. The rest of the response apart from this metadata message
// is undefined.
string error = 2; string error = 2;
// error as a gRPC Status message. // error as a gRPC Status message.
google.rpc.Status status = 3; google.rpc.Status status = 3;
+1
View File
@@ -86,6 +86,7 @@ func (cli *Client) progressOut() *streams.Out {
// ProxyMachinesContext returns a new context that proxies gRPC requests to the specified machines. // ProxyMachinesContext returns a new context that proxies gRPC requests to the specified machines.
// If namesOrIDs is nil or empty, all machines are included. // If namesOrIDs is nil or empty, all machines are included.
// This triggers One2Many proxying, which always injects metadata into the response. // This triggers One2Many proxying, which always injects metadata into the response.
// TODO: validate namesOrIDs can't contain "*" as this is reserved as internal value and may break the caller logic.
func ProxyMachinesContext(ctx context.Context, namesOrIDs []string) context.Context { func ProxyMachinesContext(ctx context.Context, namesOrIDs []string) context.Context {
md := outgoingMetadataWithoutProxyTargets(ctx) md := outgoingMetadataWithoutProxyTargets(ctx)
if len(namesOrIDs) == 0 { if len(namesOrIDs) == 0 {