Check ErrPluginStaticUnsupported for fallback to RotateRootCredentials (#11585)

This commit is contained in:
Michael Golowka
2021-05-12 15:22:41 -06:00
committed by GitHub
parent c191081750
commit 67ca3beb1e
2 changed files with 27 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ func (d databaseVersionWrapper) changePasswordLegacy(ctx context.Context, userna
err = d.changeUserPasswordLegacy(ctx, username, passwordChange)
// If changing the root user's password but SetCredentials is unimplemented, fall back to RotateRootCredentials
if isRootUser && status.Code(err) == codes.Unimplemented {
if isRootUser && (err == v4.ErrPluginStaticUnsupported || status.Code(err) == codes.Unimplemented) {
saveConfig, err = d.changeRootUserPasswordLegacy(ctx, passwordChange)
if err != nil {
return nil, err