diff --git a/build/build-allocation-images/go/gen.sh b/build/build-allocation-images/go/gen.sh index b8b1d1c42d..f7e43e01de 100644 --- a/build/build-allocation-images/go/gen.sh +++ b/build/build-allocation-images/go/gen.sh @@ -25,8 +25,8 @@ cd /go/src/agones.dev/agones go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go install -mod=vendor github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger -outputpath=pkg/allocation/go/v1alpha1 -protopath=proto/allocation/v1alpha1 +outputpath=pkg/allocation/go +protopath=proto/allocation googleapis=/go/src/agones.dev/agones/proto/googleapis protofile=${protopath}/allocation.proto diff --git a/cmd/allocator/main.go b/cmd/allocator/main.go index 93df955752..95d921279c 100644 --- a/cmd/allocator/main.go +++ b/cmd/allocator/main.go @@ -29,7 +29,7 @@ import ( "agones.dev/agones/pkg" "agones.dev/agones/pkg/allocation/converters" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" "agones.dev/agones/pkg/client/clientset/versioned" "agones.dev/agones/pkg/client/informers/externalversions" @@ -281,7 +281,7 @@ type serviceHandler struct { // Allocate implements the Allocate gRPC method definition func (h *serviceHandler) Allocate(ctx context.Context, in *pb.AllocationRequest) (*pb.AllocationResponse, error) { logger.WithField("request", in).Infof("allocation request received.") - gsa := converters.ConvertAllocationRequestV1Alpha1ToGSAV1(in) + gsa := converters.ConvertAllocationRequestToGSA(in) resultObj, err := h.allocationCallback(gsa) if err != nil { logger.WithField("gsa", gsa).WithError(err).Info("allocation failed") @@ -297,7 +297,7 @@ func (h *serviceHandler) Allocate(ctx context.Context, in *pb.AllocationRequest) logger.Errorf("internal server error - Bad GSA format %v", resultObj) return nil, status.Errorf(codes.Internal, "internal server error- Bad GSA format %v", resultObj) } - response, err := converters.ConvertGSAV1ToAllocationResponseV1Alpha1(allocatedGsa) + response, err := converters.ConvertGSAToAllocationResponse(allocatedGsa) logger.WithField("response", response).WithError(err).Infof("allocation response is being sent") return response, err diff --git a/cmd/allocator/main_test.go b/cmd/allocator/main_test.go index 13f7898639..f8208e2814 100644 --- a/cmd/allocator/main_test.go +++ b/cmd/allocator/main_test.go @@ -22,7 +22,7 @@ import ( "os" "testing" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" "github.com/stretchr/testify/assert" "google.golang.org/grpc/codes" diff --git a/examples/allocator-client-csharp/Program.cs b/examples/allocator-client-csharp/Program.cs index 398b44124a..2c665f344a 100644 --- a/examples/allocator-client-csharp/Program.cs +++ b/examples/allocator-client-csharp/Program.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using System.IO; using Grpc.Core; -using V1Alpha1; +using Allocation; using System.Net.Http; namespace AllocatorClient @@ -30,7 +30,7 @@ static async Task Main(string[] args) try { var response = await client.AllocateAsync(new AllocationRequest { Namespace = namespaceArg, - MultiClusterSetting = new V1Alpha1.MultiClusterSetting { + MultiClusterSetting = new Allocation.MultiClusterSetting { Enabled = multicluster, } }); diff --git a/examples/allocator-client-csharp/allocator-client-csharp.csproj b/examples/allocator-client-csharp/allocator-client-csharp.csproj index cd915a633e..004f51ded7 100644 --- a/examples/allocator-client-csharp/allocator-client-csharp.csproj +++ b/examples/allocator-client-csharp/allocator-client-csharp.csproj @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/examples/allocator-client/main.go b/examples/allocator-client/main.go index 1c1ee9c642..b14383d14d 100644 --- a/examples/allocator-client/main.go +++ b/examples/allocator-client/main.go @@ -22,7 +22,7 @@ import ( "fmt" "io/ioutil" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/pkg/allocation/converters/converter.go b/pkg/allocation/converters/converter.go index ae33d66f29..5f07c4a931 100644 --- a/pkg/allocation/converters/converter.go +++ b/pkg/allocation/converters/converter.go @@ -16,7 +16,7 @@ package converters import ( - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" "agones.dev/agones/pkg/apis" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" @@ -25,8 +25,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ConvertAllocationRequestV1Alpha1ToGSAV1 converts AllocationRequest to GameServerAllocation V1 (GSA) -func ConvertAllocationRequestV1Alpha1ToGSAV1(in *pb.AllocationRequest) *allocationv1.GameServerAllocation { +// ConvertAllocationRequestToGSA converts AllocationRequest to GameServerAllocation V1 (GSA) +func ConvertAllocationRequestToGSA(in *pb.AllocationRequest) *allocationv1.GameServerAllocation { if in == nil { return nil } @@ -37,7 +37,7 @@ func ConvertAllocationRequestV1Alpha1ToGSAV1(in *pb.AllocationRequest) *allocati }, Spec: allocationv1.GameServerAllocationSpec{ Preferred: convertLabelSelectorsToInternalLabelSelectors(in.GetPreferredGameServerSelectors()), - Scheduling: convertAllocationSchedulingV1Alpha1ToSchedulingStrategyV1(in.GetScheduling()), + Scheduling: convertAllocationSchedulingToGSASchedulingStrategy(in.GetScheduling()), }, } @@ -63,8 +63,8 @@ func ConvertAllocationRequestV1Alpha1ToGSAV1(in *pb.AllocationRequest) *allocati return gsa } -// ConvertGSAV1ToAllocationRequestV1Alpha1 converts AllocationRequest to GameServerAllocation V1 (GSA) -func ConvertGSAV1ToAllocationRequestV1Alpha1(in *allocationv1.GameServerAllocation) *pb.AllocationRequest { +// ConvertGSAToAllocationRequest converts AllocationRequest to GameServerAllocation V1 (GSA) +func ConvertGSAToAllocationRequest(in *allocationv1.GameServerAllocation) *pb.AllocationRequest { if in == nil { return nil } @@ -72,7 +72,7 @@ func ConvertGSAV1ToAllocationRequestV1Alpha1(in *allocationv1.GameServerAllocati out := &pb.AllocationRequest{ Namespace: in.GetNamespace(), PreferredGameServerSelectors: convertInternalLabelSelectorsToLabelSelectors(in.Spec.Preferred), - Scheduling: convertSchedulingStrategyV1ToAllocationSchedulingV1Alpha1(in.Spec.Scheduling), + Scheduling: convertGSASchedulingStrategyToAllocationScheduling(in.Spec.Scheduling), MultiClusterSetting: &pb.MultiClusterSetting{ Enabled: in.Spec.MultiClusterSetting.Enabled, }, @@ -90,8 +90,8 @@ func ConvertGSAV1ToAllocationRequestV1Alpha1(in *allocationv1.GameServerAllocati return out } -// convertAllocationSchedulingV1Alpha1ToSchedulingStrategyV1 converts AllocationRequest_SchedulingStrategy to apis.SchedulingStrategy -func convertAllocationSchedulingV1Alpha1ToSchedulingStrategyV1(in pb.AllocationRequest_SchedulingStrategy) apis.SchedulingStrategy { +// convertAllocationSchedulingToGSASchedulingStrategy converts AllocationRequest_SchedulingStrategy to apis.SchedulingStrategy +func convertAllocationSchedulingToGSASchedulingStrategy(in pb.AllocationRequest_SchedulingStrategy) apis.SchedulingStrategy { switch in { case pb.AllocationRequest_Packed: return apis.Packed @@ -101,8 +101,8 @@ func convertAllocationSchedulingV1Alpha1ToSchedulingStrategyV1(in pb.AllocationR return apis.Packed } -// convertSchedulingStrategyV1ToAllocationSchedulingV1Alpha1 converts apis.SchedulingStrategy to pb.AllocationRequest_SchedulingStrategy -func convertSchedulingStrategyV1ToAllocationSchedulingV1Alpha1(in apis.SchedulingStrategy) pb.AllocationRequest_SchedulingStrategy { +// convertGSASchedulingStrategyToAllocationScheduling converts apis.SchedulingStrategy to pb.AllocationRequest_SchedulingStrategy +func convertGSASchedulingStrategyToAllocationScheduling(in apis.SchedulingStrategy) pb.AllocationRequest_SchedulingStrategy { switch in { case apis.Packed: return pb.AllocationRequest_Packed @@ -146,8 +146,8 @@ func convertLabelSelectorsToInternalLabelSelectors(in []*pb.LabelSelector) []met return result } -// ConvertGSAV1ToAllocationResponseV1Alpha1 converts GameServerAllocation V1 (GSA) to AllocationResponse -func ConvertGSAV1ToAllocationResponseV1Alpha1(in *allocationv1.GameServerAllocation) (*pb.AllocationResponse, error) { +// ConvertGSAToAllocationResponse converts GameServerAllocation V1 (GSA) to AllocationResponse +func ConvertGSAToAllocationResponse(in *allocationv1.GameServerAllocation) (*pb.AllocationResponse, error) { if in == nil { return nil, nil } @@ -160,12 +160,12 @@ func ConvertGSAV1ToAllocationResponseV1Alpha1(in *allocationv1.GameServerAllocat GameServerName: in.Status.GameServerName, Address: in.Status.Address, NodeName: in.Status.NodeName, - Ports: convertAgonesPortsV1ToAllocationPortsV1Alpha1(in.Status.Ports), + Ports: convertGSAAgonesPortsToAllocationPorts(in.Status.Ports), }, nil } -// ConvertAllocationResponseV1Alpha1ToGSAV1 converts AllocationResponse to GameServerAllocation V1 (GSA) -func ConvertAllocationResponseV1Alpha1ToGSAV1(in *pb.AllocationResponse) *allocationv1.GameServerAllocation { +// ConvertAllocationResponseToGSA converts AllocationResponse to GameServerAllocation V1 (GSA) +func ConvertAllocationResponseToGSA(in *pb.AllocationResponse) *allocationv1.GameServerAllocation { if in == nil { return nil } @@ -176,15 +176,15 @@ func ConvertAllocationResponseV1Alpha1ToGSAV1(in *pb.AllocationResponse) *alloca GameServerName: in.GameServerName, Address: in.Address, NodeName: in.NodeName, - Ports: convertAllocationPortsV1Alpha1ToAgonesPortsV1(in.Ports), + Ports: convertAllocationPortsToGSAAgonesPorts(in.Ports), }, } return out } -// convertAgonesPortsV1ToAllocationPortsV1Alpha1 converts GameServerStatusPort V1 (GSA) to AllocationResponse_GameServerStatusPort -func convertAgonesPortsV1ToAllocationPortsV1Alpha1(in []agonesv1.GameServerStatusPort) []*pb.AllocationResponse_GameServerStatusPort { +// convertGSAAgonesPortsToAllocationPorts converts GameServerStatusPort V1 (GSA) to AllocationResponse_GameServerStatusPort +func convertGSAAgonesPortsToAllocationPorts(in []agonesv1.GameServerStatusPort) []*pb.AllocationResponse_GameServerStatusPort { var pbPorts []*pb.AllocationResponse_GameServerStatusPort for _, port := range in { pbPort := &pb.AllocationResponse_GameServerStatusPort{ @@ -196,8 +196,8 @@ func convertAgonesPortsV1ToAllocationPortsV1Alpha1(in []agonesv1.GameServerStatu return pbPorts } -// convertAllocationPortsV1Alpha1ToAgonesPortsV1 converts AllocationResponse_GameServerStatusPort to GameServerStatusPort V1 (GSA) -func convertAllocationPortsV1Alpha1ToAgonesPortsV1(in []*pb.AllocationResponse_GameServerStatusPort) []agonesv1.GameServerStatusPort { +// convertAllocationPortsToGSAAgonesPorts converts AllocationResponse_GameServerStatusPort to GameServerStatusPort V1 (GSA) +func convertAllocationPortsToGSAAgonesPorts(in []*pb.AllocationResponse_GameServerStatusPort) []agonesv1.GameServerStatusPort { var out []agonesv1.GameServerStatusPort for _, port := range in { p := &agonesv1.GameServerStatusPort{ @@ -209,7 +209,7 @@ func convertAllocationPortsV1Alpha1ToAgonesPortsV1(in []*pb.AllocationResponse_G return out } -// convertStateV1ToAllocationStateV1Alpha1 converts GameServerAllocationState V1 (GSA) to AllocationResponse_GameServerAllocationState +// convertStateV1ToError converts GameServerAllocationState V1 (GSA) to AllocationResponse_GameServerAllocationState func convertStateV1ToError(in allocationv1.GameServerAllocationState) error { switch in { case allocationv1.GameServerAllocationAllocated: diff --git a/pkg/allocation/converters/converter_test.go b/pkg/allocation/converters/converter_test.go index 7eb602cdea..56e26c6776 100644 --- a/pkg/allocation/converters/converter_test.go +++ b/pkg/allocation/converters/converter_test.go @@ -17,7 +17,7 @@ package converters import ( "testing" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" "agones.dev/agones/pkg/apis" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" @@ -153,13 +153,13 @@ func TestConvertAllocationRequestToGameServerAllocation(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - out := ConvertAllocationRequestV1Alpha1ToGSAV1(tc.in) + out := ConvertAllocationRequestToGSA(tc.in) if !assert.Equal(t, tc.want, out) { t.Errorf("mismatch with want after conversion: \"%s\"", tc.name) } if !tc.skipConvertFromGSA { - gsa := ConvertGSAV1ToAllocationRequestV1Alpha1(tc.want) + gsa := ConvertGSAToAllocationRequest(tc.want) if !assert.Equal(t, tc.in, gsa) { t.Errorf("mismatch with input after double conversion \"%s\"", tc.name) } @@ -168,7 +168,7 @@ func TestConvertAllocationRequestToGameServerAllocation(t *testing.T) { } } -func TestConvertGSAV1ToAllocationRequestV1Alpha1Empty(t *testing.T) { +func TestConvertGSAToAllocationRequestEmpty(t *testing.T) { tests := []struct { name string in *allocationv1.GameServerAllocation @@ -212,7 +212,7 @@ func TestConvertGSAV1ToAllocationRequestV1Alpha1Empty(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() - gsa := ConvertGSAV1ToAllocationRequestV1Alpha1(tc.in) + gsa := ConvertGSAToAllocationRequest(tc.in) if !assert.Equal(t, tc.want, gsa) { t.Errorf("mismatch with want after conversion \"%s\"", tc.name) } @@ -220,7 +220,7 @@ func TestConvertGSAV1ToAllocationRequestV1Alpha1Empty(t *testing.T) { } } -func TestConvertGSAV1ToAllocationResponseV1Alpha1(t *testing.T) { +func TestConvertGSAToAllocationResponse(t *testing.T) { tests := []struct { name string in *allocationv1.GameServerAllocation @@ -321,7 +321,7 @@ func TestConvertGSAV1ToAllocationResponseV1Alpha1(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - out, err := ConvertGSAV1ToAllocationResponseV1Alpha1(tc.in) + out, err := ConvertGSAToAllocationResponse(tc.in) if tc.wantErrCode != 0 { st, ok := status.FromError(err) if !assert.True(t, ok) { @@ -334,7 +334,7 @@ func TestConvertGSAV1ToAllocationResponseV1Alpha1(t *testing.T) { } if !tc.skipConvertToGSA { - gsa := ConvertAllocationResponseV1Alpha1ToGSAV1(tc.want) + gsa := ConvertAllocationResponseToGSA(tc.want) if !assert.Equal(t, tc.in, gsa) { t.Errorf("mismatch with input after double conversion \"%s\"", tc.name) } @@ -343,7 +343,7 @@ func TestConvertGSAV1ToAllocationResponseV1Alpha1(t *testing.T) { } } -func TestConvertAllocationResponseV1Alpha1ToGSAV1(t *testing.T) { +func TestConvertAllocationResponseToGSA(t *testing.T) { tests := []struct { name string in *pb.AllocationResponse @@ -366,7 +366,7 @@ func TestConvertAllocationResponseV1Alpha1ToGSAV1(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - out := ConvertAllocationResponseV1Alpha1ToGSAV1(tc.in) + out := ConvertAllocationResponseToGSA(tc.in) if !assert.Equal(t, tc.want, out) { t.Errorf("mismatch with want after conversion: \"%s\"", tc.name) } diff --git a/pkg/allocation/go/v1alpha1/allocation.gw.pb.go b/pkg/allocation/go/allocation.gw.pb.go similarity index 96% rename from pkg/allocation/go/v1alpha1/allocation.gw.pb.go rename to pkg/allocation/go/allocation.gw.pb.go index b09c05026d..bfea895f43 100644 --- a/pkg/allocation/go/v1alpha1/allocation.gw.pb.go +++ b/pkg/allocation/go/allocation.gw.pb.go @@ -14,14 +14,14 @@ // This code was autogenerated. Do not edit directly. // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: proto/allocation/v1alpha1/allocation.proto +// source: proto/allocation/allocation.proto /* -Package v1alpha1 is a reverse proxy. +Package allocation is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ -package v1alpha1 +package allocation import ( "context" @@ -170,7 +170,7 @@ func RegisterAllocationServiceHandlerClient(ctx context.Context, mux *runtime.Se } var ( - pattern_AllocationService_Allocate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1alpha1", "gameserverallocation"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AllocationService_Allocate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"gameserverallocation"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( diff --git a/pkg/allocation/go/v1alpha1/allocation.pb.go b/pkg/allocation/go/allocation.pb.go similarity index 74% rename from pkg/allocation/go/v1alpha1/allocation.pb.go rename to pkg/allocation/go/allocation.pb.go index 5261577066..8366fb9c9f 100644 --- a/pkg/allocation/go/v1alpha1/allocation.pb.go +++ b/pkg/allocation/go/allocation.pb.go @@ -14,9 +14,9 @@ // This code was autogenerated. Do not edit directly. // Code generated by protoc-gen-go. DO NOT EDIT. -// source: proto/allocation/v1alpha1/allocation.proto +// source: proto/allocation/allocation.proto -package v1alpha1 +package allocation import ( fmt "fmt" @@ -63,7 +63,7 @@ func (x AllocationRequest_SchedulingStrategy) String() string { return proto.EnumName(AllocationRequest_SchedulingStrategy_name, int32(x)) } func (AllocationRequest_SchedulingStrategy) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{0, 0} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{0, 0} } type AllocationRequest struct { @@ -77,7 +77,7 @@ type AllocationRequest struct { // If the first selector is not matched, the selection attempts the second selector, and so on. PreferredGameServerSelectors []*LabelSelector `protobuf:"bytes,4,rep,name=preferredGameServerSelectors,proto3" json:"preferredGameServerSelectors,omitempty"` // Scheduling strategy. Defaults to "Packed". - Scheduling AllocationRequest_SchedulingStrategy `protobuf:"varint,5,opt,name=scheduling,proto3,enum=v1alpha1.AllocationRequest_SchedulingStrategy" json:"scheduling,omitempty"` + Scheduling AllocationRequest_SchedulingStrategy `protobuf:"varint,5,opt,name=scheduling,proto3,enum=allocation.AllocationRequest_SchedulingStrategy" json:"scheduling,omitempty"` // MetaPatch is optional custom metadata that is added to the game server at // allocation You can use this to tell the server necessary session data MetaPatch *MetaPatch `protobuf:"bytes,6,opt,name=metaPatch,proto3" json:"metaPatch,omitempty"` @@ -90,7 +90,7 @@ func (m *AllocationRequest) Reset() { *m = AllocationRequest{} } func (m *AllocationRequest) String() string { return proto.CompactTextString(m) } func (*AllocationRequest) ProtoMessage() {} func (*AllocationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{0} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{0} } func (m *AllocationRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AllocationRequest.Unmarshal(m, b) @@ -166,7 +166,7 @@ func (m *AllocationResponse) Reset() { *m = AllocationResponse{} } func (m *AllocationResponse) String() string { return proto.CompactTextString(m) } func (*AllocationResponse) ProtoMessage() {} func (*AllocationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{1} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{1} } func (m *AllocationResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AllocationResponse.Unmarshal(m, b) @@ -229,7 +229,7 @@ func (m *AllocationResponse_GameServerStatusPort) Reset() { func (m *AllocationResponse_GameServerStatusPort) String() string { return proto.CompactTextString(m) } func (*AllocationResponse_GameServerStatusPort) ProtoMessage() {} func (*AllocationResponse_GameServerStatusPort) Descriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{1, 0} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{1, 0} } func (m *AllocationResponse_GameServerStatusPort) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AllocationResponse_GameServerStatusPort.Unmarshal(m, b) @@ -278,7 +278,7 @@ func (m *MultiClusterSetting) Reset() { *m = MultiClusterSetting{} } func (m *MultiClusterSetting) String() string { return proto.CompactTextString(m) } func (*MultiClusterSetting) ProtoMessage() {} func (*MultiClusterSetting) Descriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{2} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{2} } func (m *MultiClusterSetting) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MultiClusterSetting.Unmarshal(m, b) @@ -325,7 +325,7 @@ func (m *MetaPatch) Reset() { *m = MetaPatch{} } func (m *MetaPatch) String() string { return proto.CompactTextString(m) } func (*MetaPatch) ProtoMessage() {} func (*MetaPatch) Descriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{3} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{3} } func (m *MetaPatch) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MetaPatch.Unmarshal(m, b) @@ -372,7 +372,7 @@ func (m *LabelSelector) Reset() { *m = LabelSelector{} } func (m *LabelSelector) String() string { return proto.CompactTextString(m) } func (*LabelSelector) ProtoMessage() {} func (*LabelSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_allocation_a8b682e2fff83ddc, []int{4} + return fileDescriptor_allocation_d5752a3ca48e8a0b, []int{4} } func (m *LabelSelector) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LabelSelector.Unmarshal(m, b) @@ -400,16 +400,16 @@ func (m *LabelSelector) GetMatchLabels() map[string]string { } func init() { - proto.RegisterType((*AllocationRequest)(nil), "v1alpha1.AllocationRequest") - proto.RegisterType((*AllocationResponse)(nil), "v1alpha1.AllocationResponse") - proto.RegisterType((*AllocationResponse_GameServerStatusPort)(nil), "v1alpha1.AllocationResponse.GameServerStatusPort") - proto.RegisterType((*MultiClusterSetting)(nil), "v1alpha1.MultiClusterSetting") - proto.RegisterType((*MetaPatch)(nil), "v1alpha1.MetaPatch") - proto.RegisterMapType((map[string]string)(nil), "v1alpha1.MetaPatch.AnnotationsEntry") - proto.RegisterMapType((map[string]string)(nil), "v1alpha1.MetaPatch.LabelsEntry") - proto.RegisterType((*LabelSelector)(nil), "v1alpha1.LabelSelector") - proto.RegisterMapType((map[string]string)(nil), "v1alpha1.LabelSelector.MatchLabelsEntry") - proto.RegisterEnum("v1alpha1.AllocationRequest_SchedulingStrategy", AllocationRequest_SchedulingStrategy_name, AllocationRequest_SchedulingStrategy_value) + proto.RegisterType((*AllocationRequest)(nil), "allocation.AllocationRequest") + proto.RegisterType((*AllocationResponse)(nil), "allocation.AllocationResponse") + proto.RegisterType((*AllocationResponse_GameServerStatusPort)(nil), "allocation.AllocationResponse.GameServerStatusPort") + proto.RegisterType((*MultiClusterSetting)(nil), "allocation.MultiClusterSetting") + proto.RegisterType((*MetaPatch)(nil), "allocation.MetaPatch") + proto.RegisterMapType((map[string]string)(nil), "allocation.MetaPatch.AnnotationsEntry") + proto.RegisterMapType((map[string]string)(nil), "allocation.MetaPatch.LabelsEntry") + proto.RegisterType((*LabelSelector)(nil), "allocation.LabelSelector") + proto.RegisterMapType((map[string]string)(nil), "allocation.LabelSelector.MatchLabelsEntry") + proto.RegisterEnum("allocation.AllocationRequest_SchedulingStrategy", AllocationRequest_SchedulingStrategy_name, AllocationRequest_SchedulingStrategy_value) } // Reference imports to suppress errors if they are not otherwise used. @@ -437,7 +437,7 @@ func NewAllocationServiceClient(cc *grpc.ClientConn) AllocationServiceClient { func (c *allocationServiceClient) Allocate(ctx context.Context, in *AllocationRequest, opts ...grpc.CallOption) (*AllocationResponse, error) { out := new(AllocationResponse) - err := c.cc.Invoke(ctx, "/v1alpha1.AllocationService/Allocate", in, out, opts...) + err := c.cc.Invoke(ctx, "/allocation.AllocationService/Allocate", in, out, opts...) if err != nil { return nil, err } @@ -463,7 +463,7 @@ func _AllocationService_Allocate_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/v1alpha1.AllocationService/Allocate", + FullMethod: "/allocation.AllocationService/Allocate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AllocationServiceServer).Allocate(ctx, req.(*AllocationRequest)) @@ -472,7 +472,7 @@ func _AllocationService_Allocate_Handler(srv interface{}, ctx context.Context, d } var _AllocationService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1alpha1.AllocationService", + ServiceName: "allocation.AllocationService", HandlerType: (*AllocationServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -481,53 +481,52 @@ var _AllocationService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "proto/allocation/v1alpha1/allocation.proto", + Metadata: "proto/allocation/allocation.proto", } func init() { - proto.RegisterFile("proto/allocation/v1alpha1/allocation.proto", fileDescriptor_allocation_a8b682e2fff83ddc) -} - -var fileDescriptor_allocation_a8b682e2fff83ddc = []byte{ - // 631 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0x49, 0x13, 0x92, 0x89, 0x28, 0x61, 0x5b, 0x09, 0xcb, 0x04, 0x88, 0x0c, 0x42, 0xa1, - 0x07, 0x47, 0x29, 0x07, 0xa0, 0x87, 0xa2, 0x8a, 0x9f, 0x4a, 0xa8, 0x2d, 0x95, 0x73, 0xe0, 0xc0, - 0x69, 0x63, 0x0f, 0xa9, 0xd5, 0x8d, 0xd7, 0xdd, 0x5d, 0x57, 0xca, 0x15, 0x09, 0xf1, 0x00, 0x1c, - 0x79, 0x2c, 0x5e, 0x81, 0x33, 0x2f, 0xc0, 0x05, 0xed, 0x26, 0x8e, 0x4d, 0x6a, 0x2c, 0xf5, 0xb6, - 0xbb, 0xf3, 0x7d, 0xdf, 0xce, 0x7c, 0x33, 0xbb, 0xb0, 0x93, 0x08, 0xae, 0xf8, 0x90, 0x32, 0xc6, - 0x03, 0xaa, 0x22, 0x1e, 0x0f, 0x2f, 0x47, 0x94, 0x25, 0x67, 0x74, 0x54, 0x38, 0xf3, 0x0c, 0x88, - 0xb4, 0xb2, 0x90, 0xd3, 0x9b, 0x72, 0x3e, 0x65, 0x38, 0xa4, 0x49, 0x34, 0xa4, 0x71, 0xcc, 0x95, - 0x81, 0xc9, 0x05, 0xce, 0xfd, 0x5d, 0x87, 0x3b, 0x07, 0x2b, 0xb2, 0x8f, 0x17, 0x29, 0x4a, 0x45, - 0x7a, 0xd0, 0x8e, 0xe9, 0x0c, 0x65, 0x42, 0x03, 0xb4, 0xad, 0xbe, 0x35, 0x68, 0xfb, 0xf9, 0x01, - 0xf9, 0x00, 0x5b, 0xb3, 0x94, 0xa9, 0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xe1, 0xbb, 0x3f, 0x2c, 0xb8, 0xf5, 0x8f, 0x57, 0xe4, 0x3d, 0x74, 0x66, 0x3a, - 0xe7, 0xa3, 0xa2, 0x25, 0x83, 0xff, 0x38, 0xeb, 0x1d, 0xe7, 0xd0, 0x65, 0x61, 0x05, 0xb2, 0xce, - 0x6e, 0x1d, 0x70, 0x9d, 0xec, 0x76, 0xbf, 0x5a, 0xc5, 0x8f, 0x50, 0x0f, 0x58, 0x14, 0x20, 0x49, - 0xa0, 0xb5, 0x3c, 0x44, 0x72, 0xaf, 0xe2, 0x6d, 0x3b, 0xbd, 0xaa, 0x87, 0xe0, 0x3e, 0xfd, 0xf2, - 0xf3, 0xd7, 0xf7, 0xda, 0x23, 0xf7, 0x41, 0xfe, 0x63, 0xeb, 0x77, 0x25, 0xcd, 0x18, 0xe7, 0x7f, - 0xf7, 0x9e, 0xb5, 0x33, 0x69, 0x9a, 0x7f, 0xf9, 0xd9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x19, - 0x62, 0xb9, 0x64, 0xed, 0x05, 0x00, 0x00, + proto.RegisterFile("proto/allocation/allocation.proto", fileDescriptor_allocation_d5752a3ca48e8a0b) +} + +var fileDescriptor_allocation_d5752a3ca48e8a0b = []byte{ + // 619 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4d, 0x6f, 0x13, 0x31, + 0x10, 0x65, 0x93, 0x26, 0x34, 0x13, 0x51, 0xc2, 0xb4, 0x95, 0x96, 0x55, 0x81, 0x74, 0x0f, 0x55, + 0xd5, 0x43, 0x02, 0xed, 0x85, 0xf6, 0x50, 0xa9, 0x02, 0x04, 0x48, 0x2d, 0x0a, 0x9b, 0x13, 0x07, + 0x0e, 0xce, 0xee, 0x90, 0xae, 0xea, 0xac, 0xb7, 0xb6, 0xb7, 0x52, 0x6e, 0x88, 0x2b, 0x47, 0xce, + 0xfc, 0x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, 0xff, 0xc8, 0x15, 0x3d, 0x53, 0xf5, 0x05, 0x00, 0x00, } diff --git a/pkg/allocation/go/v1alpha1/allocation.swagger.json b/pkg/allocation/go/allocation.swagger.json similarity index 85% rename from pkg/allocation/go/v1alpha1/allocation.swagger.json rename to pkg/allocation/go/allocation.swagger.json index 1c1b585eb3..4bea5ff276 100644 --- a/pkg/allocation/go/v1alpha1/allocation.swagger.json +++ b/pkg/allocation/go/allocation.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "proto/allocation/v1alpha1/allocation.proto", + "title": "proto/allocation/allocation.proto", "version": "version not set" }, "schemes": [ @@ -14,14 +14,14 @@ "application/json" ], "paths": { - "/v1alpha1/gameserverallocation": { + "/gameserverallocation": { "post": { "operationId": "Allocate", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1alpha1AllocationResponse" + "$ref": "#/definitions/allocationAllocationResponse" } } }, @@ -31,7 +31,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v1alpha1AllocationRequest" + "$ref": "#/definitions/allocationAllocationRequest" } } ], @@ -63,7 +63,7 @@ }, "description": "The gameserver port info that is allocated." }, - "v1alpha1AllocationRequest": { + "allocationAllocationRequest": { "type": "object", "properties": { "namespace": { @@ -71,17 +71,17 @@ "title": "The k8s namespace that is hosting the targeted fleet of gameservers to be allocated" }, "multiClusterSetting": { - "$ref": "#/definitions/v1alpha1MultiClusterSetting", + "$ref": "#/definitions/allocationMultiClusterSetting", "description": "If specified, multi-cluster policies are applied. Otherwise, allocation will happen locally." }, "requiredGameServerSelector": { - "$ref": "#/definitions/v1alpha1LabelSelector", + "$ref": "#/definitions/allocationLabelSelector", "description": "The required allocation. Defaults to all GameServers." }, "preferredGameServerSelectors": { "type": "array", "items": { - "$ref": "#/definitions/v1alpha1LabelSelector" + "$ref": "#/definitions/allocationLabelSelector" }, "description": "The ordered list of preferred allocations out of the `required` set.\nIf the first selector is not matched, the selection attempts the second selector, and so on." }, @@ -90,12 +90,12 @@ "description": "Scheduling strategy. Defaults to \"Packed\"." }, "metaPatch": { - "$ref": "#/definitions/v1alpha1MetaPatch", + "$ref": "#/definitions/allocationMetaPatch", "title": "MetaPatch is optional custom metadata that is added to the game server at\nallocation You can use this to tell the server necessary session data" } } }, - "v1alpha1AllocationResponse": { + "allocationAllocationResponse": { "type": "object", "properties": { "gameServerName": { @@ -115,7 +115,7 @@ } } }, - "v1alpha1LabelSelector": { + "allocationLabelSelector": { "type": "object", "properties": { "matchLabels": { @@ -128,7 +128,7 @@ }, "description": "LabelSelector used for finding a GameServer with matching labels." }, - "v1alpha1MetaPatch": { + "allocationMetaPatch": { "type": "object", "properties": { "labels": { @@ -146,7 +146,7 @@ }, "title": "MetaPatch is the metadata used to patch the GameServer metadata on allocation" }, - "v1alpha1MultiClusterSetting": { + "allocationMultiClusterSetting": { "type": "object", "properties": { "enabled": { @@ -155,7 +155,7 @@ "description": "If set to true, multi-cluster allocation is enabled." }, "policySelector": { - "$ref": "#/definitions/v1alpha1LabelSelector", + "$ref": "#/definitions/allocationLabelSelector", "description": "Selects multi-cluster allocation policies to apply. If not specified, all multi-cluster allocation policies are to be applied." } }, diff --git a/pkg/gameserverallocations/allocator.go b/pkg/gameserverallocations/allocator.go index 47d224a6f3..3d3bc84d95 100644 --- a/pkg/gameserverallocations/allocator.go +++ b/pkg/gameserverallocations/allocator.go @@ -26,7 +26,7 @@ import ( "time" "agones.dev/agones/pkg/allocation/converters" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" @@ -332,7 +332,7 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca // Forward the game server allocation request to another cluster, // and disable multicluster settings to avoid the target cluster // forward the allocation request again. - request := converters.ConvertGSAV1ToAllocationRequestV1Alpha1(gsa) + request := converters.ConvertGSAToAllocationRequest(gsa) request.MultiClusterSetting.Enabled = false request.Namespace = connectionInfo.Namespace @@ -359,7 +359,7 @@ func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAlloca return nil }) - return converters.ConvertAllocationResponseV1Alpha1ToGSAV1(allocationResponse), err + return converters.ConvertAllocationResponseToGSA(allocationResponse), err } // createRemoteClusterDialOption creates a grpc client dial option with proper certs to make a remote call. diff --git a/pkg/gameserverallocations/controller_test.go b/pkg/gameserverallocations/controller_test.go index 0896892ee5..d801ad5569 100644 --- a/pkg/gameserverallocations/controller_test.go +++ b/pkg/gameserverallocations/controller_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" "agones.dev/agones/pkg/apis" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" diff --git a/proto/allocation/v1alpha1/allocation.proto b/proto/allocation/allocation.proto similarity index 95% rename from proto/allocation/v1alpha1/allocation.proto rename to proto/allocation/allocation.proto index 7fe7783fba..4378ca84c2 100644 --- a/proto/allocation/v1alpha1/allocation.proto +++ b/proto/allocation/allocation.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC All Rights Reserved. +// Copyright 2020 Google LLC All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ syntax = "proto3"; -package v1alpha1; +package allocation; import "google/api/annotations.proto"; service AllocationService { rpc Allocate(AllocationRequest) returns (AllocationResponse) { option (google.api.http) = { - post: "/v1alpha1/gameserverallocation" + post: "/gameserverallocation" body: "*" }; } diff --git a/site/content/en/docs/Advanced/allocator-service.md b/site/content/en/docs/Advanced/allocator-service.md index e7ce337d19..4481ccd341 100644 --- a/site/content/en/docs/Advanced/allocator-service.md +++ b/site/content/en/docs/Advanced/allocator-service.md @@ -1,16 +1,21 @@ --- title: "Allocator Service" -date: 2019-10-25T05:45:05Z -version: "v1alpha1" +date: 2020-05-19T05:45:05Z description: > Agones provides an mTLS based allocator service that is accessible from outside the cluster using a load balancer. The service is deployed and scales independent to Agones controller. --- +{{% feature expiryVersion="1.6.0" %}} {{< alert title="Alpha" color="warning">}} This feature is in a pre-release state and might change. {{< /alert >}} To allocate a game server, Agones in addition to {{< ghlink href="pkg/apis/allocation/v1/gameserverallocation.go" >}}GameServerAllocations{{< /ghlink >}}, provides a gRPC service with mTLS authentication, called agones-allocator, which is on {{< ghlink href="proto/allocation/v1alpha1" >}}v1alpha1 version{{< /ghlink >}}, starting on agones v1.1. +{{% /feature %}} + +{{% feature publishVersion="1.6.0" %}} +To allocate a game server, Agones in addition to {{< ghlink href="pkg/apis/allocation/v1/gameserverallocation.go" >}}GameServerAllocations{{< /ghlink >}}, provides a gRPC service with mTLS authentication, called agones-allocator, which is on {{< ghlink href="proto/allocation" >}}stable version{{< /ghlink >}}, starting on agones v1.6. +{{% /feature %}} The gRPC service is accessible through a Kubernetes service that is externalized using a load balancer. For the gRPC request to succeed, a client certificate must be provided that is in the authorization list of the allocator service. @@ -33,16 +38,16 @@ agones-allocator LoadBalancer 10.55.251.73 34.82.195.204 ## Server TLS certificate -Replace the default server TLS certificate with a certificate with CN and subjectAltName. There are multiple approaches to generate a certificate. Agones recommends using [cert-manager.io](https://cert-manager.io/) solution for cluster level certificate management. +Replace the default server TLS certificate with a certificate with CN and subjectAltName. There are multiple approaches to generate a certificate. Agones recommends using [cert-manager.io](https://cert-manager.io/) solution for cluster level certificate management. -In order to use cert-manager solution, first, [install cert-manager](https://cert-manager.io/docs/installation/kubernetes/) on the cluster. Then, [configure](https://cert-manager.io/docs/configuration/) an `Issuer`/`ClusterIssuer` resource and last configure a `Certificate` resource to manage allocator-tls `Secret`. +In order to use cert-manager solution, first, [install cert-manager](https://cert-manager.io/docs/installation/kubernetes/) on the cluster. Then, [configure](https://cert-manager.io/docs/configuration/) an `Issuer`/`ClusterIssuer` resource and last configure a `Certificate` resource to manage allocator-tls `Secret`. Here is an example of using a self-signed `ClusterIssuer` for configuring allocator-tls `Secret`: ```bash #!/bin/bash # Create a self-signed ClusterIssuer -cat < In order to allow allocation from multiple clusters, Agones provides a mechanism to set redirect rules for allocation requests to the right cluster. --- +{{% feature expiryVersion="1.6.0" %}} {{< alert title="Alpha" color="warning">}} This feature is in a pre-release state and might change. {{< /alert >}} +{{% /feature %}} There may be different types of clusters, such as on-premise, and Google Kubernetes Engine (GKE), used by a game to help with the cost-saving and availability. For this purpose, Agones provides a mechanism to define priorities on the clusters. Priorities are defined on {{< ghlink href="pkg/apis/multicluster/v1/gameserverallocationpolicy.go" >}}GameServerAllocationPolicy{{< /ghlink >}} agones CRD. A matchmaker can enable the multi-cluster rules on a request and target [agones-allocator]({{< relref "allocator-service.md">}}) endpoint in any of the clusters and get resources allocated on the cluster with the highest priority. If the cluster with the highest priority is overloaded, the allocation request is redirected to the cluster with the next highest priority. @@ -94,7 +95,13 @@ EOF ## Allocate multi-cluster +{{% feature expiryVersion="1.6.0" %}} To enable multi-cluster allocation, set `multiClusterSetting.enabled` to `true` in {{< ghlink href="proto/allocation/v1alpha1/allocation.proto" >}}allocation.proto{{< /ghlink >}} and send allocation requests. For more information visit [agones-allocator]({{< relref "allocator-service.md">}}). In the following, using {{< ghlink href="examples/allocator-client/main.go" >}}allocator-client sample{{< /ghlink >}}, a multi-cluster allocation request is sent to the agones-allocator service. +{{% /feature %}} + +{{% feature publishVersion="1.6.0" %}} +To enable multi-cluster allocation, set `multiClusterSetting.enabled` to `true` in {{< ghlink href="proto/allocation/allocation.proto" >}}allocation.proto{{< /ghlink >}} and send allocation requests. For more information visit [agones-allocator]({{< relref "allocator-service.md">}}). In the following, using {{< ghlink href="examples/allocator-client/main.go" >}}allocator-client sample{{< /ghlink >}}, a multi-cluster allocation request is sent to the agones-allocator service. +{{% /feature %}} ```bash #!/bin/bash diff --git a/test/e2e/allocator_test.go b/test/e2e/allocator_test.go index 672f9de0bc..5d19c561a4 100644 --- a/test/e2e/allocator_test.go +++ b/test/e2e/allocator_test.go @@ -29,7 +29,7 @@ import ( "testing" "time" - pb "agones.dev/agones/pkg/allocation/go/v1alpha1" + pb "agones.dev/agones/pkg/allocation/go" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" e2e "agones.dev/agones/test/e2e/framework"