Skip to content
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

fix: rewrite tag nil pointer reference #1232

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/crd/bases/fluentd.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,9 @@ spec:
description: 'Specify https if your Opensearch endpoint
supports SSL (default: http).'
type: string
sslVerify:
description: Optional, Force certificate validation
type: boolean
user:
description: Optional, The login credentials to connect
to Opensearch
Expand Down
22 changes: 12 additions & 10 deletions controllers/fluentbitconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,18 @@ func (r *FluentBitConfigReconciler) generateRewriteTagConfig(
md5.Sum([]byte(cfg.Namespace)),
),
)
if cfg.Spec.Service.EmitterName != "" {
buf.WriteString(fmt.Sprintf(" Emitter_Name %s\n", cfg.Spec.Service.EmitterName))
} else {
buf.WriteString(fmt.Sprintf(" Emitter_Name re_emitted_%x\n", md5.Sum([]byte(cfg.Namespace))))
}
if cfg.Spec.Service.EmitterStorageType != "" {
buf.WriteString(fmt.Sprintf(" Emitter_Storage.type %s\n", cfg.Spec.Service.EmitterStorageType))
}
if cfg.Spec.Service.EmitterMemBufLimit != "" {
buf.WriteString(fmt.Sprintf(" Emitter_Mem_Buf_Limit %s\n", cfg.Spec.Service.EmitterMemBufLimit))
if cfg.Spec.Service != nil {
if cfg.Spec.Service.EmitterName != "" {
buf.WriteString(fmt.Sprintf(" Emitter_Name %s\n", cfg.Spec.Service.EmitterName))
} else {
buf.WriteString(fmt.Sprintf(" Emitter_Name re_emitted_%x\n", md5.Sum([]byte(cfg.Namespace))))
}
if cfg.Spec.Service.EmitterStorageType != "" {
buf.WriteString(fmt.Sprintf(" Emitter_Storage.type %s\n", cfg.Spec.Service.EmitterStorageType))
}
if cfg.Spec.Service.EmitterMemBufLimit != "" {
buf.WriteString(fmt.Sprintf(" Emitter_Mem_Buf_Limit %s\n", cfg.Spec.Service.EmitterMemBufLimit))
}
}
return buf.String()
}
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/fluentd/output/opensearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Opensearch defines the parameters for out_opensearch plugin
| logstashPrefix | LogstashPrefix defines the logstash prefix index name to write events when logstash_format is true (default: logstash). | *string |
| user | Optional, The login credentials to connect to Opensearch | *[plugins.Secret](../secret.md) |
| password | Optional, The login credentials to connect to Opensearch | *[plugins.Secret](../secret.md) |
| sslVerify | Optional, Force certificate validation | *bool |
| sslVerify | Optional, Force certificate validation | *bool |
3 changes: 3 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36042,6 +36042,9 @@ spec:
description: 'Specify https if your Opensearch endpoint
supports SSL (default: http).'
type: string
sslVerify:
description: Optional, Force certificate validation
type: boolean
user:
description: Optional, The login credentials to connect
to Opensearch
Expand Down
Loading