Skip to content

[storage] Swift and S3 driver does not have the same upload behaviour #91

Closed
@EtienneM

Description

@EtienneM

When using the Upload method, on Swift we remove the prefix / (https://github.com/Scalingo/go-utils/blob/master/storage/swift.go#L120):

func (s *Swift) fullPath(path string) string {
	return strings.TrimLeft(s.cfg.Prefix+"/"+path, "/")
}

But we don't do the same with S3. Hence for the same code, when I switch from one driver to another I don't have the same upload behaviour. It's annoying as with s3cmd, here is what I saw:

╰─$ s3cmd ls s3://auditlogs-development                                                                                                     
                       DIR   s3://auditlogs-development//

Then I need to write the following to see my upload:

╰─$ s3cmd ls s3://auditlogs-development//           
                       DIR   s3://auditlogs-development//2019-08-26/

It confused me...

@Soulou Don't you think we should have the same behaviour for both? Do you prefer to remove this behaviour from Swift or add it to S3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions