Skip to content

Commit

Permalink
update tempalte for AdminAccessLogConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Dec 14, 2023
1 parent 1c6d5e5 commit 2939082
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 41 deletions.
8 changes: 7 additions & 1 deletion command/connect/envoy/bootstrap_tpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,13 @@ const bootstrapTemplate = `{
"access_log": [
{{- range $index, $element := .AdminAccessLogConfig}}
{{if $index}},{{end}}
{{$element}}
{
"name": "envoy.access_loggers.file",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "{{$element}}"
}
}
{{end}}],
{{- end}}
"address": {
Expand Down
80 changes: 40 additions & 40 deletions command/connect/envoy/envoy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -206,7 +206,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -230,7 +230,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -257,7 +257,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -287,7 +287,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -345,7 +345,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -369,7 +369,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -395,7 +395,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -422,7 +422,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -447,7 +447,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "9999",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -473,7 +473,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "9999",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -493,7 +493,7 @@ func TestGenerateConfig(t *testing.T) {
GRPC: GRPC{
AgentSocket: "/var/run/consul.sock",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -512,7 +512,7 @@ func TestGenerateConfig(t *testing.T) {
AgentSocket: "/var/run/consul.sock",
AgentTLS: true,
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
AgentCAPEM: rootPEM,
Expand All @@ -537,7 +537,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "9999",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -563,7 +563,7 @@ func TestGenerateConfig(t *testing.T) {
AgentPort: "9998",
AgentTLS: true,
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -588,7 +588,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "9999",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -612,7 +612,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/some/path/access.log",
AdminAccessLogConfig: []string{"/some/path/access.log"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -644,7 +644,7 @@ func TestGenerateConfig(t *testing.T) {
AgentTLS: true,
},
AgentCAPEM: rootPEM,
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -676,7 +676,7 @@ func TestGenerateConfig(t *testing.T) {
AgentTLS: true,
},
AgentCAPEM: pathPEM,
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -726,7 +726,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -763,7 +763,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -805,7 +805,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -834,7 +834,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -893,7 +893,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -918,7 +918,7 @@ func TestGenerateConfig(t *testing.T) {
AgentPort: "8502",
AgentTLS: false,
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -944,7 +944,7 @@ func TestGenerateConfig(t *testing.T) {
AgentTLS: true,
},
AgentCAPEM: rootPEM,
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -972,7 +972,7 @@ func TestGenerateConfig(t *testing.T) {
AgentPort: "8502",
AgentTLS: false,
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -1001,7 +1001,7 @@ func TestGenerateConfig(t *testing.T) {
AgentTLS: true,
},
AgentCAPEM: rootPEM,
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1019,7 +1019,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1037,7 +1037,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1058,7 +1058,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1077,7 +1077,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1095,7 +1095,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1113,7 +1113,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1131,7 +1131,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1149,7 +1149,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1173,7 +1173,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502",
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand Down Expand Up @@ -1205,7 +1205,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
LocalAgentClusterName: xds.LocalAgentClusterName,
Expand All @@ -1227,7 +1227,7 @@ func TestGenerateConfig(t *testing.T) {
AgentAddress: "127.0.0.1",
AgentPort: "8502", // Note this is the gRPC port
},
AdminAccessLogPath: "/dev/null",
AdminAccessLogConfig: []string{"/dev/null"},
AdminBindAddress: "127.0.0.1",
AdminBindPort: "19000",
Token: "foo",
Expand Down

0 comments on commit 2939082

Please sign in to comment.