Skip to content

Commit 53e8f19

Browse files
committed
Replace capi v1alpha3 with v1beta2 in test cases
1 parent 9a51871 commit 53e8f19

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

cluster-autoscaler/cloudprovider/clusterapi/clusterapi_controller_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ func mustCreateTestController(t testing.TB, testConfigs ...*testConfig) (*machin
107107
dynamicClientset := fakedynamic.NewSimpleDynamicClientWithCustomListKinds(
108108
runtime.NewScheme(),
109109
map[schema.GroupVersionResource]string{
110-
{Group: "cluster.x-k8s.io", Version: "v1alpha3", Resource: "machinedeployments"}: "kindList",
111-
{Group: "cluster.x-k8s.io", Version: "v1alpha3", Resource: "machines"}: "kindList",
112-
{Group: "cluster.x-k8s.io", Version: "v1alpha3", Resource: "machinesets"}: "kindList",
113-
{Group: "cluster.x-k8s.io", Version: "v1alpha3", Resource: "machinepools"}: "kindList",
114110
{Group: "cluster.x-k8s.io", Version: "v1beta1", Resource: "machinedeployments"}: "kindList",
115111
{Group: "cluster.x-k8s.io", Version: "v1beta1", Resource: "machines"}: "kindList",
116112
{Group: "cluster.x-k8s.io", Version: "v1beta1", Resource: "machinesets"}: "kindList",
113+
{Group: "cluster.x-k8s.io", Version: "v1beta2", Resource: "machinedeployments"}: "kindList",
114+
{Group: "cluster.x-k8s.io", Version: "v1beta2", Resource: "machines"}: "kindList",
115+
{Group: "cluster.x-k8s.io", Version: "v1beta2", Resource: "machinesets"}: "kindList",
116+
{Group: "cluster.x-k8s.io", Version: "v1beta2", Resource: "machinepools"}: "kindList",
117117
{Group: "custom.x-k8s.io", Version: "v1beta1", Resource: "machinepools"}: "kindList",
118118
{Group: "custom.x-k8s.io", Version: "v1beta1", Resource: "machinedeployments"}: "kindList",
119119
{Group: "custom.x-k8s.io", Version: "v1beta1", Resource: "machines"}: "kindList",
@@ -151,7 +151,7 @@ func mustCreateTestController(t testing.TB, testConfigs ...*testConfig) (*machin
151151
},
152152
},
153153
{
154-
GroupVersion: fmt.Sprintf("%s/v1alpha3", defaultCAPIGroup),
154+
GroupVersion: fmt.Sprintf("%s/v1beta2", defaultCAPIGroup),
155155
APIResources: []metav1.APIResource{
156156
{
157157
Name: resourceNameMachineDeployment,
@@ -191,7 +191,7 @@ func mustCreateTestController(t testing.TB, testConfigs ...*testConfig) (*machin
191191

192192
gvr := schema.GroupVersionResource{
193193
Group: action.GetResource().Group,
194-
Version: "v1alpha3",
194+
Version: "v1beta2",
195195
Resource: resource,
196196
}
197197

@@ -366,7 +366,7 @@ func createTestConfigs(specs ...testSpec) []*testConfig {
366366
config.machineSet = &unstructured.Unstructured{
367367
Object: map[string]interface{}{
368368
"kind": machineSetKind,
369-
"apiVersion": "cluster.x-k8s.io/v1alpha3",
369+
"apiVersion": "cluster.x-k8s.io/v1beta2",
370370
"metadata": map[string]interface{}{
371371
"name": spec.machineSetName,
372372
"namespace": spec.namespace,
@@ -404,7 +404,7 @@ func createTestConfigs(specs ...testSpec) []*testConfig {
404404
config.machineDeployment = &unstructured.Unstructured{
405405
Object: map[string]interface{}{
406406
"kind": machineDeploymentKind,
407-
"apiVersion": "cluster.x-k8s.io/v1alpha3",
407+
"apiVersion": "cluster.x-k8s.io/v1beta2",
408408
"metadata": map[string]interface{}{
409409
"name": spec.machineDeploymentName,
410410
"namespace": spec.namespace,
@@ -506,7 +506,7 @@ func makeLinkedNodeAndMachine(i int, namespace, clusterName string, owner metav1
506506
machine := &unstructured.Unstructured{
507507
Object: map[string]interface{}{
508508
"kind": machineKind,
509-
"apiVersion": "cluster.x-k8s.io/v1alpha3",
509+
"apiVersion": "cluster.x-k8s.io/v1beta2",
510510
"metadata": map[string]interface{}{
511511
"name": fmt.Sprintf("%s-%s-machine-%d", namespace, owner.Name, i),
512512
"namespace": namespace,
@@ -1550,7 +1550,7 @@ func TestGetAPIGroupPreferredVersion(t *testing.T) {
15501550
{
15511551
description: "find version for default API group",
15521552
APIGroup: defaultCAPIGroup,
1553-
preferredVersion: "v1alpha3",
1553+
preferredVersion: "v1beta2",
15541554
envVar: "",
15551555
error: false,
15561556
},
@@ -1584,7 +1584,7 @@ func TestGetAPIGroupPreferredVersion(t *testing.T) {
15841584
GroupVersion: fmt.Sprintf("%s/v1beta1", customCAPIGroup),
15851585
},
15861586
{
1587-
GroupVersion: fmt.Sprintf("%s/v1alpha3", defaultCAPIGroup),
1587+
GroupVersion: fmt.Sprintf("%s/v1beta2", defaultCAPIGroup),
15881588
},
15891589
{
15901590
GroupVersion: fmt.Sprintf("%s/%s", customCAPIGroup, customVersion),
@@ -1617,14 +1617,14 @@ func TestGroupVersionHasResource(t *testing.T) {
16171617
{
16181618
description: "true when it finds resource",
16191619
resourceName: resourceNameMachineDeployment,
1620-
APIGroup: fmt.Sprintf("%s/v1alpha3", defaultCAPIGroup),
1620+
APIGroup: fmt.Sprintf("%s/v1beta2", defaultCAPIGroup),
16211621
expected: true,
16221622
error: false,
16231623
},
16241624
{
16251625
description: "false when it does not find resource",
16261626
resourceName: "resourceDoesNotExist",
1627-
APIGroup: fmt.Sprintf("%s/v1alpha3", defaultCAPIGroup),
1627+
APIGroup: fmt.Sprintf("%s/v1beta2", defaultCAPIGroup),
16281628
expected: false,
16291629
error: false,
16301630
},
@@ -1641,7 +1641,7 @@ func TestGroupVersionHasResource(t *testing.T) {
16411641
Fake: &clientgotesting.Fake{
16421642
Resources: []*metav1.APIResourceList{
16431643
{
1644-
GroupVersion: fmt.Sprintf("%s/v1alpha3", defaultCAPIGroup),
1644+
GroupVersion: fmt.Sprintf("%s/v1beta2", defaultCAPIGroup),
16451645
APIResources: []metav1.APIResource{
16461646
{
16471647
Name: resourceNameMachineDeployment,

0 commit comments

Comments
 (0)