Skip to content

Commit

Permalink
Add ClusterClasses to the restore priority list
Browse files Browse the repository at this point in the history
Make sure ClusterClasses are stored before Clusters.
Fixes vmware-tanzu#4767

Signed-off-by: Daniel Jiang <[email protected]>
  • Loading branch information
reasonerjt committed Apr 27, 2022
1 parent de17605 commit f89691c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/4866-reasonerjt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ClusterClasses to the restore priority list
2 changes: 2 additions & 0 deletions pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ func (s *server) veleroResourcesExist() error {
// have restic restores run before controllers adopt the pods.
// - Replica sets go before deployments/other controllers so they can be explicitly
// restored and be adopted by controllers.
// - CAPI ClusterClasses go before Clusters.
// - 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
Expand All @@ -498,6 +499,7 @@ var defaultRestorePriorities = []string{
// to ensure that we prioritize restoring from "apps" too, since this is how they're stored
// in the backup.
"replicasets.apps",
"clusterclasses.cluster.x-k8s.io",
"clusters.cluster.x-k8s.io",
"clusterresourcesets.addons.cluster.x-k8s.io",
}
Expand Down

0 comments on commit f89691c

Please sign in to comment.