(awsClient *awslib.Client, accessConfig *clusterconfig.AccessConfig)
| 1196 | } |
| 1197 | |
| 1198 | func cmdDebug(awsClient *awslib.Client, accessConfig *clusterconfig.AccessConfig) { |
| 1199 | // note: if modifying this string, also change it in files.IgnoreCortexDebug() |
| 1200 | debugFileName := fmt.Sprintf("cortex-debug-%s.tgz", time.Now().UTC().Format("2006-01-02-15-04-05")) |
| 1201 | |
| 1202 | containerDebugPath := "/out/" + debugFileName |
| 1203 | copyFromPaths := []dockerCopyFromPath{ |
| 1204 | { |
| 1205 | containerPath: containerDebugPath, |
| 1206 | localDir: _cwd, |
| 1207 | }, |
| 1208 | } |
| 1209 | |
| 1210 | out, exitCode, err := runManagerAccessCommand("/root/debug.sh "+containerDebugPath, *accessConfig, awsClient, nil, copyFromPaths) |
| 1211 | if err != nil { |
| 1212 | exit.Error(err) |
| 1213 | } |
| 1214 | if exitCode == nil || *exitCode != 0 { |
| 1215 | exit.Error(ErrorClusterDebug(out)) |
| 1216 | } |
| 1217 | |
| 1218 | fmt.Println("saved cluster info to ./" + debugFileName) |
| 1219 | return |
| 1220 | } |
| 1221 | |
| 1222 | func refreshCachedClusterConfig(awsClient *awslib.Client, accessConfig *clusterconfig.AccessConfig, printToStdout bool) clusterconfig.Config { |
| 1223 | // add empty file if cached cluster doesn't exist so that the file output by manager container maintains current user permissions |
no test coverage detected