mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-07 14:05:50 +00:00
Upgrade the linter and fix all new linter warnings
Also fix some tests that were broken by bumping golang and dependencies in the previous commits. Note that in addition to changes made to satisfy the linter which do not impact the behavior of the code, this commit also adds ReadHeaderTimeout to all usages of http.Server to satisfy the linter (and because it seemed like a good suggestion).
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package localuserauthenticator provides a authentication webhook program.
|
||||
@@ -79,8 +79,9 @@ func (w *webhook) start(ctx context.Context, l net.Listener) error {
|
||||
return &cert, err
|
||||
}
|
||||
server := http.Server{
|
||||
Handler: w,
|
||||
TLSConfig: c,
|
||||
Handler: w,
|
||||
TLSConfig: c,
|
||||
ReadHeaderTimeout: 10 * time.Second,
|
||||
}
|
||||
|
||||
errCh := make(chan error)
|
||||
@@ -356,7 +357,7 @@ func run(ctx context.Context) error {
|
||||
startControllers(ctx, dynamicCertProvider, client.Kubernetes, kubeInformers)
|
||||
plog.Debug("controllers are ready")
|
||||
|
||||
// nolint: gosec // Intentionally binding to all network interfaces.
|
||||
//nolint:gosec // Intentionally binding to all network interfaces.
|
||||
l, err := net.Listen("tcp", ":8443")
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot create listener: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user