@@ -737,17 +737,13 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
737737 })
738738
739739 It ("updateClusterSummaries creates ClusterSummary for each matching CAPI Cluster" , func () {
740- cpMachine := & clusterv1.Machine {
741- ObjectMeta : metav1.ObjectMeta {
742- Namespace : matchingCluster .Namespace ,
743- Name : matchingCluster .Name ,
744- Labels : map [string ]string {
745- clusterv1 .ClusterNameLabel : matchingCluster .Name ,
746- clusterv1 .MachineControlPlaneLabel : "ok" ,
747- },
740+ matchingCluster .Status .Conditions = []clusterv1.Condition {
741+ {
742+ Type : clusterv1 .ControlPlaneInitializedCondition ,
743+ Status : corev1 .ConditionTrue ,
748744 },
749745 }
750- cpMachine .Status .SetTypedPhase ( clusterv1 . MachinePhaseRunning )
746+ nonMatchingCluster .Status .Conditions = matchingCluster . Status . Conditions
751747
752748 clusterProfile .Status .MatchingClusterRefs = []corev1.ObjectReference {
753749 {
@@ -761,7 +757,6 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
761757 clusterProfile ,
762758 nonMatchingCluster ,
763759 matchingCluster ,
764- cpMachine ,
765760 }
766761
767762 c := fake .NewClientBuilder ().WithScheme (scheme ).WithStatusSubresource (initObjects ... ).WithObjects (initObjects ... ).Build ()
@@ -795,17 +790,12 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
795790 })
796791
797792 It ("updateClusterSummaries updates existing ClusterSummary for each matching CAPI Cluster" , func () {
798- cpMachine := & clusterv1.Machine {
799- ObjectMeta : metav1.ObjectMeta {
800- Namespace : matchingCluster .Namespace ,
801- Name : matchingCluster .Name ,
802- Labels : map [string ]string {
803- clusterv1 .ClusterNameLabel : matchingCluster .Name ,
804- clusterv1 .MachineControlPlaneLabel : "ok" ,
805- },
793+ matchingCluster .Status .Conditions = []clusterv1.Condition {
794+ {
795+ Type : clusterv1 .ControlPlaneInitializedCondition ,
796+ Status : corev1 .ConditionTrue ,
806797 },
807798 }
808- cpMachine .Status .SetTypedPhase (clusterv1 .MachinePhaseRunning )
809799
810800 clusterProfile .Status .MatchingClusterRefs = []corev1.ObjectReference {
811801 {
@@ -853,7 +843,6 @@ var _ = Describe("ClusterProfile: Reconciler", func() {
853843 nonMatchingCluster ,
854844 matchingCluster ,
855845 clusterSummary ,
856- cpMachine ,
857846 }
858847
859848 c := fake .NewClientBuilder ().WithScheme (scheme ).WithStatusSubresource (initObjects ... ).WithObjects (initObjects ... ).Build ()
0 commit comments