Skip to content

Commit

Permalink
Merge pull request #5615 from ywk253100/221122_order
Browse files Browse the repository at this point in the history
Restore ClusterBootstrap before Cluster
  • Loading branch information
reasonerjt committed Nov 22, 2022
2 parents 9a617fe + c992315 commit 026f986
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/5615-ywk253100
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restore ClusterBootstrap before Cluster otherwise a new default ClusterBootstrap object is create for the cluster
11 changes: 6 additions & 5 deletions pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,13 @@ 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.
//
// Low priorities:
// - Tanzu ClusterBootstraps go last as it can reference any other kind of resources.
// ClusterBootstraps go before CAPI Clusters otherwise a new default ClusterBootstrap object is created for the cluster
// - CAPI Clusters come before ClusterResourceSets because failing to do so means the CAPI controller-manager will panic.
// Both Clusters and ClusterResourceSets need to come before ClusterResourceSetBinding in order to properly restore workload clusters.
// See https://github.com/kubernetes-sigs/cluster-api/issues/4105
//
// Low priorities:
// - Tanzu ClusterBootstrap go last as it can reference any other kind of resources
var defaultRestorePriorities = restore.Priorities{
HighPriorities: []string{
"customresourcedefinitions",
Expand All @@ -514,11 +515,11 @@ var defaultRestorePriorities = restore.Priorities{
// in the backup.
"replicasets.apps",
"clusterclasses.cluster.x-k8s.io",
"clusters.cluster.x-k8s.io",
"clusterresourcesets.addons.cluster.x-k8s.io",
},
LowPriorities: []string{
"clusterbootstraps.run.tanzu.vmware.com",
"clusters.cluster.x-k8s.io",
"clusterresourcesets.addons.cluster.x-k8s.io",
},
}

Expand Down

0 comments on commit 026f986

Please sign in to comment.