Include namespace and partition in error messages when validating ingress header manip

This commit is contained in:
Paul Banks 2021-09-10 20:58:51 +01:00
parent 1079089f20
commit b38e84df63
1 changed files with 3 additions and 3 deletions

View File

@ -173,12 +173,12 @@ func (e *IngressGatewayConfigEntry) Validate() error {
if err := validateInnerEnterpriseMeta(&s.EnterpriseMeta, &e.EnterpriseMeta); err != nil {
return fmt.Errorf("Services[%d].%v", i, err)
}
sn := NewServiceName(s.Name, &s.EnterpriseMeta)
if err := s.RequestHeaders.Validate(listener.Protocol); err != nil {
return fmt.Errorf("request headers %s (service %q on listener on port %d)", err, s.Name, listener.Port)
return fmt.Errorf("request headers %s (service %q on listener on port %d)", err, sn.String(), listener.Port)
}
if err := s.ResponseHeaders.Validate(listener.Protocol); err != nil {
return fmt.Errorf("response headers %s (service %q on listener on port %d)", err, s.Name, listener.Port)
return fmt.Errorf("response headers %s (service %q on listener on port %d)", err, sn.String(), listener.Port)
}
if listener.Protocol == "tcp" {