@@ -114,14 +114,15 @@ func TestInstrumentationValidatingWebhook(t *testing.T) {
114
114
},
115
115
},
116
116
{
117
- name : "tls cert set but missing key" ,
117
+ name : "exporter: tls cert set but missing key" ,
118
118
inst : Instrumentation {
119
119
Spec : InstrumentationSpec {
120
120
Sampler : Sampler {
121
121
Type : ParentBasedTraceIDRatio ,
122
122
Argument : "0.99" ,
123
123
},
124
124
Exporter : Exporter {
125
+ Endpoint : "https://collector:4317" ,
125
126
TLS : & TLS {
126
127
Cert : "cert" ,
127
128
},
@@ -131,14 +132,15 @@ func TestInstrumentationValidatingWebhook(t *testing.T) {
131
132
warnings : []string {"both exporter.tls.key and exporter.tls.cert mut be set" },
132
133
},
133
134
{
134
- name : "tls key set but missing cert" ,
135
+ name : "exporter: tls key set but missing cert" ,
135
136
inst : Instrumentation {
136
137
Spec : InstrumentationSpec {
137
138
Sampler : Sampler {
138
139
Type : ParentBasedTraceIDRatio ,
139
140
Argument : "0.99" ,
140
141
},
141
142
Exporter : Exporter {
143
+ Endpoint : "https://collector:4317" ,
142
144
TLS : & TLS {
143
145
Key : "key" ,
144
146
},
@@ -148,14 +150,49 @@ func TestInstrumentationValidatingWebhook(t *testing.T) {
148
150
warnings : []string {"both exporter.tls.key and exporter.tls.cert mut be set" },
149
151
},
150
152
{
151
- name : "no warning set" ,
153
+ name : "exporter: tls set but using http:// " ,
152
154
inst : Instrumentation {
153
155
Spec : InstrumentationSpec {
154
156
Sampler : Sampler {
155
157
Type : ParentBasedTraceIDRatio ,
156
158
Argument : "0.99" ,
157
159
},
158
160
Exporter : Exporter {
161
+ Endpoint : "http://collector:4317" ,
162
+ TLS : & TLS {
163
+ Key : "key" ,
164
+ Cert : "cert" ,
165
+ },
166
+ },
167
+ },
168
+ },
169
+ warnings : []string {"exporter.tls is configured but exporter.endpoint is not enabling TLS with https://" },
170
+ },
171
+ {
172
+ name : "exporter: exporter using http://, but the tls is nil" ,
173
+ inst : Instrumentation {
174
+ Spec : InstrumentationSpec {
175
+ Sampler : Sampler {
176
+ Type : ParentBasedTraceIDRatio ,
177
+ Argument : "0.99" ,
178
+ },
179
+ Exporter : Exporter {
180
+ Endpoint : "https://collector:4317" ,
181
+ },
182
+ },
183
+ },
184
+ warnings : []string {"exporter is using https:// but exporter.tls is unset" },
185
+ },
186
+ {
187
+ name : "exporter no warning set" ,
188
+ inst : Instrumentation {
189
+ Spec : InstrumentationSpec {
190
+ Sampler : Sampler {
191
+ Type : ParentBasedTraceIDRatio ,
192
+ Argument : "0.99" ,
193
+ },
194
+ Exporter : Exporter {
195
+ Endpoint : "https://collector:4317" ,
159
196
TLS : & TLS {
160
197
Key : "key" ,
161
198
Cert : "cert" ,
0 commit comments