@@ -105,13 +105,13 @@ func mustCreateTestController(t testing.TB, testConfigs ...*testConfig) (*machin
105105 dynamicClientset := fakedynamic .NewSimpleDynamicClientWithCustomListKinds (
106106 runtime .NewScheme (),
107107 map [schema.GroupVersionResource ]string {
108- {Group : "cluster.x-k8s.io" , Version : "v1alpha3" , Resource : "machinedeployments" }: "kindList" ,
109- {Group : "cluster.x-k8s.io" , Version : "v1alpha3" , Resource : "machines" }: "kindList" ,
110- {Group : "cluster.x-k8s.io" , Version : "v1alpha3" , Resource : "machinesets" }: "kindList" ,
111- {Group : "cluster.x-k8s.io" , Version : "v1alpha3" , Resource : "machinepools" }: "kindList" ,
112108 {Group : "cluster.x-k8s.io" , Version : "v1beta1" , Resource : "machinedeployments" }: "kindList" ,
113109 {Group : "cluster.x-k8s.io" , Version : "v1beta1" , Resource : "machines" }: "kindList" ,
114110 {Group : "cluster.x-k8s.io" , Version : "v1beta1" , Resource : "machinesets" }: "kindList" ,
111+ {Group : "cluster.x-k8s.io" , Version : "v1beta2" , Resource : "machinedeployments" }: "kindList" ,
112+ {Group : "cluster.x-k8s.io" , Version : "v1beta2" , Resource : "machines" }: "kindList" ,
113+ {Group : "cluster.x-k8s.io" , Version : "v1beta2" , Resource : "machinesets" }: "kindList" ,
114+ {Group : "cluster.x-k8s.io" , Version : "v1beta2" , Resource : "machinepools" }: "kindList" ,
115115 {Group : "custom.x-k8s.io" , Version : "v1beta1" , Resource : "machinepools" }: "kindList" ,
116116 {Group : "custom.x-k8s.io" , Version : "v1beta1" , Resource : "machinedeployments" }: "kindList" ,
117117 {Group : "custom.x-k8s.io" , Version : "v1beta1" , Resource : "machines" }: "kindList" ,
@@ -149,7 +149,7 @@ func mustCreateTestController(t testing.TB, testConfigs ...*testConfig) (*machin
149149 },
150150 },
151151 {
152- GroupVersion : fmt .Sprintf ("%s/v1alpha3 " , defaultCAPIGroup ),
152+ GroupVersion : fmt .Sprintf ("%s/v1beta2 " , defaultCAPIGroup ),
153153 APIResources : []metav1.APIResource {
154154 {
155155 Name : resourceNameMachineDeployment ,
@@ -189,7 +189,7 @@ func mustCreateTestController(t testing.TB, testConfigs ...*testConfig) (*machin
189189
190190 gvr := schema.GroupVersionResource {
191191 Group : action .GetResource ().Group ,
192- Version : "v1alpha3 " ,
192+ Version : "v1beta2 " ,
193193 Resource : resource ,
194194 }
195195
@@ -331,7 +331,7 @@ func createTestConfigs(specs ...testSpec) []*testConfig {
331331 config .machineSet = & unstructured.Unstructured {
332332 Object : map [string ]interface {}{
333333 "kind" : machineSetKind ,
334- "apiVersion" : "cluster.x-k8s.io/v1alpha3 " ,
334+ "apiVersion" : "cluster.x-k8s.io/v1beta2 " ,
335335 "metadata" : map [string ]interface {}{
336336 "name" : spec .machineSetName ,
337337 "namespace" : spec .namespace ,
@@ -369,7 +369,7 @@ func createTestConfigs(specs ...testSpec) []*testConfig {
369369 config .machineDeployment = & unstructured.Unstructured {
370370 Object : map [string ]interface {}{
371371 "kind" : machineDeploymentKind ,
372- "apiVersion" : "cluster.x-k8s.io/v1alpha3 " ,
372+ "apiVersion" : "cluster.x-k8s.io/v1beta2 " ,
373373 "metadata" : map [string ]interface {}{
374374 "name" : spec .machineDeploymentName ,
375375 "namespace" : spec .namespace ,
@@ -381,9 +381,9 @@ func createTestConfigs(specs ...testSpec) []*testConfig {
381381 "template" : map [string ]interface {}{
382382 "spec" : map [string ]interface {}{
383383 "infrastructureRef" : map [string ]interface {}{
384- "apiVersion " : "infrastructure.cluster.x-k8s.io/v1beta1 " ,
385- "kind" : machineTemplateKind ,
386- "name" : "TestMachineTemplate" ,
384+ "apiGroup " : "infrastructure.cluster.x-k8s.io" ,
385+ "kind" : machineTemplateKind ,
386+ "name" : "TestMachineTemplate" ,
387387 },
388388 },
389389 },
@@ -471,7 +471,7 @@ func makeLinkedNodeAndMachine(i int, namespace, clusterName string, owner metav1
471471 machine := & unstructured.Unstructured {
472472 Object : map [string ]interface {}{
473473 "kind" : machineKind ,
474- "apiVersion" : "cluster.x-k8s.io/v1alpha3 " ,
474+ "apiVersion" : "cluster.x-k8s.io/v1beta2 " ,
475475 "metadata" : map [string ]interface {}{
476476 "name" : fmt .Sprintf ("%s-%s-machine-%d" , namespace , owner .Name , i ),
477477 "namespace" : namespace ,
@@ -1528,7 +1528,7 @@ func TestGetAPIGroupPreferredVersion(t *testing.T) {
15281528 {
15291529 description : "find version for default API group" ,
15301530 APIGroup : defaultCAPIGroup ,
1531- preferredVersion : "v1alpha3 " ,
1531+ preferredVersion : "v1beta2 " ,
15321532 envVar : "" ,
15331533 error : false ,
15341534 },
@@ -1562,7 +1562,7 @@ func TestGetAPIGroupPreferredVersion(t *testing.T) {
15621562 GroupVersion : fmt .Sprintf ("%s/v1beta1" , customCAPIGroup ),
15631563 },
15641564 {
1565- GroupVersion : fmt .Sprintf ("%s/v1alpha3 " , defaultCAPIGroup ),
1565+ GroupVersion : fmt .Sprintf ("%s/v1beta2 " , defaultCAPIGroup ),
15661566 },
15671567 {
15681568 GroupVersion : fmt .Sprintf ("%s/%s" , customCAPIGroup , customVersion ),
@@ -1573,7 +1573,7 @@ func TestGetAPIGroupPreferredVersion(t *testing.T) {
15731573 for _ , tc := range testCases {
15741574 t .Run (tc .description , func (t * testing.T ) {
15751575 t .Setenv (CAPIVersionEnvVar , tc .envVar )
1576- version , err := getAPIGroupPreferredVersion (discoveryClient , tc .APIGroup )
1576+ version , err := getCAPIGroupPreferredVersion (discoveryClient , tc .APIGroup )
15771577 if (err != nil ) != tc .error {
15781578 t .Errorf ("expected to have error: %t. Had an error: %t" , tc .error , err != nil )
15791579 }
@@ -1595,14 +1595,14 @@ func TestGroupVersionHasResource(t *testing.T) {
15951595 {
15961596 description : "true when it finds resource" ,
15971597 resourceName : resourceNameMachineDeployment ,
1598- APIGroup : fmt .Sprintf ("%s/v1alpha3 " , defaultCAPIGroup ),
1598+ APIGroup : fmt .Sprintf ("%s/v1beta2 " , defaultCAPIGroup ),
15991599 expected : true ,
16001600 error : false ,
16011601 },
16021602 {
16031603 description : "false when it does not find resource" ,
16041604 resourceName : "resourceDoesNotExist" ,
1605- APIGroup : fmt .Sprintf ("%s/v1alpha3 " , defaultCAPIGroup ),
1605+ APIGroup : fmt .Sprintf ("%s/v1beta2 " , defaultCAPIGroup ),
16061606 expected : false ,
16071607 error : false ,
16081608 },
@@ -1619,7 +1619,7 @@ func TestGroupVersionHasResource(t *testing.T) {
16191619 Fake : & clientgotesting.Fake {
16201620 Resources : []* metav1.APIResourceList {
16211621 {
1622- GroupVersion : fmt .Sprintf ("%s/v1alpha3 " , defaultCAPIGroup ),
1622+ GroupVersion : fmt .Sprintf ("%s/v1beta2 " , defaultCAPIGroup ),
16231623 APIResources : []metav1.APIResource {
16241624 {
16251625 Name : resourceNameMachineDeployment ,
0 commit comments