-
Notifications
You must be signed in to change notification settings - Fork 13
PTP Status Reporting via Custom Resource Conditions #106
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
base: main
Are you sure you want to change the base?
Conversation
pkg/status/ptpconfig_status.go
Outdated
| } | ||
|
|
||
| // enforce max history | ||
| const maxConditions = 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we just want to do N conditions or should One of the same type replace it e.g if PTP4L is no longer running I would expect the running condition to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I think we thought of replacing same kind , but same kind means we need to match with conditionType and other paramters file profile name and file name , to support multiple profiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if c.Type == cond.Type && c.Profile == cond.Profile && c.Filename == cond.Filename && c.Process == cond.Process {
*c = cond
updated = true
break
}
pkg/status/ptpconfig_status.go
Outdated
| // enforce max history | ||
| const maxConditions = 100 | ||
| if n := len(pc.Status.PtpStatus.Conditions); n > maxConditions { | ||
| pc.Status.PtpStatus.Conditions = pc.Status.PtpStatus.Conditions[n-maxConditions:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if one process (e.g. ptp4l) has too many statuses, we won't see detail from other processes such as ts2phc if it didn't report more recently than the last 100 ptp4l?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point , i should filter them by processname , will add that process name + profile name + file name (ptp4l.0.config )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed , now upsert by composite key (type, profile, filename, process), so repeated ptp4l updates overwrite the same entry instead of appending. They won’t evict ts2phc, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now only if we have 100 distinct keys then we evict
40a9ab8 to
b80b607
Compare
b80b607 to
345311e
Compare
nocturnalastro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
api/v1/ptpconfig_types.go
Outdated
| ConditionPhc2sysRunning PtpConditionType = "Phc2sysRunning" | ||
| ConditionTs2phcRunning PtpConditionType = "Ts2phcRunning" | ||
| ConditionSynce4lRunning PtpConditionType = "Synce4lRunning" | ||
| ConditionChronydRunning PtpConditionType = "ChronydRunning" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should gpspipe and gpsd be added here?
345311e to
e40856b
Compare
e40856b to
4a48ac5
Compare
Signed-off-by: Aneesh Puttur <[email protected]>
4a48ac5 to
df5a320
Compare
|
What would this look like on daemon side? |
PTP: add PtpConfig status conditions API, helper, and RBAC for operand updates
Introduces status.ptpStatus.conditions[] on PtpConfig to expose runtime health/state per profile and active config file.
Adds a small helper API for operands (linuxptp-daemon, cloud-event-proxy) to upsert conditions via the status subresource.
Wires RBAC so linuxptp-daemon can update PtpConfig status.
Documents the schema and examples in README.
Te operand can import the API call call this to update (RBAC are updated for linuxptp-daemon pods)