Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RouteForCommonTenant ¶
func RouteForCommonTenant( selector clusterservice.Selector, filter func(string) bool, appendFn func(service *metadata.CNService), )
RouteForCommonTenant selects CN services for common tenant. If there are CN services for the selector, just select them, else, return CN services with empty labels if there are any.
func RouteForSuperTenant ¶
func RouteForSuperTenant( selector clusterservice.Selector, username string, filter func(string) bool, appendFn func(service *metadata.CNService), )
RouteForSuperTenant is used to select CN servers for sys tenant. For sys tenant, there are some special strategies to select CN servers. First of all, the requested labels must be match with the ones on servers. Then, the following strategies are listed in order of priority:
- The CN servers which are configured as sys account.
- The CN servers which are configured as some labels whose key is not account.
- The CN servers which are configured as no labels.
- At last, if no CN servers are selected, 4.1 If the username is dump or root, we just select one randomly. 4.2 Else, no servers are selected.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.