(ctx cli.Context, resources *cluster2.Resources, istioNamespace string, dryRun bool)
| 210 | } |
| 211 | |
| 212 | func 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. |
| 233 | func getIstioRevisions(resources *cluster2.Resources) []string { |
no test coverage detected
searching dependent graphs…