1
0
Fork 0

Add plugin's support for provider

Co-authored-by: Julien Salleyron <julien@traefik.io>
This commit is contained in:
Ludovic Fernandez 2021-05-11 16:14:10 +02:00 committed by GitHub
parent de2437cfec
commit 63ef0f1cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 928 additions and 116 deletions

View file

@ -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())
}
}
}

View file

@ -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{},

View file

@ -28,7 +28,8 @@
"KubernetesIngress",
"KubernetesCRD",
"Rest",
"Rancher"
"Rancher",
"plugin-test"
],
"tcp": {
"routers": {