Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Okhlopkov <[email protected]>
  • Loading branch information
Pavel Okhlopkov committed Nov 13, 2024
1 parent b286e2c commit d000895
Show file tree
Hide file tree
Showing 46 changed files with 66 additions and 71 deletions.
3 changes: 1 addition & 2 deletions pkg/app/webhook.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package app

import (
"gopkg.in/alecthomas/kingpin.v2"

"github.com/deckhouse/module-sdk/pkg/webhook/admission"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
"github.com/deckhouse/module-sdk/pkg/webhook/server"
"gopkg.in/alecthomas/kingpin.v2"
)

var ValidatingWebhookSettings = &admission.WebhookSettings{
Expand Down
5 changes: 2 additions & 3 deletions pkg/hook/binding_context/binding_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"encoding/json"

"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/api/admission/v1"
apixv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

. "github.com/deckhouse/module-sdk/pkg/hook/types"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
v1 "k8s.io/api/admission/v1"
apixv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

// BindingContext contains information about event for hook
Expand Down
3 changes: 1 addition & 2 deletions pkg/hook/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package config
import (
"fmt"

"sigs.k8s.io/yaml"

. "github.com/deckhouse/module-sdk/pkg/hook/types"
"sigs.k8s.io/yaml"
)

var validBindingTypes = []BindingType{OnStartup, Schedule, OnKubernetesEvent, KubernetesValidating, KubernetesMutating, KubernetesConversion}
Expand Down
5 changes: 2 additions & 3 deletions pkg/hook/config/config_v0.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package config
import (
"fmt"

"gopkg.in/robfig/cron.v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/kube-events-manager"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
. "github.com/deckhouse/module-sdk/pkg/schedule-manager/types"
"gopkg.in/robfig/cron.v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type HookConfigV0 struct {
Expand Down
12 changes: 6 additions & 6 deletions pkg/hook/config/config_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import (
"strconv"
"time"

"github.com/hashicorp/go-multierror"
"gopkg.in/robfig/cron.v2"
v1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"

. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/kube-events-manager"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
. "github.com/deckhouse/module-sdk/pkg/schedule-manager/types"
"github.com/deckhouse/module-sdk/pkg/webhook/admission"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
"github.com/deckhouse/module-sdk/pkg/webhook/validating/validation"
"github.com/hashicorp/go-multierror"
"gopkg.in/robfig/cron.v2"
v1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"

"github.com/flant/shell-operator/pkg/app"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/hook/controller/admission_bindings_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package controller

import (
"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/api/admission/v1"

. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/webhook/admission"
v1 "k8s.io/api/admission/v1"
)

// AdmissionBindingToWebhookLink is a link between a hook and a webhook configuration.
Expand Down
3 changes: 1 addition & 2 deletions pkg/hook/controller/conversion_bindings_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package controller

import (
"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

// A link between a hook and a kube monitor
Expand Down
4 changes: 2 additions & 2 deletions pkg/hook/controller/hook_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package controller

import (
"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/kube-events-manager"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/deckhouse/module-sdk/pkg/webhook/admission"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

"github.com/flant/shell-operator/pkg/schedule_manager"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/hook/controller/hook_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"testing"

"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/onsi/gomega"

"github.com/deckhouse/module-sdk/pkg/hook/binding-context"
"github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/kube-events-manager"
types2 "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
. "github.com/onsi/gomega"

"github.com/flant/kube-client/fake"
"github.com/flant/shell-operator/pkg/hook/config"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/hook/controller/kubernetes_bindings_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"

"github.com/deckhouse/deckhouse/pkg/log"

. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/kube-events-manager"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"

utils "github.com/flant/shell-operator/pkg/utils/labels"
)

Expand Down
1 change: 1 addition & 0 deletions pkg/hook/controller/schedule_bindings_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package controller
import (
. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"

"github.com/flant/shell-operator/pkg/schedule_manager"
)

Expand Down
8 changes: 4 additions & 4 deletions pkg/hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
"strings"

"github.com/deckhouse/deckhouse/pkg/log"
uuid "github.com/gofrs/uuid/v5"
"github.com/kennygrant/sanitize"
"golang.org/x/time/rate"

. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/metric-storage/operation"
"github.com/deckhouse/module-sdk/pkg/webhook/admission"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
uuid "github.com/gofrs/uuid/v5"
"github.com/kennygrant/sanitize"
"golang.org/x/time/rate"

"github.com/flant/shell-operator/pkg/app"
"github.com/flant/shell-operator/pkg/executor"
"github.com/flant/shell-operator/pkg/hook/config"
Expand Down
4 changes: 2 additions & 2 deletions pkg/hook/hook_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"strings"

"github.com/deckhouse/deckhouse/pkg/log"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/kube-events-manager"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/deckhouse/module-sdk/pkg/webhook/admission"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

"github.com/flant/shell-operator/pkg/executor"
"github.com/flant/shell-operator/pkg/hook/controller"
"github.com/flant/shell-operator/pkg/schedule_manager"
Expand Down
4 changes: 2 additions & 2 deletions pkg/hook/hook_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"testing"

"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/onsi/gomega"

"github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/deckhouse/module-sdk/pkg/webhook/admission"
"github.com/deckhouse/module-sdk/pkg/webhook/conversion"
. "github.com/onsi/gomega"

"github.com/flant/shell-operator/pkg/app"
"github.com/flant/shell-operator/pkg/hook/controller"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/hook/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"time"

"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
. "github.com/onsi/gomega"
"golang.org/x/time/rate"

. "github.com/deckhouse/module-sdk/pkg/hook/types"
"github.com/flant/shell-operator/pkg/hook/config"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/hook/task_metadata/task_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"

"github.com/deckhouse/deckhouse/pkg/log"

"github.com/deckhouse/module-sdk/pkg/hook/binding-context"
"github.com/deckhouse/module-sdk/pkg/hook/types"

"github.com/flant/shell-operator/pkg/task"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/hook/task_metadata/task_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"strings"
"testing"

. "github.com/onsi/gomega"

. "github.com/deckhouse/module-sdk/pkg/hook/binding-context"
. "github.com/deckhouse/module-sdk/pkg/hook/types"
. "github.com/onsi/gomega"

"github.com/flant/shell-operator/pkg/task"
"github.com/flant/shell-operator/pkg/task/queue"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kube_events_manager/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"runtime"
"runtime/trace"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/flant/shell-operator/pkg/app"
"github.com/flant/shell-operator/pkg/jq"
utils_checksum "github.com/flant/shell-operator/pkg/utils/checksum"
Expand Down
2 changes: 1 addition & 1 deletion pkg/kube_events_manager/kube_events_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"sync"

"github.com/deckhouse/deckhouse/pkg/log"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/deckhouse/module-sdk/pkg/metric-storage"

klient "github.com/flant/kube-client/client"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kube_events_manager/kube_events_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"time"

"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/version"
fakediscovery "k8s.io/client-go/discovery/fake"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
klient "github.com/flant/kube-client/client"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/kube_events_manager/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"sort"

"github.com/deckhouse/deckhouse/pkg/log"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/deckhouse/module-sdk/pkg/metric-storage"

klient "github.com/flant/kube-client/client"
utils "github.com/flant/shell-operator/pkg/utils/labels"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/kube_events_manager/monitor_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package kube_events_manager

import (
"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
)

// MonitorConfig is a config that suits the latest
Expand Down
2 changes: 1 addition & 1 deletion pkg/kube_events_manager/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"testing"

"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/flant/kube-client/fake"
"github.com/flant/kube-client/manifest"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/kube_events_manager/resource_informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"time"

"github.com/deckhouse/deckhouse/pkg/log"
. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/deckhouse/module-sdk/pkg/metric-storage"
"github.com/gofrs/uuid/v5"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/tools/cache"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
"github.com/deckhouse/module-sdk/pkg/metric-storage"
klient "github.com/flant/kube-client/client"
"github.com/flant/shell-operator/pkg/utils/measure"
)
Expand Down
3 changes: 1 addition & 2 deletions pkg/kube_events_manager/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"math/rand/v2"
"time"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/fields"

. "github.com/deckhouse/module-sdk/pkg/kube-events-manager/types"
)

// ResourceId describes object with namespace, kind and name
Expand Down
3 changes: 1 addition & 2 deletions pkg/metric/storage.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package metric

import (
"github.com/prometheus/client_golang/prometheus"

"github.com/deckhouse/module-sdk/pkg/metric-storage/operation"
"github.com/prometheus/client_golang/prometheus"
)

type Storage interface {
Expand Down
6 changes: 3 additions & 3 deletions pkg/metric_storage/metric_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"sync"

"github.com/deckhouse/deckhouse/pkg/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/deckhouse/module-sdk/pkg/metric"
"github.com/deckhouse/module-sdk/pkg/metric-storage/operation"
"github.com/deckhouse/module-sdk/pkg/metric-storage/vault"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

. "github.com/flant/shell-operator/pkg/utils/labels"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/metric_storage/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"sync"

"github.com/deckhouse/deckhouse/pkg/log"
"github.com/deckhouse/module-sdk/pkg/metric"
"github.com/prometheus/client_golang/prometheus"

"github.com/deckhouse/module-sdk/pkg/metric"
. "github.com/flant/shell-operator/pkg/utils/labels"
)

Expand Down
3 changes: 1 addition & 2 deletions pkg/schedule_manager/schedule_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"context"

"github.com/deckhouse/deckhouse/pkg/log"
"gopkg.in/robfig/cron.v2"

. "github.com/deckhouse/module-sdk/pkg/schedule-manager/types"
"gopkg.in/robfig/cron.v2"
)

type ScheduleManager interface {
Expand Down
Loading

0 comments on commit d000895

Please sign in to comment.