fix S1008 simplify bool returns

Signed-off-by: Ken Sipe <kensipe@gmail.com>
This commit is contained in:
Ken Sipe 2020-06-26 10:39:16 -05:00
parent e8878687b1
commit b287287a30
No known key found for this signature in database
GPG Key ID: 564882A82432498D
3 changed files with 5 additions and 15 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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) {