-
Bug
-
Resolution: Done-Errata
-
Normal
-
None
-
4.17
-
Moderate
-
None
-
CNF RAN Sprint 264
-
1
-
False
-
-
N/A
-
Release Note Not Required
-
Done
-
This is a clone of issue OCPBUGS-46627. The following is the description of the original issue:
—
If a consumer sends a bad request to subscribe to an event using the PTP event api v2, an HTTP 409 Conflict response is received instead of a 400 Bad Request.
Test Steps:
- Deploy ptp-operator with v2 event
- Create a valid subscription to an event.
- Deploy a consumer and send a specific incorrect subscribe request to the same event. The wrong request must have an incorrect field ResourceAddress. Note that it is not an incorrect value, the key field must be wrongly named.
Result:
First, create a valid subscription. See that the subscription is listed
curl -v -X GET "http://${URL}/api/ocloudNotifications/v2/subscriptions" | jq . [ { "ResourceAddress": "/cluster/node/snonode.sno-worker-01.inbound-int.se-lab.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state", "EndpointUri": "http://localhost:9043/api/ocloudNotifications/v2/dummy", "SubscriptionId": "2c027fee-30dc-4ccf-8f2a-6d20b9542317", "UriLocation": "http://ptp-event-publisher-service-snonode.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions/2c027fee-30dc-4ccf-8f2a-6d20b9542317" } ]
Now, create an invalid subscription request. Notice that the request field ResourceAddress must be incorrectly called:
curl -X POST "http://${URL}/api/ocloudNotifications/v2/subscriptions" --header 'Content-Type: application/json' --data '{ "EndpointUri": "http://localhost:9043/api/ocloudNotifications/v2/dummy", "ResourceERROR": "/cluster/node/snonode.sno-worker-01.inbound-int.se-lab.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state" }' -vvvvv < HTTP/1.1 409 Conflict
curl -X POST "http://${URL}/api/ocloudNotifications/v2/subscriptions" --header 'Content-Type: application/json' --data '{ "EndpointUri": "http://localhost:9043/api/ocloudNotifications/v2/dummy", "nothing": "/cluster/node/snonode.sno-worker-01.inbound-int.se-lab.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state" }' -vvvvv < HTTP/1.1 409 Conflict
curl -X POST "http://${URL}/api/ocloudNotifications/v2/subscriptions" --header 'Content-Type: application/json' --data '{ "EndpointUri": "http://localhost:9043/api/ocloudNotifications/v2/dummy", "ResourceERROR": "wrong route" }' -vvvvv < HTTP/1.1 409 Conflict
See that a 409 Conflict HTTP response is sent instead of a 400 Bad Request.
Expected Result:
An HTTP 400 Bad Request must be returned. See that if the EndpointUri field is wrong named the correct HTTP code is received:
curl -X POST "http://${URL}/api/ocloudNotifications/v2/subscriptions" --header 'Content-Type: application/json' --data '{ "ndpointUri": "http://localhost:9043/api/ocloudNotifications/v2/dummy", "ResourceAddress": "/cluster/node/snonode.sno-worker-01.inbound-int.se-lab.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state" }' < HTTP/1.1 400 Bad Request
- depends on
-
OCPBUGS-47792 Bad HTTP response (409) sent when the subscription request is not correct
- Closed
- links to
-
RHBA-2025:0140 OpenShift Container Platform 4.16.z bug fix update