Skip to content
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
12 changes: 7 additions & 5 deletions vault/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,13 +1052,18 @@ func (c *Core) newCredentialBackend(ctx context.Context, entry *MountEntry, sysV
return nil, err
}

pluginRunningVersion := pluginVersion
if pluginRunningVersion == "" && runningSha == "" {
pluginRunningVersion = versions.GetBuiltinVersion(consts.PluginTypeCredential, entry.Type)
}

pluginObservationRecorder, err := c.observations.WithPlugin(entry.namespace, &logical.ObservationPluginInfo{
MountClass: consts.PluginTypeCredential.String(),
MountAccessor: entry.Accessor,
MountPath: entry.Path,
Plugin: entry.Type,
PluginVersion: pluginVersion,
RunningPluginVersion: entry.RunningVersion,
RunningPluginVersion: pluginRunningVersion,
Version: entry.Options["version"],
Local: entry.Local,
})
Expand All @@ -1081,11 +1086,8 @@ func (c *Core) newCredentialBackend(ctx context.Context, entry *MountEntry, sysV
return nil, err
}
if backend != nil {
entry.RunningVersion = pluginVersion
entry.RunningVersion = pluginRunningVersion
entry.RunningSha256 = runningSha
if entry.RunningVersion == "" && entry.RunningSha256 == "" {
entry.RunningVersion = versions.GetBuiltinVersion(consts.PluginTypeCredential, entry.Type)
}
}

return backend, nil
Expand Down
12 changes: 7 additions & 5 deletions vault/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -1788,13 +1788,18 @@ func (c *Core) newLogicalBackend(ctx context.Context, entry *MountEntry, sysView
return nil, err
}

pluginRunningVersion := pluginVersion
if pluginRunningVersion == "" && runningSha == "" {
pluginRunningVersion = versions.GetBuiltinVersion(consts.PluginTypeSecrets, entry.Type)
}

pluginObservationRecorder, err := c.observations.WithPlugin(entry.namespace, &logical.ObservationPluginInfo{
MountClass: consts.PluginTypeSecrets.String(),
MountAccessor: entry.Accessor,
MountPath: entry.Path,
Plugin: entry.Type,
PluginVersion: pluginVersion,
RunningPluginVersion: entry.RunningVersion,
RunningPluginVersion: pluginRunningVersion,
Version: entry.Options["version"],
Local: entry.Local,
})
Expand Down Expand Up @@ -1822,11 +1827,8 @@ func (c *Core) newLogicalBackend(ctx context.Context, entry *MountEntry, sysView
return nil, fmt.Errorf("nil backend of type %q returned from factory", t)
}

entry.RunningVersion = pluginVersion
entry.RunningVersion = pluginRunningVersion
entry.RunningSha256 = runningSha
if entry.RunningVersion == "" && entry.RunningSha256 == "" {
entry.RunningVersion = versions.GetBuiltinVersion(consts.PluginTypeSecrets, entry.Type)
}
addLicenseCallback(c, backend)

return backend, nil
Expand Down
Loading