From c9da2ceab8d73f1ba7f5ea6eec12e28d513d227e Mon Sep 17 00:00:00 2001 From: Zachary Robichaud Date: Mon, 4 Mar 2024 09:58:00 -0500 Subject: [PATCH] Address PR comments - Fix indentation for example - Update type of verify_ssl to allow user ability to disable Signed-off-by: Zachary Robichaud --- .../outputs/vmware_log_intelligence.md | 26 +++++++++++-------- .../model/output/vmware_log_intelligence.go | 26 +++++++++++-------- .../model/output/zz_generated.deepcopy.go | 5 ++++ 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/docs/configuration/plugins/outputs/vmware_log_intelligence.md b/docs/configuration/plugins/outputs/vmware_log_intelligence.md index 1d443e9f08..623d60f9d1 100644 --- a/docs/configuration/plugins/outputs/vmware_log_intelligence.md +++ b/docs/configuration/plugins/outputs/vmware_log_intelligence.md @@ -13,16 +13,20 @@ For details, see [https://github.com/vmware/fluent-plugin-vmware-log-intelligenc spec: vmwarelogintelligence: endpoint_url: https://data.upgrade.symphony-dev.com/le-mans/v1/streams/ingestion-pipeline-stream - verify_ssl: true - http_compress: false - headers: - Content-Type: "application/json" - Authorization: "Bearer 12345" - structure: simple - buffer: - chunk_limit_records: 300 - flush_interval: 3s - retry_max_times: 3 + verify_ssl: true + http_compress: false + headers: + Content-Type: "application/json" + Authorization: + valueFrom: + secretKeyRef: + name: vmware-log-intelligence-token + key: authorization + structure: simple + buffer: + chunk_limit_records: 300 + flush_interval: 3s + retry_max_times: 3 ``` @@ -54,7 +58,7 @@ Compress http request https://github.com/vmware/fluent-plugin-vmware-log-intelli Required headers for sending logs to VMware Log Intelligence https://github.com/vmware/fluent-plugin-vmware-log-intelligence?tab=readme-ov-file#label-3Cheaders-3E -### verify_ssl (bool, required) {#vmwarelogintelligence-verify_ssl} +### verify_ssl (*bool, required) {#vmwarelogintelligence-verify_ssl} Verify SSL (default: true) https://github.com/vmware/fluent-plugin-vmware-log-intelligence?tab=readme-ov-file#label-verify_ssl diff --git a/pkg/sdk/logging/model/output/vmware_log_intelligence.go b/pkg/sdk/logging/model/output/vmware_log_intelligence.go index 5c7f9b3867..3179845d8e 100644 --- a/pkg/sdk/logging/model/output/vmware_log_intelligence.go +++ b/pkg/sdk/logging/model/output/vmware_log_intelligence.go @@ -31,16 +31,20 @@ For details, see [https://github.com/vmware/fluent-plugin-vmware-log-intelligenc spec: vmwarelogintelligence: endpoint_url: https://data.upgrade.symphony-dev.com/le-mans/v1/streams/ingestion-pipeline-stream - verify_ssl: true - http_compress: false - headers: - Content-Type: "application/json" - Authorization: "Bearer 12345" - structure: simple - buffer: - chunk_limit_records: 300 - flush_interval: 3s - retry_max_times: 3 + verify_ssl: true + http_compress: false + headers: + Content-Type: "application/json" + Authorization: + valueFrom: + secretKeyRef: + name: vmware-log-intelligence-token + key: authorization + structure: simple + buffer: + chunk_limit_records: 300 + flush_interval: 3s + retry_max_times: 3 ``` */ type _docVMWareLogIntelligence interface{} //nolint:deadcode,unused @@ -58,7 +62,7 @@ type VMWareLogIntelligenceOutput struct { // Log Intelligence endpoint to send logs to https://github.com/vmware/fluent-plugin-vmware-log-intelligence?tab=readme-ov-file#label-endpoint_url EndpointURL string `json:"endpoint_url"` // Verify SSL (default: true) https://github.com/vmware/fluent-plugin-vmware-log-intelligence?tab=readme-ov-file#label-verify_ssl - VerifySSL bool `json:"verify_ssl" plugin:"default:true"` + VerifySSL *bool `json:"verify_ssl" plugin:"default:true"` // Compress http request https://github.com/vmware/fluent-plugin-vmware-log-intelligence?tab=readme-ov-file#label-http_compress HTTPCompress *bool `json:"http_compress,omitempty"` // Required headers for sending logs to VMware Log Intelligence https://github.com/vmware/fluent-plugin-vmware-log-intelligence?tab=readme-ov-file#label-3Cheaders-3E diff --git a/pkg/sdk/logging/model/output/zz_generated.deepcopy.go b/pkg/sdk/logging/model/output/zz_generated.deepcopy.go index 97a7398fcd..213aee9968 100644 --- a/pkg/sdk/logging/model/output/zz_generated.deepcopy.go +++ b/pkg/sdk/logging/model/output/zz_generated.deepcopy.go @@ -1743,6 +1743,11 @@ func (in *SyslogOutputConfig) DeepCopy() *SyslogOutputConfig { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VMWareLogIntelligenceOutput) DeepCopyInto(out *VMWareLogIntelligenceOutput) { *out = *in + if in.VerifySSL != nil { + in, out := &in.VerifySSL, &out.VerifySSL + *out = new(bool) + **out = **in + } if in.HTTPCompress != nil { in, out := &in.HTTPCompress, &out.HTTPCompress *out = new(bool)