Compare commits

...

2 Commits

Author SHA1 Message Date
Jean-Marc ANDRE
ea1c1bd2e3 Added RBAC needed 2023-04-17 01:10:01 +02:00
Jean-Marc ANDRE
65d880180b cannot set sessionState to empty string otherwise the BackupSession does not get updated and the other targets won't Finalize 2023-04-17 01:09:42 +02:00
2 changed files with 7 additions and 2 deletions

View File

@ -376,10 +376,15 @@ func (r *BackupConfigurationReconciler) createRBACSidecar(sa corev1.ServiceAccou
Resources: []string{"restoresessions", "backupsessions", "backupconfigurations", "functions", "repoes"},
},
rbacv1.PolicyRule{
Verbs: []string{"get", "list", "watch"},
Verbs: []string{"get", "list", "watch", "create", "update", "patch", "delete"},
APIGroups: []string{""},
Resources: []string{"secrets", "persistentvolumeclaims"},
},
rbacv1.PolicyRule{
Verbs: []string{"get", "list", "watch", "create", "update", "patch", "delete"},
APIGroups: []string{"batch"},
Resources: []string{"jobs"},
},
rbacv1.PolicyRule{
Verbs: []string{"get", "list", "watch", "create", "update", "patch", "delete"},
APIGroups: []string{"formol.desmojim.fr"},

View File

@ -83,7 +83,7 @@ func (s Session) checkSessionState(
// We still want to run Finalize for all the targets (continue)
// but we also don't want to move the global BackupSession to Success (rewrite sessionState)
// When the Job is over, it will move the target state to Finalized and we'll be fine
defer func() { sessionState = "" }()
defer func() { sessionState = waitState }()
continue
default:
if i == len(tss)-1 {