@@ -15,7 +15,7 @@ import (
|
|||||||
{{- end}})
|
{{- end}})
|
||||||
|
|
||||||
type ConfigField struct {
|
type ConfigField struct {
|
||||||
Name string
|
EnvVars []string
|
||||||
DefaultValue string
|
DefaultValue string
|
||||||
Type string
|
Type string
|
||||||
Description string
|
Description string
|
||||||
@@ -86,8 +86,9 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
|
|||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
v := fmt.Sprintf("%v", value.Interface())
|
v := fmt.Sprintf("%v", value.Interface())
|
||||||
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", " +\n"), DefaultValue: v, Description: desc, Type: value.Type().Name()})
|
td := strings.Split(env, ";")
|
||||||
|
fields = append(fields, ConfigField{EnvVars: td, DefaultValue: v, Description: desc, Type: value.Type().Name()})
|
||||||
case reflect.Ptr:
|
case reflect.Ptr:
|
||||||
// PolicySelectors in the Proxy are being skipped atm
|
// PolicySelectors in the Proxy are being skipped atm
|
||||||
// they are not configurable via env vars, if that changes
|
// they are not configurable via env vars, if that changes
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"html"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@@ -76,7 +77,7 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
v := fmt.Sprintf("%v", value.Interface())
|
v := fmt.Sprintf("%v", value.Interface())
|
||||||
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: v, Description: desc, Type: value.Type().Name()})
|
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: value.Type().Name()})
|
||||||
case reflect.Ptr:
|
case reflect.Ptr:
|
||||||
// PolicySelectors in the Proxy are being skipped atm
|
// PolicySelectors in the Proxy are being skipped atm
|
||||||
// they are not configurable via env vars, if that changes
|
// they are not configurable via env vars, if that changes
|
||||||
|
|||||||
Vendored
+4
-1
@@ -8,7 +8,10 @@
|
|||||||
| Description
|
| Description
|
||||||
|
|
||||||
{{- range .Fields}}
|
{{- range .Fields}}
|
||||||
| `{{.Name}}`
|
{{ $numVars := len .EnvVars }}
|
||||||
|
| {{- range $i, $value := .EnvVars }}{{- if $i }} +{{ end }}
|
||||||
|
`{{- $value }}`
|
||||||
|
{{- end }}
|
||||||
| {{.Type}}
|
| {{.Type}}
|
||||||
| {{.DefaultValue}}
|
| {{.DefaultValue}}
|
||||||
| {{.Description}}
|
| {{.Description}}
|
||||||
|
|||||||
Reference in New Issue
Block a user