Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug for incorrect name #4175

Merged
merged 12 commits into from
Oct 12, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func CheckValidExecutionID(executionID, fieldName string) error {
matched := executionIDRegex.MatchString(executionID)

if !matched {
return errors.NewFlyteAdminErrorf(codes.InvalidArgument, "invalid %s format: %s", fieldName, executionID)
return errors.NewFlyteAdminErrorf(codes.InvalidArgument, "invalid %s format: %s, does not match regex '%s'", fieldName, executionID, executionIDRegex.String())
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestValidateExecInvalidName(t *testing.T) {
request := testutils.GetExecutionRequest()
request.Name = "12345"
err := ValidateExecutionRequest(context.Background(), request, testutils.GetRepoWithDefaultProject(), execConfig)
assert.EqualError(t, err, "invalid name format: 12345")
assert.EqualError(t, err, "invalid name format: 12345, does not match regex '^[a-z][a-z\\-0-9]*$'")

request.Name = "e2345"
err = ValidateExecutionRequest(context.Background(), request, testutils.GetRepoWithDefaultProject(), execConfig)
Expand Down
Loading