Plugins: Add version info to CLI and server log output (#17430)
This commit is contained in:
parent
d869496969
commit
2cf29f93c7
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
plugins: Add plugin version information to key plugin lifecycle log lines.
|
||||||
|
```
|
|
@ -321,6 +321,9 @@ func (c *AuthEnableCommand) Run(args []string) int {
|
||||||
if authType == "plugin" {
|
if authType == "plugin" {
|
||||||
authThing = c.flagPluginName + " plugin"
|
authThing = c.flagPluginName + " plugin"
|
||||||
}
|
}
|
||||||
|
if c.flagPluginVersion != "" {
|
||||||
|
authThing += " version " + c.flagPluginVersion
|
||||||
|
}
|
||||||
c.UI.Output(fmt.Sprintf("Success! Enabled %s at: %s", authThing, authPath))
|
c.UI.Output(fmt.Sprintf("Success! Enabled %s at: %s", authThing, authPath))
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -343,6 +343,9 @@ func (c *SecretsEnableCommand) Run(args []string) int {
|
||||||
if engineType == "plugin" {
|
if engineType == "plugin" {
|
||||||
thing = c.flagPluginName + " plugin"
|
thing = c.flagPluginName + " plugin"
|
||||||
}
|
}
|
||||||
|
if c.flagPluginVersion != "" {
|
||||||
|
thing += " version " + c.flagPluginVersion
|
||||||
|
}
|
||||||
c.UI.Output(fmt.Sprintf("Success! Enabled the %s at: %s", thing, mountPath))
|
c.UI.Output(fmt.Sprintf("Success! Enabled the %s at: %s", thing, mountPath))
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ func (c *Core) enableCredentialInternal(ctx context.Context, entry *MountEntry,
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.logger.IsInfo() {
|
if c.logger.IsInfo() {
|
||||||
c.logger.Info("enabled credential backend", "path", entry.Path, "type", entry.Type)
|
c.logger.Info("enabled credential backend", "path", entry.Path, "type", entry.Type, "version", entry.Version)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -845,7 +845,7 @@ func (c *Core) setupCredentials(ctx context.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.logger.IsInfo() {
|
if c.logger.IsInfo() {
|
||||||
c.logger.Info("successfully enabled credential backend", "type", entry.Type, "path", entry.Path, "namespace", entry.Namespace())
|
c.logger.Info("successfully enabled credential backend", "type", entry.Type, "version", entry.Version, "path", entry.Path, "namespace", entry.Namespace())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the path is tainted if set in the mount table
|
// Ensure the path is tainted if set in the mount table
|
||||||
|
|
|
@ -679,7 +679,7 @@ func (c *Core) mountInternal(ctx context.Context, entry *MountEntry, updateStora
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.logger.IsInfo() {
|
if c.logger.IsInfo() {
|
||||||
c.logger.Info("successful mount", "namespace", entry.Namespace().Path, "path", entry.Path, "type", entry.Type)
|
c.logger.Info("successful mount", "namespace", entry.Namespace().Path, "path", entry.Path, "type", entry.Type, "version", entry.Version)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -1493,7 +1493,7 @@ func (c *Core) setupMounts(ctx context.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.logger.IsInfo() {
|
if c.logger.IsInfo() {
|
||||||
c.logger.Info("successfully mounted backend", "type", entry.Type, "path", entry.Path)
|
c.logger.Info("successfully mounted backend", "type", entry.Type, "version", entry.Version, "path", entry.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the path is tainted if set in the mount table
|
// Ensure the path is tainted if set in the mount table
|
||||||
|
|
|
@ -62,7 +62,7 @@ func (c *Core) reloadMatchingPluginMounts(ctx context.Context, mounts []string)
|
||||||
errors = multierror.Append(errors, fmt.Errorf("cannot reload plugin on %q: %w", mount, err))
|
errors = multierror.Append(errors, fmt.Errorf("cannot reload plugin on %q: %w", mount, err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
c.logger.Info("successfully reloaded plugin", "plugin", entry.Accessor, "path", entry.Path)
|
c.logger.Info("successfully reloaded plugin", "plugin", entry.Accessor, "path", entry.Path, "version", entry.Version)
|
||||||
}
|
}
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ func (c *Core) reloadMatchingPlugin(ctx context.Context, pluginName string) erro
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c.logger.Info("successfully reloaded plugin", "plugin", pluginName, "path", entry.Path)
|
c.logger.Info("successfully reloaded plugin", "plugin", pluginName, "path", entry.Path, "version", entry.Version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ func (c *Core) reloadMatchingPlugin(ctx context.Context, pluginName string) erro
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c.logger.Info("successfully reloaded plugin", "plugin", entry.Accessor, "path", entry.Path)
|
c.logger.Info("successfully reloaded plugin", "plugin", entry.Accessor, "path", entry.Path, "version", entry.Version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue