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 (
23
23
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
24
24
)
25
25
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 {
27
29
// Namespaces go first because all namespaced resources depend on them.
28
30
"Namespace" : - 100 ,
29
31
// Custom Resource Definitions come before Custom Resource so that they can be
@@ -53,8 +55,8 @@ var priorityMap = map[string]int{
53
55
// priorityLess returns true if o1 should be created before o2.
54
56
// To be used in sort.{Slice,SliceStable} to sort manifests in place.
55
57
func 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 ()]
58
60
return p1 < p2
59
61
}
60
62
You can’t perform that action at this time.
0 commit comments