Skip to content

Commit

Permalink
chore: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
clementnuss committed Dec 9, 2022
1 parent 2fd4edd commit aea094f
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
stable: true

- name: install and run golangci-lint
uses: golangci/[email protected]
Expand All @@ -37,7 +36,6 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18
stable: true

- name: Download K8s envtest - local K8s cluster control plane
run: |
Expand Down
4 changes: 0 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ linters-settings:
- performance
- style
disabled-checks:
- whyNoLint
- hugeParam
gocyclo:
min-complexity: 15
Expand All @@ -47,7 +46,6 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
Expand All @@ -74,13 +72,11 @@ linters:
- rowserrcheck
- exportloopref
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- wsl

Expand Down
1 change: 1 addition & 0 deletions cmd/kubelet-csr-approver/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// main
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func prepareCmdlineConfig() *controller.Config {
)
)

err := ff.Parse(fs, os.Args[1:], ff.WithEnvVarNoPrefix())
err := ff.Parse(fs, os.Args[1:], ff.WithEnvVars())
if err != nil {
fmt.Printf("unable to parse args/envs, exiting. error message: %v", err)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/csr_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type CertificateSigningRequestReconciler struct {
// cyclomatic complexity is high (over 15), but this improves
// readibility for the programmer, therefore we ignore the linting error
//
//nolint:gocyclo
//nolint:gocyclo // see above
func (r *CertificateSigningRequestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, returnErr error) {
l := log.FromContext(ctx)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/regex_ip_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// complies with the provider-specific regex
// is resolvable (this check can be opted out with a parameter)
//
//nolint:gocyclo
//nolint:gocyclo // see above
func (r *CertificateSigningRequestReconciler) DNSCheck(ctx context.Context, csr *certificatesv1.CertificateSigningRequest, x509cr *x509.CertificateRequest) (valid bool, reason string, err error) {
if valid = (len(x509cr.DNSNames) <= r.AllowedDNSNames); !valid {
reason = "The x509 Cert Request contains more DNS names than allowed through the config flag"
Expand Down

0 comments on commit aea094f

Please sign in to comment.