nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: banzaicloud/logging-operator
Pull request #383 (2020-02-26 23:26:08)

Fix Kinesis assume role config
| Q               | A
| --------------- | ---
| Bug fix?        | yes
| New feature?    | no
| API breaks?     | no
| Deprecations?   | no
| Related tickets | fixes https://github.com/banzaicloud/logging-operator/issues/378
| License         | Apache 2.0



Patch:
diff --git a/pkg/sdk/model/output/kinesis_stream.go b/pkg/sdk/model/output/kinesis_stream.go
index 365602c7..9365cbf7 100644
--- a/pkg/sdk/model/output/kinesis_stream.go
+++ b/pkg/sdk/model/output/kinesis_stream.go
@@ -103,6 +103,12 @@ type KinesisStreamAssumeRoleCredentials struct {
 	ExternalId string `json:"external_id,omitempty"`
 }
 
+func (o *KinesisStreamAssumeRoleCredentials) ToDirective(secretLoader secret.SecretLoader, id string) (types.Directive, error) {
+	return types.NewFlatDirective(types.PluginMeta{
+		Directive: "assume_role_credentials",
+	}, o, secretLoader)
+}
+
 func (e *KinesisStreamOutputConfig) ToDirective(secretLoader secret.SecretLoader, id string) (types.Directive, error) {
 	pluginType := "kinesis_streams"
 	pluginID := id + "_" + pluginType
@@ -119,6 +125,13 @@ func (e *KinesisStreamOutputConfig) ToDirective(secretLoader secret.SecretLoader
 	} else {
 		kinesis.Params = params
 	}
+	if e.AssumeRoleCredentials != nil {
+		if assumeRoleCredentials, err := e.AssumeRoleCredentials.ToDirective(secretLoader, pluginID); err != nil {
+			return nil, err
+		} else {
+			kinesis.SubDirectives = append(kinesis.SubDirectives, assumeRoleCredentials)
+		}
+	}
 	if e.Buffer != nil {
 		if buffer, err := e.Buffer.ToDirective(secretLoader, pluginID); err != nil {
 			return nil, err


Test patch:
diff --git a/pkg/sdk/model/output/kinesis_stream_test.go b/pkg/sdk/model/output/kinesis_stream_test.go
index 86f0f4ff..b478962d 100644
--- a/pkg/sdk/model/output/kinesis_stream_test.go
+++ b/pkg/sdk/model/output/kinesis_stream_test.go
@@ -28,6 +28,9 @@ stream_name: test
 region: us-east-1
 format:
   type: json
+assume_role_credentials:
+  role_arn: arn:aws:iam::1111/IAM_ROLE_NAME
+  role_session_name: logging-operator
 buffer:
   timekey: 1m
   timekey_wait: 30s
@@ -39,6 +42,10 @@ buffer:
     @id test_kinesis_streams    
     region us-east-1
     stream_name test
+    <assume_role_credentials>
+      role_arn arn:aws:iam::1111/IAM_ROLE_NAME
+      role_session_name logging-operator
+    </assume_role_credentials>
     <buffer tag,time>
       @type file
       path /buffers/test_kinesis_streams.*.buffer
Repository: banzaicloud/logging-operator
Pull request #574 (2020-09-03 23:27:23)

Allow emit_invalid_record_to_error to be set to false
| Q               | A
| --------------- | ---
| Bug fix?        | yes
| Related tickets | Fixes https://github.com/banzaicloud/logging-operator/issues/571
| License         | Apache 2.0


### What's in this PR?

Fix to allow emit_invalid_record_to_error to be set to false


### Checklist

- [x] Code meets the [Developer Guide](https://github.com/banzaicloud/developer-guide)
- [x] User guide and development docs updated (if needed)
- [x] Related Helm chart(s) updated (if needed)




Patch:
diff --git a/pkg/sdk/model/filter/parser.go b/pkg/sdk/model/filter/parser.go
index ad045067..96857fe6 100644
--- a/pkg/sdk/model/filter/parser.go
+++ b/pkg/sdk/model/filter/parser.go
@@ -55,7 +55,7 @@ type ParserConfig struct {
 	// Store parsed values as a hash value in a field.
 	HashValueField string `json:"hash_value_field,omitempty"`
 	// Emit invalid record to @ERROR label. Invalid cases are: key not exist, format is not matched, unexpected error
-	EmitInvalidRecordToError bool `json:"emit_invalid_record_to_error,omitempty"`
+	EmitInvalidRecordToError *bool `json:"emit_invalid_record_to_error,omitempty"`
 	// +docLink:"Parse Section,#parse-section"
 	Parse ParseSection `json:"parse,omitempty"`
 	// Deprecated, use `parse` instead
diff --git a/pkg/sdk/model/filter/zz_generated.deepcopy.go b/pkg/sdk/model/filter/zz_generated.deepcopy.go
index a4252f9e..bd634689 100644
--- a/pkg/sdk/model/filter/zz_generated.deepcopy.go
+++ b/pkg/sdk/model/filter/zz_generated.deepcopy.go
@@ -252,6 +252,11 @@ func (in *ParseSection) DeepCopy() *ParseSection {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *ParserConfig) DeepCopyInto(out *ParserConfig) {
 	*out = *in
+	if in.EmitInvalidRecordToError != nil {
+		in, out := &in.EmitInvalidRecordToError, &out.EmitInvalidRecordToError
+		*out = new(bool)
+		**out = **in
+	}
 	in.Parse.DeepCopyInto(&out.Parse)
 	if in.Parsers != nil {
 		in, out := &in.Parsers, &out.Parsers


Test patch:
diff --git a/pkg/sdk/model/filter/parser_test.go b/pkg/sdk/model/filter/parser_test.go
index 9be0266f..94d14505 100644
--- a/pkg/sdk/model/filter/parser_test.go
+++ b/pkg/sdk/model/filter/parser_test.go
@@ -26,6 +26,7 @@ func TestParser(t *testing.T) {
 	CONFIG := []byte(`
 remove_key_name_field: true
 reserve_data: true
+emit_invalid_record_to_error: false
 parse:
   type: nginx
 `)
@@ -33,6 +34,7 @@ parse:
 <filter **>
   @type parser
   @id test
+  emit_invalid_record_to_error false
   key_name message
   remove_key_name_field true
   reserve_data true
Repository: banzaicloud/logging-operator
Pull request #616 (2020-11-09 11:41:24)

s3output one-eye format keytemplate fix
| Q               | A
| --------------- | ---
| Bug fix?        |yes
| New feature?    | no
| API breaks?     | no
| Deprecations?   | no
| License         | Apache 2.0


### What's in this PR?
unnecessary '/' path delimiter removed

### Checklist
- [x] Code meets the [Developer Guide](https://github.com/banzaicloud/developer-guide)
- [x] User guide and development docs updated (if needed)
- [x] Related Helm chart(s) updated (if needed)



Patch:
diff --git a/pkg/sdk/model/output/s3.go b/pkg/sdk/model/output/s3.go
index 5bcc74bb..7fc09686 100644
--- a/pkg/sdk/model/output/s3.go
+++ b/pkg/sdk/model/output/s3.go
@@ -64,7 +64,7 @@ type _metaS3 interface{}
 const (
 	OneEyeTags            string = "tag,time,$.kubernetes.namespace_name,$.kubernetes.pod_name,$.kubernetes.container_name"
 	OneEyePathTemplate    string = "%v/%%Y/%%m/%%d/${$.kubernetes.namespace_name}/${$.kubernetes.pod_name}/${$.kubernetes.container_name}/"
-	OneEyeObjectKeyFormat string = "%{path}/%H:%M_%{index}.%{file_extension}"
+	OneEyeObjectKeyFormat string = "%{path}%H:%M_%{index}.%{file_extension}"
 )
 
 // +kubebuilder:object:generate=true


Test patch:
diff --git a/pkg/sdk/model/render/fluent_test.go b/pkg/sdk/model/render/fluent_test.go
index 225eb82a..e87412cc 100644
--- a/pkg/sdk/model/render/fluent_test.go
+++ b/pkg/sdk/model/render/fluent_test.go
@@ -539,7 +539,7 @@ func TestRenderS3(t *testing.T) {
                         @id test
 						path one-eye/%Y/%m/%d/${$.kubernetes.namespace_name}/${$.kubernetes.pod_name}/${$.kubernetes.container_name}/
 						s3_bucket oneeye_bucket
-						s3_object_key_format %{path}/%H:%M_%{index}.%{file_extension}
+						s3_object_key_format %{path}%H:%M_%{index}.%{file_extension}
 						<buffer tag,time,$.kubernetes.namespace_name,$.kubernetes.pod_name,$.kubernetes.container_name>
 						@type file
 						path /buffers/test.*.buffer