mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-25 00:26:08 +00:00
Clean up copied secrets in CSI snapshot exposer CleanUp
Add label-based secret cleanup in CleanUp() to delete any secrets that were copied to the Velero namespace for backup PVC provisioning. Uses the velero.io/backup-pvc-secret label to find secrets associated with the DataUpload being cleaned up. Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
This commit is contained in:
@@ -514,6 +514,9 @@ func (e *csiSnapshotExposer) CleanUp(ctx context.Context, ownerObject corev1api.
|
||||
kube.DeletePodIfAny(ctx, e.kubeClient.CoreV1(), backupPodName, ownerObject.Namespace, e.log)
|
||||
kube.DeletePVAndPVCIfAny(ctx, e.kubeClient.CoreV1(), backupPVCName, ownerObject.Namespace, cleanUpTimeout, e.log)
|
||||
|
||||
kube.DeleteSecretsWithLabel(ctx, e.kubeClient.CoreV1(), ownerObject.Namespace,
|
||||
kube.BackupPVCSecretLabel, ownerObject.Name, e.log)
|
||||
|
||||
csi.DeleteVolumeSnapshotIfAny(ctx, e.csiSnapshotClient, backupVSName, ownerObject.Namespace, e.log)
|
||||
csi.DeleteVolumeSnapshotIfAny(ctx, e.csiSnapshotClient, vsName, sourceNamespace, e.log)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user