@@ -815,34 +815,45 @@ func TestPortConflictValidation(t *testing.T) {
815815 assert := assert .New (t )
816816 info := reconcilers.Common {Namespace : "ns" , ClusterInfo : & cluster.Info {}}
817817
818- // Test FLP port conflict
818+ // Test FLP port conflict (only when informers enabled)
819819 cfg := getConfig ()
820820 cfg .Processor .Advanced .Port = ptr .To (int32 (9090 ))
821+ cfg .Processor .Informers = & flowslatest.FlowCollectorInformers {Enabled : ptr .To (true )}
821822 _ , err := newMonolithBuilder (info .NewInstance (image , status.Instance {}), & cfg , & metricslatest.FlowMetricList {}, nil , nil )
822823 assert .Error (err )
823824 assert .Contains (err .Error (), "flowlogs-pipeline port 9090 conflicts with reserved k8scache port" )
824825
825- // Test health port conflict
826+ // Test health port conflict (only when informers enabled)
826827 cfg = getConfig ()
827828 cfg .Processor .Advanced .HealthPort = ptr .To (int32 (9090 ))
829+ cfg .Processor .Informers = & flowslatest.FlowCollectorInformers {Enabled : ptr .To (true )}
828830 _ , err = newMonolithBuilder (info .NewInstance (image , status.Instance {}), & cfg , & metricslatest.FlowMetricList {}, nil , nil )
829831 assert .Error (err )
830832 assert .Contains (err .Error (), "flowlogs-pipeline health port 9090 conflicts with reserved k8scache port" )
831833
832- // Test metrics port conflict
834+ // Test metrics port conflict (only when informers enabled)
833835 cfg = getConfig ()
834836 cfg .Processor .Metrics .Server .Port = ptr .To (int32 (9090 ))
837+ cfg .Processor .Informers = & flowslatest.FlowCollectorInformers {Enabled : ptr .To (true )}
835838 _ , err = newMonolithBuilder (info .NewInstance (image , status.Instance {}), & cfg , & metricslatest.FlowMetricList {}, nil , nil )
836839 assert .Error (err )
837840 assert .Contains (err .Error (), "flowlogs-pipeline metrics port 9090 conflicts with reserved k8scache port" )
838841
839- // Test profile port conflict
842+ // Test profile port conflict (only when informers enabled)
840843 cfg = getConfig ()
841844 cfg .Processor .Advanced .ProfilePort = ptr .To (int32 (9090 ))
845+ cfg .Processor .Informers = & flowslatest.FlowCollectorInformers {Enabled : ptr .To (true )}
842846 _ , err = newMonolithBuilder (info .NewInstance (image , status.Instance {}), & cfg , & metricslatest.FlowMetricList {}, nil , nil )
843847 assert .Error (err )
844848 assert .Contains (err .Error (), "flowlogs-pipeline profile port 9090 conflicts with reserved k8scache port" )
845849
850+ // Test port 9090 is allowed when informers disabled (no conflict)
851+ cfg = getConfig ()
852+ cfg .Processor .Advanced .Port = ptr .To (int32 (9090 ))
853+ cfg .Processor .Informers = nil // or &FlowCollectorInformers{Enabled: false}
854+ _ , err = newMonolithBuilder (info .NewInstance (image , status.Instance {}), & cfg , & metricslatest.FlowMetricList {}, nil , nil )
855+ assert .NoError (err )
856+
846857 // Test valid configuration (no conflicts)
847858 cfg = getConfig ()
848859 _ , err = newMonolithBuilder (info .NewInstance (image , status.Instance {}), & cfg , & metricslatest.FlowMetricList {}, nil , nil )
0 commit comments