Pass Velero server command args to the plugins

Pass Velero server command args to the plugins

Fixes #7806

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
Wenkai Yin(尹文开)
2024-09-04 13:43:27 +08:00
parent 981f30cb25
commit dc6eeafe98
22 changed files with 500 additions and 483 deletions
+6
View File
@@ -45,6 +45,9 @@ func NewCommand(f client.Factory) *cobra.Command {
Hidden: true,
Short: "INTERNAL COMMAND ONLY - not intended to be run directly by users",
Run: func(c *cobra.Command, args []string) {
config := pluginServer.GetConfig()
f.SetClientQPS(config.ClientQPS)
f.SetClientBurst(config.ClientBurst)
pluginServer = pluginServer.
RegisterBackupItemAction(
"velero.io/pv",
@@ -197,6 +200,9 @@ func NewCommand(f client.Factory) *cobra.Command {
}
pluginServer.Serve()
},
FParseErrWhitelist: cobra.FParseErrWhitelist{ // Velero.io word list : ignore
UnknownFlags: true,
},
}
pluginServer.BindFlags(c.Flags())
return c