mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-11 10:44:41 +00:00
21a0fe1b9b
This removes AWS and Kubernetes support from Linux binaries by default on GOARCH values where people don't typically run on AWS or use Kubernetes, such as 32-bit mips CPUs. It primarily focuses on optimizing for the static binaries we distribute. But for people building it themselves, they can set ts_kube or ts_aws (the opposite of ts_omit_kube or ts_omit_aws) to force it back on. Makes tailscaled binary ~2.3MB (~7%) smaller. Updates #7272, #10627 etc Change-Id: I42a8775119ce006fa321462cb2d28bc985d1c146 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
26 lines
596 B
Go
26 lines
596 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build (ts_kube || (linux && (arm64 || amd64))) && !ts_omit_kube
|
|
|
|
package store
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"tailscale.com/ipn"
|
|
"tailscale.com/ipn/store/kubestore"
|
|
"tailscale.com/types/logger"
|
|
)
|
|
|
|
func init() {
|
|
registerAvailableExternalStores = append(registerAvailableExternalStores, registerKubeStore)
|
|
}
|
|
|
|
func registerKubeStore() {
|
|
Register("kube:", func(logf logger.Logf, path string) (ipn.StateStore, error) {
|
|
secretName := strings.TrimPrefix(path, "kube:")
|
|
return kubestore.New(logf, secretName)
|
|
})
|
|
}
|