fix new linter warnings from prealloc linter

This commit is contained in:
Ryan Richard
2026-02-13 15:19:15 -08:00
parent 745c93af51
commit e5366d782d
20 changed files with 50 additions and 48 deletions
@@ -1,4 +1,4 @@
// Copyright 2020-2025 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2026 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package jwtcachefiller implements a controller for filling an authncache.Cache with each
@@ -305,7 +305,7 @@ func (c *jwtCacheFillerController) doExpensiveValidations(
okSoFar bool,
) (*cachedJWTAuthenticator, []*metav1.Condition, []error) {
var conditions []*metav1.Condition
var errs []error
errs := make([]error, 0, 4)
client := phttp.Default(caBundle.CertPool())
client.Timeout = 30 * time.Second // copied from Kube OIDC code
@@ -1,4 +1,4 @@
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2026 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package webhookcachefiller implements a controller for filling an authncache.Cache with each added/updated WebhookAuthenticator.
@@ -256,7 +256,7 @@ func (c *webhookCacheFillerController) doExpensiveValidations(
) (*cachedWebhookAuthenticator, []*metav1.Condition, []error) {
var newWebhookAuthenticatorForCache *cachedWebhookAuthenticator
var conditions []*metav1.Condition
var errs []error
errs := make([]error, 0, 2)
conditions, tlsNegotiateErr := c.validateConnection(ctx, caBundle.CertPool(), endpointHostPort, conditions, okSoFar, usingProxyForHost, logger)
errs = append(errs, tlsNegotiateErr)