diff --git a/api/v1/v1.pb.go b/api/v1/v1.pb.go index 6bddb86..7252cf6 100644 --- a/api/v1/v1.pb.go +++ b/api/v1/v1.pb.go @@ -1,7 +1,21 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.6.1 +// protoc v3.13.0 // source: v1.proto package v1 @@ -178,6 +192,44 @@ func (*ListRequest) Descriptor() ([]byte, []int) { return file_v1_proto_rawDescGZIP(), []int{1} } +type PingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PingRequest) Reset() { + *x = PingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingRequest) ProtoMessage() {} + +func (x *PingRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. +func (*PingRequest) Descriptor() ([]byte, []int) { + return file_v1_proto_rawDescGZIP(), []int{2} +} + type StopExposeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -190,7 +242,7 @@ type StopExposeRequest struct { func (x *StopExposeRequest) Reset() { *x = StopExposeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[2] + mi := &file_v1_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -203,7 +255,7 @@ func (x *StopExposeRequest) String() string { func (*StopExposeRequest) ProtoMessage() {} func (x *StopExposeRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[2] + mi := &file_v1_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -216,7 +268,7 @@ func (x *StopExposeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopExposeRequest.ProtoReflect.Descriptor instead. func (*StopExposeRequest) Descriptor() ([]byte, []int) { - return file_v1_proto_rawDescGZIP(), []int{2} + return file_v1_proto_rawDescGZIP(), []int{3} } func (x *StopExposeRequest) GetNamespace() string { @@ -249,7 +301,7 @@ type ConsoleResponse struct { func (x *ConsoleResponse) Reset() { *x = ConsoleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[3] + mi := &file_v1_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -262,7 +314,7 @@ func (x *ConsoleResponse) String() string { func (*ConsoleResponse) ProtoMessage() {} func (x *ConsoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[3] + mi := &file_v1_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -275,7 +327,7 @@ func (x *ConsoleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ConsoleResponse.ProtoReflect.Descriptor instead. func (*ConsoleResponse) Descriptor() ([]byte, []int) { - return file_v1_proto_rawDescGZIP(), []int{3} + return file_v1_proto_rawDescGZIP(), []int{4} } func (x *ConsoleResponse) GetLevel() ConsoleLevel { @@ -292,6 +344,44 @@ func (x *ConsoleResponse) GetMessage() string { return "" } +type PingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PingResponse) Reset() { + *x = PingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingResponse) ProtoMessage() {} + +func (x *PingResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. +func (*PingResponse) Descriptor() ([]byte, []int) { + return file_v1_proto_rawDescGZIP(), []int{5} +} + type ListService struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -309,7 +399,7 @@ type ListService struct { func (x *ListService) Reset() { *x = ListService{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[4] + mi := &file_v1_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -322,7 +412,7 @@ func (x *ListService) String() string { func (*ListService) ProtoMessage() {} func (x *ListService) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[4] + mi := &file_v1_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -335,7 +425,7 @@ func (x *ListService) ProtoReflect() protoreflect.Message { // Deprecated: Use ListService.ProtoReflect.Descriptor instead. func (*ListService) Descriptor() ([]byte, []int) { - return file_v1_proto_rawDescGZIP(), []int{4} + return file_v1_proto_rawDescGZIP(), []int{6} } func (x *ListService) GetNamespace() string { @@ -398,7 +488,7 @@ type ListResponse struct { func (x *ListResponse) Reset() { *x = ListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[5] + mi := &file_v1_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -411,7 +501,7 @@ func (x *ListResponse) String() string { func (*ListResponse) ProtoMessage() {} func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[5] + mi := &file_v1_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -424,7 +514,7 @@ func (x *ListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. func (*ListResponse) Descriptor() ([]byte, []int) { - return file_v1_proto_rawDescGZIP(), []int{5} + return file_v1_proto_rawDescGZIP(), []int{7} } func (x *ListResponse) GetServices() []*ListService { @@ -445,58 +535,63 @@ var file_v1_proto_rawDesc = []byte{ 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x61, 0x70, 0x22, 0x0d, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x11, - 0x53, 0x74, 0x6f, 0x70, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, + 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0d, 0x0a, 0x0b, + 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x11, 0x53, + 0x74, 0x6f, 0x70, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x57, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x73, + 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x57, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, - 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x05, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, - 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x14, 0x0a, - 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6f, - 0x72, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2a, 0x76, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, - 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x43, - 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, 0x52, - 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, - 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x32, 0xd9, 0x01, 0x0a, - 0x10, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, - 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x44, 0x0a, - 0x0a, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x30, 0x01, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x61, 0x72, 0x65, 0x64, 0x61, 0x6c, 0x6c, 0x61, - 0x72, 0x64, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2a, 0x76, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, + 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, 0x45, + 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, + 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, 0x52, 0x4e, + 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, 0x45, + 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x32, 0x8e, 0x02, 0x0a, 0x10, + 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x73, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0a, + 0x53, 0x74, 0x6f, 0x70, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, + 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x61, 0x72, 0x65, 0x64, + 0x61, 0x6c, 0x6c, 0x61, 0x72, 0x64, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -512,27 +607,31 @@ func file_v1_proto_rawDescGZIP() []byte { } var file_v1_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_v1_proto_goTypes = []interface{}{ (ConsoleLevel)(0), // 0: api.v1.ConsoleLevel (*ExposeServiceRequest)(nil), // 1: api.v1.ExposeServiceRequest (*ListRequest)(nil), // 2: api.v1.ListRequest - (*StopExposeRequest)(nil), // 3: api.v1.StopExposeRequest - (*ConsoleResponse)(nil), // 4: api.v1.ConsoleResponse - (*ListService)(nil), // 5: api.v1.ListService - (*ListResponse)(nil), // 6: api.v1.ListResponse + (*PingRequest)(nil), // 3: api.v1.PingRequest + (*StopExposeRequest)(nil), // 4: api.v1.StopExposeRequest + (*ConsoleResponse)(nil), // 5: api.v1.ConsoleResponse + (*PingResponse)(nil), // 6: api.v1.PingResponse + (*ListService)(nil), // 7: api.v1.ListService + (*ListResponse)(nil), // 8: api.v1.ListResponse } var file_v1_proto_depIdxs = []int32{ 0, // 0: api.v1.ConsoleResponse.level:type_name -> api.v1.ConsoleLevel - 5, // 1: api.v1.ListResponse.services:type_name -> api.v1.ListService + 7, // 1: api.v1.ListResponse.services:type_name -> api.v1.ListService 1, // 2: api.v1.LocalizerService.ExposeService:input_type -> api.v1.ExposeServiceRequest - 3, // 3: api.v1.LocalizerService.StopExpose:input_type -> api.v1.StopExposeRequest + 4, // 3: api.v1.LocalizerService.StopExpose:input_type -> api.v1.StopExposeRequest 2, // 4: api.v1.LocalizerService.List:input_type -> api.v1.ListRequest - 4, // 5: api.v1.LocalizerService.ExposeService:output_type -> api.v1.ConsoleResponse - 4, // 6: api.v1.LocalizerService.StopExpose:output_type -> api.v1.ConsoleResponse - 6, // 7: api.v1.LocalizerService.List:output_type -> api.v1.ListResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type + 3, // 5: api.v1.LocalizerService.Ping:input_type -> api.v1.PingRequest + 5, // 6: api.v1.LocalizerService.ExposeService:output_type -> api.v1.ConsoleResponse + 5, // 7: api.v1.LocalizerService.StopExpose:output_type -> api.v1.ConsoleResponse + 8, // 8: api.v1.LocalizerService.List:output_type -> api.v1.ListResponse + 6, // 9: api.v1.LocalizerService.Ping:output_type -> api.v1.PingResponse + 6, // [6:10] is the sub-list for method output_type + 2, // [2:6] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -569,7 +668,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopExposeRequest); i { + switch v := v.(*PingRequest); i { case 0: return &v.state case 1: @@ -581,7 +680,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConsoleResponse); i { + switch v := v.(*StopExposeRequest); i { case 0: return &v.state case 1: @@ -593,7 +692,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListService); i { + switch v := v.(*ConsoleResponse); i { case 0: return &v.state case 1: @@ -605,6 +704,30 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListService); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponse); i { case 0: return &v.state @@ -623,7 +746,7 @@ func file_v1_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_proto_rawDesc, NumEnums: 1, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/api/v1/v1.proto b/api/v1/v1.proto index 1a6a3fb..23d95ec 100644 --- a/api/v1/v1.proto +++ b/api/v1/v1.proto @@ -1,3 +1,17 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + syntax = "proto3"; package api.v1; @@ -12,6 +26,8 @@ message ExposeServiceRequest { message ListRequest {} +message PingRequest {} + message StopExposeRequest { string namespace = 1; string service = 2; @@ -34,6 +50,8 @@ message ConsoleResponse { string message = 2; } +message PingResponse {} + message ListService { string namespace = 1; string name = 2; @@ -52,4 +70,5 @@ service LocalizerService { rpc ExposeService(ExposeServiceRequest) returns (stream ConsoleResponse) {} rpc StopExpose(StopExposeRequest) returns (stream ConsoleResponse) {} rpc List(ListRequest) returns (ListResponse) {} + rpc Ping(PingRequest) returns (PingResponse) {} } diff --git a/api/v1/v1_grpc.pb.go b/api/v1/v1_grpc.pb.go index b0cfbd8..b64a7f8 100644 --- a/api/v1/v1_grpc.pb.go +++ b/api/v1/v1_grpc.pb.go @@ -20,6 +20,7 @@ type LocalizerServiceClient interface { ExposeService(ctx context.Context, in *ExposeServiceRequest, opts ...grpc.CallOption) (LocalizerService_ExposeServiceClient, error) StopExpose(ctx context.Context, in *StopExposeRequest, opts ...grpc.CallOption) (LocalizerService_StopExposeClient, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) + Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) } type localizerServiceClient struct { @@ -103,6 +104,15 @@ func (c *localizerServiceClient) List(ctx context.Context, in *ListRequest, opts return out, nil } +func (c *localizerServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { + out := new(PingResponse) + err := c.cc.Invoke(ctx, "/api.v1.LocalizerService/Ping", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // LocalizerServiceServer is the server API for LocalizerService service. // All implementations must embed UnimplementedLocalizerServiceServer // for forward compatibility @@ -110,6 +120,7 @@ type LocalizerServiceServer interface { ExposeService(*ExposeServiceRequest, LocalizerService_ExposeServiceServer) error StopExpose(*StopExposeRequest, LocalizerService_StopExposeServer) error List(context.Context, *ListRequest) (*ListResponse, error) + Ping(context.Context, *PingRequest) (*PingResponse, error) mustEmbedUnimplementedLocalizerServiceServer() } @@ -126,6 +137,9 @@ func (UnimplementedLocalizerServiceServer) StopExpose(*StopExposeRequest, Locali func (UnimplementedLocalizerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } +func (UnimplementedLocalizerServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} func (UnimplementedLocalizerServiceServer) mustEmbedUnimplementedLocalizerServiceServer() {} // UnsafeLocalizerServiceServer may be embedded to opt out of forward compatibility for this service. @@ -199,6 +213,24 @@ func _LocalizerService_List_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _LocalizerService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LocalizerServiceServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.v1.LocalizerService/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LocalizerServiceServer).Ping(ctx, req.(*PingRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _LocalizerService_serviceDesc = grpc.ServiceDesc{ ServiceName: "api.v1.LocalizerService", HandlerType: (*LocalizerServiceServer)(nil), @@ -207,6 +239,10 @@ var _LocalizerService_serviceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _LocalizerService_List_Handler, }, + { + MethodName: "Ping", + Handler: _LocalizerService_Ping_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/cmd/localizer/expose.go b/cmd/localizer/expose.go index a529d55..2874161 100644 --- a/cmd/localizer/expose.go +++ b/cmd/localizer/expose.go @@ -1,3 +1,16 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package main import ( @@ -31,7 +44,6 @@ func NewExposeCommand(log logrus.FieldLogger) *cli.Command { Usage: "stop exposing a service", }, }, - // TODO: multiple service support before this gets released Action: func(c *cli.Context) error { split := strings.Split(c.Args().First(), "/") if len(split) != 2 { diff --git a/cmd/localizer/list.go b/cmd/localizer/list.go index a86243c..562ba7a 100644 --- a/cmd/localizer/list.go +++ b/cmd/localizer/list.go @@ -1,3 +1,16 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package main import ( diff --git a/go.mod b/go.mod index 206db25..5bc3ebf 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/jaredallard/localizer go 1.15 require ( + github.com/apex/log v1.9.0 github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef github.com/benbjohnson/clock v1.1.0 github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect diff --git a/go.sum b/go.sum index cbc5537..c53e0ed 100644 --- a/go.sum +++ b/go.sum @@ -50,12 +50,19 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/apex/gateway v1.1.1/go.mod h1:x7iPY22zu9D8sfrynawEwh1wZEO/kQTRaOM5ye02tWU= +github.com/apex/log v1.9.0 h1:FHtw/xuaM8AgmvDDTI9fiwoAL25Sq2cxojnZICUU8l0= +github.com/apex/log v1.9.0/go.mod h1:m82fZlWIuiWzWP04XCTXmnX0xRkYYbCdYn8jbJeLBEA= +github.com/apex/logs v1.0.0/go.mod h1:XzxuLZ5myVHDy9SAmYpamKKRNApGj54PfYLcFrXqDwo= +github.com/aphistic/golf v0.0.0-20180712155816-02c07f170c5a/go.mod h1:3NqKYiepwy8kCu4PNA+aP7WUV72eXWJeP9/r3/K9aLE= +github.com/aphistic/sweet v0.2.0/go.mod h1:fWDlIh/isSE9n6EPsRmC0det+whmX6dJid3stzu0Xys= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef h1:46PFijGLmAjMPwCCCo7Jf0W6f9slllCkkv7vyc1yOSg= github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-lambda-go v1.13.2/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.16.15/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.20.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -111,6 +118,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= @@ -222,6 +230,7 @@ github.com/jaredallard/client-go v0.0.0-20201216203657-cc48b6b74693/go.mod h1:2o github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -246,6 +255,10 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= @@ -253,6 +266,7 @@ github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGw github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/metal-stack/go-ipam v1.7.0 h1:OwezGvR5xWTUlJ0LoxULXCfx5PjUB9OK4gT1keioabI= github.com/metal-stack/go-ipam v1.7.0/go.mod h1:d4odlA8XAoF+OV0NBcWGtG9RItONHMctIW3Y/jP/vzY= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -303,16 +317,21 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= +github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -329,6 +348,12 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/testcontainers/testcontainers-go v0.9.0 h1:ZyftCfROjGrKlxk3MOUn2DAzWrUtzY/mj17iAkdUIvI= github.com/testcontainers/testcontainers-go v0.9.0/go.mod h1:b22BFXhRbg4PJmeMVWh6ftqjyZHgiIl3w274e9r3C2E= +github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0= +github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk= +github.com/tj/go-buffer v1.1.0/go.mod h1:iyiJpfFcR2B9sXu7KvjbT9fpM4mOelRSDTbntVj52Uc= +github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= +github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= +github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= @@ -340,6 +365,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/internal/server/grpc.go b/internal/server/grpc.go index 3ee1844..60c11c6 100644 --- a/internal/server/grpc.go +++ b/internal/server/grpc.go @@ -18,6 +18,7 @@ import ( "fmt" "net" "os" + "time" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -49,10 +50,37 @@ func NewGRPCService(opts *RunOpts) *GRPCService { } } +// CleanupPreviousInstance attempts to cleanup after a dead localizer instance +// if a not dead one is found, an error is returned or if it fails to cleanup +func (g *GRPCService) CleanupPreviousInstance(ctx context.Context) error { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, time.Second*10) + defer cancel() + + conn, err := grpc.DialContext(ctx, "unix://"+SocketPath, + grpc.WithBlock(), grpc.WithInsecure()) + + // if we made a connection, see if it's responding to pings + // eventually we can expose useful information here? + if err == nil { + client := apiv1.NewLocalizerServiceClient(conn) + _, err = client.Ping(ctx, &apiv1.PingRequest{}) + if err == nil { + return fmt.Errorf("localizer instance is already running") + } + } + + return errors.Wrap(os.Remove(SocketPath), "failed to cleanup socket from old localizer instance") +} + // Run starts a grpc server with the internal server handler func (g *GRPCService) Run(ctx context.Context, log logrus.FieldLogger) error { if _, err := os.Stat(SocketPath); err == nil { - return fmt.Errorf("localizer instance already running") + // if we found an existing instance, attempt to cleanup after it + err = g.CleanupPreviousInstance(ctx) + if err != nil { + return err + } } l, err := net.Listen("unix", SocketPath) diff --git a/internal/server/ping.go b/internal/server/ping.go new file mode 100644 index 0000000..64d3cb2 --- /dev/null +++ b/internal/server/ping.go @@ -0,0 +1,24 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package server + +import ( + "context" + + apiv1 "github.com/jaredallard/localizer/api/v1" +) + +func (h *GRPCServiceHandler) Ping(ctx context.Context, req *apiv1.PingRequest) (*apiv1.PingResponse, error) { + return &apiv1.PingResponse{}, nil +} diff --git a/internal/ssh/client.go b/internal/ssh/client.go index 85ac26e..b9f0685 100644 --- a/internal/ssh/client.go +++ b/internal/ssh/client.go @@ -1,3 +1,16 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package ssh import ( diff --git a/pkg/hostsfile/parser.go b/pkg/hostsfile/parser.go index e87431f..b051eeb 100644 --- a/pkg/hostsfile/parser.go +++ b/pkg/hostsfile/parser.go @@ -1,3 +1,16 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package hostsfile import ( @@ -8,6 +21,7 @@ import ( "fmt" "io/ioutil" "net" + "sort" "strings" "sync" "time" @@ -158,26 +172,41 @@ func (f *File) Load(ctx context.Context) error { return nil } -func (f *File) generateBlock() ([]byte, error) { - contents := [][]byte{} +func (f *File) generateBlock() (string, error) { + contents := []string{} m, err := json.Marshal(&Metadata{ BlockName: f.blockName, LastModified: f.clock.Now().UTC(), }) if err != nil { - return nil, err + return "", err + } + + // ensure the output is stable, convert the keys + // into a sorted slice + ipAddresses := make([]string, len(f.hostsFile)) + + i := 0 + for ip := range f.hostsFile { + ipAddresses[i] = ip + i++ } - contents = append(contents, []byte("###start-hostfile"), []byte(fmt.Sprintf("###%s", m))) - for ip, line := range f.hostsFile { - contents = append(contents, []byte( - fmt.Sprintf("%s %s", ip, strings.Join(line.Addresses, " ")), - )) + sort.Slice(ipAddresses, func(i, j int) bool { + return bytes.Compare(net.ParseIP(ipAddresses[i]), net.ParseIP(ipAddresses[j])) < 0 + }) + + contents = append(contents, "###start-hostfile", fmt.Sprintf("###%s", m)) + for _, ip := range ipAddresses { + contents = append( + contents, + fmt.Sprintf("%s %s", ip, strings.Join(f.hostsFile[ip].Addresses, " ")), + ) } - contents = append(contents, []byte("###end-hostfile")) + contents = append(contents, "###end-hostfile") - return bytes.Join(contents, []byte("\n")), nil + return strings.Join(contents, "\n"), nil } // Marshal renders a hosts file from memory. @@ -187,7 +216,7 @@ func (f *File) Marshal(ctx context.Context) ([]byte, error) { scanner := bufio.NewScanner(bytes.NewReader(f.contents)) - contents := [][]byte{} + contents := []string{} wroteBlock := false copyLines := true @@ -235,7 +264,7 @@ func (f *File) Marshal(ctx context.Context) ([]byte, error) { continue } - contents = append(contents, scanner.Bytes()) + contents = append(contents, scanner.Text()) } if scanner.Err() != nil { return nil, scanner.Err() @@ -251,7 +280,7 @@ func (f *File) Marshal(ctx context.Context) ([]byte, error) { contents = append(contents, b) } - return bytes.Join(contents, []byte("\n")), nil + return []byte(strings.Join(contents, "\n")), nil } // Save marshalls the hosts file and then saves it to disk. diff --git a/pkg/hostsfile/parser_test.go b/pkg/hostsfile/parser_test.go index d9c46ad..d5936ff 100644 --- a/pkg/hostsfile/parser_test.go +++ b/pkg/hostsfile/parser_test.go @@ -1,8 +1,22 @@ +// Copyright 2020 Jared Allard +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package hostsfile import ( "bytes" "context" + "io/ioutil" "reflect" "testing" @@ -119,6 +133,38 @@ func TestFile_Marshal(t *testing.T) { } } +// Ensure that we don't corrupt hosts files that have data inside of +// a block already. This was triggering it in the past. This also ensures +// that our hosts file is ordered +func TestFile_HandleCorruption(t *testing.T) { + f, err := New("./testdata/load/hosts-with-block-corrupt.hosts", "") + if err != nil { + t.Error(err) + } + f.clock = clock.NewMock() + + err = f.Load(context.Background()) + if err != nil { + t.Error(errors.Wrap(err, "failed to load valid hosts file")) + } + + b, err := f.Marshal(context.Background()) + if err != nil { + t.Error(errors.Wrap(err, "failed to marshal hosts file")) + } + + origContents, err := ioutil.ReadFile("./testdata/load/hosts-with-block-corrupt.hosts") + if err != nil { + t.Fatal(err) + } + + expected := origContents + + if !reflect.DeepEqual(expected, b) { + t.Error("expected: ", cmp.Diff(expected, b)) + } +} + func TestFile_AddHosts(t *testing.T) { f, err := New("./testdata/load/hosts-with-block.hosts", "") if err != nil { diff --git a/pkg/hostsfile/testdata/load/hosts-with-block-corrupt.hosts b/pkg/hostsfile/testdata/load/hosts-with-block-corrupt.hosts new file mode 100644 index 0000000..036605f --- /dev/null +++ b/pkg/hostsfile/testdata/load/hosts-with-block-corrupt.hosts @@ -0,0 +1,19 @@ +127.0.0.1 localhost yuigahama +::1 localhost yuigahama + +###start-hostfile +###{"blockName":"localizer","last_modified_at":"1970-01-01T00:00:00Z"} +127.0.0.2 cert-manager cert-manager.cert-manager cert-manager.cert-manager.svc cert-manager.cert-manager.svc.cluster.local cert-manager-85c9b9bb44-9rlkd.cert-manager.cert-manager cert-manager-85c9b9bb44-9rlkd.cert-manager.cert-manager.svc cert-manager-85c9b9bb44-9rlkd.cert-manager.cert-manager.svc.cluster.local +127.0.0.3 kube-dns kube-dns.kube-system kube-dns.kube-system.svc kube-dns.kube-system.svc.cluster.local coredns-6955765f44-mx5ft.kube-dns.kube-system coredns-6955765f44-mx5ft.kube-dns.kube-system.svc coredns-6955765f44-mx5ft.kube-dns.kube-system.svc.cluster.local +127.0.0.4 cert-manager-webhook cert-manager-webhook.cert-manager cert-manager-webhook.cert-manager.svc cert-manager-webhook.cert-manager.svc.cluster.local cert-manager-webhook-695f8b56cd-755r7.cert-manager-webhook.cert-manager cert-manager-webhook-695f8b56cd-755r7.cert-manager-webhook.cert-manager.svc cert-manager-webhook-695f8b56cd-755r7.cert-manager-webhook.cert-manager.svc.cluster.local +127.0.0.5 nginx-ingress-ingress-nginx-controller-admission nginx-ingress-ingress-nginx-controller-admission.nginx-ingress nginx-ingress-ingress-nginx-controller-admission.nginx-ingress.svc nginx-ingress-ingress-nginx-controller-admission.nginx-ingress.svc.cluster.local nginx-ingress-ingress-nginx-controller-f99d588c4-tnp6s.nginx-ingress-ingress-nginx-controller-admission.nginx-ingress nginx-ingress-ingress-nginx-controller-f99d588c4-tnp6s.nginx-ingress-ingress-nginx-controller-admission.nginx-ingress.svc nginx-ingress-ingress-nginx-controller-f99d588c4-tnp6s.nginx-ingress-ingress-nginx-controller-admission.nginx-ingress.svc.cluster.local +127.0.0.6 vault-secrets-operator vault-secrets-operator.vault-secrets-operator vault-secrets-operator.vault-secrets-operator.svc vault-secrets-operator.vault-secrets-operator.svc.cluster.local vault-secrets-operator-547479dd8d-p5mrl.vault-secrets-operator.vault-secrets-operator vault-secrets-operator-547479dd8d-p5mrl.vault-secrets-operator.vault-secrets-operator.svc vault-secrets-operator-547479dd8d-p5mrl.vault-secrets-operator.vault-secrets-operator.svc.cluster.local +127.0.0.7 kafka-headless kafka-headless.kafka kafka-headless.kafka.svc kafka-headless.kafka.svc.cluster.local kafka-0.kafka-headless.kafka kafka-0.kafka-headless.kafka.svc kafka-0.kafka-headless.kafka.svc.cluster.local +127.0.0.8 kafka kafka.kafka kafka.kafka.svc kafka.kafka.svc.cluster.local kafka-0.kafka.kafka kafka-0.kafka.kafka.svc kafka-0.kafka.kafka.svc.cluster.local +127.0.0.9 kafka-zookeeper kafka-zookeeper.kafka kafka-zookeeper.kafka.svc kafka-zookeeper.kafka.svc.cluster.local kafka-zookeeper-0.kafka-zookeeper.kafka kafka-zookeeper-0.kafka-zookeeper.kafka.svc kafka-zookeeper-0.kafka-zookeeper.kafka.svc.cluster.local +127.0.0.10 nginx-ingress-ingress-nginx-controller nginx-ingress-ingress-nginx-controller.nginx-ingress nginx-ingress-ingress-nginx-controller.nginx-ingress.svc nginx-ingress-ingress-nginx-controller.nginx-ingress.svc.cluster.local nginx-ingress-ingress-nginx-controller-f99d588c4-tnp6s.nginx-ingress-ingress-nginx-controller.nginx-ingress nginx-ingress-ingress-nginx-controller-f99d588c4-tnp6s.nginx-ingress-ingress-nginx-controller.nginx-ingress.svc nginx-ingress-ingress-nginx-controller-f99d588c4-tnp6s.nginx-ingress-ingress-nginx-controller.nginx-ingress.svc.cluster.local +127.0.0.11 service-postgresql-headless service-postgresql-headless.bento1a service-postgresql-headless.bento1a.svc service-postgresql-headless.bento1a.svc.cluster.local service-postgresql-0.service-postgresql-headless.bento1a service-postgresql-0.service-postgresql-headless.bento1a.svc service-postgresql-0.service-postgresql-headless.bento1a.svc.cluster.local +127.0.0.12 service-postgresql service-postgresql.bento1a service-postgresql.bento1a.svc service-postgresql.bento1a.svc.cluster.local service-postgresql-0.service-postgresql.bento1a service-postgresql-0.service-postgresql.bento1a.svc service-postgresql-0.service-postgresql.bento1a.svc.cluster.local +127.0.0.13 metrics-server metrics-server.kube-system metrics-server.kube-system.svc metrics-server.kube-system.svc.cluster.local metrics-server-6cc8f9b85c-x6znm.metrics-server.kube-system metrics-server-6cc8f9b85c-x6znm.metrics-server.kube-system.svc metrics-server-6cc8f9b85c-x6znm.metrics-server.kube-system.svc.cluster.local +127.0.0.14 kafka-zookeeper-headless kafka-zookeeper-headless.kafka kafka-zookeeper-headless.kafka.svc kafka-zookeeper-headless.kafka.svc.cluster.local kafka-zookeeper-0.kafka-zookeeper-headless.kafka kafka-zookeeper-0.kafka-zookeeper-headless.kafka.svc kafka-zookeeper-0.kafka-zookeeper-headless.kafka.svc.cluster.local +###end-hostfile \ No newline at end of file