Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The experimental dynamic plugin is deprecated #1197

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions bfe_config/bfe_conf/conf_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package bfe_conf

import (
"fmt"
"strings"
)

import (
Expand All @@ -32,11 +31,6 @@ const (
BalancerNone = "NONE" // layer4 balancer not used
)

const (
// LibrarySuffix defines BFE plugin's file suffix.
LibrarySuffix = ".so"
)

type ConfigBasic struct {
HttpPort int // listen port for http
HttpsPort int // listen port for https
Expand All @@ -59,7 +53,6 @@ type ConfigBasic struct {
KeepAliveEnabled bool // if false, client connection is shutdown disregard of http headers

Modules []string // modules to load
Plugins []string // plugins to load

// location of data files for bfe_route
HostRuleConf string // path of host_rule.data
Expand Down Expand Up @@ -217,11 +210,6 @@ func basicConfCheck(cfg *ConfigBasic) error {
return fmt.Errorf("MaxHeaderHeaderBytes[%d] should > 0", cfg.MaxHeaderBytes)
}

// check Plugins
if err := checkPlugins(cfg); err != nil {
return fmt.Errorf("plugins[%v] check failed. err: %s", cfg.Plugins, err.Error())
}

return nil
}

Expand All @@ -240,24 +228,6 @@ func checkLayer4LoadBalancer(cfg *ConfigBasic) error {
}
}

func checkPlugins(cfg *ConfigBasic) error {
plugins := []string{}
for _, pluginPath := range cfg.Plugins {
pluginPath = strings.TrimSpace(pluginPath)
if pluginPath == "" {
continue
}

if !strings.HasSuffix(pluginPath, LibrarySuffix) {
pluginPath += LibrarySuffix
}
plugins = append(plugins, pluginPath)
}
cfg.Plugins = plugins

return nil
}

func dataFileConfCheck(cfg *ConfigBasic, confRoot string) error {
// check HostRuleConf
if cfg.HostRuleConf == "" {
Expand Down
109 changes: 0 additions & 109 deletions bfe_module/bfe_plugin.go

This file was deleted.

28 changes: 0 additions & 28 deletions bfe_module/bfe_plugin_info.go

This file was deleted.

23 changes: 0 additions & 23 deletions bfe_server/bfe_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ type BfeServer struct {
// module and callback
CallBacks *bfe_module.BfeCallbacks // call back functions
Modules *bfe_module.BfeModules // bfe modules
Plugins *bfe_module.BfePlugins // bfe plugins

// web server for bfe monitor and reload
Monitor *BfeMonitor
Expand Down Expand Up @@ -121,8 +120,6 @@ func NewBfeServer(cfg bfe_conf.BfeConfig, confRoot string,
s.CallBacks = bfe_module.NewBfeCallbacks()
// create modules
s.Modules = bfe_module.NewBfeModules()
// create plugins
s.Plugins = bfe_module.NewBfePlugins()

// initialize balTable
s.balTable = bfe_balance.NewBalTable(s.GetCheckConf)
Expand Down Expand Up @@ -317,26 +314,6 @@ func (srv *BfeServer) InitModules() error {
return srv.Modules.Init(srv.CallBacks, srv.Monitor.WebHandlers, srv.ConfRoot)
}

func (srv *BfeServer) LoadPlugins(plugins []string) error {
if len(plugins) == 0 {
return nil
}

for _, pluginPath := range plugins {
if err := srv.Plugins.RegisterPlugin(pluginPath, srv.Version); err != nil {
return err
}

log.Logger.Info("RegisterPlugin():pluginPath=%s", pluginPath)
}

return nil
}

func (srv *BfeServer) InitPlugins() error {
return srv.Plugins.Init(srv.CallBacks, srv.Monitor.WebHandlers, srv.ConfRoot)
}

func (srv *BfeServer) InitSignalTable() {
/* create signal table */
srv.SignalTable = signal_table.NewSignalTable()
Expand Down
14 changes: 0 additions & 14 deletions bfe_server/bfe_server_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ func StartUp(cfg bfe_conf.BfeConfig, version string, confRoot string, dryRun boo
}
log.Logger.Info("StartUp():bfeServer.InitModules() OK")

// load plugins
if err = bfeServer.LoadPlugins(cfg.Server.Plugins); err != nil {
log.Logger.Error("StartUp():bfeServer.LoadPlugins():%s", err.Error())
return err
}

// initialize plugins
if err = bfeServer.InitPlugins(); err != nil {
log.Logger.Error("StartUp():bfeServer.InitPlugins():%s",
err.Error())
return err
}
log.Logger.Info("StartUp():bfeServer.InitPlugins() OK")

if dryRun {
return nil
}
Expand Down
Loading