-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add minio scheme for S3-style storage if you're not using Amazon S3 #118
base: master
Are you sure you want to change the base?
Conversation
log.Fatal().Err(err).Msg("Create S3 Session") | ||
} | ||
// Create an uploader with the session and default options | ||
if len(host) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be simplified the config is the thing that varies based on host info. So something like this could be better...
cfg := aws.Config{LogLevel: aws.LogLevel(aws.LogDebugWithRequestErrors)})}
if host != "" {
cfg.Endpoint = aws.String(host)
}
s, err := session.NewSession(&cfg)
if err != nil {
log.Fatal().Err(err).Msg("Create S3 Session")
}
func parseBucket(bucketURI string) (string, string, error) { | ||
var bucket, key string | ||
func parseBucket(bucketURI string) (string, string, string, error) { | ||
var host, bucket, key string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test should be provided here to make sure we're doing the right thing with minio urls
Would be really nice, if this feature will be finalized and integrated
|
@OllowainT did you manage to upload anything to a non |
@rbjorklin: Yes, as I pointed out, I had to add the three args:
Its just a workaround, but for me its ok for now. You need to add --s3-bucket option with quotes. Unfortunately it also creates the directory in the bucket with quotes... Here the Spec part of my CronJob
Hope this helps |
This PR adds a new scheme for the s3-bucket argument,
minio://
, which allows you to specify a custom endpoint for your s3 connection rather than using the AWS defaults. This allows you to use S3-compatible storage systems such as MinIO.I am an extreme novice at Go programming, so if I've done anything weird here that might break other things, I apologize in advance. I wanted to provide this as a proof of concept to indicate how easy it is to support third-party S3-compatible endpoints.
If this is close to mergable, please feel free to suggest any amendments.