Merge branch 'main' into fix/orderingConsole

main
Raphaël 2021-06-16 10:48:03 +02:00 committed by GitHub
commit 5a23a1b1d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 4 deletions

View File

@ -173,6 +173,15 @@
"contributions": [
"code"
]
},
{
"login": "a-vorobiev",
"name": "Anton Vorobiev",
"avatar_url": "https://avatars.githubusercontent.com/u/197565?v=4",
"profile": "https://vorobiev.cloud",
"contributions": [
"bug"
]
}
]
}

View File

@ -24,6 +24,7 @@ Thank you to all the people who have already contributed to driftctl.
<td align="center"><a href="https://crvx.fr/"><img src="https://avatars.githubusercontent.com/u/16480203?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Raphaël</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=sundowndev" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/vainkop"><img src="https://avatars.githubusercontent.com/u/28118190?v=4?s=80" width="80px;" alt=""/><br /><sub><b>vainkop</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/issues?q=author%3Avainkop" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://remidoreau.com"><img src="https://avatars.githubusercontent.com/u/32459935?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Rémi Doreau</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/commits?author=ayshiff" title="Code">💻</a></td>
<td align="center"><a href="https://vorobiev.cloud"><img src="https://avatars.githubusercontent.com/u/197565?v=4?s=80" width="80px;" alt=""/><br /><sub><b>Anton Vorobiev</b></sub></a><br /><a href="https://github.com/cloudskiff/driftctl/issues?q=author%3Aa-vorobiev" title="Bug reports">🐛</a></td>
</tr>
</table>

View File

@ -25,7 +25,7 @@ func HasMeta(path string) bool {
func splitDirPattern(p string) (base string, pattern string) {
base = p
sep := string(os.PathSeparator)
sep := "/"
for {
if !HasMeta(base) {

View File

@ -2,7 +2,6 @@ package enumerator
import (
"fmt"
"path/filepath"
"strings"
"github.com/aws/aws-sdk-go/aws"
@ -44,7 +43,10 @@ func (s *S3Enumerator) Enumerate() ([]string, error) {
bucket := bucketPath[0]
prefix, pattern := GlobS3(strings.Join(bucketPath[1:], "/"))
fullPattern := filepath.Join(prefix, pattern)
fullPattern := prefix
if pattern != "" {
fullPattern = strings.Join([]string{prefix, pattern}, "/")
}
files := make([]string, 0)
input := &s3.ListObjectsV2Input{
@ -56,7 +58,7 @@ func (s *S3Enumerator) Enumerate() ([]string, error) {
if aws.Int64Value(metadata.Size) > 0 {
key := *metadata.Key
if match, _ := doublestar.Match(fullPattern, key); match {
files = append(files, filepath.Join(bucket, key))
files = append(files, strings.Join([]string{bucket, key}, "/"))
}
}
}

View File

@ -15,5 +15,6 @@ func initAwsS3BucketMetaData(resourceSchemaRepository resource.SchemaRepositoryI
resourceSchemaRepository.SetNormalizeFunc(AwsS3BucketResourceType, func(res *resource.AbstractResource) {
val := res.Attrs
val.SafeDelete([]string{"force_destroy"})
val.SafeDelete([]string{"bucket_prefix"})
})
}