Skip to content

Commit

Permalink
Use v1alpha2 as version in tests (#1186)
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <[email protected]>
  • Loading branch information
vincepri authored and k8s-ci-robot committed Jul 23, 2019
1 parent 8d4cb92 commit 6afa7ae
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func getMachineWithError(machineName, namespace string, nodeRef *v1.ObjectRefere
},
Spec: v1alpha2.MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureRef",
Name: "machine-infrastructure",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha2/machine_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestStorageMachine(t *testing.T) {
},
Spec: MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureRef",
Name: "machine-infrastructure",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha2/machinedeployment_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestStorageMachineDeployment(t *testing.T) {
Template: MachineTemplateSpec{
Spec: MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureRef",
Name: "machine-infrastructure",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/cluster/v1alpha2/machineset_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestStorageMachineSet(t *testing.T) {
Template: MachineTemplateSpec{
Spec: MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureRef",
Name: "machine-infrastructure",
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/external/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
Validation: &apiextensionsv1beta1.CustomResourceValidation{},
Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{
{
Name: "v1alpha1",
Name: "v1alpha2",
Served: true,
Storage: true,
},
Expand All @@ -64,7 +64,7 @@ var (
Validation: &apiextensionsv1beta1.CustomResourceValidation{},
Versions: []apiextensionsv1beta1.CustomResourceDefinitionVersion{
{
Name: "v1alpha1",
Name: "v1alpha2",
Served: true,
Storage: true,
},
Expand Down
60 changes: 30 additions & 30 deletions pkg/controller/machine/machine_controller_phases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ func TestReconcilePhase(t *testing.T) {
Spec: v1alpha2.MachineSpec{
Bootstrap: v1alpha2.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha1",
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha2",
Kind: "BootstrapConfig",
Name: "bootstrap-config1",
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand All @@ -69,7 +69,7 @@ func TestReconcilePhase(t *testing.T) {
name: "new machine, expect pending",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -79,7 +79,7 @@ func TestReconcilePhase(t *testing.T) {
},
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand All @@ -97,7 +97,7 @@ func TestReconcilePhase(t *testing.T) {
name: "ready bootstrap, expect provisioning",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -110,7 +110,7 @@ func TestReconcilePhase(t *testing.T) {
},
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand All @@ -128,7 +128,7 @@ func TestReconcilePhase(t *testing.T) {
name: "ready bootstrap and infra, expect provisioned",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -141,7 +141,7 @@ func TestReconcilePhase(t *testing.T) {
},
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestReconcilePhase(t *testing.T) {
name: "ready bootstrap and infra, expect error with nil addresses",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -187,7 +187,7 @@ func TestReconcilePhase(t *testing.T) {
},
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand Down Expand Up @@ -216,13 +216,13 @@ func TestReconcilePhase(t *testing.T) {
Spec: v1alpha2.MachineSpec{
Bootstrap: v1alpha2.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha1",
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha2",
Kind: "BootstrapConfig",
Name: "bootstrap-config1",
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand All @@ -235,7 +235,7 @@ func TestReconcilePhase(t *testing.T) {
},
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -248,7 +248,7 @@ func TestReconcilePhase(t *testing.T) {
},
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand Down Expand Up @@ -283,13 +283,13 @@ func TestReconcilePhase(t *testing.T) {
Spec: v1alpha2.MachineSpec{
Bootstrap: v1alpha2.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha1",
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha2",
Kind: "BootstrapConfig",
Name: "bootstrap-config1",
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand All @@ -302,7 +302,7 @@ func TestReconcilePhase(t *testing.T) {
},
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -315,7 +315,7 @@ func TestReconcilePhase(t *testing.T) {
},
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand Down Expand Up @@ -394,7 +394,7 @@ func TestReconcileBootstrap(t *testing.T) {
Spec: v1alpha2.MachineSpec{
Bootstrap: v1alpha2.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha1",
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha2",
Kind: "BootstrapConfig",
Name: "bootstrap-config1",
},
Expand All @@ -413,7 +413,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "new machine, bootstrap config ready with data",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -435,7 +435,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "new machine, bootstrap config ready with no data",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -455,7 +455,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "new machine, bootstrap config not ready",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -472,7 +472,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "new machine, bootstrap config is not found",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "wrong-namespace",
Expand All @@ -489,7 +489,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "new machine, no bootstrap config or data",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "wrong-namespace",
Expand All @@ -503,7 +503,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "existing machine, bootstrap data should not change",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -522,7 +522,7 @@ func TestReconcileBootstrap(t *testing.T) {
Spec: v1alpha2.MachineSpec{
Bootstrap: v1alpha2.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha1",
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha2",
Kind: "BootstrapConfig",
Name: "bootstrap-config1",
},
Expand All @@ -543,7 +543,7 @@ func TestReconcileBootstrap(t *testing.T) {
name: "existing machine, bootstrap provider is to not ready",
bootstrapConfig: map[string]interface{}{
"kind": "BootstrapConfig",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha1",
"apiVersion": "bootstrap.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "bootstrap-config1",
"namespace": "default",
Expand All @@ -562,7 +562,7 @@ func TestReconcileBootstrap(t *testing.T) {
Spec: v1alpha2.MachineSpec{
Bootstrap: v1alpha2.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha1",
APIVersion: "bootstrap.cluster.x-k8s.io/v1alpha2",
Kind: "BootstrapConfig",
Name: "bootstrap-config1",
},
Expand Down Expand Up @@ -621,7 +621,7 @@ func TestReconcileInfrastructure(t *testing.T) {
},
Spec: v1alpha2.MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand All @@ -640,7 +640,7 @@ func TestReconcileInfrastructure(t *testing.T) {
name: "new machine, infrastructure config ready",
infraConfig: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/machine/machine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestReconcileRequest(t *testing.T) {
infraConfig := unstructured.Unstructured{
Object: map[string]interface{}{
"kind": "InfrastructureConfig",
"apiVersion": "infra.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{
"name": "infra-config1",
"namespace": "default",
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestReconcileRequest(t *testing.T) {
},
Spec: v1alpha2.MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand All @@ -90,7 +90,7 @@ func TestReconcileRequest(t *testing.T) {
},
Spec: v1alpha2.MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand All @@ -110,7 +110,7 @@ func TestReconcileRequest(t *testing.T) {
},
Spec: v1alpha2.MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infra.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureConfig",
Name: "infra-config1",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/machine/machine_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestReconcile(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "default"},
Spec: clusterv1.MachineSpec{
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.clusters.k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureRef",
Name: "machine-infrastructure",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestReconcile(t *testing.T) {
Spec: clusterv1.MachineSpec{
Version: &version,
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha1",
APIVersion: "infrastructure.cluster.x-k8s.io/v1alpha2",
Kind: "InfrastructureMachineTemplate",
Name: "foo-template",
},
Expand All @@ -90,7 +90,7 @@ func TestReconcile(t *testing.T) {
// Create infrastructure template resource.
infraResource := map[string]interface{}{
"kind": "InfrastructureMachine",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha1",
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha2",
"metadata": map[string]interface{}{},
"spec": map[string]interface{}{
"size": "3xlarge",
Expand All @@ -104,7 +104,7 @@ func TestReconcile(t *testing.T) {
},
}
infraTmpl.SetKind("InfrastructureMachineTemplate")
infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1alpha1")
infraTmpl.SetAPIVersion("infrastructure.cluster.x-k8s.io/v1alpha2")
infraTmpl.SetName("foo-template")
infraTmpl.SetNamespace("default")
Expect(c.Create(ctx, infraTmpl)).To(BeNil())
Expand Down
Loading

0 comments on commit 6afa7ae

Please sign in to comment.