Skip to content

Commit 135cf91

Browse files
Merge pull request #31088 from tsorya/fix-network-not-ready-regex
OCPBUGS-84846: Fix NetworkNotReady pathological event regex case mismatch
2 parents 428e96c + be4d8f1 commit 135cf91

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_event_patterns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ func NewUpgradePathologicalEventMatchers(kubeConfig *rest.Config, finalIntervals
653653
registry.AddPathologicalEventMatcherOrDie(&SimplePathologicalEventMatcher{
654654
name: "NetworkNotReady",
655655
messageReasonRegex: regexp.MustCompile(`^NetworkNotReady$`),
656-
messageHumanRegex: regexp.MustCompile(`network is not ready: container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: No CNI configuration file.*Has your network provider started\?`),
656+
messageHumanRegex: regexp.MustCompile(`network is not ready: container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: [Nn]o CNI configuration file.*Has your network provider started\?`),
657657
})
658658

659659
// Allow FailedScheduling repeat events during node upgrades:

pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,32 @@ func TestAllowedRepeatedEvents(t *testing.T) {
223223
Reason("SuccessfulCreate").Build(),
224224
expectedAllowName: "PacemakerStatusCollectorCronJobEvents",
225225
},
226+
{
227+
name: "NetworkNotReady with lowercase no from ocicni",
228+
locator: monitorapi.Locator{
229+
Keys: map[monitorapi.LocatorKey]string{
230+
monitorapi.LocatorNamespaceKey: "openshift-multus",
231+
monitorapi.LocatorPodKey: "network-metrics-daemon-4snn9",
232+
monitorapi.LocatorNodeKey: "ip-10-0-124-97.us-west-1.compute.internal",
233+
},
234+
},
235+
msg: monitorapi.NewMessage().HumanMessage("network is not ready: container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: no CNI configuration file in /etc/kubernetes/cni/net.d/. Has your network provider started?").
236+
Reason("NetworkNotReady").Build(),
237+
expectedAllowName: "NetworkNotReady",
238+
},
239+
{
240+
name: "NetworkNotReady with uppercase No",
241+
locator: monitorapi.Locator{
242+
Keys: map[monitorapi.LocatorKey]string{
243+
monitorapi.LocatorNamespaceKey: "openshift-network-diagnostics",
244+
monitorapi.LocatorPodKey: "network-check-target-pf5mx",
245+
monitorapi.LocatorNodeKey: "ip-10-0-80-8.us-west-1.compute.internal",
246+
},
247+
},
248+
msg: monitorapi.NewMessage().HumanMessage("network is not ready: container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: No CNI configuration file in /etc/kubernetes/cni/net.d/. Has your network provider started?").
249+
Reason("NetworkNotReady").Build(),
250+
expectedAllowName: "NetworkNotReady",
251+
},
226252
}
227253
for _, test := range tests {
228254
registry := NewUpgradePathologicalEventMatchers(nil, nil)

0 commit comments

Comments
 (0)