Add http-wasm plugin support to Traefik
This commit is contained in:
parent
b2bb96390a
commit
6858dbdd07
9 changed files with 338 additions and 119 deletions
|
@ -138,18 +138,28 @@ func checkLocalPluginManifest(descriptor LocalDescriptor) error {
|
|||
var errs *multierror.Error
|
||||
|
||||
switch m.Type {
|
||||
case "middleware", "provider":
|
||||
// noop
|
||||
case typeMiddleware:
|
||||
if m.Runtime != runtimeYaegi && m.Runtime != runtimeWasm && m.Runtime != "" {
|
||||
errs = multierror.Append(errs, fmt.Errorf("%s: unsupported runtime '%q'", descriptor.ModuleName, m.Runtime))
|
||||
}
|
||||
|
||||
case typeProvider:
|
||||
if m.Runtime != runtimeYaegi && m.Runtime != "" {
|
||||
errs = multierror.Append(errs, fmt.Errorf("%s: unsupported runtime '%q'", descriptor.ModuleName, m.Runtime))
|
||||
}
|
||||
|
||||
default:
|
||||
errs = multierror.Append(errs, fmt.Errorf("%s: unsupported type %q", descriptor.ModuleName, m.Type))
|
||||
}
|
||||
|
||||
if m.Import == "" {
|
||||
errs = multierror.Append(errs, fmt.Errorf("%s: missing import", descriptor.ModuleName))
|
||||
}
|
||||
if m.IsYaegiPlugin() {
|
||||
if m.Import == "" {
|
||||
errs = multierror.Append(errs, fmt.Errorf("%s: missing import", descriptor.ModuleName))
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(m.Import, descriptor.ModuleName) {
|
||||
errs = multierror.Append(errs, fmt.Errorf("the import %q must be related to the module name %q", m.Import, descriptor.ModuleName))
|
||||
if !strings.HasPrefix(m.Import, descriptor.ModuleName) {
|
||||
errs = multierror.Append(errs, fmt.Errorf("the import %q must be related to the module name %q", m.Import, descriptor.ModuleName))
|
||||
}
|
||||
}
|
||||
|
||||
if m.DisplayName == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue