Skip to content

Commit

Permalink
chore(deps): bump golangci-lint from v1.51.2 to v1.53.3 (#7334)
Browse files Browse the repository at this point in the history
Signed-off-by: Charly Molter <[email protected]>
  • Loading branch information
lahabana authored and michaelbeaumont committed Sep 25, 2023
1 parent d8d87cb commit 129d2e2
Show file tree
Hide file tree
Showing 40 changed files with 67 additions and 81 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 @@
2b9b91f44000434af60a0e0b1a608c9233271ca4
7ebf248663cfa5c19109be4201e85038f2663100
2 changes: 1 addition & 1 deletion mk/dependencies/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

OUTPUT_BIN_DIR=$1/bin
VERSION="1.51.2"
VERSION="1.53.3"

golangcilint="${OUTPUT_BIN_DIR}"/golangci-lint

Expand Down
2 changes: 1 addition & 1 deletion pkg/core/logs/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,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 @@ -76,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 @@ -77,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 @@ -77,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 @@ -77,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())
})
})
2 changes: 1 addition & 1 deletion pkg/intercp/catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,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
16 changes: 5 additions & 11 deletions pkg/kds/server/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func New(
insight bool,
nackBackoff time.Duration,
) (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 @@ -115,14 +115,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)
}
2 changes: 1 addition & 1 deletion pkg/kds/v2/client/zone_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var _ = Describe("Zone Delta Sync", func() {
actual := mesh.MeshResourceList{}
err := zoneStore.List(context.Background(), &actual)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(actual.Items).To(HaveLen(0))
g.Expect(actual.Items).To(BeEmpty())
}, "5s", "100ms").Should(Succeed())
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/kds/v2/server/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func newSyncTracker(log logr.Logger, reconciler reconcile_v2.Reconciler, refresh
}), nil
}

func newKDSContext(log logr.Logger) (envoy_cache.NodeHash, envoy_cache.SnapshotCache) {
func newKDSContext(log logr.Logger) (envoy_cache.NodeHash, envoy_cache.SnapshotCache) { //nolint:unparam
hasher := hasher{}
logger := util_xds.NewLogger(log)
return hasher, envoy_cache.NewSnapshotCache(false, hasher, logger)
Expand Down
2 changes: 1 addition & 1 deletion pkg/mads/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,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
2 changes: 1 addition & 1 deletion pkg/plugins/resources/k8s/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,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
Original file line number Diff line number Diff line change
Expand Up @@ -166,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 @@ -189,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 @@ -212,6 +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())
})
})
8 changes: 4 additions & 4 deletions pkg/plugins/runtime/k8s/controllers/pod_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,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 @@ -329,7 +329,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 @@ -406,7 +406,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 @@ -429,7 +429,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
2 changes: 1 addition & 1 deletion pkg/plugins/secrets/k8s/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,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
4 changes: 2 additions & 2 deletions pkg/test/store/store_test_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func ExecuteStoreTests(
// and
Expect(list.Pagination.Total).To(Equal(uint32(0)))
// and
Expect(list.Items).To(HaveLen(0))
Expect(list.Items).To(BeEmpty())
})

It("should return a list of resources", func() {
Expand Down Expand Up @@ -338,7 +338,7 @@ func ExecuteStoreTests(
// and
Expect(list.Pagination.Total).To(Equal(uint32(0)))
// and
Expect(list.Items).To(HaveLen(0))
Expect(list.Items).To(BeEmpty())
})

It("should return a list of resources with prefix from all meshes", func() {
Expand Down
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
4 changes: 2 additions & 2 deletions test/blackbox_network_tests/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ var _ = Describe("Outbound IPv4 DNS/UDP traffic to port 53 only for addresses in

// and do not redirect any dns request
Eventually(ns.UnsafeExec(func() {
Expect(udp.DialUDPAddrWithHelloMsgAndGetReply(randomAddressDnsRequest, randomAddressDnsRequest))
Expect(udp.DialUDPAddrWithHelloMsgAndGetReply(randomAddressDnsRequest, randomAddressDnsRequest)).To(Succeed())
})).ShouldNot(BeClosed())

// then
Expand Down Expand Up @@ -880,7 +880,7 @@ var _ = Describe("Outbound IPv6 DNS/UDP traffic to port 53 only for addresses in

// and do not redirect any dns request
Eventually(ns.UnsafeExec(func() {
Expect(udp.DialUDPAddrWithHelloMsgAndGetReply(randomAddressDnsRequest, randomAddressDnsRequest))
Expect(udp.DialUDPAddrWithHelloMsgAndGetReply(randomAddressDnsRequest, randomAddressDnsRequest)).To(Succeed())
})).ShouldNot(BeClosed())

// then
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/connectivity/headless_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func HeadlessServices() {

E2EAfterAll(func() {
Expect(kubernetes.Cluster.TriggerDeleteNamespace(namespace)).To(Succeed())
Expect(kubernetes.Cluster.DeleteMesh(meshName))
Expect(kubernetes.Cluster.DeleteMesh(meshName)).To(Succeed())
})

It("should be able to connect to the headless service", func() {
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 @@ -142,7 +142,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
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/graceful/graceful.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ spec:

E2EAfterAll(func() {
Expect(kubernetes.Cluster.TriggerDeleteNamespace(namespace)).To(Succeed())
Expect(kubernetes.Cluster.DeleteMesh(mesh))
Expect(kubernetes.Cluster.DeleteMesh(mesh)).To(Succeed())
})

requestThroughGateway := func() error {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/healthcheck/virtual_probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func VirtualProbes() {
})
E2EAfterAll(func() {
Expect(kubernetes.Cluster.TriggerDeleteNamespace(namespace)).To(Succeed())
Expect(kubernetes.Cluster.DeleteMesh(mesh))
Expect(kubernetes.Cluster.DeleteMesh(mesh)).To(Succeed())
})

It("should deploy test-server with probes", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/jobs/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Jobs() {
out, err := kubernetes.Cluster.GetKumactlOptions().RunKumactlAndGetOutput("get", "dataplanes", "--mesh", mesh)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(out).ToNot(ContainSubstring("demo-job-client"))
}, "30s", "1s")
}, "30s", "1s").Should(Succeed())
})

It("should terminate jobs with mTLS", func() {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e_env/kubernetes/meshcircuitbreaker/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func API() {
// given no MeshCircuitBreakers
mcb, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshcircuitbreakers", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mcb).To(HaveLen(0))
Expect(mcb).To(BeEmpty())

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

// when
err = k8s.KubectlApplyFromStringE(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func MeshCircuitBreaker() {
// given no MeshCircuitBreaker
mcbs, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshcircuitbreakers", mesh)
Expect(err).ToNot(HaveOccurred())
Expect(mcbs).To(HaveLen(0))
Expect(mcbs).To(BeEmpty())

Eventually(func() ([]client.FailureResponse, error) {
return client.CollectResponsesAndFailures(
Expand Down
4 changes: 2 additions & 2 deletions test/e2e_env/kubernetes/meshfaultinjection/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func API() {
// given no MeshRateLimit
mrls, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshfaultinjections", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mrls).To(HaveLen(0))
Expect(mrls).To(BeEmpty())

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

// when
err = k8s.KubectlApplyFromStringE(
Expand Down
4 changes: 2 additions & 2 deletions test/e2e_env/kubernetes/meshhealthcheck/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func API() {
// given no MeshHealthChecks
mtps, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshhealthchecks", 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 MeshHealthChecks
mtps, err := kubernetes.Cluster.GetKumactlOptions().KumactlList("meshhealthchecks", meshName)
Expect(err).ToNot(HaveOccurred())
Expect(mtps).To(HaveLen(0))
Expect(mtps).To(BeEmpty())

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

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

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

0 comments on commit 129d2e2

Please sign in to comment.