MCPcopy
hub / github.com/istio/istio / dumpRevisionsAndVersions

Function dumpRevisionsAndVersions

tools/bug-report/pkg/bugreport/bugreport.go:212–230  ·  view source on GitHub ↗
(ctx cli.Context, resources *cluster2.Resources, istioNamespace string, dryRun bool)

Source from the content-addressed store, hash-verified

210}
211
212func dumpRevisionsAndVersions(ctx cli.Context, resources *cluster2.Resources, istioNamespace string, dryRun bool) {
213 defer logRuntime(time.Now(), "Done getting control plane revisions/versions")
214
215 text := ""
216 text += fmt.Sprintf("CLI version:\n%s\n\n", version.Info.LongForm())
217
218 revisions := getIstioRevisions(resources)
219 istioVersions, proxyVersions := getIstioVersions(ctx, istioNamespace, revisions)
220 text += "✅ The following Istio control plane revisions/versions were found in the cluster:\n"
221 for rev, ver := range istioVersions {
222 text += fmt.Sprintf("Revision %s:\n%s\n\n", rev, ver)
223 }
224 text += "✅ The following proxy revisions/versions were found in the cluster:\n"
225 for rev, ver := range proxyVersions {
226 text += fmt.Sprintf("Revision %s: Versions {%s}\n", rev, strings.Join(ver, ", "))
227 }
228 common.LogAndPrintf("%s", text)
229 writeFile(filepath.Join(archive.OutputRootDir(tempDir), "versions"), text, dryRun)
230}
231
232// getIstioRevisions returns a slice with all Istio revisions detected in the cluster.
233func getIstioRevisions(resources *cluster2.Resources) []string {

Callers 1

runBugReportCommandFunction · 0.85

Calls 8

LogAndPrintfFunction · 0.92
OutputRootDirFunction · 0.92
logRuntimeFunction · 0.85
getIstioRevisionsFunction · 0.85
getIstioVersionsFunction · 0.85
NowMethod · 0.80
LongFormMethod · 0.80
writeFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…