mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
executor: use int when encoding signal in RPC
This commit is contained in:
@@ -2,7 +2,9 @@ package executor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/LK4D4/joincontext"
|
||||
@@ -113,8 +115,12 @@ func (c *grpcExecutorClient) Stats() (*cstructs.TaskResourceUsage, error) {
|
||||
|
||||
func (c *grpcExecutorClient) Signal(s os.Signal) error {
|
||||
ctx := context.Background()
|
||||
sig, ok := s.(syscall.Signal)
|
||||
if !ok {
|
||||
return fmt.Errorf("unsupported signal type: %q", s.String())
|
||||
}
|
||||
req := &proto.SignalRequest{
|
||||
Signal: s.String(),
|
||||
Signal: int32(sig),
|
||||
}
|
||||
if _, err := c.client.Signal(ctx, req); err != nil {
|
||||
return err
|
||||
|
||||
@@ -45,7 +45,7 @@ func (m *LaunchRequest) Reset() { *m = LaunchRequest{} }
|
||||
func (m *LaunchRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*LaunchRequest) ProtoMessage() {}
|
||||
func (*LaunchRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{0}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{0}
|
||||
}
|
||||
func (m *LaunchRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LaunchRequest.Unmarshal(m, b)
|
||||
@@ -146,7 +146,7 @@ func (m *LaunchResponse) Reset() { *m = LaunchResponse{} }
|
||||
func (m *LaunchResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*LaunchResponse) ProtoMessage() {}
|
||||
func (*LaunchResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{1}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{1}
|
||||
}
|
||||
func (m *LaunchResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_LaunchResponse.Unmarshal(m, b)
|
||||
@@ -183,7 +183,7 @@ func (m *WaitRequest) Reset() { *m = WaitRequest{} }
|
||||
func (m *WaitRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*WaitRequest) ProtoMessage() {}
|
||||
func (*WaitRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{2}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{2}
|
||||
}
|
||||
func (m *WaitRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_WaitRequest.Unmarshal(m, b)
|
||||
@@ -214,7 +214,7 @@ func (m *WaitResponse) Reset() { *m = WaitResponse{} }
|
||||
func (m *WaitResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*WaitResponse) ProtoMessage() {}
|
||||
func (*WaitResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{3}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{3}
|
||||
}
|
||||
func (m *WaitResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_WaitResponse.Unmarshal(m, b)
|
||||
@@ -253,7 +253,7 @@ func (m *ShutdownRequest) Reset() { *m = ShutdownRequest{} }
|
||||
func (m *ShutdownRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ShutdownRequest) ProtoMessage() {}
|
||||
func (*ShutdownRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{4}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{4}
|
||||
}
|
||||
func (m *ShutdownRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ShutdownRequest.Unmarshal(m, b)
|
||||
@@ -297,7 +297,7 @@ func (m *ShutdownResponse) Reset() { *m = ShutdownResponse{} }
|
||||
func (m *ShutdownResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ShutdownResponse) ProtoMessage() {}
|
||||
func (*ShutdownResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{5}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{5}
|
||||
}
|
||||
func (m *ShutdownResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ShutdownResponse.Unmarshal(m, b)
|
||||
@@ -328,7 +328,7 @@ func (m *UpdateResourcesRequest) Reset() { *m = UpdateResourcesRequest{}
|
||||
func (m *UpdateResourcesRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateResourcesRequest) ProtoMessage() {}
|
||||
func (*UpdateResourcesRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{6}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{6}
|
||||
}
|
||||
func (m *UpdateResourcesRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateResourcesRequest.Unmarshal(m, b)
|
||||
@@ -365,7 +365,7 @@ func (m *UpdateResourcesResponse) Reset() { *m = UpdateResourcesResponse
|
||||
func (m *UpdateResourcesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*UpdateResourcesResponse) ProtoMessage() {}
|
||||
func (*UpdateResourcesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{7}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{7}
|
||||
}
|
||||
func (m *UpdateResourcesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_UpdateResourcesResponse.Unmarshal(m, b)
|
||||
@@ -395,7 +395,7 @@ func (m *VersionRequest) Reset() { *m = VersionRequest{} }
|
||||
func (m *VersionRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*VersionRequest) ProtoMessage() {}
|
||||
func (*VersionRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{8}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{8}
|
||||
}
|
||||
func (m *VersionRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_VersionRequest.Unmarshal(m, b)
|
||||
@@ -426,7 +426,7 @@ func (m *VersionResponse) Reset() { *m = VersionResponse{} }
|
||||
func (m *VersionResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*VersionResponse) ProtoMessage() {}
|
||||
func (*VersionResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{9}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{9}
|
||||
}
|
||||
func (m *VersionResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_VersionResponse.Unmarshal(m, b)
|
||||
@@ -463,7 +463,7 @@ func (m *StatsRequest) Reset() { *m = StatsRequest{} }
|
||||
func (m *StatsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatsRequest) ProtoMessage() {}
|
||||
func (*StatsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{10}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{10}
|
||||
}
|
||||
func (m *StatsRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StatsRequest.Unmarshal(m, b)
|
||||
@@ -494,7 +494,7 @@ func (m *StatsResponse) Reset() { *m = StatsResponse{} }
|
||||
func (m *StatsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*StatsResponse) ProtoMessage() {}
|
||||
func (*StatsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{11}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{11}
|
||||
}
|
||||
func (m *StatsResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_StatsResponse.Unmarshal(m, b)
|
||||
@@ -522,7 +522,7 @@ func (m *StatsResponse) GetStats() *proto1.TaskStats {
|
||||
}
|
||||
|
||||
type SignalRequest struct {
|
||||
Signal string `protobuf:"bytes,1,opt,name=signal,proto3" json:"signal,omitempty"`
|
||||
Signal int32 `protobuf:"varint,1,opt,name=signal,proto3" json:"signal,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@@ -532,7 +532,7 @@ func (m *SignalRequest) Reset() { *m = SignalRequest{} }
|
||||
func (m *SignalRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignalRequest) ProtoMessage() {}
|
||||
func (*SignalRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{12}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{12}
|
||||
}
|
||||
func (m *SignalRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignalRequest.Unmarshal(m, b)
|
||||
@@ -552,11 +552,11 @@ func (m *SignalRequest) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_SignalRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *SignalRequest) GetSignal() string {
|
||||
func (m *SignalRequest) GetSignal() int32 {
|
||||
if m != nil {
|
||||
return m.Signal
|
||||
}
|
||||
return ""
|
||||
return 0
|
||||
}
|
||||
|
||||
type SignalResponse struct {
|
||||
@@ -569,7 +569,7 @@ func (m *SignalResponse) Reset() { *m = SignalResponse{} }
|
||||
func (m *SignalResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*SignalResponse) ProtoMessage() {}
|
||||
func (*SignalResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{13}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{13}
|
||||
}
|
||||
func (m *SignalResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_SignalResponse.Unmarshal(m, b)
|
||||
@@ -602,7 +602,7 @@ func (m *ExecRequest) Reset() { *m = ExecRequest{} }
|
||||
func (m *ExecRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExecRequest) ProtoMessage() {}
|
||||
func (*ExecRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{14}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{14}
|
||||
}
|
||||
func (m *ExecRequest) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExecRequest.Unmarshal(m, b)
|
||||
@@ -655,7 +655,7 @@ func (m *ExecResponse) Reset() { *m = ExecResponse{} }
|
||||
func (m *ExecResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ExecResponse) ProtoMessage() {}
|
||||
func (*ExecResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{15}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{15}
|
||||
}
|
||||
func (m *ExecResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ExecResponse.Unmarshal(m, b)
|
||||
@@ -703,7 +703,7 @@ func (m *ProcessState) Reset() { *m = ProcessState{} }
|
||||
func (m *ProcessState) String() string { return proto.CompactTextString(m) }
|
||||
func (*ProcessState) ProtoMessage() {}
|
||||
func (*ProcessState) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_executor_ac624d46b225110f, []int{16}
|
||||
return fileDescriptor_executor_47d1ec212828d159, []int{16}
|
||||
}
|
||||
func (m *ProcessState) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ProcessState.Unmarshal(m, b)
|
||||
@@ -1075,61 +1075,61 @@ var _Executor_serviceDesc = grpc.ServiceDesc{
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("drivers/shared/executor/proto/executor.proto", fileDescriptor_executor_ac624d46b225110f)
|
||||
proto.RegisterFile("drivers/shared/executor/proto/executor.proto", fileDescriptor_executor_47d1ec212828d159)
|
||||
}
|
||||
|
||||
var fileDescriptor_executor_ac624d46b225110f = []byte{
|
||||
// 826 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_executor_47d1ec212828d159 = []byte{
|
||||
// 827 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x4b, 0x6f, 0xe4, 0x44,
|
||||
0x10, 0x5e, 0xcf, 0x7b, 0x6a, 0x9e, 0x6a, 0xa1, 0xe0, 0x35, 0x87, 0x1d, 0x7c, 0x60, 0x47, 0x02,
|
||||
0xd9, 0xab, 0xec, 0x8b, 0x0b, 0x20, 0x11, 0x96, 0x53, 0xb4, 0x8a, 0x9c, 0x85, 0x95, 0x38, 0x30,
|
||||
0x74, 0xec, 0xc6, 0x6e, 0x65, 0xc6, 0x6d, 0xba, 0xdb, 0x43, 0x22, 0x21, 0x71, 0xe2, 0x1f, 0xf0,
|
||||
0x0f, 0xf9, 0x13, 0x1c, 0x91, 0xfb, 0xe1, 0xcc, 0x24, 0x10, 0x3c, 0xa0, 0x3d, 0xb9, 0xab, 0x5c,
|
||||
0x55, 0x5f, 0x55, 0xf7, 0x57, 0x1f, 0x7c, 0x92, 0x70, 0xba, 0x25, 0x5c, 0x84, 0x22, 0xc3, 0x9c,
|
||||
0x24, 0x21, 0xb9, 0x22, 0x71, 0x29, 0x19, 0x0f, 0x0b, 0xce, 0x24, 0xab, 0xcd, 0x40, 0x99, 0xe8,
|
||||
0xa3, 0x0c, 0x8b, 0x8c, 0xc6, 0x8c, 0x17, 0x41, 0xce, 0x36, 0x38, 0x09, 0x8a, 0x75, 0x99, 0xd2,
|
||||
0x5c, 0x04, 0xfb, 0x71, 0xde, 0xa3, 0x94, 0xb1, 0x74, 0x4d, 0x74, 0x91, 0x8b, 0xf2, 0xc7, 0x50,
|
||||
0xd2, 0x0d, 0x11, 0x12, 0x6f, 0x0a, 0x13, 0xf0, 0x59, 0x4a, 0x65, 0x56, 0x5e, 0x04, 0x31, 0xdb,
|
||||
0x84, 0x75, 0xcd, 0x50, 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 0x38, 0x8b, 0x89, 0x10, 0xab, 0x38, 0xe5, 0xac, 0x2c, 0x5c, 0x50, 0xd1, 0x48,
|
||||
0xfd, 0x3b, 0xd3, 0xbf, 0x4e, 0xd4, 0x1f, 0xff, 0x07, 0x98, 0xda, 0x4b, 0x16, 0x05, 0xcb, 0x05,
|
||||
0x41, 0xaf, 0xa1, 0x6f, 0xb2, 0xd5, 0x4d, 0x8f, 0x8e, 0x9f, 0x05, 0xcd, 0x18, 0x11, 0x98, 0xca,
|
||||
0xe7, 0x12, 0x4b, 0x12, 0xd9, 0x22, 0xfe, 0x04, 0x46, 0x6f, 0x31, 0x95, 0xe6, 0x11, 0xfd, 0xef,
|
||||
0x61, 0xac, 0xcd, 0x77, 0x04, 0x77, 0x0a, 0xb3, 0xf3, 0xac, 0x94, 0x09, 0xfb, 0x39, 0xb7, 0xbc,
|
||||
0x39, 0x82, 0x9e, 0xa0, 0x69, 0x8e, 0xd7, 0x86, 0x3a, 0xc6, 0x42, 0x1f, 0xc2, 0x38, 0xe5, 0x38,
|
||||
0x26, 0xab, 0x82, 0x70, 0xca, 0x12, 0xb7, 0xb5, 0x70, 0x96, 0xed, 0x68, 0xa4, 0x7c, 0x67, 0xca,
|
||||
0xe5, 0x23, 0x98, 0xdf, 0x54, 0xd3, 0x1d, 0xfb, 0x19, 0x1c, 0x7d, 0x53, 0x24, 0x15, 0x68, 0x4d,
|
||||
0x17, 0x03, 0xb4, 0x47, 0x3d, 0xe7, 0x7f, 0x53, 0xcf, 0x7f, 0x08, 0xef, 0xdf, 0x41, 0x32, 0x4d,
|
||||
0xcc, 0x61, 0xfa, 0x2d, 0xe1, 0x82, 0x32, 0x3b, 0xa5, 0xff, 0x31, 0xcc, 0x6a, 0x8f, 0xb9, 0x5b,
|
||||
0x17, 0xfa, 0x5b, 0xed, 0x32, 0x93, 0x5b, 0xd3, 0x9f, 0xc2, 0xb8, 0xba, 0x37, 0xdb, 0xb9, 0xff,
|
||||
0x16, 0x26, 0xc6, 0x36, 0xa9, 0x5f, 0x43, 0x57, 0x54, 0x8e, 0x03, 0xc7, 0x78, 0x83, 0xc5, 0xa5,
|
||||
0x2e, 0xa4, 0xd3, 0xfd, 0xc7, 0x30, 0x39, 0x57, 0xb7, 0xfd, 0x2f, 0x8f, 0x51, 0x0d, 0x64, 0x03,
|
||||
0xcd, 0x88, 0x97, 0x30, 0x7a, 0x75, 0x45, 0x62, 0x9b, 0xf8, 0x02, 0x06, 0x09, 0xc1, 0xc9, 0x9a,
|
||||
0xe6, 0xc4, 0x34, 0xe5, 0x05, 0x5a, 0x82, 0x02, 0x2b, 0x41, 0xc1, 0x1b, 0x2b, 0x41, 0x51, 0x1d,
|
||||
0x6b, 0x55, 0xa3, 0x75, 0x57, 0x35, 0xda, 0x37, 0xaa, 0xe1, 0x9f, 0xc0, 0x58, 0x83, 0x99, 0xf9,
|
||||
0x8f, 0xa0, 0xc7, 0x4a, 0x59, 0x94, 0x52, 0x61, 0x8d, 0x23, 0x63, 0xa1, 0x0f, 0x60, 0x48, 0xae,
|
||||
0xa8, 0x5c, 0xc5, 0x2c, 0x21, 0xaa, 0x66, 0x37, 0x1a, 0x54, 0x8e, 0x13, 0x96, 0x10, 0xff, 0x37,
|
||||
0x07, 0xc6, 0xbb, 0xac, 0xac, 0xb0, 0x0b, 0xaa, 0x15, 0xab, 0x1b, 0x55, 0xc7, 0x7b, 0xf3, 0x77,
|
||||
0xee, 0xa6, 0xad, 0xfe, 0x58, 0xa2, 0x06, 0xd0, 0xa9, 0xc4, 0x55, 0x69, 0xcf, 0xfd, 0x63, 0xab,
|
||||
0xb8, 0xe3, 0x3f, 0xfb, 0x30, 0x78, 0x65, 0x96, 0x05, 0x5d, 0x43, 0x4f, 0x6f, 0x38, 0x7a, 0xde,
|
||||
0x74, 0xb3, 0xf6, 0x64, 0xd7, 0x7b, 0x71, 0x68, 0x9a, 0x79, 0xbf, 0x07, 0x48, 0x40, 0xa7, 0xda,
|
||||
0x75, 0xf4, 0xb4, 0x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0xe0, 0xb3, 0x84, 0xd3, 0x2d, 0xe1, 0x22, 0x14, 0x19, 0xe6,
|
||||
0x24, 0x09, 0xc9, 0x15, 0x89, 0x4b, 0xc9, 0x78, 0x58, 0x70, 0x26, 0x59, 0x6d, 0x06, 0xca, 0x44,
|
||||
0x9f, 0x64, 0x58, 0x64, 0x34, 0x66, 0xbc, 0x08, 0x72, 0xb6, 0xc1, 0x49, 0x50, 0xac, 0xcb, 0x94,
|
||||
0xe6, 0x22, 0xd8, 0x8f, 0xf3, 0x1e, 0xa5, 0x8c, 0xa5, 0x6b, 0xa2, 0x41, 0x2e, 0xca, 0x9f, 0x43,
|
||||
0x49, 0x37, 0x44, 0x48, 0xbc, 0x29, 0x4c, 0xc0, 0x17, 0x29, 0x95, 0x59, 0x79, 0x11, 0xc4, 0x6c,
|
||||
0x13, 0xd6, 0x98, 0xa1, 0xc2, 0x0c, 0x0d, 0x66, 0x68, 0x2b, 0xd3, 0x95, 0x68, 0x4b, 0xa7, 0xfb,
|
||||
0x7f, 0xb5, 0x60, 0x72, 0x8a, 0xcb, 0x3c, 0xce, 0x22, 0xf2, 0x4b, 0x49, 0x84, 0x44, 0x73, 0x68,
|
||||
0xc7, 0x9b, 0xc4, 0x75, 0x16, 0xce, 0x72, 0x18, 0x55, 0x47, 0x84, 0xa0, 0x83, 0x79, 0x2a, 0xdc,
|
||||
0xd6, 0xa2, 0xbd, 0x1c, 0x46, 0xea, 0x8c, 0x5e, 0xc3, 0x90, 0x13, 0xc1, 0x4a, 0x1e, 0x13, 0xe1,
|
||||
0xb6, 0x17, 0xce, 0x72, 0x74, 0xfc, 0x24, 0xf8, 0xb7, 0x9e, 0x0c, 0xbf, 0xa6, 0x0c, 0x22, 0x9b,
|
||||
0x17, 0x5d, 0x43, 0xa0, 0x47, 0x30, 0x12, 0x32, 0x61, 0xa5, 0x5c, 0x15, 0x58, 0x66, 0x6e, 0x47,
|
||||
0xb1, 0x83, 0x76, 0x9d, 0x61, 0x99, 0x99, 0x00, 0xc2, 0xb9, 0x0e, 0xe8, 0xd6, 0x01, 0x84, 0x73,
|
||||
0x15, 0x30, 0x87, 0x36, 0xc9, 0xb7, 0x6e, 0x4f, 0x15, 0x59, 0x1d, 0xab, 0xba, 0x4b, 0x41, 0xb8,
|
||||
0xdb, 0x57, 0xb1, 0xea, 0x8c, 0x1e, 0xc2, 0x40, 0x62, 0x71, 0xb9, 0x4a, 0x28, 0x77, 0x07, 0xca,
|
||||
0xdf, 0xaf, 0xec, 0x6f, 0x28, 0x47, 0x8f, 0x61, 0x66, 0xeb, 0x59, 0xad, 0xe9, 0x86, 0x4a, 0xe1,
|
||||
0x0e, 0x17, 0xce, 0x72, 0x10, 0x4d, 0xad, 0xfb, 0x54, 0x79, 0xd1, 0x13, 0xf8, 0xe0, 0x02, 0x0b,
|
||||
0x1a, 0xaf, 0x0a, 0xce, 0x62, 0x22, 0xc4, 0x2a, 0x4e, 0x39, 0x2b, 0x0b, 0x17, 0x54, 0x34, 0x52,
|
||||
0xff, 0xce, 0xf4, 0xaf, 0x13, 0xf5, 0xc7, 0xff, 0x09, 0xa6, 0xf6, 0x92, 0x45, 0xc1, 0x72, 0x41,
|
||||
0xd0, 0x6b, 0xe8, 0x9b, 0x6c, 0x75, 0xd3, 0xa3, 0xe3, 0x67, 0x41, 0xb3, 0x89, 0x08, 0x0c, 0xf2,
|
||||
0xb9, 0xc4, 0x92, 0x44, 0x16, 0xc4, 0x9f, 0xc0, 0xe8, 0x2d, 0xa6, 0xd2, 0x3c, 0xa2, 0xff, 0x23,
|
||||
0x8c, 0xb5, 0xf9, 0x9e, 0xe8, 0x4e, 0x61, 0x76, 0x9e, 0x95, 0x32, 0x61, 0xbf, 0xe6, 0x76, 0x6e,
|
||||
0x8e, 0xa0, 0x27, 0x68, 0x9a, 0xe3, 0xb5, 0x19, 0x1d, 0x63, 0xa1, 0x8f, 0x61, 0x9c, 0x72, 0x1c,
|
||||
0x93, 0x55, 0x41, 0x38, 0x65, 0x89, 0xdb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xa5, 0xa6, 0xbf, 0x5a, 0xc2, 0xe6, 0xd3, 0xbf, 0xa3, 0x76, 0xcd, 0xa7, 0x7f, 0x57,
|
||||
0xb5, 0xfc, 0x07, 0x5f, 0xf7, 0x7f, 0xe8, 0x6a, 0x59, 0xe8, 0xa9, 0xcf, 0xd3, 0x7f, 0x02, 0x00,
|
||||
0x00, 0xff, 0xff, 0x6b, 0xfb, 0xa5, 0x9a, 0xfd, 0x09, 0x00, 0x00,
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ message StatsResponse {
|
||||
}
|
||||
|
||||
message SignalRequest {
|
||||
string signal = 1;
|
||||
int32 signal = 1;
|
||||
}
|
||||
|
||||
message SignalResponse {}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package executor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/golang/protobuf/ptypes"
|
||||
"github.com/hashicorp/consul-template/signals"
|
||||
"github.com/hashicorp/nomad/drivers/shared/executor/proto"
|
||||
"github.com/hashicorp/nomad/plugins/drivers"
|
||||
"golang.org/x/net/context"
|
||||
@@ -103,13 +102,11 @@ func (s *grpcExecutorServer) Stats(context.Context, *proto.StatsRequest) (*proto
|
||||
}
|
||||
|
||||
func (s *grpcExecutorServer) Signal(ctx context.Context, req *proto.SignalRequest) (*proto.SignalResponse, error) {
|
||||
if sig, ok := signals.SignalLookup[req.Signal]; ok {
|
||||
if err := s.impl.Signal(sig); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &proto.SignalResponse{}, nil
|
||||
sig := syscall.Signal(req.Signal)
|
||||
if err := s.impl.Signal(sig); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, fmt.Errorf("invalid signal sent by client")
|
||||
return &proto.SignalResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *grpcExecutorServer) Exec(ctx context.Context, req *proto.ExecRequest) (*proto.ExecResponse, error) {
|
||||
|
||||
Reference in New Issue
Block a user