Skip to content

Commit

Permalink
fix golangci lint
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Sep 26, 2024
1 parent 27bfb85 commit 805b17a
Show file tree
Hide file tree
Showing 35 changed files with 40 additions and 43 deletions.
12 changes: 4 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
run:
skip-dirs:
- .gen
- client

linters-settings:
revive:
min-confidence: 0.9
gocyclo:
min-complexity: 15

linters:

issues:
exclude:
exclude-dirs:
- .gen
- client
exclude:
- if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
- "`if` block ends with a `return` statement, so drop this `else` and outdent its block"
- "missing the call to method parallel"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ENVTEST_K8S_VERSION := 1.31.0
ENVTEST_BINARY_ASSETS := ${ENVTEST_BIN_DIR}/bin

GOLANGCI_LINT := ${BIN}/golangci-lint
GOLANGCI_LINT_VERSION := v1.61.0
GOLANGCI_LINT_VERSION := v1.60.1
LINTER_FLAGS := --timeout 5m

HELM_DOCS := ${BIN}/helm-docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: eventtailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: hosttailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: flows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentbitagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentdconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggingroutes.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggings.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: nodeagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: outputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngoutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: eventtailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: hosttailers.logging-extensions.banzaicloud.io
spec:
group: logging-extensions.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_clusterflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: clusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_flows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: flows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentbitagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: fluentdconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_loggingroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggingroutes.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: loggings.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_nodeagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: nodeagents.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: outputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusterflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngclusteroutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngconfigs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/logging.banzaicloud.io_syslogngflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngflows.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
controller-gen.kubebuilder.io/version: v0.16.3
name: syslogngoutputs.logging.banzaicloud.io
spec:
group: logging.banzaicloud.io
Expand Down
5 changes: 3 additions & 2 deletions pkg/sdk/logging/model/output/logdna_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ package output_test
import (
"testing"

"sigs.k8s.io/yaml"

"github.com/kube-logging/logging-operator/pkg/sdk/logging/model/output"
"github.com/kube-logging/logging-operator/pkg/sdk/logging/model/render"
"sigs.k8s.io/yaml"
)

func TestLogDNAOutput(t *testing.T) {
Expand Down Expand Up @@ -60,7 +61,7 @@ buffer:
logdna := &output.LogDNAOutput{}
err := yaml.Unmarshal(CONFIG, logdna)
if err != nil {
t.Fatalf(err.Error())
t.Fatal(err.Error())
}
test := render.NewOutputPluginTest(t, logdna)
test.DiffResult(expected)
Expand Down

0 comments on commit 805b17a

Please sign in to comment.