mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 06:54:32 +00:00
Restore Services before Clusters
Restore Services before Clusters so they can be adopted by AKO-operator and no new Services will be created for the same clusters Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
@@ -1002,7 +1002,7 @@ func TestBackupResourceCohabitation(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "when deployments exist that are not in the cohabitating groups those are backed up along with apps/deployments",
|
||||
name: "when deployments exist that are not in the cohabiting groups those are backed up along with apps/deployments",
|
||||
backup: defaultBackup().Result(),
|
||||
apiResources: []*test.APIResource{
|
||||
test.VeleroDeployments(
|
||||
@@ -1047,7 +1047,7 @@ func TestBackupResourceCohabitation(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestBackupUsesNewCohabitatingResourcesForEachBackup ensures that when two backups are
|
||||
// run that each include cohabitating resources, one copy of the relevant resources is
|
||||
// run that each include cohabiting resources, one copy of the relevant resources is
|
||||
// backed up in each backup. Verification is done by looking at the contents of the backup
|
||||
// tarball. This covers a specific issue that was fixed by https://github.com/vmware-tanzu/velero/pull/485.
|
||||
func TestBackupUsesNewCohabitatingResourcesForEachBackup(t *testing.T) {
|
||||
|
||||
@@ -508,6 +508,8 @@ func (s *server) veleroResourcesExist() error {
|
||||
// - Replica sets go before deployments/other controllers so they can be explicitly
|
||||
// restored and be adopted by controllers.
|
||||
// - CAPI ClusterClasses go before Clusters.
|
||||
// - Services go before Clusters so they can be adopted by AKO-operator and no new Services will be created
|
||||
// for the same clusters
|
||||
//
|
||||
// Low priorities:
|
||||
// - Tanzu ClusterBootstraps go last as it can reference any other kind of resources.
|
||||
@@ -536,6 +538,7 @@ var defaultRestorePriorities = restore.Priorities{
|
||||
// in the backup.
|
||||
"replicasets.apps",
|
||||
"clusterclasses.cluster.x-k8s.io",
|
||||
"services",
|
||||
},
|
||||
LowPriorities: []string{
|
||||
"clusterbootstraps.run.tanzu.vmware.com",
|
||||
|
||||
Reference in New Issue
Block a user