mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 15:20:17 +00:00
fix S1008 simplify bool returns
Signed-off-by: Ken Sipe <kensipe@gmail.com>
This commit is contained in:
parent
e8878687b1
commit
b287287a30
@ -38,6 +38,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
|
||||
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||
"k8s.io/apiserver/pkg/registry/generic"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
@ -45,7 +47,6 @@ import (
|
||||
storeerr "k8s.io/apiserver/pkg/storage/errors"
|
||||
"k8s.io/apiserver/pkg/storage/etcd3/metrics"
|
||||
"k8s.io/apiserver/pkg/util/dryrun"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
@ -683,10 +684,7 @@ func shouldOrphanDependents(ctx context.Context, e *Store, accessor metav1.Objec
|
||||
}
|
||||
|
||||
// Get default orphan policy from this REST object type if it exists
|
||||
if defaultGCPolicy == rest.OrphanDependents {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return defaultGCPolicy == rest.OrphanDependents
|
||||
}
|
||||
|
||||
// shouldDeleteDependents returns true if the finalizer for foreground deletion should be set
|
||||
|
@ -80,9 +80,5 @@ type probabilisticGoawayDecider struct {
|
||||
|
||||
// Goaway implement GoawayDecider
|
||||
func (p *probabilisticGoawayDecider) Goaway(r *http.Request) bool {
|
||||
if p.next() < p.chance {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
return p.next() < p.chance
|
||||
}
|
||||
|
@ -85,11 +85,7 @@ func (o *ResourceConfig) EnableVersions(versions ...schema.GroupVersion) {
|
||||
|
||||
func (o *ResourceConfig) VersionEnabled(version schema.GroupVersion) bool {
|
||||
enabled, _ := o.GroupVersionConfigs[version]
|
||||
if enabled {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
return enabled
|
||||
}
|
||||
|
||||
func (o *ResourceConfig) DisableResources(resources ...schema.GroupVersionResource) {
|
||||
|
Loading…
Reference in New Issue
Block a user