|
| 1 | +// Copyright 2019 Google LLC All Rights Reserved. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package v1alpha1 |
| 16 | + |
| 17 | +import ( |
| 18 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 19 | +) |
| 20 | + |
| 21 | +// GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy |
| 22 | +type GameServerAllocationPolicySpec struct { |
| 23 | + // +kubebuilder:validation:Minimum=0 |
| 24 | + Priority int `json:"priority"` |
| 25 | + // +kubebuilder:validation:Minimum=0 |
| 26 | + Weight int `json:"weight"` |
| 27 | + ConnectionInfo ClusterConnectionInfo `json:"connectionInfo,omitempty"` |
| 28 | +} |
| 29 | + |
| 30 | +// ClusterConnectionInfo defines the connection information for a cluster |
| 31 | +type ClusterConnectionInfo struct { |
| 32 | + ClusterName string `json:"clusterName"` |
| 33 | + APIServerEndpoint string `json:"apiServerEndpoint"` |
| 34 | + SecretName string `json:"secretName"` |
| 35 | +} |
| 36 | + |
| 37 | +// +genclient |
| 38 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 39 | + |
| 40 | +// GameServerAllocationPolicy is the Schema for the gameserverallocationpolicies API |
| 41 | +// +k8s:openapi-gen=true |
| 42 | +type GameServerAllocationPolicy struct { |
| 43 | + metav1.TypeMeta `json:",inline"` |
| 44 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 45 | + |
| 46 | + Spec GameServerAllocationPolicySpec `json:"spec,omitempty"` |
| 47 | +} |
| 48 | + |
| 49 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 50 | + |
| 51 | +// GameServerAllocationPolicyList contains a list of GameServerAllocationPolicy |
| 52 | +type GameServerAllocationPolicyList struct { |
| 53 | + metav1.TypeMeta `json:",inline"` |
| 54 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 55 | + Items []GameServerAllocationPolicy `json:"items"` |
| 56 | +} |
0 commit comments