Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Improves Access Logger names
Browse files Browse the repository at this point in the history
Access loggers were using incosistent names accross the project.
Consolidate all of them into a single one named `envoy.access_loggers.stream`

Signed-off-by: Sotiris Nanopoulos <[email protected]>
  • Loading branch information
Sotiris Nanopoulos committed Jun 8, 2021
1 parent 7dd0fb2 commit 9949d04
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 17 deletions.
3 changes: 2 additions & 1 deletion pkg/envoy/bootstrap/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"google.golang.org/protobuf/types/known/durationpb"

"github.com/openservicemesh/osm/pkg/constants"
"github.com/openservicemesh/osm/pkg/envoy"
)

// BuildFromConfig builds and returns an Envoy Bootstrap object from the given config
Expand Down Expand Up @@ -87,7 +88,7 @@ func BuildFromConfig(config Config) (*xds_bootstrap.Bootstrap, error) {
Admin: &xds_bootstrap.Admin{
AccessLog: []*xds_accesslog_config.AccessLog{
{
Name: "envoy.access_loggers.stdout",
Name: envoy.AccessLoggerName,
ConfigType: &xds_accesslog_config.AccessLog_TypedConfig{
TypedConfig: pbAccessLog,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/envoy/bootstrap/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestBuildFromConfig(t *testing.T) {

expectedYAML := `admin:
access_log:
- name: envoy.access_loggers.stdout
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
address:
Expand Down
6 changes: 4 additions & 2 deletions pkg/envoy/xdsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
xds_accesslog "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3"
xds_auth "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3"
extensions_upstream_http_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/upstreams/http/v3"
"github.com/envoyproxy/go-control-plane/pkg/wellknown"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
structpb "github.com/golang/protobuf/ptypes/struct"
Expand Down Expand Up @@ -49,6 +48,9 @@ const (

// OutboundPassthroughCluster is the outbound passthrough cluster name
OutboundPassthroughCluster = "passthrough-outbound"

// AccessLoggerName is name used for the envoy access loggers.
AccessLoggerName = "envoy.access_loggers.stream"
)

// ALPNInMesh indicates that the proxy is connecting to an in-mesh destination.
Expand Down Expand Up @@ -86,7 +88,7 @@ func GetAccessLog() []*xds_accesslog_filter.AccessLog {
return nil
}
return []*xds_accesslog_filter.AccessLog{{
Name: wellknown.FileAccessLog,
Name: AccessLoggerName,
ConfigType: &xds_accesslog_filter.AccessLog_TypedConfig{
TypedConfig: accessLog,
}},
Expand Down
6 changes: 4 additions & 2 deletions pkg/injector/envoy_config_health_probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/structpb"

"github.com/openservicemesh/osm/pkg/envoy"

xds_accesslog_filter "github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v3"
xds_cluster "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
xds_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
Expand Down Expand Up @@ -232,7 +234,7 @@ func getHTTPAccessLog() (*xds_accesslog_filter.AccessLog, error) {
return nil, err
}
return &xds_accesslog_filter.AccessLog{
Name: wellknown.FileAccessLog,
Name: envoy.AccessLoggerName,
ConfigType: &xds_accesslog_filter.AccessLog_TypedConfig{
TypedConfig: accessLog,
},
Expand All @@ -247,7 +249,7 @@ func getTCPAccessLog() (*xds_accesslog_filter.AccessLog, error) {
return nil, err
}
return &xds_accesslog_filter.AccessLog{
Name: wellknown.FileAccessLog,
Name: envoy.AccessLoggerName,
ConfigType: &xds_accesslog_filter.AccessLog_TypedConfig{
TypedConfig: accessLog,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
admin:
access_log:
- name: envoy.access_loggers.stdout
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
address:
Expand Down Expand Up @@ -107,7 +107,7 @@ static_resources:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down Expand Up @@ -157,7 +157,7 @@ static_resources:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down Expand Up @@ -207,7 +207,7 @@ static_resources:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: envoy.access_loggers.file
name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filter_chains:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filter_chains:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filter_chains:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filter_chains:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ filter_chains:
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
access_log:
- name: envoy.access_loggers.file
- name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: envoy.access_loggers.file
name: envoy.access_loggers.stream
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
log_format:
Expand Down

0 comments on commit 9949d04

Please sign in to comment.