Skip to content

Commit acbae23

Browse files
v-davegillies-upscalecw-Guo
authored andcommitted
update based on review feedback
Signed-off-by: Dave Gillies <[email protected]>
1 parent 9033fbd commit acbae23

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

apis/fluentd/v1alpha1/plugins/output/s3.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ import "github.com/fluent/fluent-operator/v3/apis/fluentd/v1alpha1/plugins"
55
// S3 defines the parameters for out_s3 output plugin
66
type S3 struct {
77
// The AWS access key id.
8-
AwsKeyId *plugins.Secret `json:"awsKeyId,omitempty"`
8+
AwsKeyId *string `json:"awsKeyId,omitempty"`
99
// The AWS secret key.
10-
AwsSecKey *plugins.Secret `json:"awsSecKey,omitempty"`
10+
AwsSecKey *string `json:"awsSecKey,omitempty"`
11+
// The AWS access key id from Secrets.
12+
AwsKeyIdFromSecret *plugins.Secret `json:"awsKeyIdFromSecret,omitempty"`
13+
// The AWS secret key from Secrets.
14+
AwsSecKeyFromSecret *plugins.Secret `json:"awsSecKeyFromSecret,omitempty"`
1115
// The Amazon S3 bucket name.
1216
S3Bucket *string `json:"s3Bucket,omitempty"`
1317
// The Amazon S3 region name

apis/fluentd/v1alpha1/plugins/output/types.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,19 +677,23 @@ func (o *Output) kafka2Plugin(parent *params.PluginStore, loader plugins.SecretL
677677
}
678678

679679
func (o *Output) s3Plugin(parent *params.PluginStore, loader plugins.SecretLoader) *params.PluginStore {
680-
if o.S3.AwsKeyId != nil {
681-
value, err := loader.LoadSecret(*o.S3.AwsKeyId)
680+
if o.S3.AwsKeyIdFromSecret != nil {
681+
value, err := loader.LoadSecret(*o.S3.AwsKeyIdFromSecret)
682682
if err != nil {
683683
return nil
684684
}
685685
parent.InsertPairs("aws_key_id", value)
686+
} else if o.S3.AwsKeyId != nil {
687+
parent.InsertPairs("aws_key_id", fmt.Sprint(*o.S3.AwsKeyId))
686688
}
687-
if o.S3.AwsSecKey != nil {
688-
value, err := loader.LoadSecret(*o.S3.AwsSecKey)
689+
if o.S3.AwsSecKeyFromSecret != nil {
690+
value, err := loader.LoadSecret(*o.S3.AwsSecKeyFromSecret)
689691
if err != nil {
690692
return nil
691693
}
692694
parent.InsertPairs("aws_sec_key", value)
695+
} else if o.S3.AwsSecKey != nil {
696+
parent.InsertPairs("aws_sec_key", fmt.Sprint(*o.S3.AwsSecKey))
693697
}
694698
if o.S3.S3Bucket != nil {
695699
parent.InsertPairs("s3_bucket", fmt.Sprint(*o.S3.S3Bucket))

docs/plugins/fluentd/output/s3.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ S3 defines the parameters for out_s3 output plugin
55

66
| Field | Description | Scheme |
77
| ----- | ----------- | ------ |
8-
| awsKeyId | | *[plugins.Secret](../secret.md) |
9-
| awsSecKey | | *[plugins.Secret](../secret.md) |
8+
| awsKeyId | The AWS access key id. | *string |
9+
| awsSecKey | The AWS secret key. | *string |
10+
| awsKeyIdFromSecret | The AWS access key id from Secrets. | *[plugins.Secret](../secret.md) |
11+
| awsSecKeyFromSecret | The AWS secret key from Secrets. | *[plugins.Secret](../secret.md) |
1012
| s3Bucket | The Amazon S3 bucket name. | *string |
1113
| s3Region | The Amazon S3 region name | *string |
1214
| s3Endpoint | The endpoint URL (like \"http://localhost:9000/\") | *string |

0 commit comments

Comments
 (0)