mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
cmd/k8s-operator: allow to optionally configure tailscaled port (#14005)
Updates tailscale/tailscale#13981 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
parent
d4222fae95
commit
809a6eba80
@ -11,6 +11,7 @@
|
|||||||
"context"
|
"context"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -150,6 +151,13 @@ func initTSNet(zlog *zap.SugaredLogger) (*tsnet.Server, *tailscale.Client) {
|
|||||||
Hostname: hostname,
|
Hostname: hostname,
|
||||||
Logf: zlog.Named("tailscaled").Debugf,
|
Logf: zlog.Named("tailscaled").Debugf,
|
||||||
}
|
}
|
||||||
|
if p := os.Getenv("TS_PORT"); p != "" {
|
||||||
|
port, err := strconv.ParseUint(p, 10, 16)
|
||||||
|
if err != nil {
|
||||||
|
startlog.Fatalf("TS_PORT %q cannot be parsed as uint16: %v", p, err)
|
||||||
|
}
|
||||||
|
s.Port = uint16(port)
|
||||||
|
}
|
||||||
if kubeSecret != "" {
|
if kubeSecret != "" {
|
||||||
st, err := kubestore.New(logger.Discard, kubeSecret)
|
st, err := kubestore.New(logger.Discard, kubeSecret)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user