From 9507403907c62536c97277bcd8ebffa7f357adae Mon Sep 17 00:00:00 2001 From: Kern Walster Date: Thu, 6 Jun 2024 16:43:36 +0000 Subject: [PATCH] Allow proxy plugins to have capabilities Signed-off-by: Kern Walster (cherry picked from commit 5b8dfbd1115ce129feea417b1f88acabf182b31c) --- services/server/config/config.go | 9 +++++---- services/server/server.go | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/server/config/config.go b/services/server/config/config.go index 063e71c3d547..802b37d1edad 100644 --- a/services/server/config/config.go +++ b/services/server/config/config.go @@ -170,10 +170,11 @@ type CgroupConfig struct { // ProxyPlugin provides a proxy plugin configuration type ProxyPlugin struct { - Type string `toml:"type"` - Address string `toml:"address"` - Platform string `toml:"platform"` - Exports map[string]string `toml:"exports"` + Type string `toml:"type"` + Address string `toml:"address"` + Platform string `toml:"platform"` + Exports map[string]string `toml:"exports"` + Capabilities []string `toml:"capabilities"` } // Decode unmarshals a plugin specific configuration by plugin id diff --git a/services/server/server.go b/services/server/server.go index b31f39afa496..4285da84e1ae 100644 --- a/services/server/server.go +++ b/services/server/server.go @@ -510,6 +510,7 @@ func LoadPlugins(ctx context.Context, config *srvconfig.Config) ([]*plugin.Regis InitFn: func(ic *plugin.InitContext) (interface{}, error) { ic.Meta.Exports = exports ic.Meta.Platforms = append(ic.Meta.Platforms, p) + ic.Meta.Capabilities = pp.Capabilities conn, err := clients.getClient(address) if err != nil { return nil, err