Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate the PVC for non CSI PV #192

Merged
merged 1 commit into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/backup/pvc_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ func (p *PVCBackupItemAction) Execute(item runtime.Unstructured, backup *velerov
}
if pv.Spec.PersistentVolumeSource.CSI == nil {
p.Log.Infof("Skipping PVC %s/%s, associated PV %s is not a CSI volume", pvc.Namespace, pvc.Name, pv.Name)
return item, nil, "", nil, nil
util.AddAnnotations(&pvc.ObjectMeta, map[string]string{
util.SkippedNoCSIPVAnnotation: "true",
})
data, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&pvc)
return &unstructured.Unstructured{Object: data}, nil, "", nil, err
}

// Do nothing if FS uploader is used to backup this PV
Expand Down
4 changes: 3 additions & 1 deletion internal/util/labels_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const (

// Velero checks this annotation to determine whether to skip resource excluding check.
MustIncludeAdditionalItemAnnotation = "backup.velero.io/must-include-additional-items"

// SkippedNoCSIPVAnnotation - Velero checks this annotation on processed PVC to
// find out if the snapshot was skipped b/c the PV is not provisioned via CSI
SkippedNoCSIPVAnnotation = "backup.velero.io/skipped-no-csi-pv"
// ResourceTimeoutAnnotation is the annotation key used to carry the global resoure
// timeout value for backup to plugins.
ResourceTimeoutAnnotation = "velero.io/resource-timeout"
Expand Down
Loading