route

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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:

  1. The CN servers which are configured as sys account.
  2. The CN servers which are configured as some labels whose key is not account.
  3. The CN servers which are configured as no labels.
  4. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL