diff --git a/build/build-image/gen-crd-client.sh b/build/build-image/gen-crd-client.sh index 1d165cab6b..3682fc4ad2 100644 --- a/build/build-image/gen-crd-client.sh +++ b/build/build-image/gen-crd-client.sh @@ -23,6 +23,6 @@ rsync -r /go/src/agones.dev/agones/vendor/k8s.io/ /go/src/k8s.io/ cd /go/src/k8s.io/code-generator ./generate-groups.sh "all" \ agones.dev/agones/pkg/client \ - agones.dev/agones/pkg/apis "allocation:v1 agones:v1 multicluster:v1alpha1 autoscaling:v1" \ + agones.dev/agones/pkg/apis "allocation:v1 agones:v1 multicluster:v1 autoscaling:v1" \ --go-header-file=/go/src/agones.dev/agones/build/boilerplate.go.txt diff --git a/cmd/allocator/main.go b/cmd/allocator/main.go index 3e2794b949..5a7f9162d8 100644 --- a/cmd/allocator/main.go +++ b/cmd/allocator/main.go @@ -163,7 +163,7 @@ func newServiceHandler(kubeClient kubernetes.Interface, agonesClient versioned.I gsCounter := gameservers.NewPerNodeCounter(kubeInformerFactory, agonesInformerFactory) allocator := gameserverallocations.NewAllocator( - agonesInformerFactory.Multicluster().V1alpha1().GameServerAllocationPolicies(), + agonesInformerFactory.Multicluster().V1().GameServerAllocationPolicies(), kubeInformerFactory.Core().V1().Secrets(), kubeClient, gameserverallocations.NewReadyGameServerCache(agonesInformerFactory.Agones().V1().GameServers(), agonesClient.AgonesV1(), gsCounter, health)) diff --git a/install/helm/agones/templates/crds/gameserverallocationpolicy.yaml b/install/helm/agones/templates/crds/gameserverallocationpolicy.yaml index 6f58ff6df9..ffeda5ab7c 100644 --- a/install/helm/agones/templates/crds/gameserverallocationpolicy.yaml +++ b/install/helm/agones/templates/crds/gameserverallocationpolicy.yaml @@ -28,7 +28,14 @@ metadata: name: gameserverallocationpolicies.multicluster.agones.dev spec: group: multicluster.agones.dev - version: v1alpha1 + versions: + - name: v1 + served: true + storage: true + - name: v1alpha1 + # Disable the v1alpha1 version, but include it for inplace upgrade. + served: false + storage: false names: kind: GameServerAllocationPolicy plural: gameserverallocationpolicies @@ -67,7 +74,7 @@ spec: - namespace type: object priority: - format: int64 + format: int32 minimum: 0 type: integer weight: diff --git a/install/yaml/install.yaml b/install/yaml/install.yaml index 4d14eb8e23..e1c95b4f41 100644 --- a/install/yaml/install.yaml +++ b/install/yaml/install.yaml @@ -709,7 +709,14 @@ metadata: name: gameserverallocationpolicies.multicluster.agones.dev spec: group: multicluster.agones.dev - version: v1alpha1 + versions: + - name: v1 + served: true + storage: true + - name: v1alpha1 + # Disable the v1alpha1 version, but include it for inplace upgrade. + served: false + storage: false names: kind: GameServerAllocationPolicy plural: gameserverallocationpolicies @@ -748,7 +755,7 @@ spec: - namespace type: object priority: - format: int64 + format: int32 minimum: 0 type: integer weight: diff --git a/pkg/apis/agones/v1/fuzz_test/roundtrip_test.go b/pkg/apis/agones/v1/fuzz_test/roundtrip_test.go index 8fcb38ee5f..084ede6456 100644 --- a/pkg/apis/agones/v1/fuzz_test/roundtrip_test.go +++ b/pkg/apis/agones/v1/fuzz_test/roundtrip_test.go @@ -7,7 +7,7 @@ import ( agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" - multiclusterv1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" "github.com/stretchr/testify/assert" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" @@ -24,7 +24,7 @@ func TestRoundTripTypes(t *testing.T) { agonesv1.AddToScheme, allocationv1.AddToScheme, autoscalingv1.AddToScheme, - multiclusterv1alpha1.AddToScheme, + multiclusterv1.AddToScheme, } seed := rand.Int63() localFuzzer := fuzzer.FuzzerFor(genericfuzzer.Funcs, rand.NewSource(seed), codecs) diff --git a/pkg/apis/multicluster/v1alpha1/doc.go b/pkg/apis/multicluster/v1/doc.go similarity index 90% rename from pkg/apis/multicluster/v1alpha1/doc.go rename to pkg/apis/multicluster/v1/doc.go index 077e221ad8..def080edd8 100644 --- a/pkg/apis/multicluster/v1alpha1/doc.go +++ b/pkg/apis/multicluster/v1/doc.go @@ -14,6 +14,6 @@ // +k8s:deepcopy-gen=package,register -// Package v1alpha1 is the v1alpha1 version of the API. +// Package v1 is the v1 version of the API. // +groupName=multicluster.agones.dev -package v1alpha1 +package v1 diff --git a/pkg/apis/multicluster/v1alpha1/gameserverallocationpolicy.go b/pkg/apis/multicluster/v1/gameserverallocationpolicy.go similarity index 95% rename from pkg/apis/multicluster/v1alpha1/gameserverallocationpolicy.go rename to pkg/apis/multicluster/v1/gameserverallocationpolicy.go index 99fc6373cc..ca1d16aebc 100644 --- a/pkg/apis/multicluster/v1alpha1/gameserverallocationpolicy.go +++ b/pkg/apis/multicluster/v1/gameserverallocationpolicy.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package v1 import ( "math/rand" @@ -24,7 +24,7 @@ import ( // GameServerAllocationPolicySpec defines the desired state of GameServerAllocationPolicy type GameServerAllocationPolicySpec struct { // +kubebuilder:validation:Minimum=0 - Priority int `json:"priority"` + Priority int32 `json:"priority"` // +kubebuilder:validation:Minimum=0 Weight int `json:"weight"` ConnectionInfo ClusterConnectionInfo `json:"connectionInfo,omitempty"` @@ -70,9 +70,9 @@ type ConnectionInfoIterator struct { // currPriority Current priority index from the orderedPriorities currPriority int // orderedPriorities list of ordered priorities - orderedPriorities []int + orderedPriorities []int32 // priorityToCluster Map of priority to cluster-policies map - priorityToCluster map[int]map[string][]*GameServerAllocationPolicy + priorityToCluster map[int32]map[string][]*GameServerAllocationPolicy // clusterBlackList the cluster blacklist for the clusters that has already returned clusterBlackList map[string]bool } @@ -99,7 +99,7 @@ func (it *ConnectionInfoIterator) Next() *ClusterConnectionInfo { // NewConnectionInfoIterator creates an iterator for connection info func NewConnectionInfoIterator(policies []*GameServerAllocationPolicy) *ConnectionInfoIterator { - priorityToCluster := make(map[int]map[string][]*GameServerAllocationPolicy) + priorityToCluster := make(map[int32]map[string][]*GameServerAllocationPolicy) for _, policy := range policies { priority := policy.Spec.Priority clusterName := policy.Spec.ConnectionInfo.ClusterName @@ -120,7 +120,7 @@ func NewConnectionInfoIterator(policies []*GameServerAllocationPolicy) *Connecti } // 3. Sort priorities - priorities := make([]int, 0, len(priorityToCluster)) + priorities := make([]int32, 0, len(priorityToCluster)) for k := range priorityToCluster { priorities = append(priorities, k) } diff --git a/pkg/apis/multicluster/v1alpha1/gameserverallocationpolicy_test.go b/pkg/apis/multicluster/v1/gameserverallocationpolicy_test.go similarity index 99% rename from pkg/apis/multicluster/v1alpha1/gameserverallocationpolicy_test.go rename to pkg/apis/multicluster/v1/gameserverallocationpolicy_test.go index 5a5e018fff..3a43562b61 100644 --- a/pkg/apis/multicluster/v1alpha1/gameserverallocationpolicy_test.go +++ b/pkg/apis/multicluster/v1/gameserverallocationpolicy_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package v1 import ( "testing" diff --git a/pkg/apis/multicluster/v1alpha1/register.go b/pkg/apis/multicluster/v1/register.go similarity index 97% rename from pkg/apis/multicluster/v1alpha1/register.go rename to pkg/apis/multicluster/v1/register.go index ca55dde2fe..4d3852f4f6 100644 --- a/pkg/apis/multicluster/v1alpha1/register.go +++ b/pkg/apis/multicluster/v1/register.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1alpha1 +package v1 import ( "agones.dev/agones/pkg/apis/multicluster" @@ -23,7 +23,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: multicluster.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: multicluster.GroupName, Version: "v1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/multicluster/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/multicluster/v1/zz_generated.deepcopy.go similarity index 97% rename from pkg/apis/multicluster/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/multicluster/v1/zz_generated.deepcopy.go index 7deeb401b6..7d2f1bcda9 100644 --- a/pkg/apis/multicluster/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/multicluster/v1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ // Code generated by deepcopy-gen. DO NOT EDIT. -package v1alpha1 +package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" @@ -50,12 +50,12 @@ func (in *ConnectionInfoIterator) DeepCopyInto(out *ConnectionInfoIterator) { *out = *in if in.orderedPriorities != nil { in, out := &in.orderedPriorities, &out.orderedPriorities - *out = make([]int, len(*in)) + *out = make([]int32, len(*in)) copy(*out, *in) } if in.priorityToCluster != nil { in, out := &in.priorityToCluster, &out.priorityToCluster - *out = make(map[int]map[string][]*GameServerAllocationPolicy, len(*in)) + *out = make(map[int32]map[string][]*GameServerAllocationPolicy, len(*in)) for key, val := range *in { var outVal map[string][]*GameServerAllocationPolicy if val == nil { diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index e8a3127ce5..c6044097b0 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -22,7 +22,7 @@ import ( agonesv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1" allocationv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/allocation/v1" autoscalingv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/autoscaling/v1" - multiclusterv1alpha1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -39,19 +39,19 @@ type Interface interface { AutoscalingV1() autoscalingv1.AutoscalingV1Interface // Deprecated: please explicitly pick a version if possible. Autoscaling() autoscalingv1.AutoscalingV1Interface - MulticlusterV1alpha1() multiclusterv1alpha1.MulticlusterV1alpha1Interface + MulticlusterV1() multiclusterv1.MulticlusterV1Interface // Deprecated: please explicitly pick a version if possible. - Multicluster() multiclusterv1alpha1.MulticlusterV1alpha1Interface + Multicluster() multiclusterv1.MulticlusterV1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - agonesV1 *agonesv1.AgonesV1Client - allocationV1 *allocationv1.AllocationV1Client - autoscalingV1 *autoscalingv1.AutoscalingV1Client - multiclusterV1alpha1 *multiclusterv1alpha1.MulticlusterV1alpha1Client + agonesV1 *agonesv1.AgonesV1Client + allocationV1 *allocationv1.AllocationV1Client + autoscalingV1 *autoscalingv1.AutoscalingV1Client + multiclusterV1 *multiclusterv1.MulticlusterV1Client } // AgonesV1 retrieves the AgonesV1Client @@ -87,15 +87,15 @@ func (c *Clientset) Autoscaling() autoscalingv1.AutoscalingV1Interface { return c.autoscalingV1 } -// MulticlusterV1alpha1 retrieves the MulticlusterV1alpha1Client -func (c *Clientset) MulticlusterV1alpha1() multiclusterv1alpha1.MulticlusterV1alpha1Interface { - return c.multiclusterV1alpha1 +// MulticlusterV1 retrieves the MulticlusterV1Client +func (c *Clientset) MulticlusterV1() multiclusterv1.MulticlusterV1Interface { + return c.multiclusterV1 } // Deprecated: Multicluster retrieves the default version of MulticlusterClient. // Please explicitly pick a version. -func (c *Clientset) Multicluster() multiclusterv1alpha1.MulticlusterV1alpha1Interface { - return c.multiclusterV1alpha1 +func (c *Clientset) Multicluster() multiclusterv1.MulticlusterV1Interface { + return c.multiclusterV1 } // Discovery retrieves the DiscoveryClient @@ -126,7 +126,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } - cs.multiclusterV1alpha1, err = multiclusterv1alpha1.NewForConfig(&configShallowCopy) + cs.multiclusterV1, err = multiclusterv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -145,7 +145,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { cs.agonesV1 = agonesv1.NewForConfigOrDie(c) cs.allocationV1 = allocationv1.NewForConfigOrDie(c) cs.autoscalingV1 = autoscalingv1.NewForConfigOrDie(c) - cs.multiclusterV1alpha1 = multiclusterv1alpha1.NewForConfigOrDie(c) + cs.multiclusterV1 = multiclusterv1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -157,7 +157,7 @@ func New(c rest.Interface) *Clientset { cs.agonesV1 = agonesv1.New(c) cs.allocationV1 = allocationv1.New(c) cs.autoscalingV1 = autoscalingv1.New(c) - cs.multiclusterV1alpha1 = multiclusterv1alpha1.New(c) + cs.multiclusterV1 = multiclusterv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 864594a600..bb3558c3ad 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -26,8 +26,8 @@ import ( fakeallocationv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/allocation/v1/fake" autoscalingv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/autoscaling/v1" fakeautoscalingv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/autoscaling/v1/fake" - multiclusterv1alpha1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1alpha1" - fakemulticlusterv1alpha1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake" + multiclusterv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1" + fakemulticlusterv1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -107,12 +107,12 @@ func (c *Clientset) Autoscaling() autoscalingv1.AutoscalingV1Interface { return &fakeautoscalingv1.FakeAutoscalingV1{Fake: &c.Fake} } -// MulticlusterV1alpha1 retrieves the MulticlusterV1alpha1Client -func (c *Clientset) MulticlusterV1alpha1() multiclusterv1alpha1.MulticlusterV1alpha1Interface { - return &fakemulticlusterv1alpha1.FakeMulticlusterV1alpha1{Fake: &c.Fake} +// MulticlusterV1 retrieves the MulticlusterV1Client +func (c *Clientset) MulticlusterV1() multiclusterv1.MulticlusterV1Interface { + return &fakemulticlusterv1.FakeMulticlusterV1{Fake: &c.Fake} } -// Multicluster retrieves the MulticlusterV1alpha1Client -func (c *Clientset) Multicluster() multiclusterv1alpha1.MulticlusterV1alpha1Interface { - return &fakemulticlusterv1alpha1.FakeMulticlusterV1alpha1{Fake: &c.Fake} +// Multicluster retrieves the MulticlusterV1Client +func (c *Clientset) Multicluster() multiclusterv1.MulticlusterV1Interface { + return &fakemulticlusterv1.FakeMulticlusterV1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 39d6dd32eb..305c3fbc2b 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -22,7 +22,7 @@ import ( agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" - multiclusterv1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -37,7 +37,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ agonesv1.AddToScheme, allocationv1.AddToScheme, autoscalingv1.AddToScheme, - multiclusterv1alpha1.AddToScheme, + multiclusterv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index dc514c267b..d7a7c4ba4b 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -22,7 +22,7 @@ import ( agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" - multiclusterv1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -37,7 +37,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ agonesv1.AddToScheme, allocationv1.AddToScheme, autoscalingv1.AddToScheme, - multiclusterv1alpha1.AddToScheme, + multiclusterv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/multicluster/v1/doc.go similarity index 97% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/doc.go index 46c44a0793..55d9c43d2c 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/doc.go @@ -17,4 +17,4 @@ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha1 +package v1 diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gameserverallocationpolicy.go b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go similarity index 69% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gameserverallocationpolicy.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go index 2db254d68f..aeee19341e 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_gameserverallocationpolicy.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_gameserverallocationpolicy.go @@ -19,7 +19,7 @@ package fake import ( - v1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeGameServerAllocationPolicies implements GameServerAllocationPolicyInterface type FakeGameServerAllocationPolicies struct { - Fake *FakeMulticlusterV1alpha1 + Fake *FakeMulticlusterV1 ns string } -var gameserverallocationpoliciesResource = schema.GroupVersionResource{Group: "multicluster.agones.dev", Version: "v1alpha1", Resource: "gameserverallocationpolicies"} +var gameserverallocationpoliciesResource = schema.GroupVersionResource{Group: "multicluster.agones.dev", Version: "v1", Resource: "gameserverallocationpolicies"} -var gameserverallocationpoliciesKind = schema.GroupVersionKind{Group: "multicluster.agones.dev", Version: "v1alpha1", Kind: "GameServerAllocationPolicy"} +var gameserverallocationpoliciesKind = schema.GroupVersionKind{Group: "multicluster.agones.dev", Version: "v1", Kind: "GameServerAllocationPolicy"} // Get takes name of the gameServerAllocationPolicy, and returns the corresponding gameServerAllocationPolicy object, and an error if there is any. -func (c *FakeGameServerAllocationPolicies) Get(name string, options v1.GetOptions) (result *v1alpha1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Get(name string, options v1.GetOptions) (result *multiclusterv1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(gameserverallocationpoliciesResource, c.ns, name), &v1alpha1.GameServerAllocationPolicy{}) + Invokes(testing.NewGetAction(gameserverallocationpoliciesResource, c.ns, name), &multiclusterv1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.GameServerAllocationPolicy), err + return obj.(*multiclusterv1.GameServerAllocationPolicy), err } // List takes label and field selectors, and returns the list of GameServerAllocationPolicies that match those selectors. -func (c *FakeGameServerAllocationPolicies) List(opts v1.ListOptions) (result *v1alpha1.GameServerAllocationPolicyList, err error) { +func (c *FakeGameServerAllocationPolicies) List(opts v1.ListOptions) (result *multiclusterv1.GameServerAllocationPolicyList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(gameserverallocationpoliciesResource, gameserverallocationpoliciesKind, c.ns, opts), &v1alpha1.GameServerAllocationPolicyList{}) + Invokes(testing.NewListAction(gameserverallocationpoliciesResource, gameserverallocationpoliciesKind, c.ns, opts), &multiclusterv1.GameServerAllocationPolicyList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeGameServerAllocationPolicies) List(opts v1.ListOptions) (result *v1 if label == nil { label = labels.Everything() } - list := &v1alpha1.GameServerAllocationPolicyList{ListMeta: obj.(*v1alpha1.GameServerAllocationPolicyList).ListMeta} - for _, item := range obj.(*v1alpha1.GameServerAllocationPolicyList).Items { + list := &multiclusterv1.GameServerAllocationPolicyList{ListMeta: obj.(*multiclusterv1.GameServerAllocationPolicyList).ListMeta} + for _, item := range obj.(*multiclusterv1.GameServerAllocationPolicyList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeGameServerAllocationPolicies) Watch(opts v1.ListOptions) (watch.Int } // Create takes the representation of a gameServerAllocationPolicy and creates it. Returns the server's representation of the gameServerAllocationPolicy, and an error, if there is any. -func (c *FakeGameServerAllocationPolicies) Create(gameServerAllocationPolicy *v1alpha1.GameServerAllocationPolicy) (result *v1alpha1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Create(gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicy) (result *multiclusterv1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &v1alpha1.GameServerAllocationPolicy{}) + Invokes(testing.NewCreateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &multiclusterv1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.GameServerAllocationPolicy), err + return obj.(*multiclusterv1.GameServerAllocationPolicy), err } // Update takes the representation of a gameServerAllocationPolicy and updates it. Returns the server's representation of the gameServerAllocationPolicy, and an error, if there is any. -func (c *FakeGameServerAllocationPolicies) Update(gameServerAllocationPolicy *v1alpha1.GameServerAllocationPolicy) (result *v1alpha1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Update(gameServerAllocationPolicy *multiclusterv1.GameServerAllocationPolicy) (result *multiclusterv1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &v1alpha1.GameServerAllocationPolicy{}) + Invokes(testing.NewUpdateAction(gameserverallocationpoliciesResource, c.ns, gameServerAllocationPolicy), &multiclusterv1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.GameServerAllocationPolicy), err + return obj.(*multiclusterv1.GameServerAllocationPolicy), err } // Delete takes name of the gameServerAllocationPolicy and deletes it. Returns an error if one occurs. func (c *FakeGameServerAllocationPolicies) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(gameserverallocationpoliciesResource, c.ns, name), &v1alpha1.GameServerAllocationPolicy{}) + Invokes(testing.NewDeleteAction(gameserverallocationpoliciesResource, c.ns, name), &multiclusterv1.GameServerAllocationPolicy{}) return err } @@ -112,17 +112,17 @@ func (c *FakeGameServerAllocationPolicies) Delete(name string, options *v1.Delet func (c *FakeGameServerAllocationPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(gameserverallocationpoliciesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1alpha1.GameServerAllocationPolicyList{}) + _, err := c.Fake.Invokes(action, &multiclusterv1.GameServerAllocationPolicyList{}) return err } // Patch applies the patch and returns the patched gameServerAllocationPolicy. -func (c *FakeGameServerAllocationPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GameServerAllocationPolicy, err error) { +func (c *FakeGameServerAllocationPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *multiclusterv1.GameServerAllocationPolicy, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gameserverallocationpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.GameServerAllocationPolicy{}) + Invokes(testing.NewPatchSubresourceAction(gameserverallocationpoliciesResource, c.ns, name, pt, data, subresources...), &multiclusterv1.GameServerAllocationPolicy{}) if obj == nil { return nil, err } - return obj.(*v1alpha1.GameServerAllocationPolicy), err + return obj.(*multiclusterv1.GameServerAllocationPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_multicluster_client.go b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_multicluster_client.go similarity index 76% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_multicluster_client.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_multicluster_client.go index 34f5852a7c..8f3443550b 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/fake/fake_multicluster_client.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/fake/fake_multicluster_client.go @@ -19,22 +19,22 @@ package fake import ( - v1alpha1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1alpha1" + v1 "agones.dev/agones/pkg/client/clientset/versioned/typed/multicluster/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeMulticlusterV1alpha1 struct { +type FakeMulticlusterV1 struct { *testing.Fake } -func (c *FakeMulticlusterV1alpha1) GameServerAllocationPolicies(namespace string) v1alpha1.GameServerAllocationPolicyInterface { +func (c *FakeMulticlusterV1) GameServerAllocationPolicies(namespace string) v1.GameServerAllocationPolicyInterface { return &FakeGameServerAllocationPolicies{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeMulticlusterV1alpha1) RESTClient() rest.Interface { +func (c *FakeMulticlusterV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/gameserverallocationpolicy.go b/pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go similarity index 73% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/gameserverallocationpolicy.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go index 8429a00ea6..e464e64508 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/gameserverallocationpolicy.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/gameserverallocationpolicy.go @@ -16,14 +16,14 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1 import ( "time" - v1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + v1 "agones.dev/agones/pkg/apis/multicluster/v1" scheme "agones.dev/agones/pkg/client/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" @@ -37,14 +37,14 @@ type GameServerAllocationPoliciesGetter interface { // GameServerAllocationPolicyInterface has methods to work with GameServerAllocationPolicy resources. type GameServerAllocationPolicyInterface interface { - Create(*v1alpha1.GameServerAllocationPolicy) (*v1alpha1.GameServerAllocationPolicy, error) - Update(*v1alpha1.GameServerAllocationPolicy) (*v1alpha1.GameServerAllocationPolicy, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.GameServerAllocationPolicy, error) - List(opts v1.ListOptions) (*v1alpha1.GameServerAllocationPolicyList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GameServerAllocationPolicy, err error) + Create(*v1.GameServerAllocationPolicy) (*v1.GameServerAllocationPolicy, error) + Update(*v1.GameServerAllocationPolicy) (*v1.GameServerAllocationPolicy, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(name string, options metav1.GetOptions) (*v1.GameServerAllocationPolicy, error) + List(opts metav1.ListOptions) (*v1.GameServerAllocationPolicyList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.GameServerAllocationPolicy, err error) GameServerAllocationPolicyExpansion } @@ -55,7 +55,7 @@ type gameServerAllocationPolicies struct { } // newGameServerAllocationPolicies returns a GameServerAllocationPolicies -func newGameServerAllocationPolicies(c *MulticlusterV1alpha1Client, namespace string) *gameServerAllocationPolicies { +func newGameServerAllocationPolicies(c *MulticlusterV1Client, namespace string) *gameServerAllocationPolicies { return &gameServerAllocationPolicies{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newGameServerAllocationPolicies(c *MulticlusterV1alpha1Client, namespace st } // Get takes name of the gameServerAllocationPolicy, and returns the corresponding gameServerAllocationPolicy object, and an error if there is any. -func (c *gameServerAllocationPolicies) Get(name string, options v1.GetOptions) (result *v1alpha1.GameServerAllocationPolicy, err error) { - result = &v1alpha1.GameServerAllocationPolicy{} +func (c *gameServerAllocationPolicies) Get(name string, options metav1.GetOptions) (result *v1.GameServerAllocationPolicy, err error) { + result = &v1.GameServerAllocationPolicy{} err = c.client.Get(). Namespace(c.ns). Resource("gameserverallocationpolicies"). @@ -76,12 +76,12 @@ func (c *gameServerAllocationPolicies) Get(name string, options v1.GetOptions) ( } // List takes label and field selectors, and returns the list of GameServerAllocationPolicies that match those selectors. -func (c *gameServerAllocationPolicies) List(opts v1.ListOptions) (result *v1alpha1.GameServerAllocationPolicyList, err error) { +func (c *gameServerAllocationPolicies) List(opts metav1.ListOptions) (result *v1.GameServerAllocationPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1alpha1.GameServerAllocationPolicyList{} + result = &v1.GameServerAllocationPolicyList{} err = c.client.Get(). Namespace(c.ns). Resource("gameserverallocationpolicies"). @@ -93,7 +93,7 @@ func (c *gameServerAllocationPolicies) List(opts v1.ListOptions) (result *v1alph } // Watch returns a watch.Interface that watches the requested gameServerAllocationPolicies. -func (c *gameServerAllocationPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *gameServerAllocationPolicies) Watch(opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -108,8 +108,8 @@ func (c *gameServerAllocationPolicies) Watch(opts v1.ListOptions) (watch.Interfa } // Create takes the representation of a gameServerAllocationPolicy and creates it. Returns the server's representation of the gameServerAllocationPolicy, and an error, if there is any. -func (c *gameServerAllocationPolicies) Create(gameServerAllocationPolicy *v1alpha1.GameServerAllocationPolicy) (result *v1alpha1.GameServerAllocationPolicy, err error) { - result = &v1alpha1.GameServerAllocationPolicy{} +func (c *gameServerAllocationPolicies) Create(gameServerAllocationPolicy *v1.GameServerAllocationPolicy) (result *v1.GameServerAllocationPolicy, err error) { + result = &v1.GameServerAllocationPolicy{} err = c.client.Post(). Namespace(c.ns). Resource("gameserverallocationpolicies"). @@ -120,8 +120,8 @@ func (c *gameServerAllocationPolicies) Create(gameServerAllocationPolicy *v1alph } // Update takes the representation of a gameServerAllocationPolicy and updates it. Returns the server's representation of the gameServerAllocationPolicy, and an error, if there is any. -func (c *gameServerAllocationPolicies) Update(gameServerAllocationPolicy *v1alpha1.GameServerAllocationPolicy) (result *v1alpha1.GameServerAllocationPolicy, err error) { - result = &v1alpha1.GameServerAllocationPolicy{} +func (c *gameServerAllocationPolicies) Update(gameServerAllocationPolicy *v1.GameServerAllocationPolicy) (result *v1.GameServerAllocationPolicy, err error) { + result = &v1.GameServerAllocationPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("gameserverallocationpolicies"). @@ -133,7 +133,7 @@ func (c *gameServerAllocationPolicies) Update(gameServerAllocationPolicy *v1alph } // Delete takes name of the gameServerAllocationPolicy and deletes it. Returns an error if one occurs. -func (c *gameServerAllocationPolicies) Delete(name string, options *v1.DeleteOptions) error { +func (c *gameServerAllocationPolicies) Delete(name string, options *metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("gameserverallocationpolicies"). @@ -144,7 +144,7 @@ func (c *gameServerAllocationPolicies) Delete(name string, options *v1.DeleteOpt } // DeleteCollection deletes a collection of objects. -func (c *gameServerAllocationPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *gameServerAllocationPolicies) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { var timeout time.Duration if listOptions.TimeoutSeconds != nil { timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second @@ -160,8 +160,8 @@ func (c *gameServerAllocationPolicies) DeleteCollection(options *v1.DeleteOption } // Patch applies the patch and returns the patched gameServerAllocationPolicy. -func (c *gameServerAllocationPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.GameServerAllocationPolicy, err error) { - result = &v1alpha1.GameServerAllocationPolicy{} +func (c *gameServerAllocationPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.GameServerAllocationPolicy, err error) { + result = &v1.GameServerAllocationPolicy{} err = c.client.Patch(pt). Namespace(c.ns). Resource("gameserverallocationpolicies"). diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/multicluster/v1/generated_expansion.go similarity index 97% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/generated_expansion.go index 685d5bd13d..aab2a89f85 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/generated_expansion.go @@ -16,6 +16,6 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1 type GameServerAllocationPolicyExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/multicluster_client.go b/pkg/client/clientset/versioned/typed/multicluster/v1/multicluster_client.go similarity index 63% rename from pkg/client/clientset/versioned/typed/multicluster/v1alpha1/multicluster_client.go rename to pkg/client/clientset/versioned/typed/multicluster/v1/multicluster_client.go index 9930b33635..77cac552be 100644 --- a/pkg/client/clientset/versioned/typed/multicluster/v1alpha1/multicluster_client.go +++ b/pkg/client/clientset/versioned/typed/multicluster/v1/multicluster_client.go @@ -16,31 +16,31 @@ // Code generated by client-gen. DO NOT EDIT. -package v1alpha1 +package v1 import ( - v1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + v1 "agones.dev/agones/pkg/apis/multicluster/v1" "agones.dev/agones/pkg/client/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) -type MulticlusterV1alpha1Interface interface { +type MulticlusterV1Interface interface { RESTClient() rest.Interface GameServerAllocationPoliciesGetter } -// MulticlusterV1alpha1Client is used to interact with features provided by the multicluster.agones.dev group. -type MulticlusterV1alpha1Client struct { +// MulticlusterV1Client is used to interact with features provided by the multicluster.agones.dev group. +type MulticlusterV1Client struct { restClient rest.Interface } -func (c *MulticlusterV1alpha1Client) GameServerAllocationPolicies(namespace string) GameServerAllocationPolicyInterface { +func (c *MulticlusterV1Client) GameServerAllocationPolicies(namespace string) GameServerAllocationPolicyInterface { return newGameServerAllocationPolicies(c, namespace) } -// NewForConfig creates a new MulticlusterV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*MulticlusterV1alpha1Client, error) { +// NewForConfig creates a new MulticlusterV1Client for the given config. +func NewForConfig(c *rest.Config) (*MulticlusterV1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -49,12 +49,12 @@ func NewForConfig(c *rest.Config) (*MulticlusterV1alpha1Client, error) { if err != nil { return nil, err } - return &MulticlusterV1alpha1Client{client}, nil + return &MulticlusterV1Client{client}, nil } -// NewForConfigOrDie creates a new MulticlusterV1alpha1Client for the given config and +// NewForConfigOrDie creates a new MulticlusterV1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *MulticlusterV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *MulticlusterV1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -62,13 +62,13 @@ func NewForConfigOrDie(c *rest.Config) *MulticlusterV1alpha1Client { return client } -// New creates a new MulticlusterV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *MulticlusterV1alpha1Client { - return &MulticlusterV1alpha1Client{c} +// New creates a new MulticlusterV1Client for the given RESTClient. +func New(c rest.Interface) *MulticlusterV1Client { + return &MulticlusterV1Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := v1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} @@ -82,7 +82,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *MulticlusterV1alpha1Client) RESTClient() rest.Interface { +func (c *MulticlusterV1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index b65917601c..9f41acc1f4 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -23,7 +23,7 @@ import ( v1 "agones.dev/agones/pkg/apis/agones/v1" autoscalingv1 "agones.dev/agones/pkg/apis/autoscaling/v1" - v1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -66,9 +66,9 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case autoscalingv1.SchemeGroupVersion.WithResource("fleetautoscalers"): return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V1().FleetAutoscalers().Informer()}, nil - // Group=multicluster.agones.dev, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("gameserverallocationpolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Multicluster().V1alpha1().GameServerAllocationPolicies().Informer()}, nil + // Group=multicluster.agones.dev, Version=v1 + case multiclusterv1.SchemeGroupVersion.WithResource("gameserverallocationpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Multicluster().V1().GameServerAllocationPolicies().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/multicluster/interface.go b/pkg/client/informers/externalversions/multicluster/interface.go index 710e18fe2e..2ca7bfffb1 100644 --- a/pkg/client/informers/externalversions/multicluster/interface.go +++ b/pkg/client/informers/externalversions/multicluster/interface.go @@ -20,13 +20,13 @@ package multicluster import ( internalinterfaces "agones.dev/agones/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "agones.dev/agones/pkg/client/informers/externalversions/multicluster/v1alpha1" + v1 "agones.dev/agones/pkg/client/informers/externalversions/multicluster/v1" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/multicluster/v1alpha1/gameserverallocationpolicy.go b/pkg/client/informers/externalversions/multicluster/v1/gameserverallocationpolicy.go similarity index 77% rename from pkg/client/informers/externalversions/multicluster/v1alpha1/gameserverallocationpolicy.go rename to pkg/client/informers/externalversions/multicluster/v1/gameserverallocationpolicy.go index e44178f2b3..fc4185cd66 100644 --- a/pkg/client/informers/externalversions/multicluster/v1alpha1/gameserverallocationpolicy.go +++ b/pkg/client/informers/externalversions/multicluster/v1/gameserverallocationpolicy.go @@ -16,16 +16,16 @@ // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1 import ( time "time" - multiclusterv1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" versioned "agones.dev/agones/pkg/client/clientset/versioned" internalinterfaces "agones.dev/agones/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "agones.dev/agones/pkg/client/listers/multicluster/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "agones.dev/agones/pkg/client/listers/multicluster/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" @@ -35,7 +35,7 @@ import ( // GameServerAllocationPolicies. type GameServerAllocationPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.GameServerAllocationPolicyLister + Lister() v1.GameServerAllocationPolicyLister } type gameServerAllocationPolicyInformer struct { @@ -57,20 +57,20 @@ func NewGameServerAllocationPolicyInformer(client versioned.Interface, namespace func NewFilteredGameServerAllocationPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.MulticlusterV1alpha1().GameServerAllocationPolicies(namespace).List(options) + return client.MulticlusterV1().GameServerAllocationPolicies(namespace).List(options) }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.MulticlusterV1alpha1().GameServerAllocationPolicies(namespace).Watch(options) + return client.MulticlusterV1().GameServerAllocationPolicies(namespace).Watch(options) }, }, - &multiclusterv1alpha1.GameServerAllocationPolicy{}, + &multiclusterv1.GameServerAllocationPolicy{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *gameServerAllocationPolicyInformer) defaultInformer(client versioned.In } func (f *gameServerAllocationPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&multiclusterv1alpha1.GameServerAllocationPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&multiclusterv1.GameServerAllocationPolicy{}, f.defaultInformer) } -func (f *gameServerAllocationPolicyInformer) Lister() v1alpha1.GameServerAllocationPolicyLister { - return v1alpha1.NewGameServerAllocationPolicyLister(f.Informer().GetIndexer()) +func (f *gameServerAllocationPolicyInformer) Lister() v1.GameServerAllocationPolicyLister { + return v1.NewGameServerAllocationPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/multicluster/v1alpha1/interface.go b/pkg/client/informers/externalversions/multicluster/v1/interface.go similarity index 99% rename from pkg/client/informers/externalversions/multicluster/v1alpha1/interface.go rename to pkg/client/informers/externalversions/multicluster/v1/interface.go index 65e8ea249d..38773d31e2 100644 --- a/pkg/client/informers/externalversions/multicluster/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/multicluster/v1/interface.go @@ -16,7 +16,7 @@ // Code generated by informer-gen. DO NOT EDIT. -package v1alpha1 +package v1 import ( internalinterfaces "agones.dev/agones/pkg/client/informers/externalversions/internalinterfaces" diff --git a/pkg/client/listers/multicluster/v1alpha1/expansion_generated.go b/pkg/client/listers/multicluster/v1/expansion_generated.go similarity index 98% rename from pkg/client/listers/multicluster/v1alpha1/expansion_generated.go rename to pkg/client/listers/multicluster/v1/expansion_generated.go index 4f4cd54972..0a71a7b167 100644 --- a/pkg/client/listers/multicluster/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/multicluster/v1/expansion_generated.go @@ -16,7 +16,7 @@ // Code generated by lister-gen. DO NOT EDIT. -package v1alpha1 +package v1 // GameServerAllocationPolicyListerExpansion allows custom methods to be added to // GameServerAllocationPolicyLister. diff --git a/pkg/client/listers/multicluster/v1alpha1/gameserverallocationpolicy.go b/pkg/client/listers/multicluster/v1/gameserverallocationpolicy.go similarity index 81% rename from pkg/client/listers/multicluster/v1alpha1/gameserverallocationpolicy.go rename to pkg/client/listers/multicluster/v1/gameserverallocationpolicy.go index f57d97dadb..26d9c3d4bc 100644 --- a/pkg/client/listers/multicluster/v1alpha1/gameserverallocationpolicy.go +++ b/pkg/client/listers/multicluster/v1/gameserverallocationpolicy.go @@ -16,10 +16,10 @@ // Code generated by lister-gen. DO NOT EDIT. -package v1alpha1 +package v1 import ( - v1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + v1 "agones.dev/agones/pkg/apis/multicluster/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // GameServerAllocationPolicyLister helps list GameServerAllocationPolicies. type GameServerAllocationPolicyLister interface { // List lists all GameServerAllocationPolicies in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.GameServerAllocationPolicy, err error) + List(selector labels.Selector) (ret []*v1.GameServerAllocationPolicy, err error) // GameServerAllocationPolicies returns an object that can list and get GameServerAllocationPolicies. GameServerAllocationPolicies(namespace string) GameServerAllocationPolicyNamespaceLister GameServerAllocationPolicyListerExpansion @@ -45,9 +45,9 @@ func NewGameServerAllocationPolicyLister(indexer cache.Indexer) GameServerAlloca } // List lists all GameServerAllocationPolicies in the indexer. -func (s *gameServerAllocationPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.GameServerAllocationPolicy, err error) { +func (s *gameServerAllocationPolicyLister) List(selector labels.Selector) (ret []*v1.GameServerAllocationPolicy, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.GameServerAllocationPolicy)) + ret = append(ret, m.(*v1.GameServerAllocationPolicy)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *gameServerAllocationPolicyLister) GameServerAllocationPolicies(namespac // GameServerAllocationPolicyNamespaceLister helps list and get GameServerAllocationPolicies. type GameServerAllocationPolicyNamespaceLister interface { // List lists all GameServerAllocationPolicies in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1alpha1.GameServerAllocationPolicy, err error) + List(selector labels.Selector) (ret []*v1.GameServerAllocationPolicy, err error) // Get retrieves the GameServerAllocationPolicy from the indexer for a given namespace and name. - Get(name string) (*v1alpha1.GameServerAllocationPolicy, error) + Get(name string) (*v1.GameServerAllocationPolicy, error) GameServerAllocationPolicyNamespaceListerExpansion } @@ -74,21 +74,21 @@ type gameServerAllocationPolicyNamespaceLister struct { } // List lists all GameServerAllocationPolicies in the indexer for a given namespace. -func (s gameServerAllocationPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.GameServerAllocationPolicy, err error) { +func (s gameServerAllocationPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1.GameServerAllocationPolicy, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.GameServerAllocationPolicy)) + ret = append(ret, m.(*v1.GameServerAllocationPolicy)) }) return ret, err } // Get retrieves the GameServerAllocationPolicy from the indexer for a given namespace and name. -func (s gameServerAllocationPolicyNamespaceLister) Get(name string) (*v1alpha1.GameServerAllocationPolicy, error) { +func (s gameServerAllocationPolicyNamespaceLister) Get(name string) (*v1.GameServerAllocationPolicy, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("gameserverallocationpolicy"), name) + return nil, errors.NewNotFound(v1.Resource("gameserverallocationpolicy"), name) } - return obj.(*v1alpha1.GameServerAllocationPolicy), nil + return obj.(*v1.GameServerAllocationPolicy), nil } diff --git a/pkg/gameserverallocations/allocator.go b/pkg/gameserverallocations/allocator.go index c67b893178..7fd2d0209b 100644 --- a/pkg/gameserverallocations/allocator.go +++ b/pkg/gameserverallocations/allocator.go @@ -29,9 +29,9 @@ import ( pb "agones.dev/agones/pkg/allocation/go/v1alpha1" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" - multiclusterv1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" - multiclusterinformerv1alpha1 "agones.dev/agones/pkg/client/informers/externalversions/multicluster/v1alpha1" - multiclusterlisterv1alpha1 "agones.dev/agones/pkg/client/listers/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" + multiclusterinformerv1 "agones.dev/agones/pkg/client/informers/externalversions/multicluster/v1" + multiclusterlisterv1 "agones.dev/agones/pkg/client/listers/multicluster/v1" "agones.dev/agones/pkg/util/apiserver" "agones.dev/agones/pkg/util/logfields" "agones.dev/agones/pkg/util/runtime" @@ -96,7 +96,7 @@ var remoteAllocationRetry = wait.Backoff{ // Allocator handles game server allocation type Allocator struct { baseLogger *logrus.Entry - allocationPolicyLister multiclusterlisterv1alpha1.GameServerAllocationPolicyLister + allocationPolicyLister multiclusterlisterv1.GameServerAllocationPolicyLister allocationPolicySynced cache.InformerSynced secretLister corev1lister.SecretLister secretSynced cache.InformerSynced @@ -121,7 +121,7 @@ type response struct { } // NewAllocator creates an instance off Allocator -func NewAllocator(policyInformer multiclusterinformerv1alpha1.GameServerAllocationPolicyInformer, secretInformer informercorev1.SecretInformer, +func NewAllocator(policyInformer multiclusterinformerv1.GameServerAllocationPolicyInformer, secretInformer informercorev1.SecretInformer, kubeClient kubernetes.Interface, readyGameServerCache *ReadyGameServerCache) *Allocator { ah := &Allocator{ pendingRequests: make(chan request, maxBatchQueue), @@ -286,7 +286,7 @@ func (c *Allocator) applyMultiClusterAllocation(gsa *allocationv1.GameServerAllo return nil, errors.New("no multi-cluster allocation policy is specified") } - it := multiclusterv1alpha1.NewConnectionInfoIterator(policies) + it := multiclusterv1.NewConnectionInfoIterator(policies) for { connectionInfo := it.Next() if connectionInfo == nil { @@ -318,7 +318,7 @@ func (c *Allocator) applyMultiClusterAllocation(gsa *allocationv1.GameServerAllo // allocateFromRemoteCluster allocates gameservers from a remote cluster by making // an http call to allocation service in that cluster. -func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAllocation, connectionInfo *multiclusterv1alpha1.ClusterConnectionInfo, namespace string) (*allocationv1.GameServerAllocation, error) { +func (c *Allocator) allocateFromRemoteCluster(gsa *allocationv1.GameServerAllocation, connectionInfo *multiclusterv1.ClusterConnectionInfo, namespace string) (*allocationv1.GameServerAllocation, error) { var allocationResponse *pb.AllocationResponse // TODO: handle converting error to apiserver error diff --git a/pkg/gameserverallocations/controller.go b/pkg/gameserverallocations/controller.go index 0084fa55ee..546a37287c 100644 --- a/pkg/gameserverallocations/controller.go +++ b/pkg/gameserverallocations/controller.go @@ -62,7 +62,7 @@ func NewController(apiServer *apiserver.APIServer, c := &Controller{ api: apiServer, allocator: NewAllocator( - agonesInformerFactory.Multicluster().V1alpha1().GameServerAllocationPolicies(), + agonesInformerFactory.Multicluster().V1().GameServerAllocationPolicies(), kubeInformerFactory.Core().V1().Secrets(), kubeClient, NewReadyGameServerCache(agonesInformerFactory.Agones().V1().GameServers(), agonesClient.AgonesV1(), counter, health)), diff --git a/pkg/gameserverallocations/controller_test.go b/pkg/gameserverallocations/controller_test.go index 0c12797867..ebff3e4952 100644 --- a/pkg/gameserverallocations/controller_test.go +++ b/pkg/gameserverallocations/controller_test.go @@ -28,7 +28,7 @@ import ( "agones.dev/agones/pkg/apis" agonesv1 "agones.dev/agones/pkg/apis/agones/v1" allocationv1 "agones.dev/agones/pkg/apis/allocation/v1" - multiclusterv1alpha1 "agones.dev/agones/pkg/apis/multicluster/v1alpha1" + multiclusterv1 "agones.dev/agones/pkg/apis/multicluster/v1" "agones.dev/agones/pkg/gameservers" agtesting "agones.dev/agones/pkg/testing" "agones.dev/agones/pkg/util/apiserver" @@ -796,13 +796,13 @@ func TestMultiClusterAllocationFromLocal(t *testing.T) { fleetName := addReactorForGameServer(&m) m.AgonesClient.AddReactor("list", "gameserverallocationpolicies", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { - return true, &multiclusterv1alpha1.GameServerAllocationPolicyList{ - Items: []multiclusterv1alpha1.GameServerAllocationPolicy{ + return true, &multiclusterv1.GameServerAllocationPolicyList{ + Items: []multiclusterv1.GameServerAllocationPolicy{ { - Spec: multiclusterv1alpha1.GameServerAllocationPolicySpec{ + Spec: multiclusterv1.GameServerAllocationPolicySpec{ Priority: 1, Weight: 200, - ConnectionInfo: multiclusterv1alpha1.ClusterConnectionInfo{ + ConnectionInfo: multiclusterv1.ClusterConnectionInfo{ ClusterName: "multicluster", SecretName: "localhostsecret", Namespace: defaultNs, @@ -860,8 +860,8 @@ func TestMultiClusterAllocationFromLocal(t *testing.T) { fleetName := addReactorForGameServer(&m) m.AgonesClient.AddReactor("list", "gameserverallocationpolicies", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { - return true, &multiclusterv1alpha1.GameServerAllocationPolicyList{ - Items: []multiclusterv1alpha1.GameServerAllocationPolicy{}, + return true, &multiclusterv1.GameServerAllocationPolicyList{ + Items: []multiclusterv1.GameServerAllocationPolicy{}, }, nil }) @@ -914,13 +914,13 @@ func TestMultiClusterAllocationFromRemote(t *testing.T) { secretName := clusterName + "secret" targetedNamespace := "tns" m.AgonesClient.AddReactor("list", "gameserverallocationpolicies", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { - return true, &multiclusterv1alpha1.GameServerAllocationPolicyList{ - Items: []multiclusterv1alpha1.GameServerAllocationPolicy{ + return true, &multiclusterv1.GameServerAllocationPolicyList{ + Items: []multiclusterv1.GameServerAllocationPolicy{ { - Spec: multiclusterv1alpha1.GameServerAllocationPolicySpec{ + Spec: multiclusterv1.GameServerAllocationPolicySpec{ Priority: 1, Weight: 200, - ConnectionInfo: multiclusterv1alpha1.ClusterConnectionInfo{ + ConnectionInfo: multiclusterv1.ClusterConnectionInfo{ AllocationEndpoints: []string{endpoint, "non-existing"}, ClusterName: clusterName, SecretName: secretName, @@ -1002,13 +1002,13 @@ func TestMultiClusterAllocationFromRemote(t *testing.T) { // Allocation policy reactor secretName := clusterName + "secret" m.AgonesClient.AddReactor("list", "gameserverallocationpolicies", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { - return true, &multiclusterv1alpha1.GameServerAllocationPolicyList{ - Items: []multiclusterv1alpha1.GameServerAllocationPolicy{ + return true, &multiclusterv1.GameServerAllocationPolicyList{ + Items: []multiclusterv1.GameServerAllocationPolicy{ { - Spec: multiclusterv1alpha1.GameServerAllocationPolicySpec{ + Spec: multiclusterv1.GameServerAllocationPolicySpec{ Priority: 1, Weight: 200, - ConnectionInfo: multiclusterv1alpha1.ClusterConnectionInfo{ + ConnectionInfo: multiclusterv1.ClusterConnectionInfo{ AllocationEndpoints: []string{endpoint}, ClusterName: clusterName, SecretName: secretName, @@ -1020,10 +1020,10 @@ func TestMultiClusterAllocationFromRemote(t *testing.T) { }, }, { - Spec: multiclusterv1alpha1.GameServerAllocationPolicySpec{ + Spec: multiclusterv1.GameServerAllocationPolicySpec{ Priority: 2, Weight: 200, - ConnectionInfo: multiclusterv1alpha1.ClusterConnectionInfo{ + ConnectionInfo: multiclusterv1.ClusterConnectionInfo{ AllocationEndpoints: []string{endpoint}, ClusterName: "remotecluster2", SecretName: secretName, @@ -1098,13 +1098,13 @@ func TestMultiClusterAllocationFromRemote(t *testing.T) { // Allocation policy reactor secretName := clusterName + "secret" m.AgonesClient.AddReactor("list", "gameserverallocationpolicies", func(action k8stesting.Action) (bool, k8sruntime.Object, error) { - return true, &multiclusterv1alpha1.GameServerAllocationPolicyList{ - Items: []multiclusterv1alpha1.GameServerAllocationPolicy{ + return true, &multiclusterv1.GameServerAllocationPolicyList{ + Items: []multiclusterv1.GameServerAllocationPolicy{ { - Spec: multiclusterv1alpha1.GameServerAllocationPolicySpec{ + Spec: multiclusterv1.GameServerAllocationPolicySpec{ Priority: 1, Weight: 200, - ConnectionInfo: multiclusterv1alpha1.ClusterConnectionInfo{ + ConnectionInfo: multiclusterv1.ClusterConnectionInfo{ AllocationEndpoints: []string{unhealthyEndpoint, healthyEndpoint}, ClusterName: clusterName, SecretName: secretName, diff --git a/site/content/en/docs/Reference/agones_crd_api_reference.html b/site/content/en/docs/Reference/agones_crd_api_reference.html index f2099a04bc..28b3704ce4 100644 --- a/site/content/en/docs/Reference/agones_crd_api_reference.html +++ b/site/content/en/docs/Reference/agones_crd_api_reference.html @@ -4494,7 +4494,7 @@

WebhookPolicy

multicluster.agones.dev

-

Package v1alpha1 is the v1alpha1 version of the API.

+

Package v1 is the v1 version of the API.

Resource Types: