CE Changes for VAULT-38180 (#31296)

* CE Changes for VAULT-38180

* whoopsie

* whoopsie 2
This commit is contained in:
Violet Hynes 2025-07-16 16:36:59 -04:00 committed by GitHub
parent c948ec09af
commit e6a5b2fc8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 10 deletions

View file

@ -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,
})
@ -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

View file

@ -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,
})
@ -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