Skip to content

Commit 16cdf12

Browse files
authored
Merge branch 'openshift:main' into update-tests-to-dotnet-8
2 parents baac27f + f06eec0 commit 16cdf12

File tree

24 files changed

+993
-400
lines changed

24 files changed

+993
-400
lines changed

pkg/cmd/openshift-tests/run-upgrade/options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ func (o *RunUpgradeSuiteOptions) UpgradeTestPreSuite() error {
7272
if err := clusterdiscovery.InitializeTestFramework(exutil.TestContext, config, o.GinkgoRunSuiteOptions.DryRun); err != nil {
7373
return err
7474
}
75-
klog.V(4).Infof("Loaded test configuration: %#v", exutil.TestContext)
75+
// Redact the bearer token exposure
76+
testContextString := fmt.Sprintf("%#v", exutil.TestContext)
77+
redactedTestContext := exutil.RedactBearerToken(testContextString)
78+
klog.V(4).Infof("Loaded test configuration: %s", redactedTestContext)
7679

7780
return nil
7881
}

pkg/defaultmonitortests/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/openshift/origin/pkg/monitortests/authentication/requiredsccmonitortests"
99
admupgradestatus "github.com/openshift/origin/pkg/monitortests/cli/adm_upgrade/status"
1010
azuremetrics "github.com/openshift/origin/pkg/monitortests/cloud/azure/metrics"
11-
"github.com/openshift/origin/pkg/monitortests/clusterversionoperator/clusterversionchecker"
1211
"github.com/openshift/origin/pkg/monitortests/clusterversionoperator/legacycvomonitortests"
1312
"github.com/openshift/origin/pkg/monitortests/clusterversionoperator/operatorstateanalyzer"
1413
"github.com/openshift/origin/pkg/monitortests/clusterversionoperator/terminationmessagepolicy"
@@ -86,7 +85,6 @@ func ListAllMonitorTests() []string {
8685
}
8786

8887
func NewMonitorTestsFor(info monitortestframework.MonitorTestInitializationInfo) (monitortestframework.MonitorTestRegistry, error) {
89-
9088
// get tests and apply any filtering defined in info
9189
var startingRegistry monitortestframework.MonitorTestRegistry
9290

@@ -174,7 +172,6 @@ func newUniversalMonitorTests(info monitortestframework.MonitorTestInitializatio
174172
monitorTestRegistry.AddMonitorTestOrDie("termination-message-policy", "Cluster Version Operator", terminationmessagepolicy.NewAnalyzer())
175173
monitorTestRegistry.AddMonitorTestOrDie("operator-state-analyzer", "Cluster Version Operator", operatorstateanalyzer.NewAnalyzer())
176174
monitorTestRegistry.AddMonitorTestOrDie("required-scc-annotation-checker", "Cluster Version Operator", requiredsccmonitortests.NewAnalyzer())
177-
monitorTestRegistry.AddMonitorTestOrDie("cluster-version-checker", "Cluster Version Operator", clusterversionchecker.NewClusterVersionChecker())
178175

179176
monitorTestRegistry.AddMonitorTestOrDie("etcd-log-analyzer", "etcd", etcdloganalyzer.NewEtcdLogAnalyzer())
180177
monitorTestRegistry.AddMonitorTestOrDie("legacy-etcd-invariants", "etcd", legacyetcdmonitortests.NewLegacyTests())

pkg/monitor/backenddisruption/disruption_backend_sampler.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ type BackendSampler struct {
7979
stopRunning context.CancelFunc
8080
// consumptionFinished is closed when the consumer is done
8181
consumptionFinished chan struct{}
82+
83+
samplerHooks []SamplerHook
8284
}
8385

8486
type routeCoordinates struct {
@@ -195,7 +197,7 @@ func (b *BackendSampler) WithTLSConfig(tlsConfig *tls.Config) *BackendSampler {
195197
return b
196198
}
197199

198-
// WithTLSConfig sets both the CA bundle for trusting the server and the client cert/key pair for identifying to the server
200+
// WithExpectedStatusCode sets the expected http status
199201
func (b *BackendSampler) WithExpectedStatusCode(statusCode int) *BackendSampler {
200202
b.expectedStatusCode = statusCode
201203
return b
@@ -223,6 +225,12 @@ func (b *BackendSampler) WithExpectedBodyRegex(expectedBodyRegex string) *Backen
223225
return b
224226
}
225227

228+
// WithSamplerHooks adds a list of hooks for the sampler to call at different stages of disruption detection
229+
func (b *BackendSampler) WithSamplerHooks(samplerHooks []SamplerHook) *BackendSampler {
230+
b.samplerHooks = samplerHooks
231+
return b
232+
}
233+
226234
// bodyMatches checks the body content and returns an error if it doesn't match the expected.
227235
func (b *BackendSampler) bodyMatches(body []byte) error {
228236
switch {
@@ -620,6 +628,9 @@ func (b *disruptionSampler) consumeSamples(ctx context.Context, consumerDoneCh c
620628
monitorRecorder.EndInterval(previousIntervalID, currSample.startTime)
621629
}
622630

631+
for _, hook := range b.backendSampler.samplerHooks {
632+
hook.DisruptionStarted(ctx)
633+
}
623634
// start a new interval with the new error
624635
message, eventReason, level := DisruptionBegan(b.backendSampler.GetLocator().OldLocator(), b.backendSampler.GetConnectionType(), currentError, currSample.getRequestAuditID())
625636
framework.Logf("%s", message.BuildString())
@@ -653,6 +664,10 @@ func (b *disruptionSampler) consumeSamples(ctx context.Context, consumerDoneCh c
653664
monitorRecorder.EndInterval(previousIntervalID, currSample.startTime)
654665
}
655666

667+
for _, hook := range b.backendSampler.samplerHooks {
668+
hook.DisruptionStarted(ctx)
669+
}
670+
656671
message, eventReason, level := DisruptionBegan(b.backendSampler.GetLocator().OldLocator(), b.backendSampler.GetConnectionType(), currentError, currSample.getRequestAuditID())
657672
framework.Logf("%s", message.BuildString())
658673
eventRecorder.Eventf(

0 commit comments

Comments
 (0)