@@ -119,114 +119,45 @@ func (k *Kubernetes) Params(_ plugins.SecretLoader) (*params.KVs, error) {
119119 if err != nil {
120120 return kvs , err
121121 }
122- if k .BufferSize != "" {
123- kvs .Insert ("Buffer_Size" , k .BufferSize )
124- }
125- if k .KubeURL != "" {
126- kvs .Insert ("Kube_URL" , k .KubeURL )
127- }
128- if k .KubeCAFile != "" {
129- kvs .Insert ("Kube_CA_File" , k .KubeCAFile )
130- }
131- if k .KubeCAPath != "" {
132- kvs .Insert ("Kube_CA_Path" , k .KubeCAPath )
133- }
134- if k .KubeTokenFile != "" {
135- kvs .Insert ("Kube_Token_File" , k .KubeTokenFile )
136- }
137- if k .KubeTagPrefix != "" {
138- kvs .Insert ("Kube_Tag_Prefix" , k .KubeTagPrefix )
139- }
140- if k .MergeLog != nil {
141- kvs .Insert ("Merge_Log" , fmt .Sprint (* k .MergeLog ))
142- }
143- if k .MergeLogKey != "" {
144- kvs .Insert ("Merge_Log_Key" , k .MergeLogKey )
145- }
146- if k .MergeLogTrim != nil {
147- kvs .Insert ("Merge_Log_Trim" , fmt .Sprint (* k .MergeLogTrim ))
148- }
149- if k .MergeParser != "" {
150- kvs .Insert ("Merge_Parser" , k .MergeParser )
151- }
152- if k .KeepLog != nil {
153- kvs .Insert ("Keep_Log" , fmt .Sprint (* k .KeepLog ))
154- }
155- if k .TLSDebug != nil {
156- kvs .Insert ("tls.debug" , fmt .Sprint (* k .TLSDebug ))
157- }
158- if k .TLSVerify != nil {
159- kvs .Insert ("tls.verify" , fmt .Sprint (* k .TLSVerify ))
160- }
161- if k .UseJournal != nil {
162- kvs .Insert ("Use_Journal" , fmt .Sprint (* k .UseJournal ))
163- }
164- if k .CacheUseDockerId != nil {
165- kvs .Insert ("Cache_Use_Docker_Id" , fmt .Sprint (* k .CacheUseDockerId ))
166- }
167- if k .RegexParser != "" {
168- kvs .Insert ("Regex_Parser" , k .RegexParser )
169- }
170- if k .K8SLoggingParser != nil {
171- kvs .Insert ("K8S-Logging.Parser" , fmt .Sprint (* k .K8SLoggingParser ))
172- }
173- if k .K8SLoggingExclude != nil {
174- kvs .Insert ("K8S-Logging.Exclude" , fmt .Sprint (* k .K8SLoggingExclude ))
175- }
176- if k .Labels != nil {
177- kvs .Insert ("Labels" , fmt .Sprint (* k .Labels ))
178- }
179- if k .Annotations != nil {
180- kvs .Insert ("Annotations" , fmt .Sprint (* k .Annotations ))
181- }
182- if k .KubeMetaPreloadCacheDir != "" {
183- kvs .Insert ("Kube_meta_preload_cache_dir" , k .KubeMetaPreloadCacheDir )
184- }
185- if k .DummyMeta != nil {
186- kvs .Insert ("Dummy_Meta" , fmt .Sprint (* k .DummyMeta ))
187- }
188- if k .DNSRetries != nil {
189- kvs .Insert ("DNS_Retries" , fmt .Sprint (* k .DNSRetries ))
190- }
191- if k .DNSWaitTime != nil {
192- kvs .Insert ("DNS_Wait_Time" , fmt .Sprint (* k .DNSWaitTime ))
193- }
194- if k .UseKubelet != nil {
195- kvs .Insert ("Use_Kubelet" , fmt .Sprint (* k .UseKubelet ))
196- }
197- if k .KubeletPort != nil {
198- kvs .Insert ("Kubelet_Port" , fmt .Sprint (* k .KubeletPort ))
199- }
200- if k .KubeletHost != "" {
201- kvs .Insert ("Kubelet_Host" , k .KubeletHost )
202- }
203- if k .KubeMetaCacheTTL != "" {
204- kvs .Insert ("Kube_Meta_Cache_TTL" , k .KubeMetaCacheTTL )
205- }
206- if k .KubeTokenTTL != "" {
207- kvs .Insert ("Kube_Token_TTL" , k .KubeTokenTTL )
208- }
209- if k .KubeTokenCommand != "" {
210- kvs .Insert ("Kube_Token_Command" , fmt .Sprint (k .KubeTokenCommand ))
211- }
212- if k .KubeMetaNamespaceCacheTTL != nil {
213- kvs .Insert ("Kube_Meta_Namespace_Cache_TTL" , fmt .Sprint (* k .KubeMetaNamespaceCacheTTL ))
214- }
215- if k .NamespaceLabels != nil {
216- kvs .Insert ("Namespace_Labels" , fmt .Sprint (* k .NamespaceLabels ))
217- }
218- if k .NamespaceAnnotations != nil {
219- kvs .Insert ("Namespace_Annotations" , fmt .Sprint (* k .NamespaceAnnotations ))
220- }
221- if k .NamespaceMetadataOnly != nil {
222- kvs .Insert ("Namespace_Metadata_Only" , fmt .Sprint (* k .NamespaceMetadataOnly ))
223- }
224- if k .OwnerReferences != nil {
225- kvs .Insert ("Owner_References" , fmt .Sprint (* k .OwnerReferences ))
226- }
227- if k .UseTagForMeta != nil {
228- kvs .Insert ("Use_Tag_For_Meta" , fmt .Sprint (* k .UseTagForMeta ))
229- }
122+
123+ plugins .InsertKVString (kvs , "Buffer_Size" , k .BufferSize )
124+ plugins .InsertKVString (kvs , "Kube_URL" , k .KubeURL )
125+ plugins .InsertKVString (kvs , "Kube_CA_File" , k .KubeCAFile )
126+ plugins .InsertKVString (kvs , "Kube_CA_Path" , k .KubeCAPath )
127+ plugins .InsertKVString (kvs , "Kube_Token_File" , k .KubeTokenFile )
128+ plugins .InsertKVString (kvs , "Kube_Tag_Prefix" , k .KubeTagPrefix )
129+ plugins .InsertKVString (kvs , "Merge_Log_Key" , k .MergeLogKey )
130+ plugins .InsertKVString (kvs , "Merge_Parser" , k .MergeParser )
131+ plugins .InsertKVString (kvs , "Regex_Parser" , k .RegexParser )
132+ plugins .InsertKVString (kvs , "Kube_meta_preload_cache_dir" , k .KubeMetaPreloadCacheDir )
133+ plugins .InsertKVString (kvs , "Kubelet_Host" , k .KubeletHost )
134+ plugins .InsertKVString (kvs , "Kube_Meta_Cache_TTL" , k .KubeMetaCacheTTL )
135+ plugins .InsertKVString (kvs , "Kube_Token_TTL" , k .KubeTokenTTL )
136+ plugins .InsertKVString (kvs , "Kube_Token_Command" , k .KubeTokenCommand )
137+
138+ plugins .InsertKVField (kvs , "Merge_Log" , k .MergeLog )
139+ plugins .InsertKVField (kvs , "Merge_Log_Trim" , k .MergeLogTrim )
140+ plugins .InsertKVField (kvs , "Keep_Log" , k .KeepLog )
141+ plugins .InsertKVField (kvs , "tls.debug" , k .TLSDebug )
142+ plugins .InsertKVField (kvs , "tls.verify" , k .TLSVerify )
143+ plugins .InsertKVField (kvs , "Use_Journal" , k .UseJournal )
144+ plugins .InsertKVField (kvs , "Cache_Use_Docker_Id" , k .CacheUseDockerId )
145+ plugins .InsertKVField (kvs , "K8S-Logging.Parser" , k .K8SLoggingParser )
146+ plugins .InsertKVField (kvs , "K8S-Logging.Exclude" , k .K8SLoggingExclude )
147+ plugins .InsertKVField (kvs , "Labels" , k .Labels )
148+ plugins .InsertKVField (kvs , "Annotations" , k .Annotations )
149+ plugins .InsertKVField (kvs , "Dummy_Meta" , k .DummyMeta )
150+ plugins .InsertKVField (kvs , "DNS_Retries" , k .DNSRetries )
151+ plugins .InsertKVField (kvs , "DNS_Wait_Time" , k .DNSWaitTime )
152+ plugins .InsertKVField (kvs , "Use_Kubelet" , k .UseKubelet )
153+ plugins .InsertKVField (kvs , "Kubelet_Port" , k .KubeletPort )
154+ plugins .InsertKVField (kvs , "Kube_Meta_Namespace_Cache_TTL" , k .KubeMetaNamespaceCacheTTL )
155+ plugins .InsertKVField (kvs , "Namespace_Labels" , k .NamespaceLabels )
156+ plugins .InsertKVField (kvs , "Namespace_Annotations" , k .NamespaceAnnotations )
157+ plugins .InsertKVField (kvs , "Namespace_Metadata_Only" , k .NamespaceMetadataOnly )
158+ plugins .InsertKVField (kvs , "Owner_References" , k .OwnerReferences )
159+ plugins .InsertKVField (kvs , "Use_Tag_For_Meta" , k .UseTagForMeta )
160+
230161 return kvs , nil
231162}
232163
0 commit comments