Skip to content

Commit

Permalink
NET-6317 - update usage of deprecated fields: http2_protocol_options …
Browse files Browse the repository at this point in the history
…and access_log_path (#19940)

* updating usage of http2_protocol_options and access_log_path

* add changelog

* update template for AdminAccessLogConfig

* remove mucking with AdminAccessLogConfig
  • Loading branch information
jmurret authored Dec 14, 2023
1 parent afc6fe8 commit a995505
Show file tree
Hide file tree
Showing 50 changed files with 780 additions and 116 deletions.
3 changes: 3 additions & 0 deletions .changelog/19940.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
xds: remove usages of deprecated Envoy fields: `envoy.config.cluster.v3.Cluster.http2_protocol_options`, `envoy.config.bootstrap.v3.Admin.access_log_path`
```
9 changes: 8 additions & 1 deletion command/connect/envoy/bootstrap_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,14 @@ func appendTelemetryCollectorConfig(args *BootstrapTplArgs, telemetryCollectorBi
args.StaticClustersJSON += fmt.Sprintf(`{
"name": "consul_telemetry_collector_loopback",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "consul_telemetry_collector_loopback",
"endpoints": [
Expand Down
9 changes: 8 additions & 1 deletion command/connect/envoy/bootstrap_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,14 @@ const (
expectedTelemetryCollectorCluster = `{
"name": "consul_telemetry_collector_loopback",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "consul_telemetry_collector_loopback",
"endpoints": [
Expand Down
19 changes: 17 additions & 2 deletions command/connect/envoy/bootstrap_tpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ type GRPC struct {
const bootstrapTemplate = `{
"admin": {
{{- if (not .AdminAccessLogConfig) }}
"access_log_path": "{{ .AdminAccessLogPath }}",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "{{ .AdminAccessLogPath }}"
}
}
],
{{- end}}
{{- if .AdminAccessLogConfig }}
"access_log": [
Expand Down Expand Up @@ -220,7 +228,14 @@ const bootstrapTemplate = `{
}
},
{{- end }}
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "{{ .LocalAgentClusterName }}",
"endpoints": [
Expand Down
10 changes: 9 additions & 1 deletion command/connect/envoy/envoy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,15 @@ func TestGenerateConfig(t *testing.T) {
"envoy_bootstrap_json_tpl": `
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "{{ .AdminBindAddress }}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -46,7 +54,14 @@
}
}
},
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -33,7 +41,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
19 changes: 17 additions & 2 deletions command/connect/envoy/testdata/access-log-path.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/some/path/access.log",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/some/path/access.log"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -33,7 +41,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
9 changes: 8 additions & 1 deletion command/connect/envoy/testdata/access-logs-enabled.golden
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
19 changes: 17 additions & 2 deletions command/connect/envoy/testdata/acl-enabled-and-token.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -33,7 +41,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
19 changes: 17 additions & 2 deletions command/connect/envoy/testdata/acl-enabled-but-no-token.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -33,7 +41,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -46,7 +54,14 @@
}
}
},
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -33,7 +41,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
10 changes: 9 additions & 1 deletion command/connect/envoy/testdata/custom-bootstrap.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down
19 changes: 17 additions & 2 deletions command/connect/envoy/testdata/defaults-nodemeta.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"admin": {
"access_log_path": "/dev/null",
"access_log": [
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/dev/null"
}
}
],
"address": {
"socket_address": {
"address": "127.0.0.1",
Expand Down Expand Up @@ -34,7 +42,14 @@
"ignore_health_on_host_removal": false,
"connect_timeout": "1s",
"type": "STATIC",
"http2_protocol_options": {},
"typed_extension_protocol_options": {
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
"@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
"explicit_http_config": {
"http2_protocol_options": {}
}
}
},
"loadAssignment": {
"clusterName": "local_agent",
"endpoints": [
Expand Down
Loading

0 comments on commit a995505

Please sign in to comment.