diff --git a/agent/structs/config_entry.go b/agent/structs/config_entry.go index 048ab8425..97e3e9ff8 100644 --- a/agent/structs/config_entry.go +++ b/agent/structs/config_entry.go @@ -706,11 +706,7 @@ func (cfg UpstreamConfig) MergeInto(dst map[string]interface{}, legacy bool) { } func (cfg *UpstreamConfig) Normalize() { - if cfg.Protocol == "" { - cfg.Protocol = "tcp" - } else { - cfg.Protocol = strings.ToLower(cfg.Protocol) - } + cfg.Protocol = strings.ToLower(cfg.Protocol) if cfg.ConnectTimeoutMs < 1 { cfg.ConnectTimeoutMs = 5000 diff --git a/agent/structs/config_entry_test.go b/agent/structs/config_entry_test.go index 9e79d8f14..7e5d58f16 100644 --- a/agent/structs/config_entry_test.go +++ b/agent/structs/config_entry_test.go @@ -1575,12 +1575,10 @@ func TestServiceConfigEntry_Normalize(t *testing.T) { ConnectTimeoutMs: 5000, }, "memcached": { - Protocol: "tcp", ConnectTimeoutMs: 5000, }, }, UpstreamDefaults: &UpstreamConfig{ - Protocol: "tcp", ConnectTimeoutMs: 5000, }, }, @@ -1771,7 +1769,6 @@ func TestParseUpstreamConfig(t *testing.T) { input: nil, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", }, }, { @@ -1779,7 +1776,6 @@ func TestParseUpstreamConfig(t *testing.T) { input: map[string]interface{}{}, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", }, }, { @@ -1790,7 +1786,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", }, }, { @@ -1810,7 +1805,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 1000, - Protocol: "tcp", }, }, { @@ -1820,7 +1814,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 1000, - Protocol: "tcp", }, }, { @@ -1830,7 +1823,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 1000, - Protocol: "tcp", }, }, { @@ -1844,7 +1836,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", Limits: &UpstreamLimits{ MaxConnections: intPointer(50), MaxPendingRequests: intPointer(60), @@ -1863,7 +1854,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", Limits: &UpstreamLimits{ MaxConnections: intPointer(0), MaxPendingRequests: intPointer(0), @@ -1881,7 +1871,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", PassiveHealthCheck: &PassiveHealthCheck{ Interval: 22 * time.Second, MaxFailures: 7, @@ -1897,7 +1886,6 @@ func TestParseUpstreamConfig(t *testing.T) { }, want: UpstreamConfig{ ConnectTimeoutMs: 5000, - Protocol: "tcp", MeshGateway: MeshGatewayConfig{ Mode: MeshGatewayModeRemote, },