Skip to content

Commit d64b32a

Browse files
committed
UPSTREAM: <carry>: openshift: Remove old test functions
These are now covered by TestControllerNodeGroupForNodeLookup
1 parent b773ea7 commit d64b32a

File tree

1 file changed

+0
-172
lines changed

1 file changed

+0
-172
lines changed

cluster-autoscaler/cloudprovider/openshiftmachineapi/machineapi_controller_test.go

Lines changed: 0 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -636,178 +636,6 @@ func TestControllerNodeGroupForNodeWithMissingMachineOwner(t *testing.T) {
636636
}
637637
}
638638

639-
func TestControllerNodeGroupForNodeSuccessFromMachineSet(t *testing.T) {
640-
node := &apiv1.Node{
641-
TypeMeta: v1.TypeMeta{
642-
Kind: "Node",
643-
},
644-
ObjectMeta: v1.ObjectMeta{
645-
Name: "node",
646-
Annotations: map[string]string{
647-
machineAnnotationKey: "test-namespace/machine",
648-
},
649-
},
650-
Spec: apiv1.NodeSpec{
651-
ProviderID: "provider-id",
652-
},
653-
}
654-
655-
machineSet := &v1beta1.MachineSet{
656-
TypeMeta: v1.TypeMeta{
657-
Kind: "MachineSet",
658-
},
659-
ObjectMeta: v1.ObjectMeta{
660-
Name: "machineset",
661-
Namespace: "test-namespace",
662-
UID: uuid1,
663-
},
664-
}
665-
666-
machine := &v1beta1.Machine{
667-
TypeMeta: v1.TypeMeta{
668-
Kind: "Machine",
669-
},
670-
ObjectMeta: v1.ObjectMeta{
671-
Name: "machine",
672-
Namespace: "test-namespace",
673-
OwnerReferences: []v1.OwnerReference{{
674-
Name: machineSet.Name,
675-
Kind: machineSet.Kind,
676-
UID: machineSet.UID,
677-
}},
678-
},
679-
}
680-
681-
controller, stop := mustCreateTestController(t, testControllerConfig{
682-
nodeObjects: []runtime.Object{
683-
node,
684-
},
685-
machineObjects: []runtime.Object{
686-
machine,
687-
machineSet,
688-
},
689-
})
690-
defer stop()
691-
692-
ng, err := controller.nodeGroupForNode(&apiv1.Node{
693-
TypeMeta: v1.TypeMeta{
694-
Kind: "Node",
695-
},
696-
ObjectMeta: v1.ObjectMeta{
697-
Name: "node",
698-
},
699-
Spec: apiv1.NodeSpec{
700-
ProviderID: "provider-id",
701-
},
702-
})
703-
704-
if err != nil {
705-
t.Fatal("expected no error")
706-
}
707-
708-
if ng == nil {
709-
t.Fatal("expected a nodegroup")
710-
}
711-
712-
expected := path.Join(machineSet.Namespace, machineSet.Name)
713-
if actual := ng.Id(); actual != expected {
714-
t.Errorf("expected %q, got %q", expected, actual)
715-
}
716-
}
717-
718-
func TestControllerNodeGroupForNodeSuccessFromMachineDeployment(t *testing.T) {
719-
node := &apiv1.Node{
720-
TypeMeta: v1.TypeMeta{
721-
Kind: "Node",
722-
},
723-
ObjectMeta: v1.ObjectMeta{
724-
Name: "node",
725-
Annotations: map[string]string{
726-
machineAnnotationKey: "test-namespace/machine",
727-
},
728-
},
729-
Spec: apiv1.NodeSpec{
730-
ProviderID: "provider-id",
731-
},
732-
}
733-
734-
machineDeployment := &v1beta1.MachineDeployment{
735-
TypeMeta: v1.TypeMeta{
736-
Kind: "MachineDeployment",
737-
},
738-
ObjectMeta: v1.ObjectMeta{
739-
Name: "machinedeployment",
740-
Namespace: "test-namespace",
741-
},
742-
}
743-
744-
machineSet := &v1beta1.MachineSet{
745-
TypeMeta: v1.TypeMeta{
746-
Kind: "MachineSet",
747-
},
748-
ObjectMeta: v1.ObjectMeta{
749-
Name: "machineset",
750-
Namespace: "test-namespace",
751-
OwnerReferences: []v1.OwnerReference{{
752-
Kind: "MachineDeployment",
753-
Name: machineDeployment.Name,
754-
}},
755-
},
756-
}
757-
758-
machine := &v1beta1.Machine{
759-
TypeMeta: v1.TypeMeta{
760-
Kind: "Machine",
761-
},
762-
ObjectMeta: v1.ObjectMeta{
763-
Name: "machine",
764-
Namespace: "test-namespace",
765-
OwnerReferences: []v1.OwnerReference{{
766-
Name: machineSet.Name,
767-
Kind: machineSet.Kind,
768-
UID: machineSet.UID,
769-
}},
770-
},
771-
}
772-
773-
controller, stop := mustCreateTestController(t, testControllerConfig{
774-
nodeObjects: []runtime.Object{
775-
node,
776-
},
777-
machineObjects: []runtime.Object{
778-
machine,
779-
machineSet,
780-
machineDeployment,
781-
},
782-
})
783-
defer stop()
784-
785-
ng, err := controller.nodeGroupForNode(&apiv1.Node{
786-
TypeMeta: v1.TypeMeta{
787-
Kind: "Node",
788-
},
789-
ObjectMeta: v1.ObjectMeta{
790-
Name: "node",
791-
},
792-
Spec: apiv1.NodeSpec{
793-
ProviderID: "provider-id",
794-
},
795-
})
796-
797-
if err != nil {
798-
t.Fatal("expected no error")
799-
}
800-
801-
if ng == nil {
802-
t.Fatal("expected a nodegroup")
803-
}
804-
805-
expected := path.Join(machineDeployment.Namespace, machineDeployment.Name)
806-
if actual := ng.Id(); actual != expected {
807-
t.Errorf("expected %q, got %q", expected, actual)
808-
}
809-
}
810-
811639
func TestControllerNodeGroupsWithMachineDeployments(t *testing.T) {
812640
machineDeploymentTemplate := &v1beta1.MachineDeployment{
813641
TypeMeta: v1.TypeMeta{

0 commit comments

Comments
 (0)