Skip to content

Commit

Permalink
lint: Fix lint directives, drop deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
viccuad committed Aug 24, 2022
1 parent 196cd17 commit 9cf8d51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ linters:
- interfacer
# TODO: enable once we can set some exceptions
- funlen
- ifshort # deprecated

linters-settings:
cyclop:
Expand Down
6 changes: 3 additions & 3 deletions apis/policies/v1/webhook_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var _ = BeforeSuite(func() {
dialer := &net.Dialer{Timeout: time.Second}
addrPort := fmt.Sprintf("%s:%d", webhookInstallOptions.LocalServingHost, webhookInstallOptions.LocalServingPort)
Eventually(func() error {
// nolint:gosec
//nolint:gosec
conn, err := tls.DialWithDialer(dialer, "tcp", addrPort, &tls.Config{InsecureSkipVerify: true})
if err != nil {
return fmt.Errorf("failed polling webhook server: %w", err)
Expand Down Expand Up @@ -166,7 +166,7 @@ func makeClusterAdmissionPolicyTemplate(name, namespace, policyServerName string
}
}

// nolint: dupl
//nolint: dupl
func deleteClusterAdmissionPolicy(ctx context.Context, name, namespace string) {
nsn := types.NamespacedName{
Name: name,
Expand Down Expand Up @@ -211,7 +211,7 @@ func makePolicyServerTemplate(name, namespace string) *PolicyServer {
}
}

// nolint: dupl
//nolint: dupl
func deletePolicyServer(ctx context.Context, name, namespace string) {
nsn := types.NamespacedName{
Name: name,
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/admission/policy-server-ca-secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestFetchOrInitializePolicyServerCARootSecret(t *testing.T) {
admissionregCA, err := admissionregistration.GenerateCA()
generateCACalled := false

// nolint: wrapcheck
//nolint: wrapcheck
generateCAFunc := func() (*admissionregistration.CA, error) {
generateCACalled = true
return admissionregCA, err
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestFetchOrInitializePolicyServerSecret(t *testing.T) {
admissionregCA, _ := admissionregistration.GenerateCA()
caSecret := &corev1.Secret{Data: map[string][]byte{constants.PolicyServerCARootCACert: admissionregCA.CaCert, constants.PolicyServerCARootPrivateKeyCertName: x509.MarshalPKCS1PrivateKey(admissionregCA.CaPrivateKey)}}

// nolint:unparam
//nolint:unparam
generateCertFunc := func(ca []byte, commonName string, extraSANs []string, CAPrivateKey *rsa.PrivateKey) ([]byte, []byte, error) {
generateCertCalled = true
return servingCert, servingKey, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/admission/policy-server-configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type policyServerSourceAuthority struct {
Data string `json:"data"` // contains a PEM encoded certificate
}

// nolint:tagliatelle
//nolint:tagliatelle
type policyServerSourcesEntry struct {
InsecureSources []string `json:"insecure_sources,omitempty"`
SourceAuthorities map[string][]policyServerSourceAuthority `json:"source_authorities,omitempty"`
Expand Down

0 comments on commit 9cf8d51

Please sign in to comment.