configmap: option to not trust incoming tracing spans (#7045)
* validate the sender of tracing spans * add location-specific setting
This commit is contained in:
parent
e4001df41e
commit
7d5452d00b
9 changed files with 124 additions and 34 deletions
|
|
@ -106,6 +106,29 @@ func TestIngressAnnotationOpentracingSetFalse(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestIngressAnnotationOpentracingTrustSetTrue(t *testing.T) {
|
||||
ing := buildIngress()
|
||||
|
||||
data := map[string]string{}
|
||||
data[parser.GetAnnotationWithPrefix("enable-opentracing")] = "true"
|
||||
data[parser.GetAnnotationWithPrefix("opentracing-trust-incoming-span")] = "true"
|
||||
ing.SetAnnotations(data)
|
||||
|
||||
val, _ := NewParser(&resolver.Mock{}).Parse(ing)
|
||||
openTracing, ok := val.(*Config)
|
||||
if !ok {
|
||||
t.Errorf("expected a Config type")
|
||||
}
|
||||
|
||||
if !openTracing.Enabled {
|
||||
t.Errorf("expected annotation value to be true, got false")
|
||||
}
|
||||
|
||||
if !openTracing.TrustEnabled {
|
||||
t.Errorf("expected annotation value to be true, got false")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIngressAnnotationOpentracingUnset(t *testing.T) {
|
||||
ing := buildIngress()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue