Duplicate error message, variable collision fix, method doc references (#3568)

dev
Keith Chason 2023-04-19 16:52:34 -04:00 committed by GitHub
parent 978d0bcc23
commit b211d6fa44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -21,11 +21,11 @@ type customTemplateS3Bucket struct {
Location string
}
// download custom templates from s3 bucket
// Download retrieves all custom templates from s3 bucket
func (bk *customTemplateS3Bucket) Download(location string, ctx context.Context) {
downloadPath := filepath.Join(location, CustomS3TemplateDirectory, bk.bucketName)
manager := manager.NewDownloader(bk.s3Client)
s3Manager := manager.NewDownloader(bk.s3Client)
paginator := s3.NewListObjectsV2Paginator(bk.s3Client, &s3.ListObjectsV2Input{
Bucket: &bk.bucketName,
Prefix: &bk.prefix,
@ -38,16 +38,16 @@ func (bk *customTemplateS3Bucket) Download(location string, ctx context.Context)
return
}
for _, obj := range page.Contents {
if err := downloadToFile(manager, downloadPath, bk.bucketName, aws.ToString(obj.Key)); err != nil {
if err := downloadToFile(s3Manager, downloadPath, bk.bucketName, aws.ToString(obj.Key)); err != nil {
gologger.Error().Msgf("error downloading s3 bucket %s %s", bk.bucketName, err)
return
}
}
}
gologger.Info().Msgf("AWS bucket %s successfully cloned successfully at %s", bk.bucketName, downloadPath)
gologger.Info().Msgf("AWS bucket %s was cloned successfully at %s", bk.bucketName, downloadPath)
}
// download custom templates from s3 bucket
// Update download custom templates from s3 bucket
func (bk *customTemplateS3Bucket) Update(location string, ctx context.Context) {
bk.Download(location, ctx)
}