Edit and delete of backup schedules cannot be done with database-cluster-backups update permission

Description

Tested with Everest v1.2.0-rc1 version.

Install mysql operator in a1 namespace and mongodb in a2 namespace.

Login in Everest UI using admin user and create mysql database using the admin user. Take some scheduled backups for the mysql database.

Create a user dbadmin using cli.

./everestctl-1.2.0-rc1 accounts create

Add the following permissions in the RBAC policy

p, dbadmin:role, namespaces, read, * p, dbadmin:role, database-engines, read, * p, dbadmin:role, database-clusters, *, */* p, dbadmin:role, database-cluster-backups, create, a2/* p, dbadmin:role, backup-storages, *, */* g, dbadmin, dbadmin:role

Login as dbadmin user and create a mongodb database in a2 namespace, add a scheduled backup and take some backups.

Change the permissions in the RBAC policy to use update instead of create for database-cluster-backups

p, dbadmin:role, namespaces, read, * p, dbadmin:role, database-engines, read, * p, dbadmin:role, database-clusters, *, */* p, dbadmin:role, database-cluster-backups, update, a2/* p, dbadmin:role, backup-storages, *, */* g, dbadmin, dbadmin:role

Edit the backup schedule as dbadmin user

image-20240910-140228.png

Clicking the Save button does not do anything.

Try to delete the backup schedule

image-20240910-140458.png

Clicking the Delete button does not do anything.

Hence editing and deleting the backup schedule cannot be done using update permissions of database-cluster-backups.

Also, it is not clear how the update permissions affect the backups or is it used for restoring a database.

Environment

None

Attachments

2
  • 10 Sep 2024, 02:09 PM
  • 10 Sep 2024, 02:09 PM

Activity

Show:

Diogo Recharte September 20, 2024 at 9:45 AM

Done here

Mayank Shah September 10, 2024 at 2:33 PM

I don’t think it does at all. It seems like we cannot update a backup object. So having update on a backup is a no-op..

I think we should update this in the docs

Manish Chawla September 10, 2024 at 2:27 PM

Thanks Mayank, but then how does the update permission affect the backup schedules and backups?

Mayank Shah September 10, 2024 at 2:23 PM

Editing a backup schedule is effectively the same as creating a backup (because that’s what the operators eventually do). Hence, editing the backup schedule requires permission to create a backup, and not update

I think this behaviour is as expected.

ref ticket where this was implemented: https://perconadev.atlassian.net/browse/EVEREST-1257

Please let me know if I misunderstood the ask in this ticket..

Unresolved

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Smart Checklist

Created September 10, 2024 at 2:09 PM
Updated October 1, 2024 at 7:43 PM

Flag notifications