Skip to content

Commit

Permalink
chore(deps): bump golangci-lint from v1.51.2 to v1.53.3 (backport of #…
Browse files Browse the repository at this point in the history
…7334) (#7846)

chore(deps): bump golangci-lint from v1.51.2 to v1.53.3 (#7334)

Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
Co-authored-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
kumahq[bot] and michaelbeaumont authored Sep 25, 2023
1 parent c5daf92 commit 0766acd
Show file tree
Hide file tree
Showing 27 changed files with 50 additions and 80 deletions.
2 changes: 1 addition & 1 deletion app/kumactl/cmd/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var _ = Describe("kumactl get ", func() {
It("should have get commands for all defined types", func() {
// when
all := registry.Global().ObjectDescriptors(model.HasKumactlEnabled())
Expect(len(getCmd.Commands()) > len(all)).To(BeTrue())
Expect(len(getCmd.Commands())).To(BeNumerically(">", len(all)))

// then
for _, sub := range all {
Expand Down
2 changes: 1 addition & 1 deletion mk/dependencies/deps.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c2be6ddbdf8d5765f08b0ff17b41eb848038415f
2290363849a4e7f1b5e559d46d6ca7defebe0fe3
2 changes: 1 addition & 1 deletion mk/dependencies/go-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ for i in \
${PGV} \
${PGKUMADOC} \
github.com/onsi/ginkgo/v2/ginkgo@$(go list -m github.com/onsi/ginkgo/v2 | cut -d ' ' -f2) \
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 \
github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 \
github.com/mikefarah/yq/v4@v4.27.2 \
github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0 \
golang.stackrox.io/kube-linter/cmd/kube-linter@v0.0.0-20220513142942-846f273ed465; do
Expand Down
3 changes: 1 addition & 2 deletions pkg/core/logs/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

var _ = Describe("Matcher", func() {

var manager core_manager.ResourceManager
var matcher logs.TrafficLogsMatcher
var dpRes core_mesh.DataplaneResource
Expand Down Expand Up @@ -194,7 +193,7 @@ var _ = Describe("Matcher", func() {

// then
Expect(err).ToNot(HaveOccurred())
Expect(log).To(HaveLen(0))
Expect(log).To(BeEmpty())
})

It("should skip unknown backends", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
)

var _ = Describe("DataplaneInsight Manager", func() {

It("should limit the number of subscription", func() {
// setup
s := memory.NewStore()
Expand Down Expand Up @@ -77,7 +76,7 @@ var _ = Describe("DataplaneInsight Manager", func() {
Expect(err).ToNot(HaveOccurred())

// then
Expect(actual.Spec.Subscriptions).To(HaveLen(0))
Expect(actual.Spec.Subscriptions).To(BeEmpty())
Expect(actual.Spec.Subscriptions).To(BeNil())
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

var _ = Describe("ZoneEgressInsight Manager", func() {

It("should limit the number of subscription", func() {
// setup
s := memory.NewStore()
Expand Down Expand Up @@ -78,7 +77,7 @@ var _ = Describe("ZoneEgressInsight Manager", func() {
Expect(err).ToNot(HaveOccurred())

// then
Expect(actual.Spec.Subscriptions).To(HaveLen(0))
Expect(actual.Spec.Subscriptions).To(BeEmpty())
Expect(actual.Spec.Subscriptions).To(BeNil())
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

var _ = Describe("ZoneIngressInsight Manager", func() {

It("should limit the number of subscription", func() {
// setup
s := memory.NewStore()
Expand Down Expand Up @@ -78,7 +77,7 @@ var _ = Describe("ZoneIngressInsight Manager", func() {
Expect(err).ToNot(HaveOccurred())

// then
Expect(actual.Spec.Subscriptions).To(HaveLen(0))
Expect(actual.Spec.Subscriptions).To(BeEmpty())
Expect(actual.Spec.Subscriptions).To(BeNil())
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

var _ = Describe("ZoneInsight Manager", func() {

It("should limit the number of subscription", func() {
// setup
s := memory.NewStore()
Expand Down Expand Up @@ -78,7 +77,7 @@ var _ = Describe("ZoneInsight Manager", func() {
Expect(err).ToNot(HaveOccurred())

// then
Expect(actual.Spec.Subscriptions).To(HaveLen(0))
Expect(actual.Spec.Subscriptions).To(BeEmpty())
Expect(actual.Spec.Subscriptions).To(BeNil())
})
})
3 changes: 1 addition & 2 deletions pkg/intercp/catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
)

var _ = Describe("Catalog", func() {

var c catalog.Catalog

BeforeEach(func() {
Expand Down Expand Up @@ -192,7 +191,7 @@ var _ = Describe("Catalog", func() {

// then
Expect(err).ToNot(HaveOccurred())
Expect(instances).To(HaveLen(0))
Expect(instances).To(BeEmpty())
})

It("should handle IPV6 addresses when building inter cp URL", func() {
Expand Down
17 changes: 5 additions & 12 deletions pkg/kds/server/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
)

func New(log logr.Logger, rt core_runtime.Runtime, providedTypes []model.ResourceType, serverID string, refresh time.Duration, filter reconcile.ResourceFilter, mapper reconcile.ResourceMapper, insight bool) (Server, error) {
hasher, cache := newKDSContext(log)
hashFn, cache := newKDSContext(log)
generator := reconcile.NewSnapshotGenerator(rt.ReadOnlyResourceManager(), providedTypes, filter, mapper)
versioner := util_xds_v3.SnapshotAutoVersioner{UUID: core.NewUUID}
statsCallbacks, err := util_xds.NewStatsCallbacks(rt.Metrics(), "kds")
if err != nil {
return nil, err
}
reconciler := reconcile.NewReconciler(hasher, cache, generator, versioner, rt.Config().Mode, statsCallbacks)
reconciler := reconcile.NewReconciler(hashFn, cache, generator, versioner, rt.Config().Mode, statsCallbacks)
syncTracker, err := newSyncTracker(log, reconciler, refresh, rt.Metrics())
if err != nil {
return nil, err
Expand Down Expand Up @@ -103,15 +103,8 @@ func newSyncTracker(log logr.Logger, reconciler reconcile.Reconciler, refresh ti
}), nil
}

func newKDSContext(log logr.Logger) (envoy_cache.NodeHash, util_xds_v3.SnapshotCache) {
hasher := hasher{}
func newKDSContext(log logr.Logger) (envoy_cache.NodeHash, util_xds_v3.SnapshotCache) { //nolint:unparam
hashFn := util_xds_v3.IDHash{}
logger := util_xds.NewLogger(log)
return hasher, util_xds_v3.NewSnapshotCache(false, hasher, logger)
}

type hasher struct {
}

func (_ hasher) ID(node *envoy_core.Node) string {
return node.Id
return hashFn, util_xds_v3.NewSnapshotCache(false, hashFn, logger)
}
3 changes: 1 addition & 2 deletions pkg/mads/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (t *testRuntime) Metrics() metrics.Metrics {
}

var _ = Describe("MADS Server", func() {

var rt *testRuntime
var stopCh chan struct{}
var errCh chan error
Expand Down Expand Up @@ -105,7 +104,7 @@ var _ = Describe("MADS Server", func() {

assignments, err := stream.WaitForAssignments()
Expect(err).ToNot(HaveOccurred())
Expect(assignments).To(HaveLen(0))
Expect(assignments).To(BeEmpty())
})

It("should serve HTTP/1.1 requests", func() {
Expand Down
8 changes: 2 additions & 6 deletions pkg/plugins/resources/k8s/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ import (
)

var _ = Describe("KubernetesStore", func() {

var ks *k8s.KubernetesStore
var s store.ResourceStore
const name = "demo"
const mesh = "default"

var backend = struct {
backend := struct {
ParseYAML func(yaml string) client.Object
Create func(obj client.Object)
Get func(obj client.Object, ns, name string)
Expand Down Expand Up @@ -439,7 +438,6 @@ var _ = Describe("KubernetesStore", func() {
})

It("should return an error if namespaced resource is not in the right format", func() {

// when
err := ks.Get(context.Background(), v1alpha1.NewMeshTraceResource(), store.GetByKey(name, mesh))

Expand All @@ -448,7 +446,6 @@ var _ = Describe("KubernetesStore", func() {
})

It("should return an error if resource name is empty", func() {

// when
err := ks.Get(context.Background(), v1alpha1.NewMeshTraceResource(), store.GetByKey("", mesh))

Expand Down Expand Up @@ -601,7 +598,7 @@ var _ = Describe("KubernetesStore", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(trl.Items).To(HaveLen(0))
Expect(trl.Items).To(BeEmpty())
})

It("should return a list of matching resource", func() {
Expand Down Expand Up @@ -723,7 +720,6 @@ var _ = Describe("KubernetesStore", func() {
Expect(err).ToNot(HaveOccurred())
// and
backend.AssertNotExists(&mesh_k8s.Mesh{}, "", "demo")

})

It("should return a list of matching Meshes", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
)

var _ = Describe("NamespaceReconciler", func() {

var kubeClient kube_client.Client
var reconciler kube_reconcile.Reconciler

Expand Down Expand Up @@ -167,7 +166,7 @@ var _ = Describe("NamespaceReconciler", func() {
nads := &v1.NetworkAttachmentDefinitionList{}
err = kubeClient.List(context.Background(), nads)
Expect(err).ToNot(HaveOccurred())
Expect(nads.Items).To(HaveLen(0))
Expect(nads.Items).To(BeEmpty())
})

It("should ignore namespace namespaces without label", func() {
Expand All @@ -190,7 +189,7 @@ var _ = Describe("NamespaceReconciler", func() {
nads := &v1.NetworkAttachmentDefinitionList{}
err = kubeClient.List(context.Background(), nads)
Expect(err).ToNot(HaveOccurred())
Expect(nads.Items).To(HaveLen(0))
Expect(nads.Items).To(BeEmpty())
})

It("should skip creating NetworkAttachmentDefinition when CRD is absent in the cluster", func() {
Expand All @@ -213,7 +212,6 @@ var _ = Describe("NamespaceReconciler", func() {
nads := &v1.NetworkAttachmentDefinitionList{}
err = kubeClient.List(context.Background(), nads)
Expect(err).ToNot(HaveOccurred())
Expect(nads.Items).To(HaveLen(0))
Expect(nads.Items).To(BeEmpty())
})

})
9 changes: 4 additions & 5 deletions pkg/plugins/runtime/k8s/controllers/pod_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
)

var _ = Describe("PodReconciler", func() {

var kubeClient kube_client.Client
var reconciler kube_reconcile.Reconciler

Expand Down Expand Up @@ -308,7 +307,7 @@ var _ = Describe("PodReconciler", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(dataplanes.Items).To(HaveLen(0))
Expect(dataplanes.Items).To(BeEmpty())
})

It("should ignore Pods without Kuma sidecar", func() {
Expand All @@ -331,7 +330,7 @@ var _ = Describe("PodReconciler", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(dataplanes.Items).To(HaveLen(0))
Expect(dataplanes.Items).To(BeEmpty())
})

It("should not reconcile Ingress with namespace other than system", func() {
Expand Down Expand Up @@ -408,7 +407,7 @@ var _ = Describe("PodReconciler", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(dataplanes.Items).To(HaveLen(0))
Expect(dataplanes.Items).To(BeEmpty())
})

It("should ignore Pods without IP address", func() {
Expand All @@ -431,7 +430,7 @@ var _ = Describe("PodReconciler", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(dataplanes.Items).To(HaveLen(0))
Expect(dataplanes.Items).To(BeEmpty())
})

It("should generate Dataplane resource for every Pod that has Kuma sidecar injected", func() {
Expand Down
6 changes: 2 additions & 4 deletions pkg/plugins/secrets/k8s/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ import (
)

var _ = Describe("KubernetesStore", func() {

var s secret_store.SecretStore
var ns string // each test should run in a dedicated k8s namespace
const name = "demo"
const noMesh = ""

var backend = struct {
backend := struct {
ParseYAML func(yaml string) client.Object
Create func(obj client.Object)
Get func(obj client.Object, ns, name string)
Expand Down Expand Up @@ -646,7 +645,7 @@ var _ = Describe("KubernetesStore", func() {
// then
Expect(err).ToNot(HaveOccurred())
// and
Expect(secrets.Items).To(HaveLen(0))
Expect(secrets.Items).To(BeEmpty())
})

Describe("with resources loaded", func() {
Expand Down Expand Up @@ -756,6 +755,5 @@ var _ = Describe("KubernetesStore", func() {
Expect(string(secrets.Items[0].Spec.Data.Value)).To(Equal("four"))
})
})

})
})
2 changes: 1 addition & 1 deletion pkg/xds/sync/dataplane_watchdog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var _ = Describe("Dataplane Watchdog", func() {
var ctx context.Context

BeforeEach(func() {
Expect(samples.MeshDefaultBuilder().Create(resManager))
Expect(samples.MeshDefaultBuilder().Create(resManager)).To(Succeed())
Expect(samples.DataplaneBackendBuilder().Create(resManager)).To(Succeed())
resKey = core_model.MetaToResourceKey(samples.DataplaneBackend().GetMeta())

Expand Down
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/gateway/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ spec:

g.Expect(err).ToNot(HaveOccurred())
g.Expect(response.Instance).To(Equal("kubernetes"))
}, "20s", "1s")
}, "20s", "1s").Should(Succeed())

By("allowing more than 1 connection without a limit")

Expand Down
4 changes: 2 additions & 2 deletions test/e2e_env/kubernetes/meshretry/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func API() {
// given no MeshRetry
mrls, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshretries", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mrls).To(HaveLen(0))
Expect(mrls).To(BeEmpty())

// when
Expect(YamlK8s(fmt.Sprintf(`
Expand Down Expand Up @@ -70,7 +70,7 @@ spec:
// given no MeshRetry
mrls, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshretries", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mrls).To(HaveLen(0))
Expect(mrls).To(BeEmpty())

// when
err = k8s.KubectlApplyFromStringE(
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/meshtimeout/meshtimeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func MeshTimeout() {
// given no MeshTimeout
mts, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshtimeouts", mesh)
Expect(err).ToNot(HaveOccurred())
Expect(mts).To(HaveLen(0))
Expect(mts).To(BeEmpty())
Eventually(func(g Gomega) {
start := time.Now()
_, sterr, err := kubernetes.Cluster.Exec(namespace, clientPodName, "demo-client", "curl", "-v", "-H", "x-set-response-delay-ms: 5000", fmt.Sprintf("test-server_%s_svc_80.mesh", namespace))
Expand Down
4 changes: 2 additions & 2 deletions test/e2e_env/kubernetes/meshtrafficpermission/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func API() {
// given no MeshTrafficPermissions
mtps, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshtrafficpermissions", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mtps).To(HaveLen(0))
Expect(mtps).To(BeEmpty())

// when
Expect(YamlK8s(fmt.Sprintf(`
Expand Down Expand Up @@ -79,7 +79,7 @@ spec:
// given no MeshTrafficPermissions
mtps, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshtrafficpermissions", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mtps).To(HaveLen(0))
Expect(mtps).To(BeEmpty())

// when
err = k8s.KubectlApplyFromStringE(
Expand Down
Loading

0 comments on commit 0766acd

Please sign in to comment.