Migrate /pkg/controller/disruption to structured and contextual logging

This commit is contained in:
Mengjiao Liu
2023-07-12 11:30:45 +08:00
parent 98e7c2a751
commit 19869478c1
7 changed files with 201 additions and 164 deletions

View File

@@ -605,6 +605,7 @@ func PodScheduled(c clientset.Interface, podNamespace, podName string) wait.Cond
// InitDisruptionController initializes and runs a Disruption Controller to properly
// update PodDisuptionBudget objects.
func InitDisruptionController(t *testing.T, testCtx *TestContext) *disruption.DisruptionController {
_, ctx := ktesting.NewTestContext(t)
informers := informers.NewSharedInformerFactory(testCtx.ClientSet, 12*time.Hour)
discoveryClient := cacheddiscovery.NewMemCacheClient(testCtx.ClientSet.Discovery())
@@ -618,6 +619,7 @@ func InitDisruptionController(t *testing.T, testCtx *TestContext) *disruption.Di
}
dc := disruption.NewDisruptionController(
ctx,
informers.Core().V1().Pods(),
informers.Policy().V1().PodDisruptionBudgets(),
informers.Core().V1().ReplicationControllers(),