Skip to content

Commit

Permalink
prune inadvertent glog/klog to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
gabemontero committed Jun 6, 2019
1 parent b95a842 commit 38a5207
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ protected OcActionResult run() throws IOException, InterruptedException, Executi
final StringBuffer stderr = new StringBuffer();
ClientCommandRunner runner = new ClientCommandRunner(command, filePath, envVars,
line -> { // got a line from stdout
stdout.append(line).append('\n');
// some of the k8s klog's like the cached_discovery.go V(3) logging ends up in StdOut
// vs. StdErr; so we employ a simple filter to discern and send these to stderr instead
if (line != null && line.contains(".go:")) {
stderr.append(line).append('\n');
} else {
stdout.append(line).append('\n');
}
printToConsole(line);
return false; // don't interrupt `oc`
},
Expand Down

0 comments on commit 38a5207

Please sign in to comment.