mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-29 07:09:33 +00:00
cmd/{k8s-operator,k8s-proxy},kube/k8s-proxy: add static endpoints for kube-apiserver type ProxyGroups (#16523)
Updates #13358 Signed-off-by: chaosinthecrd <tom@tmlabs.co.uk>
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@@ -63,6 +64,20 @@ func run(logger *zap.SugaredLogger) error {
|
||||
logger = logger.WithOptions(zap.IncreaseLevel(level))
|
||||
}
|
||||
|
||||
// TODO:(ChaosInTheCRD) This is a temporary workaround until we can set static endpoints using prefs
|
||||
if se := cfg.Parsed.StaticEndpoints; len(se) > 0 {
|
||||
logger.Debugf("setting static endpoints '%v' via TS_DEBUG_PRETENDPOINT environment variable", cfg.Parsed.StaticEndpoints)
|
||||
ses := make([]string, len(se))
|
||||
for i, e := range se {
|
||||
ses[i] = e.String()
|
||||
}
|
||||
|
||||
err := os.Setenv("TS_DEBUG_PRETENDPOINT", strings.Join(ses, ","))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.Parsed.App != nil {
|
||||
hostinfo.SetApp(*cfg.Parsed.App)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user