Skip to content

Commit 30df54e

Browse files
committed
Code review
1 parent 879fa7b commit 30df54e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

internal/mode/static/nginx/config/generator_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ func TestGenerate(t *testing.T) {
9999
g.Expect(httpCfg).To(ContainSubstring("upstream"))
100100
g.Expect(httpCfg).To(ContainSubstring("split_clients"))
101101

102-
g.Expect(httpCfg).To(ContainSubstring(`endpoint "1.2.3.4:123";`))
103-
g.Expect(httpCfg).To(ContainSubstring(`interval "5s";`))
102+
g.Expect(httpCfg).To(ContainSubstring("endpoint 1.2.3.4:123;"))
103+
g.Expect(httpCfg).To(ContainSubstring("interval 5s;"))
104104
g.Expect(httpCfg).To(ContainSubstring("batch_size 512;"))
105105
g.Expect(httpCfg).To(ContainSubstring("batch_count 4;"))
106-
g.Expect(httpCfg).To(ContainSubstring(`otel_service_name "ngf:gw-ns:gw-name:my-name";`))
106+
g.Expect(httpCfg).To(ContainSubstring("otel_service_name ngf:gw-ns:gw-name:my-name;"))
107107

108108
g.Expect(files[2].Path).To(Equal("/etc/nginx/conf.d/matches.json"))
109109

internal/mode/static/nginx/config/telemetry_template.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package config
22

33
const otelTemplateText = `
44
otel_exporter {
5-
endpoint "{{ .Endpoint }}";
5+
endpoint {{ .Endpoint }};
66
{{- if .Interval }}
7-
interval "{{ .Interval }}";
7+
interval {{ .Interval }};
88
{{- end }}
99
{{- if .BatchSize }}
1010
batch_size {{ .BatchSize }};
@@ -14,7 +14,7 @@ otel_exporter {
1414
{{- end }}
1515
}
1616
17-
otel_service_name "{{ .ServiceName }}";
17+
otel_service_name {{ .ServiceName }};
1818
1919
{{- range $attr := .SpanAttributes }}
2020
otel_span_attr "{{ $attr.Key }}" "{{ $attr.Value }}";

internal/mode/static/nginx/config/telemetry_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ func TestExecuteTelemetry(t *testing.T) {
3232

3333
g := NewWithT(t)
3434
expSubStrings := map[string]int{
35-
`endpoint "1.2.3.4:123";`: 1,
36-
`otel_service_name "ngf:gw-ns:gw-name:my-name";`: 1,
37-
`interval "5s";`: 1,
38-
"batch_size 512;": 1,
39-
"batch_count 4;": 1,
40-
"otel_span_attr": 2,
35+
"endpoint 1.2.3.4:123;": 1,
36+
"otel_service_name ngf:gw-ns:gw-name:my-name;": 1,
37+
"interval 5s;": 1,
38+
"batch_size 512;": 1,
39+
"batch_count 4;": 1,
40+
"otel_span_attr": 2,
4141
}
4242

4343
for expSubStr, expCount := range expSubStrings {

internal/mode/static/nginx/config/validation/generic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const (
2323

2424
var alphaNumericStringFmtRegexp = regexp.MustCompile("^" + alphaNumericStringFmt + "$")
2525

26-
// ValidateServiceName validates a k8s service name that can only use alphanumeric characters.
26+
// ValidateServiceName validates a service name that can only use alphanumeric characters.
2727
func (GenericValidator) ValidateServiceName(name string) error {
2828
if !alphaNumericStringFmtRegexp.MatchString(name) {
2929
examples := []string{

0 commit comments

Comments
 (0)