Add pointers to the config var extractor
Co-authored-by: David Christofas <dchristofas@owncloud.com> Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
committed by
Ralf Haferkamp
co-authored by
David Christofas
parent
5aa90918c9
commit
0d875d30b7
@@ -37,7 +37,7 @@ tpl := template.Must(template.New("").Parse(string(content)))
|
|||||||
|
|
||||||
m := map[string]interface{}{
|
m := map[string]interface{}{
|
||||||
{{- range $key, $value := .}}
|
{{- range $key, $value := .}}
|
||||||
"{{$value}}": *pkg{{$key}}.DefaultConfig(),
|
"{{$value}}": *pkg{{$key}}.FullDefaultConfig(),
|
||||||
{{- end }}
|
{{- end }}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +77,14 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
|
|||||||
}
|
}
|
||||||
v := fmt.Sprintf("%v", value.Interface())
|
v := fmt.Sprintf("%v", value.Interface())
|
||||||
fields = append(fields, ConfigField{Name: env, DefaultValue: v, Description: desc, Type: value.Type().Name()})
|
fields = append(fields, ConfigField{Name: env, DefaultValue: v, Description: desc, Type: value.Type().Name()})
|
||||||
|
case reflect.Ptr:
|
||||||
|
// PolicySelectors in the Proxy are being skipped atm
|
||||||
|
// they are not configurable via env vars, if that changes
|
||||||
|
// they are probably added to the Sanitize() function
|
||||||
|
// and this should not be an issue then
|
||||||
|
if !value.IsZero() && value.Elem().CanInterface() {
|
||||||
|
fields = append(fields, GetAnnotatedVariables(value.Elem().Interface())...)
|
||||||
|
}
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
fields = append(fields, GetAnnotatedVariables(value.Interface())...)
|
fields = append(fields, GetAnnotatedVariables(value.Interface())...)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user