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) (#7847)

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 b50dcdc commit 83fda8a
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 65 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 @@
7845b9a40ddd58573a26d21df57fc4973febe633
174c47b656d937f3c8e42bdee90866ad6415afff
2 changes: 1 addition & 1 deletion mk/dependencies/go-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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())
})
})
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
6 changes: 2 additions & 4 deletions pkg/plugins/resources/k8s/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,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 @@ -580,7 +579,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 @@ -702,7 +701,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 @@ -143,7 +143,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/meshtrafficpermission/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func API() {
// given no MeshTrafficPermissions
mtps, err := env.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 @@ -80,7 +80,7 @@ spec:
// given no MeshTrafficPermissions
mtps, err := env.Cluster.GetKumactlOptions().KumactlList("meshtrafficpermissions", 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/observability/applications_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func ApplicationsMetrics() {
})
E2EAfterAll(func() {
Expect(env.Cluster.TriggerDeleteNamespace(namespace)).To(Succeed())
Expect(env.Cluster.DeleteMesh(mesh))
Expect(env.Cluster.DeleteMesh(meshNoAggregate))
Expect(env.Cluster.DeleteMesh(mesh)).To(Succeed())
Expect(env.Cluster.DeleteMesh(meshNoAggregate)).To(Succeed())
})

It("should scrape metrics defined in mesh and not fail when defined service doesn't exist", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ReachableServices() {

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

It("should be able to connect to reachable services", func() {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_env/kubernetes/virtualoutbound/virtualoutbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func VirtualOutbound() {

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

BeforeEach(func() {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e_env/universal/mtls/mtls.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ mtls:
// We must start client before server to test this properly. The client
// should get XDS refreshes first to trigger the race condition fixed by
// kumahq/kuma#3019
Expect(env.Cluster.Install(DemoClientUniversal("demo-client", meshName, WithTransparentProxy(true))))
Expect(env.Cluster.Install(DemoClientUniversal("demo-client", meshName, WithTransparentProxy(true)))).To(Succeed())

Expect(env.Cluster.Install(TestServerUniversal("test-server", meshName, WithArgs([]string{"echo", "--instance", "echo-v1"}))))
Expect(env.Cluster.Install(TestServerUniversal("test-server", meshName, WithArgs([]string{"echo", "--instance", "echo-v1"})))).To(Succeed())

By("Check inside-mesh communication")
trafficAllowed("test-server.mesh")
Expand All @@ -128,7 +128,7 @@ mtls:
- name: ca-1
type: builtin
mode: PERMISSIVE`, meshName)
Expect(env.Cluster.Install(YamlUniversal(meshYaml)))
Expect(env.Cluster.Install(YamlUniversal(meshYaml))).To(Succeed())

By("inside-mesh communication never fails")
Consistently(func(g Gomega) {
Expand Down
Loading

0 comments on commit 83fda8a

Please sign in to comment.