From 85529991ce26514974b352ab8a9b4c7b3c29b38c Mon Sep 17 00:00:00 2001 From: Luke Meyer Date: Thu, 9 Apr 2026 18:09:34 -0400 Subject: [PATCH 1/2] terminationmessagepolicy: correctly fail on violations --- .../terminationmessagepolicy/monitortest.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go b/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go index ca034dd7de88..a976fa88b399 100644 --- a/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go +++ b/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go @@ -3,6 +3,7 @@ package terminationmessagepolicy import ( "context" "fmt" + "regexp" "strings" "time" @@ -27,11 +28,6 @@ func init() { for i := 0; i < 16; i++ { unfixedVersions.Insert(fmt.Sprintf("4.%d", i)) } - - // TODO: [lmeyer 2026-04-08] replace this temporary hack. - unfixedVersions.Insert("5.0") - // the algorithm below has permitted every release since 4.20 to flake because "4.2" is in the version. - // predictably, a number of violations have crept in. once those are fixed, fix hasOldVersion determination below. } type terminationMessagePolicyChecker struct { @@ -67,7 +63,8 @@ func (w *terminationMessagePolicyChecker) StartCollection(ctx context.Context, a for _, history := range clusterVersion.Status.History { for _, unfixedVersion := range unfixedVersions.List() { - if strings.Contains(history.Version, unfixedVersion) { + matcher, err := regexp.Compile(fmt.Sprintf(`\b%s\b`, unfixedVersion)) + if err != nil || matcher.MatchString(history.Version) { w.hasOldVersion = true break } From d381637e784c7fe975f0c0e489882d041b5899bd Mon Sep 17 00:00:00 2001 From: Luke Meyer Date: Fri, 10 Apr 2026 18:07:43 -0400 Subject: [PATCH 2/2] terminationmessagepolicy: add temporary exemptions These have crept in while the test was erroneously allowed to flake. See https://redhat.atlassian.net/browse/TRT-2084 We will continue to flake them while working to eradicate them. Meanwhile, new ones should be hard failures. --- .../terminationmessagepolicy/monitortest.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go b/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go index a976fa88b399..d6ef7f18061d 100644 --- a/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go +++ b/pkg/monitortests/clusterversionoperator/terminationmessagepolicy/monitortest.go @@ -137,6 +137,25 @@ func (w *terminationMessagePolicyChecker) CollectData(ctx context.Context, stora "openshift-multus": sets.NewString( "containers[multus-networkpolicy]", ), + // per TRT-2084 these were erroneously allowed to flake, so grandfather them in for now. + // they should be fixed and removed from here: + "openshift-backplane": sets.NewString("pods/osd-delete-backplane-serviceaccounts"), + "openshift-cluster-machine-approver": sets.NewString("pods/machine-approver-capi"), + "openshift-cnv": sets.NewString( + "pods/hostpath-provisioner-operator", + "pods/virt-platform-autopilot", + ), + "openshift-deployment-validation-operator": sets.NewString("pods/deployment-validation-operator"), + "openshift-frr-k8s": sets.NewString("pods/frr-k8s"), + "openshift-ingress": sets.NewString( + "pods/gateway", + "pods/istiod-openshift-gateway", + ), + "openshift-insights": sets.NewString( + "pods/insights-runtime-extractor", + "pods/periodic-gathering", + ), + "openshift-operators": sets.NewString("pods/servicemesh-operator3"), } observedNamespace := map[string]bool{}