utils/sort.go
func depTier(disco discovery.OpenAPISchemaInterface, mapper meta.RESTMapper, o schema.ObjectKind) (int, error) {
	gvk := o.GroupVersionKind()
	if gk := gvk.GroupKind(); gk == gkTpr || gk == gkCrd {
		// Special case: these create other types
		return 10, nil
	}

	mapping, err := mapper.RESTMapping(gvk.GroupKind(), gvk.Version)
	if err != nil {
		log.Debugf("unable to fetch resource for %s (%v), continuing", gvk, err)
		return 50, nil
	}

	if mapping.Scope.Name() == meta.RESTScopeNameRoot {
		// Place global before namespaced
		return 20, nil
	} else if containsPodSpec(disco, gvk) {
		// (Potentially) starts a pod, so place last
		return 100, nil
	} else {
		// Everything else
		return 50, nil
	}
}
func depTier(disco discovery.OpenAPISchemaInterface, mapper meta.RESTMapper, o schema.ObjectKind) (int, error) {
	gvk := o.GroupVersionKind()
	if gk := gvk.GroupKind(); gk == gkTpr || gk == gkCrd {
		// Special case: these create other types
		return 10, nil
	}

	mapping, err := mapper.RESTMapping(gvk.GroupKind(), gvk.Version)
	if err != nil {
		log.Debugf("unable to fetch resource for %s (%v), continuing", gvk, err)
		return 50, nil
	}

	if mapping.Scope.Name() == meta.RESTScopeNameRoot {
		// Place global before namespaced
		return 20, nil
	} else if containsPodSpec(disco, gvk) {
		// (Potentially) starts a pod, so place last
		return 100, nil
	} else {
		// Everything else
		return 50, nil
	}
}
func depTier ( disco discovery . OpenAPISchemaInterface , mapper meta . RESTMapper , o schema . ObjectKind ) ( int , error ) { gvk := o . GroupVersionKind ( ) if gk := gvk . GroupKind ( ) ; gk == gkTpr || gk == gkCrd { // Special case: these create other types return 10 , nil } mapping , err := mapper . RESTMapping ( gvk . GroupKind ( ) , gvk . Version ) if err != nil { log . Debugf ( " " , gvk , err ) return 50 , nil } if mapping . Scope . Name ( ) == meta . RESTScopeNameRoot { // Place global before namespaced return 20 , nil } else if containsPodSpec ( disco , gvk ) { // (Potentially) starts a pod, so place last return 100 , nil } else { // Everything else return 50 , nil } }
// Arbitrary numbers used to do a simple topological sort of resources.
Arbitrary numbers used to do a simple topological sort of resources .