(entrypoint string, accessConfig clusterconfig.AccessConfig, awsClient *aws.Client, copyToPaths []dockerCopyToPath, copyFromPaths []dockerCopyFromPath)
| 218 | } |
| 219 | |
| 220 | func runManagerAccessCommand(entrypoint string, accessConfig clusterconfig.AccessConfig, awsClient *aws.Client, copyToPaths []dockerCopyToPath, copyFromPaths []dockerCopyFromPath) (string, *int, error) { |
| 221 | containerConfig := &container.Config{ |
| 222 | Image: accessConfig.ImageManager, |
| 223 | Entrypoint: []string{"/bin/bash", "-c"}, |
| 224 | Cmd: []string{entrypoint}, |
| 225 | Tty: true, |
| 226 | AttachStdout: true, |
| 227 | AttachStderr: true, |
| 228 | Env: []string{ |
| 229 | "AWS_ACCESS_KEY_ID=" + *awsClient.AccessKeyID(), |
| 230 | "AWS_SECRET_ACCESS_KEY=" + *awsClient.SecretAccessKey(), |
| 231 | "CORTEX_CLUSTER_NAME=" + accessConfig.ClusterName, |
| 232 | "CORTEX_REGION=" + accessConfig.Region, |
| 233 | "CORTEX_TELEMETRY_DISABLE=" + os.Getenv("CORTEX_TELEMETRY_DISABLE"), |
| 234 | "CORTEX_TELEMETRY_SENTRY_DSN=" + os.Getenv("CORTEX_TELEMETRY_SENTRY_DSN"), |
| 235 | "CORTEX_TELEMETRY_SEGMENT_WRITE_KEY=" + os.Getenv("CORTEX_TELEMETRY_SEGMENT_WRITE_KEY"), |
| 236 | }, |
| 237 | } |
| 238 | |
| 239 | if sessionToken := awsClient.SessionToken(); sessionToken != nil { |
| 240 | containerConfig.Env = append(containerConfig.Env, "AWS_SESSION_TOKEN="+*sessionToken) |
| 241 | } |
| 242 | |
| 243 | output, exitCode, err := runManager(containerConfig, true, copyToPaths, copyFromPaths) |
| 244 | if err != nil { |
| 245 | return "", nil, err |
| 246 | } |
| 247 | |
| 248 | return output, exitCode, nil |
| 249 | } |
no test coverage detected