From afd475aa590380d91b5f7df3299f073917eb9587 Mon Sep 17 00:00:00 2001 From: Sven Rebhan Date: Mon, 2 Jun 2025 17:21:47 +0200 Subject: [PATCH] Adapt templates to generator tool definitions --- telegraf-build/templates/aggregator_plugin.tmpl | 12 ++++++++---- telegraf-build/templates/input_plugin.tmpl | 12 ++++++++---- telegraf-build/templates/output_plugin.tmpl | 12 ++++++++---- telegraf-build/templates/plugin_list_entry.tmpl | 4 +--- telegraf-build/templates/processor_plugin.tmpl | 12 ++++++++---- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/telegraf-build/templates/aggregator_plugin.tmpl b/telegraf-build/templates/aggregator_plugin.tmpl index 6dbd5eed4..67cc2206a 100644 --- a/telegraf-build/templates/aggregator_plugin.tmpl +++ b/telegraf-build/templates/aggregator_plugin.tmpl @@ -6,10 +6,14 @@ menu: name: {{.Name}} identifier: aggregator-{{.ID}} tags: [{{.Name}}, "aggregator-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}] -{{if .Introduced}}introduced: "{{.Introduced}}"{{end}} -{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}} -{{if .Removal}}removal: "{{.Removal}}"{{end}} -{{if .OS}}os_support: "{{.OS}}"{{end}} +introduced: "{{.Introduced}}" +{{- with .Deprecated}} +deprecated: {{.}} +{{- end}} +{{- with .Removal}} +removal: {{.}} +{{- end}} +os_support: "{{.OSTags | join ", "}}" related: - /telegraf/v1/configure_plugins/ - {{.URL}}, {{.Name}} Plugin Source diff --git a/telegraf-build/templates/input_plugin.tmpl b/telegraf-build/templates/input_plugin.tmpl index b93a2f4df..103063d9c 100644 --- a/telegraf-build/templates/input_plugin.tmpl +++ b/telegraf-build/templates/input_plugin.tmpl @@ -6,10 +6,14 @@ menu: name: {{.Name}} identifier: input-{{.ID}} tags: [{{.Name}}, "input-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}] -{{if .Introduced}}introduced: "{{.Introduced}}"{{end}} -{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}} -{{if .Removal}}removal: "{{.Removal}}"{{end}} -{{if .OS}}os_support: "{{.OS}}"{{end}} +introduced: "{{.Introduced}}" +{{- with .Deprecated}} +deprecated: {{.}} +{{- end}} +{{- with .Removal}} +removal: {{.}} +{{- end}} +os_support: "{{.OSTags | join ", "}}" related: - /telegraf/v1/configure_plugins/ - {{.URL}}, {{.Name}} Plugin Source diff --git a/telegraf-build/templates/output_plugin.tmpl b/telegraf-build/templates/output_plugin.tmpl index bc87cbf0f..7334ae9b1 100644 --- a/telegraf-build/templates/output_plugin.tmpl +++ b/telegraf-build/templates/output_plugin.tmpl @@ -6,10 +6,14 @@ menu: name: {{.Name}} identifier: output-{{.ID}} tags: [{{.Name}}, "output-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}] -{{if .Introduced}}introduced: "{{.Introduced}}"{{end}} -{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}} -{{if .Removal}}removal: "{{.Removal}}"{{end}} -{{if .OS}}os_support: "{{.OS}}"{{end}} +introduced: "{{.Introduced}}" +{{- with .Deprecated}} +deprecated: {{.}} +{{- end}} +{{- with .Removal}} +removal: {{.}} +{{- end}} +os_support: "{{.OSTags | join ", "}}" related: - /telegraf/v1/configure_plugins/ - {{.URL}}, {{.Name}} Plugin Source diff --git a/telegraf-build/templates/plugin_list_entry.tmpl b/telegraf-build/templates/plugin_list_entry.tmpl index 3f342d968..ccdb6b3ca 100644 --- a/telegraf-build/templates/plugin_list_entry.tmpl +++ b/telegraf-build/templates/plugin_list_entry.tmpl @@ -9,7 +9,5 @@ {{- with .Removal }} removal: {{ . }} {{- end }} -{{ with .OS }} - os_support: {{ . }} -{{- end }} + os_support: [{{ .OSTags | join ", " }}] tags: [{{ .Tags | join ", " }}] diff --git a/telegraf-build/templates/processor_plugin.tmpl b/telegraf-build/templates/processor_plugin.tmpl index c74d32bb4..1b7b6a38b 100644 --- a/telegraf-build/templates/processor_plugin.tmpl +++ b/telegraf-build/templates/processor_plugin.tmpl @@ -6,10 +6,14 @@ menu: name: {{.Name}} identifier: processor-{{.ID}} tags: [{{.Name}}, "processor-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}] -{{if .Introduced}}introduced: "{{.Introduced}}"{{end}} -{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}} -{{if .Removal}}removal: "{{.Removal}}"{{end}} -{{if .OS}}os_support: "{{.OS}}"{{end}} +introduced: "{{.Introduced}}" +{{- with .Deprecated}} +deprecated: {{.}} +{{- end}} +{{- with .Removal}} +removal: {{.}} +{{- end}} +os_support: "{{.OSTags | join ", "}}" related: - /telegraf/v1/configure_plugins/ - {{.URL}}, {{.Name}} Plugin Source