Skip to content

Commit 5b8861d

Browse files
Merge pull request #30474 from QiWang19/drift-matcher
OCPBUGS-63307: Add ConfigDriftMonitorStoppedTooOften matcher
2 parents eb52c92 + ec0d7f4 commit 5b8861d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ func NewUniversalPathologicalEventMatchers(kubeConfig *rest.Config, finalInterva
502502
twoNodeEtcdEndpointsMatcher := newTwoNodeEtcdEndpointsConfigMissingEventMatcher(finalIntervals)
503503
registry.AddPathologicalEventMatcherOrDie(twoNodeEtcdEndpointsMatcher)
504504

505+
newConfigDriftMonitorStoppedTooOftenEventMatcher := newConfigDriftMonitorStoppedTooOftenEventMatcher(finalIntervals)
506+
registry.AddPathologicalEventMatcherOrDie(newConfigDriftMonitorStoppedTooOftenEventMatcher)
507+
505508
return registry
506509
}
507510

@@ -1207,3 +1210,23 @@ func newCrioReloadedTooOftenEventMatcher(finalInternals monitorapi.Intervals) Ev
12071210
allowIfWithinIntervals: crioReloadedIntervals,
12081211
}
12091212
}
1213+
1214+
func newConfigDriftMonitorStoppedTooOftenEventMatcher(finalIntervals monitorapi.Intervals) EventMatcher {
1215+
configDriftMonitorStoppedIntervals := finalIntervals.Filter(func(eventInterval monitorapi.Interval) bool {
1216+
return eventInterval.Source == monitorapi.SourceE2ETest &&
1217+
strings.Contains(eventInterval.Locator.Keys[monitorapi.LocatorE2ETestKey], "SigstoreImageVerification")
1218+
})
1219+
for i := range configDriftMonitorStoppedIntervals {
1220+
configDriftMonitorStoppedIntervals[i].To = configDriftMonitorStoppedIntervals[i].To.Add(time.Second * -30)
1221+
configDriftMonitorStoppedIntervals[i].From = configDriftMonitorStoppedIntervals[i].From.Add(time.Second * -30)
1222+
}
1223+
1224+
return &OverlapOtherIntervalsPathologicalEventMatcher{
1225+
delegate: &SimplePathologicalEventMatcher{
1226+
name: "ConfigDriftMonitorStoppedTooOften",
1227+
messageReasonRegex: regexp.MustCompile(`^ConfigDriftMonitorStopped$`),
1228+
jira: "https://issues.redhat.com/browse/OCPBUGS-58376",
1229+
},
1230+
allowIfWithinIntervals: configDriftMonitorStoppedIntervals,
1231+
}
1232+
}

0 commit comments

Comments
 (0)