OCPBUGS-44954: PTP operator Event Notification API breaking change within 4.16 release #109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Backward Compatibility for PTP Clock-Class Event Subscription (PR 1 of 2)
This is the first of two pull requests to address a backward compatibility issue. The second PR will be in the cloud-event-proxy repository.
The problem arises because the V1 version of PTP events subscribed to the resource address /sync/ptp-status/ptp-clock-class-change, which was updated to /sync/ptp-status/clock-class in V2 as per O-RAN spec.
As a result, older versions referencing /sync/ptp-status/ptp-clock-class-change failed to subscribe to clock-class events.
This PR resolves the issue by introducing a new enum type, PtpClockClassV1, which refers to the older event resource.
The solution ensures backward compatibility for V1 while adhering to the O-RAN 7.2.3.10 specification for the PtpClockClass notification.
Key Changes:
Updated Definitions:
// O-RAN 7.2.3.10
// PtpClockClass notification is generated when the clock-class changes.
PtpClockClass EventResource = "/sync/ptp-status/clock-class"
// Support V1
// PtpClockClassV1 notification is generated when the clock-class changes for V1.
PtpClockClassV1 EventResource = "/sync/ptp-status/ptp-clock-class-change"
This change ensures that both V1 and the current versions of PTP events can correctly subscribe to clock-class notifications without breaking functionality for older versions.