This PR implements a new gatherer needed by CCXDEV-4431. Right now it collects logs and image streams of namespace "openshift-cluster-samples-operator" if alert "SamplesImagestreamImportFailing" is firing, but it designed in a way that it can be further extended to run X gatherer with Y params on Z condition.
Verified on 4.9.0-0.nightly-2021-10-20-023733. Verification steps: 1. Disable Cluster Version Operator oc scale --replicas 0 deployments/cluster-version-operator -n openshift-cluster-version 2. Disable Cluster Monitoring Operator oc scale --replicas 0 deployment/cluster-monitoring-operator --namespace openshift-monitoring 3. Disable Prometheus Operator oc scale --replicas 0 deployment/prometheus-operator --namespace openshift-monitoring 4. Edit "SamplesImagestreamImportFailing" alert in "prometheus-k8s-rulefiles-0" config map of "openshift-monitoring" 4.1. Trigger the alert unconditionally using the following expression: "1 > bool 0" 4.2. Decrease trigger time to "1m" 5. Wait until the alert will be firing 6. Create an image stream in "openshift-cluster-samples-operator" namespace 7. Restart the Insights Operator 8. Wait until an archive will be created 9. Download the archive The archive contains "cluster-samples-operator" logs and the image stream manifest under "conditional" directory.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (OpenShift Container Platform 4.9.4 bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:3935
Not clear to me why this got linked to the 4.9.4 errata; the backing PR landed in June, long before 4.9 forked off from master [1]. So the code was definitely in 4.9.0 as well. [1]: https://github.com/openshift/insights-operator/pull/433#event-4950262577