From 27cd83c2d3fe25b18050b6116e1c115df40435dd Mon Sep 17 00:00:00 2001 From: cthuang Date: Sat, 28 Aug 2021 16:42:55 +0100 Subject: [PATCH] Revert "TUN-4926: Implement --region configuration option" This reverts commit d0a1daac3b3f78a8c0f0ccff70c0de5d17d0adab. --- cmd/cloudflared/tunnel/cmd.go | 5 ----- cmd/cloudflared/tunnel/configuration.go | 1 - origin/supervisor.go | 2 +- origin/tunnel.go | 1 - 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cmd/cloudflared/tunnel/cmd.go b/cmd/cloudflared/tunnel/cmd.go index 00a8da74..a03ba888 100644 --- a/cmd/cloudflared/tunnel/cmd.go +++ b/cmd/cloudflared/tunnel/cmd.go @@ -494,11 +494,6 @@ func tunnelFlags(shouldHide bool) []cli.Flag { EnvVars: []string{"TUNNEL_EDGE"}, Hidden: true, }), - altsrc.NewStringSliceFlag(&cli.StringSliceFlag{ - Name: "region", - Usage: "Cloudflare Edge region to connect to. Omit or set to empty to connect to the global region.", - EnvVars: []string{"TUNNEL_REGION"}, - }), altsrc.NewStringFlag(&cli.StringFlag{ Name: tlsconfig.CaCertFlag, Usage: "Certificate Authority authenticating connections with Cloudflare's edge network.", diff --git a/cmd/cloudflared/tunnel/configuration.go b/cmd/cloudflared/tunnel/configuration.go index dc264c31..8becf178 100644 --- a/cmd/cloudflared/tunnel/configuration.go +++ b/cmd/cloudflared/tunnel/configuration.go @@ -279,7 +279,6 @@ func prepareTunnelConfig( OSArch: buildInfo.OSArch(), ClientID: clientID, EdgeAddrs: c.StringSlice("edge"), - Region: c.String("region"), HAConnections: c.Int("ha-connections"), IncidentLookup: origin.NewIncidentLookup(), IsAutoupdated: c.Bool("is-autoupdated"), diff --git a/origin/supervisor.go b/origin/supervisor.go index 4508f2ca..bcb19da0 100644 --- a/origin/supervisor.go +++ b/origin/supervisor.go @@ -74,7 +74,7 @@ func NewSupervisor(config *TunnelConfig, reconnectCh chan ReconnectSignal, grace if len(config.EdgeAddrs) > 0 { edgeIPs, err = edgediscovery.StaticEdge(config.Log, config.EdgeAddrs) } else { - edgeIPs, err = edgediscovery.ResolveEdge(config.Log, config.Region) + edgeIPs, err = edgediscovery.ResolveEdge(config.Log, "") } if err != nil { return nil, err diff --git a/origin/tunnel.go b/origin/tunnel.go index 4b56a464..fa734b4f 100644 --- a/origin/tunnel.go +++ b/origin/tunnel.go @@ -45,7 +45,6 @@ type TunnelConfig struct { ClientID string CloseConnOnce *sync.Once // Used to close connectedSignal no more than once EdgeAddrs []string - Region string HAConnections int IncidentLookup IncidentLookup IsAutoupdated bool