mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-30 07:54:18 +00:00
feature/featuretags, all: add build features, use existing ones in more places
Saves 270 KB. Updates #12614 Change-Id: I4c3fe06d32c49edb3a4bb0758a8617d83f291cf5 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
aa5b2ce83b
commit
c45f8813b4
@@ -17,6 +17,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"tailscale.com/feature/buildfeatures"
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/util/cloudenv"
|
||||
)
|
||||
@@ -34,6 +35,9 @@ type cloudInfo struct {
|
||||
}
|
||||
|
||||
func newCloudInfo(logf logger.Logf) *cloudInfo {
|
||||
if !buildfeatures.HasCloud {
|
||||
return nil
|
||||
}
|
||||
tr := &http.Transport{
|
||||
DisableKeepAlives: true,
|
||||
Dial: (&net.Dialer{
|
||||
@@ -53,6 +57,9 @@ func newCloudInfo(logf logger.Logf) *cloudInfo {
|
||||
// if the tailscaled process is running in a known cloud and there are any such
|
||||
// IPs present.
|
||||
func (ci *cloudInfo) GetPublicIPs(ctx context.Context) ([]netip.Addr, error) {
|
||||
if !buildfeatures.HasCloud {
|
||||
return nil, nil
|
||||
}
|
||||
switch ci.cloud {
|
||||
case cloudenv.AWS:
|
||||
ret, err := ci.getAWS(ctx)
|
||||
|
||||
Reference in New Issue
Block a user