mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Add more //nolint:staticcheck for failures caught in PR tests
This commit is contained in:
parent
c862d7c0e9
commit
c8fde197f5
@ -305,7 +305,7 @@ func SupportsQuotas(m mount.Interface, path string) (bool, error) {
|
||||
// If the pod UID is identical to another one known, it may (but presently
|
||||
// doesn't) choose the same quota ID as other volumes in the pod.
|
||||
//lint:ignore SA4009 poduid is overwritten by design, see comment below
|
||||
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error {
|
||||
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error { //nolint:staticcheck
|
||||
if bytes == nil {
|
||||
return fmt.Errorf("attempting to assign null quota to %s", path)
|
||||
}
|
||||
@ -320,7 +320,7 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
|
||||
// volumes in a pod, we can simply remove this line of code.
|
||||
// If and when we decide permanently that we're going to adopt
|
||||
// one quota per volume, we can rip all of the pod code out.
|
||||
poduid = types.UID(uuid.NewUUID())
|
||||
poduid = types.UID(uuid.NewUUID()) //nolint:staticcheck
|
||||
if pod, ok := dirPodMap[path]; ok && pod != poduid {
|
||||
return fmt.Errorf("requesting quota on existing directory %s but different pod %s %s", path, pod, poduid)
|
||||
}
|
||||
|
@ -599,12 +599,12 @@ 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:
|
||||
case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0: //nolint:staticcheck
|
||||
// if there are no deletion options, the default policy for replication controllers is orphan
|
||||
orphan = true
|
||||
case options.OrphanDependents != nil:
|
||||
case options.OrphanDependents != nil: //nolint:staticcheck
|
||||
// if the deletion options explicitly specify whether to orphan, that controls
|
||||
orphan = *options.OrphanDependents
|
||||
orphan = *options.OrphanDependents //nolint:staticcheck
|
||||
case options.PropagationPolicy != nil:
|
||||
// if the deletion options explicitly specify whether to orphan, that controls
|
||||
orphan = *options.PropagationPolicy == metav1.DeletePropagationOrphan
|
||||
|
@ -440,7 +440,7 @@ func benchmarkScheduling(numExistingPods, minPods int,
|
||||
b *testing.B) {
|
||||
if b.N < minPods {
|
||||
//lint:ignore SA3001 Set a minimum for b.N to get more meaningful results
|
||||
b.N = minPods
|
||||
b.N = minPods //nolint:staticcheck
|
||||
}
|
||||
finalFunc, podInformer, clientset, _ := mustSetupScheduler(nil)
|
||||
defer finalFunc()
|
||||
|
Loading…
Reference in New Issue
Block a user