velero/pkg
Bridget McErlean 0246a32ad0
Use pod namespace from backup when matching PVBs (#3475)
* Use pod namespace from backup when matching PVBs

In #3051, we introduced an additional check to ensure that a PVB matched
a particular pod by checking both the name and the namespace of the pod.
This caused an issue when using a namespace mapping on restore. In the
case where a namespace mapping is being used, the check for whether a
PVB matches a particular pod will fail as the PVB was created for the
original pod namespace and is not aware of the new namespace mapping
being used. This resulted in PVRs not being created for pods that were
being restored into new namespaces. The restic init containers were
being created to wait on the volume restore, however this would cause
the restored pods to block indefinitely as they would be waiting for a
volume restore that was not scheduled.

To fix this, we use the original namespace of the pod from the backup to
match the PVB to the pod being restored, not the new namespace where
the pod is being restored into.

Fixes #3467.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>

* Explain why the namespace mapping can't be used

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
2021-02-22 11:16:00 -08:00
..
apis/velero/v1 Merge pull request #3409 from nrb/add-credentials-to-vsls 2021-02-10 09:07:41 +08:00
archive Restore API group version by priority (#3133) 2021-02-16 12:36:17 -05:00
backup 🐛 Do not run ItemAction plugins for unresolvable types for all types (#3059) 2020-11-11 09:50:57 -05:00
builder Use controller-runtime client to get restic secrets (#3320) 2021-02-18 10:30:52 -08:00
buildinfo update license headers to Velero contributors (#1302) 2019-03-20 12:32:48 -07:00
client Add colors to describe command (#3275) 2021-02-09 08:39:41 -08:00
cmd Use controller-runtime client to get restic secrets (#3320) 2021-02-18 10:30:52 -08:00
controller Use controller-runtime client to get restic secrets (#3320) 2021-02-18 10:30:52 -08:00
discovery fix EnableAPIGroupersions output log format (#2882) 2020-09-01 13:50:44 -04:00
features Add features package (#1849) 2019-09-18 10:57:04 -06:00
generated Remove unneeded auto-generated files (#2732) 2020-07-20 15:37:27 -07:00
install Restore API group version by priority (#3133) 2021-02-16 12:36:17 -05:00
kuberesource restore proper lowercase/plural CRD resource (#2949) 2020-10-02 09:48:12 -04:00
label Bug fix: Calculate label using backup name for CSI objects (#2510) 2020-05-07 11:56:13 -07:00
metrics Modify function name typo (#3106) 2020-11-23 11:28:34 -05:00
persistence Replace NewObjectBackupStore with interface (#3329) 2021-02-08 13:04:08 -05:00
plugin Capitalize all help messages (#3209) 2021-01-05 16:36:15 -08:00
podexec update to k8s 1.17 deps and fix breaks (#2180) 2020-01-10 08:55:58 -08:00
restic Use pod namespace from backup when matching PVBs (#3475) 2021-02-22 11:16:00 -08:00
restore Use pod namespace from backup when matching PVBs (#3475) 2021-02-22 11:16:00 -08:00
test Use controller-runtime client to get restic secrets (#3320) 2021-02-18 10:30:52 -08:00
util Use controller-runtime client to get restic secrets (#3320) 2021-02-18 10:30:52 -08:00
volume Fix various typos found by codespell (#3057) 2020-11-10 11:48:35 -05:00