@@ -212,7 +212,9 @@ func generateClusterName() string {
212
212
213
213
// errorExistsInLog looks for a specific error message in the CAPC controller log files. Because the logs may contain
214
214
// 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.
216
218
func errorExistsInLog (logFolder string , expectedError string ) (bool , error ) {
217
219
expectedErrorFound := errors .New ("expected error found" )
218
220
controllerLogPath := filepath .Join (logFolder , "controllers" , "capc-controller-manager" )
@@ -227,8 +229,7 @@ func errorExistsInLog(logFolder string, expectedError string) (bool, error) {
227
229
logLines := strings .Split (string (log ), "\n " )
228
230
for _ , line := range logLines {
229
231
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 ) {
232
233
Byf ("Found %q error" , expectedError )
233
234
return expectedErrorFound
234
235
}
0 commit comments