66 "strings"
77 "time"
88
9- allowedalerts2 "github.com/openshift/origin/pkg/monitortestlibrary/allowedalerts"
9+ allowedalerts "github.com/openshift/origin/pkg/monitortestlibrary/allowedalerts"
1010 "github.com/openshift/origin/pkg/monitortestlibrary/platformidentification"
1111
1212 o "github.com/onsi/gomega"
@@ -18,20 +18,14 @@ import (
1818 prometheusv1 "github.com/prometheus/client_golang/api/prometheus/v1"
1919 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2020 "k8s.io/apimachinery/pkg/util/sets"
21- "k8s.io/client-go/rest"
2221 "k8s.io/kubernetes/test/e2e/framework"
2322)
2423
2524type AllowedAlertsFunc func (featureSet configv1.FeatureSet ) (allowedFiringWithBugs , allowedFiring , allowedPendingWithBugs , allowedPending helper.MetricConditions )
2625
2726// CheckAlerts will query prometheus and ensure no-unexpected alerts were pending or firing.
2827// Used by both upgrade and conformance suites, with different allowances for each.
29- func CheckAlerts (allowancesFunc AllowedAlertsFunc ,
30- restConfig * rest.Config ,
31- prometheusClient prometheusv1.API , // TODO: remove
32- configClient configclient.Interface , // TODO: remove
33- testDuration time.Duration ,
34- f * framework.Framework ) {
28+ func CheckAlerts (allowancesFunc AllowedAlertsFunc , prometheusClient prometheusv1.API , configClient configclient.Interface , testDuration time.Duration , f * framework.Framework ) {
3529
3630 featureSet := configv1 .Default
3731 featureGate , err := configClient .ConfigV1 ().FeatureGates ().Get (context .TODO (), "cluster" , metav1.GetOptions {})
@@ -46,11 +40,11 @@ func CheckAlerts(allowancesFunc AllowedAlertsFunc,
4640 // In addition to the alert allowances passed in (which can differ for upgrades vs conformance),
4741 // we also exclude alerts that have their own separate tests codified. This is a backstop test for
4842 // everything else.
49- for _ , alertTest := range allowedalerts2 .AllAlertTests (& platformidentification.JobType {},
50- allowedalerts2 .DefaultAllowances ) {
43+ for _ , alertTest := range allowedalerts .AllAlertTests (& platformidentification.JobType {},
44+ allowedalerts .DefaultAllowances ) {
5145
5246 switch alertTest .AlertState () {
53- case allowedalerts2 .AlertPending :
47+ case allowedalerts .AlertPending :
5448 // a pending test covers pending and everything above (firing)
5549 allowedPendingAlerts = append (allowedPendingAlerts ,
5650 helper.MetricCondition {
@@ -64,7 +58,7 @@ func CheckAlerts(allowancesFunc AllowedAlertsFunc,
6458 Text : "has a separate e2e test" ,
6559 },
6660 )
67- case allowedalerts2 .AlertInfo :
61+ case allowedalerts .AlertInfo :
6862 // an info test covers all firing
6963 allowedFiringAlerts = append (allowedFiringAlerts ,
7064 helper.MetricCondition {
0 commit comments