Skip to content

Commit

Permalink
Merge pull request #260 from aneeshkp/crashloop1
Browse files Browse the repository at this point in the history
OCPBUGS-17322: linuxptp-daemon pod status changes to Error and CrashLoopBackOff after a ptpconfig is loaded
  • Loading branch information
openshift-merge-robot authored Aug 16, 2023
2 parents 75c41ec + 553cb9c commit 7168a89
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plugins/ptp_operator/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (

"github.com/prometheus/client_golang/prometheus"
"github.com/redhat-cne/sdk-go/pkg/event/ptp"
log "github.com/sirupsen/logrus"
"k8s.io/utils/pointer"
)

Expand Down Expand Up @@ -92,8 +91,6 @@ func (p *PTPEventState) UpdateCurrentEventState(c ClockState) ptp.SyncState {
if d.Metric[k].metricGauge == nil {
d.Metric[k].metricGauge.With(map[string]string{"from": d.Process, "process": d.Process,
"node": d.NodeName, "iface": iface}).Set(float64(v))
} else {
log.Errorf("metric %s is not registered", k)
}
}
} else {
Expand Down Expand Up @@ -156,7 +153,7 @@ func (p *PTPEventState) UpdateCurrentEventState(c ClockState) ptp.SyncState {

// UnRegisterMetrics ... unregister metrics by processname
func (p *PTPEventState) UnRegisterMetrics(processName string) {
// write a functions to unregister meteric from dependson object
// write a functions to unregister metric from dependence on object
if d, ok := p.DependsOn[processName]; ok {
// write loop d.Metric
if d.Metric != nil {
Expand All @@ -172,6 +169,9 @@ func (p *PTPEventState) UnRegisterMetrics(processName string) {
// write a functions to unregister meteric from dependson object
func (p *PTPEventState) UnRegisterAllMetrics() {
// write loop p.DependsOn
if p.DependsOn == nil {
return
}
for _, d := range p.DependsOn {
// write loop d.Metric
if d.Metric != nil {
Expand All @@ -189,6 +189,9 @@ func (p *PTPEventState) UnRegisterAllMetrics() {
// write a functions to delete meteric from dependson object
func (p *PTPEventState) DeleteAllMetrics() {
// write loop p.DependsOn
if p.DependsOn == nil {
return
}
for _, d := range p.DependsOn {
// write loop d.Metric
if d.Metric != nil {
Expand Down

0 comments on commit 7168a89

Please sign in to comment.