Skip to content

Commit

Permalink
BUG/MINOR: tcp_request_rule: fix unssuported action message
Browse files Browse the repository at this point in the history
  • Loading branch information
mjuraga authored and oliwer committed Aug 22, 2024
1 parent 002238e commit e9c52a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions configuration/tcp_request_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro
rule.Cond = a.Cond
rule.CondTest = a.CondTest
default:
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", a))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", a))
}

return rule, nil
Expand Down Expand Up @@ -522,7 +522,7 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro
rule.Cond = a.Cond
rule.CondTest = a.CondTest
default:
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", a))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", a))
}
case *tcp_types.Session:
rule = &models.TCPRequestRule{
Expand Down Expand Up @@ -594,10 +594,10 @@ func ParseTCPRequestRule(f types.TCPType) (rule *models.TCPRequestRule, err erro
rule.Cond = a.Cond
rule.CondTest = a.CondTest
default:
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", a))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", a))
}
default:
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", v))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", v))
}
return rule, nil
}
Expand Down Expand Up @@ -802,7 +802,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e
},
}, nil
}
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Action))
case models.TCPRequestRuleTypeContent:
switch f.Action {
case models.TCPRequestRuleActionAccept:
Expand Down Expand Up @@ -1084,7 +1084,7 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e
},
}, nil
}
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Action))
case models.TCPRequestRuleTypeSession:
switch f.Action {
case models.TCPRequestRuleActionAccept:
Expand Down Expand Up @@ -1229,14 +1229,14 @@ func SerializeTCPRequestRule(f models.TCPRequestRule) (rule types.TCPType, err e
},
}, nil
}
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Action))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Action))
case models.TCPRequestRuleTypeInspectDashDelay:
if f.Timeout == nil {
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Type))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Type))
}
return &tcp_types.InspectDelay{
Timeout: strconv.FormatInt(*f.Timeout, 10),
}, nil
}
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%T' in tcp_request_rule", f.Type))
return nil, NewConfError(ErrValidationError, fmt.Sprintf("unsupported action '%s' in tcp_request_rule", f.Type))
}

0 comments on commit e9c52a1

Please sign in to comment.