-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(casbackends): support for s3 compatible endpoints (minio, cloudflare R2, ...) #1055
feat(casbackends): support for s3 compatible endpoints (minio, cloudflare R2, ...) #1055
Conversation
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@@ -46,6 +48,11 @@ func newCASBackendAddAWSS3Cmd() *cobra.Command { | |||
} | |||
} | |||
|
|||
// If there is a custom endpoint we want to store it as part of the fqdn location | |||
if endpoint != "" { |
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.
the reason of storing the endpoint in the location instead of the credentials is so it's shown to the user and can't be updated later on.
// https://developers.cloudflare.com/r2/api/s3/api/ | ||
func (b *Backend) checksumVerificationEnabled() bool { | ||
var enabled = true | ||
if b.customEndpoint != "" && strings.Contains(b.customEndpoint, "r2.cloudflarestorage.com") { |
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.
cloudflare doesn't support this feature.
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
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.
This is great. Thanks for tackling it.
input.ChecksumSHA256 = aws.String(hexSha256ToBinaryB64(resource.Digest)) | ||
} | ||
|
||
if _, err := uploader.UploadWithContext(ctx, input); err != nil { |
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.
on another topic, does this do streaming already?
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.
The underlying library does, the service
layer that servers bytestream does not.
Adds support to registering an S3-compatible CAS-backend by providing a custom endpoint. making it compatible with Minio and Cloudflare R2
AWS S3 support has not changed, except that the region now is optional. Region is optional now because it doesn't make much sense in the concept of other providers.
Minio
Cloudflare R2
note that the location shows the custom endpoint provided during registration
Closes #1053
cc/ @hanygirgis