Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/state/graph/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,12 @@ func validatePathMatch(
}

if *path.Type != v1beta1.PathMatchPathPrefix {
valErr := field.NotSupported(fieldPath, *path.Type, []string{string(v1beta1.PathMatchPathPrefix)})
valErr := field.NotSupported(fieldPath.Child("type"), *path.Type, []string{string(v1beta1.PathMatchPathPrefix)})
allErrs = append(allErrs, valErr)
}

if err := validator.ValidatePathInPrefixMatch(*path.Value); err != nil {
valErr := field.Invalid(fieldPath, *path.Value, err.Error())
valErr := field.Invalid(fieldPath.Child("value"), *path.Value, err.Error())
allErrs = append(allErrs, valErr)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/state/graph/httproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func TestBuildRoute(t *testing.T) {
},
Conditions: []conditions.Condition{
conditions.NewRouteUnsupportedValue(
`All rules are invalid: spec.rules[0].matches[0].path: Invalid value: "/invalid": invalid path`,
`All rules are invalid: spec.rules[0].matches[0].path.value: Invalid value: "/invalid": invalid path`,
),
},
Rules: []Rule{
Expand Down Expand Up @@ -581,7 +581,7 @@ func TestBuildRoute(t *testing.T) {
Conditions: []conditions.Condition{
conditions.NewTODO(
`Some rules are invalid: ` +
`[spec.rules[0].matches[0].path: Invalid value: "/invalid": invalid path, ` +
`[spec.rules[0].matches[0].path.value: Invalid value: "/invalid": invalid path, ` +
`spec.rules[1].filters[0].requestRedirect.hostname: Invalid value: ` +
`"invalid.example.com": invalid hostname]`,
),
Expand Down