-
Notifications
You must be signed in to change notification settings - Fork 496
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
adding support for publishing bundle to Minio Object Storage (#5395) #5757
base: main
Are you sure you want to change the base?
adding support for publishing bundle to Minio Object Storage (#5395) #5757
Conversation
Thanks for the contribution @Dimss! I'll try to take a look at it this week. |
@Dimss Minio is API compatible with AWS S3 API, so it should be possible to use the existing |
@sorindumitru I think the main question here, should it be a generic S3 publisher or publisher for each provider with it's backend implementation. |
Thank you so much for working on this! :) Its using the minio client, but I think it could work against any s3 server as coded? There are a lot of s3 compatible implementations out there (many storage vendors support it) and they all work with the aws s3 client I believe, or one of the implementations like minio's client. Having one generic s3 driver I think would be preferable to one per storage implementation, as they all essentially work the same. |
Having separate implementations for different platforms may make sense eventually, but I feel that for now it only adds maintenance burden. If someone does end up needing something from this plugin where it makes sense to have it use platform specific APIs, such as platform specific authentication methods, we should look into splitting off that part into a separate plugin. @Dimss, do you need anything from an S3 publisher that is Minio specific? For now, it's probably easiest to just add support for specifying an optional endpoint to the awss3 plugin. |
@sorindumitru ok by me. |
Just endpoint for now I think? if you need to load in a custom ca for talking to minio, it can be done via the system trust bundle. If its actually insecure, not sure there is any advantage to funneling it through the s3 service rather then just using the agents |
@kfox1111 agree. then I'll just add one optional |
@kfox1111, @sorindumitru I applied required changes, pls review. |
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.
Thank you @Dimss for this contribution!
We need to update the documentation of the aws_s3 bundle publisher plugin with the new Endpoint setting, indicating that's an optional setting (not required).
We should also add test coverage for this, making sure to check that the configuration has been properly wired up to the aws config.
Hi @Dimss, I think we’re pretty close to having this merged. Have you had a chance to look at the latest small comments? |
Hey @amartinezfayo yeah, I saw the comments, I'll make it done in coming days. |
@amartinezfayo I've applied required changes, added tests and updated docs. |
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.
LGTM. Thanks! :)
Looks like the DCO needs fixing. |
67a371d
to
a4ad9d1
Compare
@kfox1111 DCO has been added. |
079304f
to
b4829a7
Compare
b4829a7
to
ca83e3f
Compare
options.BaseEndpoint = c.BaseEndpoint | ||
} | ||
} | ||
return s3.NewFromConfig(c, options), 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.
I think NewFromConfig
would end up calling the nil
options in the case that the BaseEndpoint
is not configured. We could have the options have a default of an empty function.
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.
@sorindumitru I do not understand what you mean.
can you pls provide an example.
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 options
variable defaults to the zero value of a function pointer, which is nil
. NewFromConfig
will then try to call that nil
and get a segfault. See for example https://play.golang.com/p/SPZxT29tKjN
We can avoid this by initializing the variable to a function that doesn't do anything.
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.
@sorindumitru, yes you are right.
@amartinezfayo suggested to change it var
comment
I'll revert it back to options := func(options *s3.Options) {}
, is that OK?
@@ -98,6 +110,20 @@ func TestConfigure(t *testing.T) { | |||
expectMsg: "failed to create client: client creation error", | |||
newClientErr: errors.New("client creation error"), | |||
}, | |||
{ | |||
name: "wrong endpoint format", |
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 find the format in the test name a bit confusing because there's a Format
field in the config too. Maybe we can say:
name: "wrong endpoint format", | |
name: "invalid endpoint url", |
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.
Looks like this change didn't get addressed.
go.mod
Outdated
@@ -1,166 +1,161 @@ | |||
module github.com/spiffe/spire | |||
|
|||
go 1.23.4 | |||
go 1.24.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.
This might be some leftover from rebasing, could you clean it up?
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.
@sorindumitru
this looks up to date.. not sure why github show this diff.
in PR, the go.mod have valid go version
7689432
to
593c46a
Compare
…5395) Signed-off-by: Dmitry Kartsev <[email protected]>
593c46a
to
cd225fd
Compare
@@ -2229,4 +2229,4 @@ sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5 | |||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= | |||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= | |||
software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k= | |||
software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= | |||
software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= |
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.
Looks like we still have these new line changes, could you also remove this? The linter is also complaining about them.
As a part of #5395 this PR add support to Minio S3 storage.
The PR does not meant to be merge to main yet.
I do need someone look on the PR and provide initial feedback.
I wanna make sure this functionality is still needed and overall logic does make sense.
if all good, I'll continue to work on it, add tests, etc...