Skip to content

Incorrect error message when sending webhook request with non-existing type #1389

@dkarpele

Description

@dkarpele

Describe the bug
When user sends a webhook request with non-existing type it returns incorrect error message.

To Reproduce

  1. Set up webhook server (in my example on localhost)
  2. Send a request with non-existing type
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
  "specversion": "1.0",
  "id": "1",
  "type": "image",
...
  }
}' \
  "http://localhost:8080/webhook?type=doesntexist"    
repository name not found in webhook payload
  1. Send the same request again and see error message
no tags in the payload
  1. and again
unsupported event type: image
  1. again - the worst case
Webhook received and processing

Expected behavior
Show a clear error message and stop execution.

Additional context
Add any other context about the problem here.

Version
1.0.1
0.17

Regression
Does this issue apply to (check all that apply):

  • Annotation-based configuration (versions starting with 0, e.g., 0.17.0)
  • CRD-based configuration (versions starting with 1, e.g., 1.0.0)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions