Add plugin's support for provider
Co-authored-by: Julien Salleyron <julien@traefik.io>
This commit is contained in:
parent
de2437cfec
commit
63ef0f1cee
24 changed files with 928 additions and 116 deletions
|
@ -212,6 +212,10 @@ func getProviders(conf static.Configuration) []string {
|
|||
if !field.IsNil() {
|
||||
providers = append(providers, v.Type().Field(i).Name)
|
||||
}
|
||||
} else if field.Kind() == reflect.Map && field.Type().Elem() == reflect.TypeOf(static.PluginConf{}) {
|
||||
for _, value := range field.MapKeys() {
|
||||
providers = append(providers, "plugin-"+value.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -217,6 +217,9 @@ func TestHandler_Overview(t *testing.T) {
|
|||
KubernetesCRD: &crd.Provider{},
|
||||
Rest: &rest.Provider{},
|
||||
Rancher: &rancher.Provider{},
|
||||
Plugin: map[string]static.PluginConf{
|
||||
"test": map[string]interface{}{},
|
||||
},
|
||||
},
|
||||
},
|
||||
confDyn: runtime.Configuration{},
|
||||
|
|
3
pkg/api/testdata/overview-providers.json
vendored
3
pkg/api/testdata/overview-providers.json
vendored
|
@ -28,7 +28,8 @@
|
|||
"KubernetesIngress",
|
||||
"KubernetesCRD",
|
||||
"Rest",
|
||||
"Rancher"
|
||||
"Rancher",
|
||||
"plugin-test"
|
||||
],
|
||||
"tcp": {
|
||||
"routers": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue