Skip to content

Commit

Permalink
Add Profile field for Fluent bit S3 output (#1127)
Browse files Browse the repository at this point in the history
* Add Profile field for Fluent bit cluster output

Signed-off-by: Jeff Evans <jevans@confluent.io>

* Update apis/fluentbit/v1alpha2/plugins/output/s3_types.go

Signed-off-by: Benjamin Huo <huobj@qq.com>

---------

Signed-off-by: Jeff Evans <jevans@confluent.io>
Signed-off-by: Benjamin Huo <huobj@qq.com>
Co-authored-by: Benjamin Huo <huobj@qq.com>
  • Loading branch information
jeff303 and benjaminhuo committed Apr 16, 2024
1 parent bc33e7f commit c35993f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apis/fluentbit/v1alpha2/plugins/output/s3_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ type S3 struct {
// Integer value to set the maximum number of retries allowed.
RetryLimit *int32 `json:"RetryLimit,omitempty"`
// Specify an external ID for the STS API, can be used with the role_arn parameter if your role requires an external ID.
ExternalId string `json:"ExternalId,omitempty"`
ExternalId string `json:"ExternalId,omitempty"`
// Option to specify an AWS Profile for credentials.
Profile string `json:"Profile,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
}

Expand Down Expand Up @@ -154,6 +156,9 @@ func (o *S3) Params(sl plugins.SecretLoader) (*params.KVs, error) {
if o.ExternalId != "" {
kvs.Insert("external_id", o.ExternalId)
}
if o.Profile != "" {
kvs.Insert("profile", o.Profile)
}
if o.TLS != nil {
tls, err := o.TLS.Params(sl)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/s3_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func TestOutput_S3_Params(t *testing.T) {
StorageClass: "storage_class",
RetryLimit: ptrAny(int32(1)),
ExternalId: "external_id",
Profile: "my-profile",
}

expected := params.NewKVs()
Expand Down Expand Up @@ -69,6 +70,7 @@ func TestOutput_S3_Params(t *testing.T) {
expected.Insert("storage_class", "storage_class")
expected.Insert("retry_limit", "1")
expected.Insert("external_id", "external_id")
expected.Insert("profile", "my-profile")

kvs, err := s3.Params(sl)
g.Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit c35993f

Please sign in to comment.