INNER CODE UNIT · Go
main
kcp-dev/kcp · cmd/sharded-test-server/main.go:47
func main() {
klog.InitFlags(flag.CommandLine)
logDirPath := flag.String("log-dir-path", "", "Path to the log files. If empty, log files are stored in the dot directories.")
workDirPath := flag.String("work-dir-path", "", "Path to the working directory where the .kcp* dot directories are created. If empty, the working directory is the current directory.")
numberOfShards := flag.Int("number-of-shards", 1, "The number of shards to create. The first created is assumed root.")
cacheSyntheticDelay := flag.Duration("cache-synthetic-delay", 0, "The duration of time the cache server will inject a delay for to all inbound requests.")
quiet := flag.Bool("quiet", false, "Suppress output of the subprocesses")
cacheServerKubeconfig := flag.String("cache-kubeconfig", "", "Path to a kubeconfig of an external cache-server. If empty, a dedicated cache-server is started.")
externalEtcdServers := flag.String("external-etcd-servers", "", "Comma-separated list of etcd server URLs to use for shards and the cache-server instead of starting embedded etcds. Each component gets its own --etcd-prefix.")
// split flags into --proxy-*, --shard-* and everything else (generic). The former are
// passed to the respective components.
var proxyFlags, shardFlags, genericFlags []string
for _, arg := range os.Args[1:] {
if strings.HasPrefix(arg, "--proxy-") {
proxyFlags = append(proxyFlags, "-"+strings.TrimPrefix(arg, "--proxy"))
} else if strings.HasPrefix(arg, "--shard-") {
shardFlags = append(shardFlags, "-"+strings.TrimPrefix(arg, "--shard"))