@@ -212,7 +212,9 @@ func generateClusterName() string {
212212
213213// errorExistsInLog looks for a specific error message in the CAPC controller log files. Because the logs may contain
214214// entries from previous test runs, or from previous tests in the same run, the function also requires that the log
215- // line contains the namespace and cluster names.
215+ // line contains the namespace. The cluster name is not check because some controllers such as failure domain controller
216+ // prints a different name which is not the cluster name. In the e2e testing, the namespace only is unique enough because
217+ // it is generated randomly per test case.
216218func errorExistsInLog (logFolder string , expectedError string ) (bool , error ) {
217219 expectedErrorFound := errors .New ("expected error found" )
218220 controllerLogPath := filepath .Join (logFolder , "controllers" , "capc-controller-manager" )
@@ -227,8 +229,7 @@ func errorExistsInLog(logFolder string, expectedError string) (bool, error) {
227229 logLines := strings .Split (string (log ), "\n " )
228230 for _ , line := range logLines {
229231 if strings .Contains (line , expectedError ) &&
230- strings .Contains (line , clusterResources .Cluster .Namespace ) &&
231- strings .Contains (line , clusterResources .Cluster .Name ) {
232+ strings .Contains (line , clusterResources .Cluster .Namespace ) {
232233 Byf ("Found %q error" , expectedError )
233234 return expectedErrorFound
234235 }
0 commit comments