Merge pull request #5150 from blackpiglet/cherry-pick-5145-to-1.9
[cherry-pick] Delay CA file deletion in PVB controllerpull/5173/head
commit
b870847375
|
@ -0,0 +1 @@
|
||||||
|
Delay CA file deletion in PVB controller.
|
|
@ -124,7 +124,11 @@ func (r *PodVolumeBackupReconciler) Reconcile(ctx context.Context, req ctrl.Requ
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return r.updateStatusToFailed(ctx, &pvb, err, "building Restic command", log)
|
return r.updateStatusToFailed(ctx, &pvb, err, "building Restic command", log)
|
||||||
}
|
}
|
||||||
defer os.Remove(resticDetails.credsFile)
|
|
||||||
|
defer func() {
|
||||||
|
os.Remove(resticDetails.credsFile)
|
||||||
|
os.Remove(resticDetails.caCertFile)
|
||||||
|
}()
|
||||||
|
|
||||||
backupLocation := &velerov1api.BackupStorageLocation{}
|
backupLocation := &velerov1api.BackupStorageLocation{}
|
||||||
if err := r.Client.Get(context.Background(), client.ObjectKey{
|
if err := r.Client.Get(context.Background(), client.ObjectKey{
|
||||||
|
@ -344,8 +348,6 @@ func (r *PodVolumeBackupReconciler) buildResticCommand(ctx context.Context, log
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Error("creating temporary caCert file")
|
log.WithError(err).Error("creating temporary caCert file")
|
||||||
}
|
}
|
||||||
defer os.Remove(details.caCertFile)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
cmd.CACertFile = details.caCertFile
|
cmd.CACertFile = details.caCertFile
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue