(awsClient *awslib.Client, accessConfig *clusterconfig.AccessConfig, printToStdout bool)
| 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 |
| 1224 | cachedClusterConfigPath := getCachedClusterConfigPath(accessConfig.ClusterName, accessConfig.Region) |
| 1225 | containerConfigPath := fmt.Sprintf("/out/%s", filepath.Base(cachedClusterConfigPath)) |
| 1226 | |
| 1227 | copyFromPaths := []dockerCopyFromPath{ |
| 1228 | { |
| 1229 | containerPath: containerConfigPath, |
| 1230 | localDir: files.Dir(cachedClusterConfigPath), |
| 1231 | }, |
| 1232 | } |
| 1233 | |
| 1234 | if printToStdout { |
| 1235 | fmt.Print("syncing cluster configuration ...\n\n") |
| 1236 | } |
| 1237 | out, exitCode, err := runManagerAccessCommand("/root/refresh.sh "+containerConfigPath, *accessConfig, awsClient, nil, copyFromPaths) |
| 1238 | if err != nil { |
| 1239 | exit.Error(err) |
| 1240 | } |
| 1241 | if exitCode == nil || *exitCode != 0 { |
| 1242 | exit.Error(ErrorClusterRefresh(out)) |
| 1243 | } |
| 1244 | |
| 1245 | refreshedClusterConfig := &clusterconfig.Config{} |
| 1246 | err = readCachedClusterConfigFile(refreshedClusterConfig, cachedClusterConfigPath) |
| 1247 | if err != nil { |
| 1248 | exit.Error(err) |
| 1249 | } |
| 1250 | return *refreshedClusterConfig |
| 1251 | } |
| 1252 | |
| 1253 | func createS3BucketIfNotFound(awsClient *awslib.Client, bucket string, tags map[string]string) error { |
| 1254 | bucketFound, err := awsClient.DoesBucketExist(bucket) |
no test coverage detected