Logo
Explore Help
Sign In
TheArchive/tailscale
1
0
Fork 0
You've already forked tailscale
mirror of https://github.com/tailscale/tailscale.git synced 2025-06-17 13:48:57 +00:00
Code Issues Packages Projects Releases Wiki Activity
tailscale/k8s-operator/api-proxy/env.go

30 lines
439 B
Go
Raw Normal View History

cmd/{k8s-operator,k8s-proxy},k8s-operator,kube: add new k8s-proxy command Refactors the proxy library interface to suit being a library better and adds a new k8s-proxy command, alongside Makefile and build_docker.sh updates to build a container out of it. Most features intentionally missing for now to act as a base/MVP version of the proxy command. Updates #13358 Change-Id: I21580db1875d2e64d72c4c988fe11c55f5cd6ae5 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-05-01 21:31:17 +01:00
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
//go:build !plan9
cmd/k8s-operator,k8s-operator/api-proxy: move k8s proxy code to library The defaultEnv and defaultBool functions are copied over temporarily to minimise diff. This lays the ground work for having both the operator and the new k8s-proxy binary implement the API proxy Updates #13358 Change-Id: Ieacc79af64df2f13b27a18135517bb31c80a5a02 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
2025-05-01 18:13:54 +01:00
package apiproxy
import (
"os"
"tailscale.com/types/opt"
)
func defaultBool(envName string, defVal bool) bool {
vs := os.Getenv(envName)
if vs == "" {
return defVal
}
v, _ := opt.Bool(vs).Get()
return v
}
func defaultEnv(envName, defVal string) string {
v := os.Getenv(envName)
if v == "" {
return defVal
}
return v
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.6 Page: 129ms Template: 6ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API