Skip to content

Conversation

Donatien26
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@sathieu sathieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've left a few comments

}

// Create a new K8S Secret to hold the user's accessKey and secretKey
fmt.Println(s3Client.GetConfig().Region)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove debugging code.

userResource.Spec.SecretFieldNameSecretKey: []byte(secretKey),
"s3region": []byte(s3Client.GetConfig().Region),
"s3certificate": []byte(strings.Join(s3Client.GetConfig().CaCertificatesBase64, ",")),
"S3url": []byte(s3Client.GetConfig().S3Url),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s3url to use consistent casing.

)
userResource.Spec.SecretFieldNameSecretKey: []byte(secretKey),
"s3region": []byte(s3Client.GetConfig().Region),
"s3certificate": []byte(strings.Join(s3Client.GetConfig().CaCertificatesBase64, ",")),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe de-base64 ?

assert.Equal(t, "example-user", string(secretCreated.Data["accessKey"]))
assert.GreaterOrEqual(t, len(string(secretCreated.Data["secretKey"])), 20)

fmt.Println(string(secretCreated.Data["s3ConnectionURL"]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove debugging code.

Add asserts instead.

Comment on lines -47 to +49
S3Config.S3Url,
S3Config.Endpoint,
S3Config.Secure,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s3 instance has Url, why this change?

Comment on lines +74 to +75
endpoint string,
isSSL bool,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s3 instance has Url, why this change?

}
s3Config.Secure = isSSL
s3Config.Endpoint = endpoint
s3Logger.Info("region ici : " + s3Config.Region)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove debugging code.

)
userResource.Spec.SecretFieldNameSecretKey: []byte(secretKey),
"s3region": []byte(s3Client.GetConfig().Region),
"s3certificate": []byte(strings.Join(s3Client.GetConfig().CaCertificatesBase64, ",")),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename field to s3CACertificate.

userResource.Spec.AccessKey,
secretKey,
strings.TrimPrefix(s3Client.GetConfig().Endpoint, "https://"),
)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a boolean field s3PathStyleUrl to identify if it's path or virtual-hosted style URL ?
Cf: https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants