Skip to content

Commit 8e9bae2

Browse files
authored
Merge pull request #1232 from cw-Guo/fix/rewrite-tag
fix: rewrite tag nil pointer reference
2 parents cb16289 + c5e306f commit 8e9bae2

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

config/crd/bases/fluentd.fluent.io_outputs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,6 +2146,9 @@ spec:
21462146
description: 'Specify https if your Opensearch endpoint
21472147
supports SSL (default: http).'
21482148
type: string
2149+
sslVerify:
2150+
description: Optional, Force certificate validation
2151+
type: boolean
21492152
user:
21502153
description: Optional, The login credentials to connect
21512154
to Opensearch

controllers/fluentbitconfig_controller.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,16 +403,18 @@ func (r *FluentBitConfigReconciler) generateRewriteTagConfig(
403403
md5.Sum([]byte(cfg.Namespace)),
404404
),
405405
)
406-
if cfg.Spec.Service.EmitterName != "" {
407-
buf.WriteString(fmt.Sprintf(" Emitter_Name %s\n", cfg.Spec.Service.EmitterName))
408-
} else {
409-
buf.WriteString(fmt.Sprintf(" Emitter_Name re_emitted_%x\n", md5.Sum([]byte(cfg.Namespace))))
410-
}
411-
if cfg.Spec.Service.EmitterStorageType != "" {
412-
buf.WriteString(fmt.Sprintf(" Emitter_Storage.type %s\n", cfg.Spec.Service.EmitterStorageType))
413-
}
414-
if cfg.Spec.Service.EmitterMemBufLimit != "" {
415-
buf.WriteString(fmt.Sprintf(" Emitter_Mem_Buf_Limit %s\n", cfg.Spec.Service.EmitterMemBufLimit))
406+
if cfg.Spec.Service != nil {
407+
if cfg.Spec.Service.EmitterName != "" {
408+
buf.WriteString(fmt.Sprintf(" Emitter_Name %s\n", cfg.Spec.Service.EmitterName))
409+
} else {
410+
buf.WriteString(fmt.Sprintf(" Emitter_Name re_emitted_%x\n", md5.Sum([]byte(cfg.Namespace))))
411+
}
412+
if cfg.Spec.Service.EmitterStorageType != "" {
413+
buf.WriteString(fmt.Sprintf(" Emitter_Storage.type %s\n", cfg.Spec.Service.EmitterStorageType))
414+
}
415+
if cfg.Spec.Service.EmitterMemBufLimit != "" {
416+
buf.WriteString(fmt.Sprintf(" Emitter_Mem_Buf_Limit %s\n", cfg.Spec.Service.EmitterMemBufLimit))
417+
}
416418
}
417419
return buf.String()
418420
}

docs/plugins/fluentd/output/opensearch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ Opensearch defines the parameters for out_opensearch plugin
1515
| logstashPrefix | LogstashPrefix defines the logstash prefix index name to write events when logstash_format is true (default: logstash). | *string |
1616
| user | Optional, The login credentials to connect to Opensearch | *[plugins.Secret](../secret.md) |
1717
| password | Optional, The login credentials to connect to Opensearch | *[plugins.Secret](../secret.md) |
18-
| sslVerify | Optional, Force certificate validation | *bool |
18+
| sslVerify | Optional, Force certificate validation | *bool |

manifests/setup/fluent-operator-crd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36042,6 +36042,9 @@ spec:
3604236042
description: 'Specify https if your Opensearch endpoint
3604336043
supports SSL (default: http).'
3604436044
type: string
36045+
sslVerify:
36046+
description: Optional, Force certificate validation
36047+
type: boolean
3604536048
user:
3604636049
description: Optional, The login credentials to connect
3604736050
to Opensearch

0 commit comments

Comments
 (0)