File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ import (
2323 "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2424)
2525
26- var priorityMap = map [string ]int {
26+ // orderMapping maps resource kinds to their creation order,
27+ // the lower the number, the earlier the resource should be created.
28+ var orderMapping = map [string ]int {
2729 // Namespaces go first because all namespaced resources depend on them.
2830 "Namespace" : - 100 ,
2931 // Custom Resource Definitions come before Custom Resource so that they can be
@@ -53,8 +55,8 @@ var priorityMap = map[string]int{
5355// priorityLess returns true if o1 should be created before o2.
5456// To be used in sort.{Slice,SliceStable} to sort manifests in place.
5557func priorityLess (o1 , o2 unstructured.Unstructured ) bool {
56- p1 := priorityMap [o1 .GetKind ()]
57- p2 := priorityMap [o2 .GetKind ()]
58+ p1 := orderMapping [o1 .GetKind ()]
59+ p2 := orderMapping [o2 .GetKind ()]
5860 return p1 < p2
5961}
6062
You can’t perform that action at this time.
0 commit comments