mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 22:23:15 +00:00
Use const to represent snapshot.storage.kubernetes.io/managed-by.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
This commit is contained in:
committed by
Xun Jiang/Bruce Jiang
parent
8678ea28ee
commit
7b872473df
@@ -471,8 +471,8 @@ func (e *csiSnapshotExposer) createBackupVSC(ctx context.Context, ownerObject co
|
||||
https://github.com/kubernetes-csi/external-snapshotter/tree/4cedb3f45790ac593ebfa3324c490abedf739477?tab=readme-ov-file#distributed-snapshotting
|
||||
https://github.com/kubernetes-csi/external-snapshotter/blob/4cedb3f45790ac593ebfa3324c490abedf739477/pkg/utils/util.go#L158
|
||||
*/
|
||||
if manager, ok := snapshotVSC.Labels["snapshot.storage.kubernetes.io/managed-by"]; ok {
|
||||
vsc.ObjectMeta.Labels["snapshot.storage.kubernetes.io/managed-by"] = manager
|
||||
if manager, ok := snapshotVSC.Labels[kube.VolumeSnapshotContentManagedByLabel]; ok {
|
||||
vsc.ObjectMeta.Labels[kube.VolumeSnapshotContentManagedByLabel] = manager
|
||||
}
|
||||
|
||||
return e.csiSnapshotClient.VolumeSnapshotContents().Create(ctx, vsc, metav1.CreateOptions{})
|
||||
|
||||
@@ -53,6 +53,11 @@ const (
|
||||
KubeAnnSelectedNode = "volume.kubernetes.io/selected-node"
|
||||
)
|
||||
|
||||
// VolumeSnapshotContentManagedByLabel is applied by the snapshot controller
|
||||
// to the VolumeSnapshotContent object in case distributed snapshotting is enabled.
|
||||
// The value contains the name of the node that handles the snapshot for the volume local to that node.
|
||||
const VolumeSnapshotContentManagedByLabel = "snapshot.storage.kubernetes.io/managed-by"
|
||||
|
||||
var ErrorPodVolumeIsNotPVC = errors.New("pod volume is not a PVC")
|
||||
|
||||
// NamespaceAndName returns a string in the format <namespace>/<name>
|
||||
|
||||
Reference in New Issue
Block a user