feat(grafana-cli): allow configuring admin ID for reset-admin-password (#60603)

* feat(grafana-cli): add a flag to control the admin user's ID for reset-admin-password

Since this is now more permissive, I've also added validation that the requested user is an admin.

* slight refactor to support testing
This commit is contained in:
Kristin Laemmert
2022-12-21 14:24:33 +01:00
committed by GitHub
parent bf541ee3d1
commit c90756eef5
3 changed files with 80 additions and 9 deletions

View File

@ -160,6 +160,11 @@ var adminCommands = []*cli.Command{
Usage: "Read the password from stdin",
Value: false,
},
&cli.IntFlag{
Name: "user-id",
Usage: "The admin user's ID",
Value: DefaultAdminUserId,
},
},
},
{