From 755f77b08a85bba3b2160c82487053b0d2fc8ea2 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 1 Jul 2022 11:03:23 +0200 Subject: [PATCH] support array types --- docs/helpers/environment-variable-docs-generator.go.tmpl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/helpers/environment-variable-docs-generator.go.tmpl b/docs/helpers/environment-variable-docs-generator.go.tmpl index 63dc7e560..af31091ab 100644 --- a/docs/helpers/environment-variable-docs-generator.go.tmpl +++ b/docs/helpers/environment-variable-docs-generator.go.tmpl @@ -77,7 +77,11 @@ func GetAnnotatedVariables(s interface{}) []ConfigField { continue } v := fmt.Sprintf("%v", value.Interface()) - fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "
"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: value.Type().Name()}) + typeName := value.Type().Name() + if typeName == "" { + typeName = value.Type().String() + } + fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "
"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: typeName}) case reflect.Ptr: // PolicySelectors in the Proxy are being skipped atm // they are not configurable via env vars, if that changes