mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-07 13:55:20 +00:00
Require DeleteBackupRequest.Spec.BackupName
Make sure a DeleteBackupRequest has its Spec.BackupName filled in. If not, record an error in the status and mark the request as processed. Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
@@ -133,6 +133,14 @@ func (c *backupDeletionController) processRequest(req *v1.DeleteBackupRequest) e
|
||||
"backup": req.Spec.BackupName,
|
||||
})
|
||||
|
||||
if req.Spec.BackupName == "" {
|
||||
_, err := c.patchDeleteBackupRequest(req, func(r *v1.DeleteBackupRequest) {
|
||||
r.Status.Phase = v1.DeleteBackupRequestPhaseProcessed
|
||||
r.Status.Errors = []string{"spec.backupName is required"}
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
// Update status to InProgress
|
||||
|
||||
Reference in New Issue
Block a user