mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Fix staticcheck in test/integration/{scheduler_perf,garbagecollector}
This commit is contained in:
parent
18605d8814
commit
e1ceac0783
@ -1,8 +1,6 @@
|
||||
cluster/images/etcd/migrate
|
||||
pkg/controller/replicaset
|
||||
pkg/kubelet/dockershim
|
||||
test/integration/garbagecollector
|
||||
test/integration/scheduler_perf
|
||||
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
||||
vendor/k8s.io/apimachinery/pkg/runtime/serializer/json
|
||||
|
@ -598,6 +598,7 @@ func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet
|
||||
}
|
||||
orphan := false
|
||||
switch {
|
||||
//lint:file-ignore SA1019 Keep testing deprecated OrphanDependents option until it's being removed
|
||||
case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0:
|
||||
// if there are no deletion options, the default policy for replication controllers is orphan
|
||||
orphan = true
|
||||
@ -1024,12 +1025,7 @@ func TestBlockingOwnerRefDoesBlock(t *testing.T) {
|
||||
// dependency graph before handling the foreground deletion of the rc.
|
||||
ctx.startGC(5)
|
||||
timeout := make(chan struct{})
|
||||
go func() {
|
||||
select {
|
||||
case <-time.After(5 * time.Second):
|
||||
close(timeout)
|
||||
}
|
||||
}()
|
||||
time.AfterFunc(5*time.Second, func() { close(timeout) })
|
||||
if !cache.WaitForCacheSync(timeout, gc.IsSynced) {
|
||||
t.Fatalf("failed to wait for garbage collector to be synced")
|
||||
}
|
||||
|
@ -439,6 +439,7 @@ func benchmarkScheduling(numExistingPods, minPods int,
|
||||
testPodStrategy testutils.TestPodCreateStrategy,
|
||||
b *testing.B) {
|
||||
if b.N < minPods {
|
||||
//lint:ignore SA3001 Set a minimum for b.N to get more meaningful results
|
||||
b.N = minPods
|
||||
}
|
||||
finalFunc, podInformer, clientset := mustSetupScheduler()
|
||||
@ -498,7 +499,7 @@ func benchmarkScheduling(numExistingPods, minPods int,
|
||||
b.StopTimer()
|
||||
}
|
||||
|
||||
// makeBasePodWithSecrets creates a Pod object to be used as a template.
|
||||
// makeBasePodWithSecret creates a Pod object to be used as a template.
|
||||
// The pod uses a single Secrets volume.
|
||||
func makeBasePodWithSecret() *v1.Pod {
|
||||
basePod := &v1.Pod{
|
||||
|
Loading…
Reference in New Issue
Block a user