MCPcopy
hub / github.com/istio/istio / getOperatorLogs

Function getOperatorLogs

tools/bug-report/pkg/bugreport/bugreport.go:473–490  ·  view source on GitHub ↗

getOperatorLogs fetches istio-operator logs for the given namespace/pod and writes the output.

(runner *kubectlcmd.Runner, config *config.BugReportConfig, resources *cluster2.Resources,
	namespace, pod string, wg *sync.WaitGroup,
)

Source from the content-addressed store, hash-verified

471
472// getOperatorLogs fetches istio-operator logs for the given namespace/pod and writes the output.
473func getOperatorLogs(runner *kubectlcmd.Runner, config *config.BugReportConfig, resources *cluster2.Resources,
474 namespace, pod string, wg *sync.WaitGroup,
475) {
476 startTime := time.Now()
477 wg.Add(1)
478 log.Infof("Waiting on operator logs for %v/%v", namespace, pod)
479 go func() {
480 defer func() {
481 wg.Done()
482 logRuntime(startTime, "Done getting operator logs for %v/%v", namespace, pod)
483 }()
484
485 clog, _, _, err := getLog(runner, resources, config, namespace, pod, common.OperatorContainerName)
486 appendGlobalErr(err)
487 writeFile(filepath.Join(archive.OperatorPath(tempDir, namespace, pod), "operator.log"), clog, config.DryRun)
488 log.Infof("Done with operator logs for %v/%v", namespace, pod)
489 }()
490}
491
492// getCniLogs fetches Cni logs from istio-cni-node daemonsets inside namespace kube-system and writes the output
493// Runs if a goroutine, with errors reported through gErrors

Callers 1

gatherInfoFunction · 0.85

Calls 9

InfofFunction · 0.92
OperatorPathFunction · 0.92
logRuntimeFunction · 0.85
getLogFunction · 0.85
appendGlobalErrFunction · 0.85
NowMethod · 0.80
DoneMethod · 0.80
writeFileFunction · 0.70
AddMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…