mirror of
https://github.com/tailscale/tailscale.git
synced 2025-06-10 09:48:35 +00:00

Registering a new store is cheap, it just adds a map entry. No need to lazy-init it with sync.Once and an intermediate slice holding init functions. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
22 lines
484 B
Go
22 lines
484 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build (ts_kube || (linux && (arm64 || amd64) && !android)) && !ts_omit_kube
|
|
|
|
package store
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"tailscale.com/ipn"
|
|
"tailscale.com/ipn/store/kubestore"
|
|
"tailscale.com/types/logger"
|
|
)
|
|
|
|
func init() {
|
|
Register("kube:", func(logf logger.Logf, path string) (ipn.StateStore, error) {
|
|
secretName := strings.TrimPrefix(path, "kube:")
|
|
return kubestore.New(logf, secretName)
|
|
})
|
|
}
|