diff --git a/webhook/resources/backupbackingimage/validator.go b/webhook/resources/backupbackingimage/validator.go index 8d9cabbd8e..492c1c4153 100644 --- a/webhook/resources/backupbackingimage/validator.go +++ b/webhook/resources/backupbackingimage/validator.go @@ -45,11 +45,11 @@ func (bbi *backupBackingImageValidator) Create(request *admission.Request, newOb backingImageName := backupBackingImage.Spec.BackingImage backingImage, err := bbi.ds.GetBackingImageRO(backingImageName) - if err != nil { + if err != nil && !datastore.ErrorIsNotFound(err) { return werror.NewInvalidError(fmt.Sprintf("failed to get the backing image %v for backup: %v", backingImageName, err), "") } // TODO: support backup for v2 data engine in the future - if types.IsDataEngineV2(backingImage.Spec.DataEngine) { + if backingImage != nil && types.IsDataEngineV2(backingImage.Spec.DataEngine) { return werror.NewInvalidError(fmt.Sprintf("backing image %v uses v2 data engine which doesn't support backup operations", backingImageName), "") }