pass --log-level to plugins (#1278)

Plumb the log level through to plugin processes


Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
Steve Kriss
2019-03-14 10:53:36 -07:00
committed by KubeKween
parent 409116fce8
commit 7674332313
8 changed files with 58 additions and 19 deletions
+5 -6
View File
@@ -1,5 +1,5 @@
/*
Copyright 2017 the Heptio Ark contributors.
Copyright 2017, 2019 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -31,16 +31,13 @@ import (
)
func NewCommand(f client.Factory) *cobra.Command {
logger := veleroplugin.NewLogger()
pluginServer := veleroplugin.NewServer()
c := &cobra.Command{
Use: "run-plugins",
Hidden: true,
Short: "INTERNAL COMMAND ONLY - not intended to be run directly by users",
Run: func(c *cobra.Command, args []string) {
logger.Debug("Executing run-plugins command")
veleroplugin.NewServer(logger).
pluginServer.
RegisterObjectStore("aws", newAwsObjectStore).
RegisterObjectStore("azure", newAzureObjectStore).
RegisterObjectStore("gcp", newGcpObjectStore).
@@ -59,6 +56,8 @@ func NewCommand(f client.Factory) *cobra.Command {
},
}
pluginServer.BindFlags(c.Flags())
return c
}