Skip to content

Commit

Permalink
Fix validation calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sjberman committed Apr 29, 2024
1 parent 680b715 commit 4018717
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/mode/static/state/graph/nginxproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func validateNginxProxy(
if telemetry != nil {
telPath := spec.Child("telemetry")
if telemetry.ServiceName != nil {
if err := validator.ValidateEscapedStringNoVarExpansion(*telemetry.ServiceName); err != nil {
if err := validator.ValidateServiceName(*telemetry.ServiceName); err != nil {
allErrs = append(allErrs, field.Invalid(telPath.Child("serviceName"), *telemetry.ServiceName, err.Error()))
}
}
Expand All @@ -58,13 +58,13 @@ func validateNginxProxy(
expPath := telPath.Child("exporter")

if exp.Endpoint != "" {
if err := validator.ValidateEscapedStringNoVarExpansion(exp.Endpoint); err != nil {
if err := validator.ValidateEndpoint(exp.Endpoint); err != nil {
allErrs = append(allErrs, field.Invalid(expPath.Child("endpoint"), exp.Endpoint, err.Error()))
}
}

if exp.Interval != nil {
if err := validator.ValidateEscapedStringNoVarExpansion(string(*exp.Interval)); err != nil {
if err := validator.ValidateNginxDuration(string(*exp.Interval)); err != nil {
allErrs = append(allErrs, field.Invalid(expPath.Child("interval"), *exp.Interval, err.Error()))
}
}
Expand Down

0 comments on commit 4018717

Please sign in to comment.