Skip to content

Commit d9722e7

Browse files
Merge pull request #19442 from nak3/break-when-config-found
diagnostics: Break a loop when config file found
2 parents 9bbdae4 + 4776e9a commit d9722e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/oc/admin/diagnostics/config.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ func (o DiagnosticsOptions) detectClientConfig() (expected bool, detected bool)
5252
}
5353
}
5454

55-
if o.canOpenConfigFile(path, errmsg) && len(foundPath) == 0 {
55+
if o.canOpenConfigFile(path, errmsg) {
5656
successfulLoad = true
5757
foundPath = path
58+
break
5859
}
5960
}
6061
if len(foundPath) > 0 {

0 commit comments

Comments
 (0)