Skip to content

Commit 20b7682

Browse files
author
Pavel Okhlopkov
committed
golangci-lint
Signed-off-by: Pavel Okhlopkov <[email protected]>
1 parent 613b7ec commit 20b7682

File tree

28 files changed

+38
-32
lines changed

28 files changed

+38
-32
lines changed

.github/workflows/build.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
name: Build shell-operator binary
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Set up Go 1.22
11+
- name: Set up Go 1.23
1212
uses: actions/setup-go@v5
1313
with:
14-
go-version: "1.22"
14+
go-version: "1.23"
1515

1616
- name: Check out shell-operator code
1717
uses: actions/checkout@v4

.github/workflows/lint.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
name: Run linter
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Set up Go 1.22
13+
- name: Set up Go 1.23
1414
uses: actions/setup-go@v5
1515
with:
16-
go-version: "1.22"
16+
go-version: "1.23"
1717

1818
- name: Check out shell-operator code
1919
uses: actions/checkout@v4
@@ -36,7 +36,7 @@ jobs:
3636
3737
- name: Run golangci-lint
3838
run: |
39-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.59.1
39+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.60.1
4040
./golangci-lint run --sort-results --build-tags integration,test
4141
4242

.github/workflows/tests-labeled.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ jobs:
6363
cluster_name: "kube-1-27"
6464
runs-on: ubuntu-latest
6565
steps:
66-
- name: Set up Go 1.22
66+
- name: Set up Go 1.23
6767
uses: actions/setup-go@v5
6868
with:
69-
go-version: "1.22"
69+
go-version: "1.23"
7070

7171
- name: Check out shell-operator code
7272
uses: actions/checkout@v4

.github/workflows/tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
name: Run unit tests
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Set up Go 1.22
12+
- name: Set up Go 1.23
1313
uses: actions/setup-go@v5
1414
with:
15-
go-version: "1.22"
15+
go-version: "1.23"
1616

1717
- name: Check out shell-operator code
1818
uses: actions/checkout@v4

cmd/shell-operator/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"os"
77
"time"
88

9+
"github.com/deckhouse/deckhouse/pkg/log"
910
"gopkg.in/alecthomas/kingpin.v2"
1011

11-
"github.com/deckhouse/deckhouse/pkg/log"
1212
"github.com/flant/kube-client/klogtolog"
1313
"github.com/flant/shell-operator/pkg/app"
1414
"github.com/flant/shell-operator/pkg/debug"

pkg/app/log.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
"strings"
66
"time"
77

8+
"github.com/deckhouse/deckhouse/pkg/log"
89
"gopkg.in/alecthomas/kingpin.v2"
910

10-
"github.com/deckhouse/deckhouse/pkg/log"
1111
"github.com/flant/shell-operator/pkg/config"
1212
)
1313

pkg/debug/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"os"
1010
"path"
1111

12+
"github.com/deckhouse/deckhouse/pkg/log"
1213
"github.com/go-chi/chi/v5"
1314
"github.com/go-chi/chi/v5/middleware"
1415
"gopkg.in/yaml.v3"
1516

16-
"github.com/deckhouse/deckhouse/pkg/log"
1717
utils "github.com/flant/shell-operator/pkg/utils/file"
1818
structuredLogger "github.com/flant/shell-operator/pkg/utils/structured-logger"
1919
)

pkg/executor/executor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"time"
1515

1616
"github.com/deckhouse/deckhouse/pkg/log"
17-
utils "github.com/flant/shell-operator/pkg/utils/labels"
1817

1918
"github.com/flant/shell-operator/pkg/app"
19+
utils "github.com/flant/shell-operator/pkg/utils/labels"
2020
)
2121

2222
type CmdUsage struct {

pkg/hook/controller/hook_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package controller
22

33
import (
4+
"github.com/deckhouse/deckhouse/pkg/log"
45
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
56

6-
"github.com/deckhouse/deckhouse/pkg/log"
77
. "github.com/flant/shell-operator/pkg/hook/binding_context"
88
. "github.com/flant/shell-operator/pkg/hook/types"
99
"github.com/flant/shell-operator/pkg/kube_events_manager"

pkg/hook/hook.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
"path/filepath"
99
"strings"
1010

11+
"github.com/deckhouse/deckhouse/pkg/log"
1112
uuid "github.com/gofrs/uuid/v5"
1213
"github.com/kennygrant/sanitize"
1314
"golang.org/x/time/rate"
1415

15-
"github.com/deckhouse/deckhouse/pkg/log"
1616
"github.com/flant/shell-operator/pkg/app"
1717
"github.com/flant/shell-operator/pkg/executor"
1818
. "github.com/flant/shell-operator/pkg/hook/binding_context"

pkg/hook/hook_manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"sort"
99
"strings"
1010

11+
"github.com/deckhouse/deckhouse/pkg/log"
1112
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1213

13-
"github.com/deckhouse/deckhouse/pkg/log"
1414
"github.com/flant/shell-operator/pkg/executor"
1515
"github.com/flant/shell-operator/pkg/hook/controller"
1616
. "github.com/flant/shell-operator/pkg/hook/types"

pkg/kube_events_manager/error_handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package kube_events_manager
33
import (
44
"io"
55

6+
"github.com/deckhouse/deckhouse/pkg/log"
67
apierrors "k8s.io/apimachinery/pkg/api/errors"
78
"k8s.io/client-go/tools/cache"
89

9-
"github.com/deckhouse/deckhouse/pkg/log"
1010
"github.com/flant/shell-operator/pkg/metric_storage"
1111
utils "github.com/flant/shell-operator/pkg/utils/labels"
1212
)

pkg/kube_events_manager/monitor.go

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"sort"
77

88
"github.com/deckhouse/deckhouse/pkg/log"
9+
910
klient "github.com/flant/kube-client/client"
1011
. "github.com/flant/shell-operator/pkg/kube_events_manager/types"
1112
"github.com/flant/shell-operator/pkg/metric_storage"

pkg/kube_events_manager/monitor_config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package kube_events_manager
22

33
import (
4+
"github.com/deckhouse/deckhouse/pkg/log"
45
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
56
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
67

7-
"github.com/deckhouse/deckhouse/pkg/log"
88
. "github.com/flant/shell-operator/pkg/kube_events_manager/types"
99
)
1010

pkg/metric/storage.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package metric
22

33
import (
4-
"github.com/flant/shell-operator/pkg/metric_storage/operation"
54
"github.com/prometheus/client_golang/prometheus"
5+
6+
"github.com/flant/shell-operator/pkg/metric_storage/operation"
67
)
78

89
type Storage interface {

pkg/metric_storage/metric_storage.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import (
77
"strings"
88
"sync"
99

10-
"github.com/flant/shell-operator/pkg/metric"
11-
10+
"github.com/deckhouse/deckhouse/pkg/log"
1211
"github.com/prometheus/client_golang/prometheus"
1312
"github.com/prometheus/client_golang/prometheus/promhttp"
1413

15-
"github.com/deckhouse/deckhouse/pkg/log"
14+
"github.com/flant/shell-operator/pkg/metric"
1615
"github.com/flant/shell-operator/pkg/metric_storage/operation"
1716
"github.com/flant/shell-operator/pkg/metric_storage/vault"
1817
. "github.com/flant/shell-operator/pkg/utils/labels"

pkg/metric_storage/vault/vault.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import (
44
"fmt"
55
"sync"
66

7-
"github.com/flant/shell-operator/pkg/metric"
8-
97
log "github.com/deckhouse/deckhouse/pkg/log"
108
"github.com/prometheus/client_golang/prometheus"
119

10+
"github.com/flant/shell-operator/pkg/metric"
1211
. "github.com/flant/shell-operator/pkg/utils/labels"
1312
)
1413

pkg/schedule_manager/schedule_manager.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package schedule_manager
33
import (
44
"context"
55

6+
"github.com/deckhouse/deckhouse/pkg/log"
67
"gopkg.in/robfig/cron.v2"
78

8-
"github.com/deckhouse/deckhouse/pkg/log"
99
. "github.com/flant/shell-operator/pkg/schedule_manager/types"
1010
)
1111

pkg/schedule_manager/schedule_manager_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"testing"
66

77
"github.com/deckhouse/deckhouse/pkg/log"
8+
89
"github.com/flant/shell-operator/pkg/schedule_manager/types"
910
)
1011

pkg/shell-operator/bootstrap.go

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"log/slog"
77

88
"github.com/deckhouse/deckhouse/pkg/log"
9+
910
"github.com/flant/shell-operator/pkg/app"
1011
"github.com/flant/shell-operator/pkg/config"
1112
"github.com/flant/shell-operator/pkg/debug"

pkg/shell-operator/debug_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"strconv"
77
"time"
88

9+
"github.com/deckhouse/deckhouse/pkg/log"
910
"github.com/go-chi/chi/v5"
1011

11-
"github.com/deckhouse/deckhouse/pkg/log"
1212
"github.com/flant/shell-operator/pkg/config"
1313
"github.com/flant/shell-operator/pkg/debug"
1414
"github.com/flant/shell-operator/pkg/task/dump"

pkg/shell-operator/kube_client.go

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/deckhouse/deckhouse/pkg/log"
7+
78
klient "github.com/flant/kube-client/client"
89
"github.com/flant/shell-operator/pkg/app"
910
"github.com/flant/shell-operator/pkg/kube/object_patch"

pkg/shell-operator/operator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"fmt"
66
"time"
77

8+
"github.com/deckhouse/deckhouse/pkg/log"
89
"github.com/gofrs/uuid/v5"
910
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1011

11-
"github.com/deckhouse/deckhouse/pkg/log"
1212
klient "github.com/flant/kube-client/client"
1313
"github.com/flant/shell-operator/pkg/hook"
1414
"github.com/flant/shell-operator/pkg/hook/binding_context"

pkg/webhook/admission/handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"net/http"
88
"strings"
99

10+
"github.com/deckhouse/deckhouse/pkg/log"
1011
"github.com/go-chi/chi/v5"
1112
"github.com/go-chi/chi/v5/middleware"
1213
v1 "k8s.io/api/admission/v1"
1314
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1415

15-
"github.com/deckhouse/deckhouse/pkg/log"
1616
structuredLogger "github.com/flant/shell-operator/pkg/utils/structured-logger"
1717
)
1818

pkg/webhook/conversion/handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"net/http"
88
"strings"
99

10+
"github.com/deckhouse/deckhouse/pkg/log"
1011
"github.com/go-chi/chi/v5"
1112
"github.com/go-chi/chi/v5/middleware"
1213
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1314
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1415
"k8s.io/apimachinery/pkg/runtime"
1516

16-
"github.com/deckhouse/deckhouse/pkg/log"
1717
structuredLogger "github.com/flant/shell-operator/pkg/utils/structured-logger"
1818
)
1919

test/hook/context/generator.go

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
"github.com/deckhouse/deckhouse/pkg/log"
10+
1011
"github.com/flant/kube-client/fake"
1112
"github.com/flant/shell-operator/pkg/hook"
1213
. "github.com/flant/shell-operator/pkg/hook/binding_context"

test/integration/kube_event_manager/kube_event_manager_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
. "github.com/onsi/ginkgo"
1212
. "github.com/onsi/gomega"
1313

14+
"github.com/deckhouse/deckhouse/pkg/log"
1415
"github.com/flant/shell-operator/pkg/app"
1516
"github.com/flant/shell-operator/pkg/kube_events_manager"
1617
. "github.com/flant/shell-operator/pkg/kube_events_manager/types"
@@ -26,7 +27,7 @@ var _ = Describe("Binding 'kubernetes' with kind 'Pod' should emit KubeEvent obj
2627
var KubeEventsManager kube_events_manager.KubeEventsManager
2728

2829
BeforeEach(func() {
29-
KubeEventsManager = kube_events_manager.NewKubeEventsManager(context.Background(), KubeClient)
30+
KubeEventsManager = kube_events_manager.NewKubeEventsManager(context.Background(), KubeClient, log.NewNop())
3031
})
3132

3233
Context("with configVersion: v1", func() {
@@ -67,7 +68,7 @@ var _ = Describe("Binding 'kubernetes' with kind 'Pod' should emit KubeEvent obj
6768

6869
When("Pod is Added", func() {
6970
JustBeforeEach(func() {
70-
app.SetupLogging(nil)
71+
app.SetupLogging(nil, log.NewNop())
7172

7273
// Unlock KubeEvent emitting.
7374
m := KubeEventsManager.GetMonitor(monitorConfig.Metadata.MonitorId)

test/integration/suite/run.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
. "github.com/onsi/ginkgo"
1111
. "github.com/onsi/gomega"
1212

13+
"github.com/deckhouse/deckhouse/pkg/log"
1314
klient "github.com/flant/kube-client/client"
1415
"github.com/flant/shell-operator/pkg/kube/object_patch"
1516
)
@@ -36,5 +37,5 @@ var _ = BeforeSuite(func() {
3637
err := KubeClient.Init()
3738
Expect(err).ShouldNot(HaveOccurred())
3839

39-
ObjectPatcher = object_patch.NewObjectPatcher(KubeClient)
40+
ObjectPatcher = object_patch.NewObjectPatcher(KubeClient, log.NewNop())
4041
})

0 commit comments

Comments
 (0)