You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see three places in the cosigned API validation logic that use ErrGeneric, which takes a variadic second argument for field names, here is one such place:
errors=errors.Also(apis.ErrGeneric("At least one image should be defined").ViaField("images"))
}
The error from this shows up as:
At least one image should be defined:
With the .ViaField doing nothing because no fields were supplied to the ErrGeneric!
I think that all of the current ErrGeneric calls in this file should be changed to use apis.ErrMissingField, which will produce a better error message.
Description
I see three places in the
cosigned
API validation logic that useErrGeneric
, which takes a variadic second argument for field names, here is one such place:cosign/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation.go
Lines 31 to 33 in 8906eff
The error from this shows up as:
With the
.ViaField
doing nothing because no fields were supplied to theErrGeneric
!I think that all of the current
ErrGeneric
calls in this file should be changed to useapis.ErrMissingField
, which will produce a better error message.cc @vaikas @kkavitha @coyote240
The text was updated successfully, but these errors were encountered: