Skip to content

Commit 9df04b7

Browse files
committed
split Test_ValidateNamespace_NoParams into successes and failures tests, init a common apiserver for all testcases
1 parent 983875b commit 9df04b7

File tree

2 files changed

+159
-108
lines changed

2 files changed

+159
-108
lines changed

staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_source.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ import (
4141
"k8s.io/klog/v2"
4242
)
4343

44+
var (
45+
PolicyRefreshInterval = 1 * time.Second
46+
)
47+
4448
type policySource[P runtime.Object, B runtime.Object, E Evaluator] struct {
4549
ctx context.Context
4650
policyInformer generic.Informer[P]
@@ -178,7 +182,7 @@ func (s *policySource[P, B, E]) Run(ctx context.Context) error {
178182
// and needs to be recompiled
179183
go func() {
180184
// Loop every 1 second until context is cancelled, refreshing policies
181-
wait.Until(s.refreshPolicies, 1*time.Second, ctx.Done())
185+
wait.Until(s.refreshPolicies, PolicyRefreshInterval, ctx.Done())
182186
}()
183187

184188
<-ctx.Done()

0 commit comments

Comments
 (0)