Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <[email protected]>
  • Loading branch information
Danil-Grigorev committed Nov 1, 2024
1 parent a41b03c commit d970a70
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions exp/internal/controllers/machinepool_controller_phases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ func TestReconcileMachinePoolPhases(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: builder.InfrastructureGroupVersion.String(),
Kind: builder.TestInfrastructureMachineTemplateKind,
Name: "infra-config1",
Namespace: metav1.NamespaceDefault,
},
},
},
Expand Down Expand Up @@ -795,6 +797,7 @@ func TestReconcileMachinePoolBootstrap(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
},
Expand Down Expand Up @@ -936,6 +939,7 @@ func TestReconcileMachinePoolBootstrap(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
DataSecretName: ptr.To("data"),
},
Expand Down Expand Up @@ -1019,6 +1023,7 @@ func TestReconcileMachinePoolBootstrap(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
DataSecretName: ptr.To("data"),
},
Expand Down Expand Up @@ -1093,6 +1098,7 @@ func TestReconcileMachinePoolInfrastructure(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
InfrastructureRef: corev1.ObjectReference{
Expand Down Expand Up @@ -1172,6 +1178,7 @@ func TestReconcileMachinePoolInfrastructure(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
InfrastructureRef: corev1.ObjectReference{
Expand Down Expand Up @@ -1268,6 +1275,7 @@ func TestReconcileMachinePoolInfrastructure(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
InfrastructureRef: corev1.ObjectReference{
Expand Down Expand Up @@ -1775,12 +1783,14 @@ func TestReconcileMachinePoolScaleToFromZero(t *testing.T) {
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.TestBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: ns.Name,
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: builder.InfrastructureGroupVersion.String(),
Kind: builder.TestInfrastructureMachineTemplateKind,
Name: "infra-config1",
Namespace: ns.Name,
},
},
},
Expand Down Expand Up @@ -2196,12 +2206,14 @@ func getMachinePool(replicas int, mpName, clusterName, nsName string) expv1.Mach
APIVersion: builder.BootstrapGroupVersion.String(),
Kind: builder.GenericBootstrapConfigKind,
Name: "bootstrap-config1",
Namespace: nsName,
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: builder.InfrastructureGroupVersion.String(),
Kind: builder.GenericInfrastructureMachineKind,
Name: "infra-config1",
Namespace: nsName,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,14 @@ func TestNodeLabelSync(t *testing.T) {
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "GenericInfrastructureMachine",
Name: "infra-config1",
Namespace: metav1.NamespaceDefault,
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestReconcileBootstrap(t *testing.T) {
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
},
Expand Down Expand Up @@ -217,6 +218,7 @@ func TestReconcileBootstrap(t *testing.T) {
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
DataSecretName: ptr.To("secret-data"),
},
Expand Down Expand Up @@ -261,6 +263,7 @@ func TestReconcileBootstrap(t *testing.T) {
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
DataSecretName: ptr.To("secret-data"),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func TestSetBootstrapReadyCondition(t *testing.T) {
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
},
Expand Down Expand Up @@ -1747,12 +1748,14 @@ func TestReconcileMachinePhases(t *testing.T) {
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
InfrastructureRef: corev1.ObjectReference{
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "GenericInfrastructureMachine",
Name: "infra-config1",
Namespace: metav1.NamespaceDefault,
},
},
}
Expand Down
2 changes: 2 additions & 0 deletions internal/controllers/machine/machine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1036,12 +1036,14 @@ func TestMachineConditions(t *testing.T) {
APIVersion: "infrastructure.cluster.x-k8s.io/v1beta1",
Kind: "GenericInfrastructureMachine",
Name: "infra-config1",
Namespace: metav1.NamespaceDefault,
},
Bootstrap: clusterv1.Bootstrap{
ConfigRef: &corev1.ObjectReference{
APIVersion: "bootstrap.cluster.x-k8s.io/v1beta1",
Kind: "GenericBootstrapConfig",
Name: "bootstrap-config1",
Namespace: metav1.NamespaceDefault,
},
},
},
Expand Down

0 comments on commit d970a70

Please sign in to comment.