feat: plugins integration.
This commit is contained in:
parent
58bf1a2ca5
commit
0186c31d59
26 changed files with 1025 additions and 51 deletions
|
@ -38,6 +38,8 @@ type Middleware struct {
|
|||
PassTLSClientCert *PassTLSClientCert `json:"passTLSClientCert,omitempty" toml:"passTLSClientCert,omitempty" yaml:"passTLSClientCert,omitempty"`
|
||||
Retry *Retry `json:"retry,omitempty" toml:"retry,omitempty" yaml:"retry,omitempty"`
|
||||
ContentType *ContentType `json:"contentType,omitempty" toml:"contentType,omitempty" yaml:"contentType,omitempty"`
|
||||
|
||||
Plugin map[string]PluginConf `json:"plugin,omitempty" toml:"plugin,omitempty" yaml:"plugin,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen=true
|
||||
|
|
27
pkg/config/dynamic/plugins.go
Normal file
27
pkg/config/dynamic/plugins.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package dynamic
|
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
// +k8s:deepcopy-gen=false
|
||||
|
||||
// PluginConf holds the plugin configuration.
|
||||
type PluginConf map[string]interface{}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PluginConf) DeepCopyInto(out *PluginConf) {
|
||||
if in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = runtime.DeepCopyJSON(*in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginConf.
|
||||
func (in *PluginConf) DeepCopy() *PluginConf {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PluginConf)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
|
@ -730,6 +730,13 @@ func (in *Middleware) DeepCopyInto(out *Middleware) {
|
|||
*out = new(ContentType)
|
||||
**out = **in
|
||||
}
|
||||
if in.Plugin != nil {
|
||||
in, out := &in.Plugin, &out.Plugin
|
||||
*out = make(map[string]PluginConf, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = *val.DeepCopy()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
16
pkg/config/static/experimental.go
Normal file
16
pkg/config/static/experimental.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package static
|
||||
|
||||
import "github.com/containous/traefik/v2/pkg/plugins"
|
||||
|
||||
// Experimental experimental Traefik features.
|
||||
type Experimental struct {
|
||||
Pilot *Pilot `description:"Traefik Pilot configuration." json:"pilot,omitempty" toml:"pilot,omitempty" yaml:"pilot,omitempty"`
|
||||
|
||||
Plugins map[string]plugins.Descriptor `description:"Plugins configuration." json:"plugins,omitempty" toml:"plugins,omitempty" yaml:"plugins,omitempty"`
|
||||
DevPlugin *plugins.DevPlugin `description:"Dev plugin configuration." json:"devPlugin,omitempty" toml:"devPlugin,omitempty" yaml:"devPlugin,omitempty"`
|
||||
}
|
||||
|
||||
// Pilot Configuration related to Traefik Pilot.
|
||||
type Pilot struct {
|
||||
Token string `description:"Traefik Pilot token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty"`
|
||||
}
|
|
@ -74,16 +74,6 @@ type Configuration struct {
|
|||
Experimental *Experimental `description:"experimental features." json:"experimental,omitempty" toml:"experimental,omitempty" yaml:"experimental,omitempty"`
|
||||
}
|
||||
|
||||
// Experimental the experimental feature configuration.
|
||||
type Experimental struct {
|
||||
Pilot *PilotConfiguration `description:"Pilot configuration." json:"pilot,omitempty" toml:"pilot,omitempty" yaml:"pilot,omitempty" export:"true"`
|
||||
}
|
||||
|
||||
// PilotConfiguration holds pilot configuration.
|
||||
type PilotConfiguration struct {
|
||||
Token string `description:"Pilot token." json:"token,omitempty" toml:"token,omitempty" yaml:"token,omitempty" export:"true"`
|
||||
}
|
||||
|
||||
// CertificateResolver contains the configuration for the different types of certificates resolver.
|
||||
type CertificateResolver struct {
|
||||
ACME *acmeprovider.Configuration `description:"Enable ACME (Let's Encrypt): automatic SSL." json:"acme,omitempty" toml:"acme,omitempty" yaml:"acme,omitempty" export:"true"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue