From 88c4623d2679d8e610f3edaaaab1041946a9e0ab Mon Sep 17 00:00:00 2001 From: John Howard Date: Tue, 5 Nov 2024 11:14:39 -0800 Subject: [PATCH] lint --- pkg/kube/krt/collection.go | 15 --------------- pkg/kube/krt/debug.go | 1 + pkg/kube/krt/informer.go | 4 +--- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pkg/kube/krt/collection.go b/pkg/kube/krt/collection.go index f84086b1c192..3ab8d81bfb58 100644 --- a/pkg/kube/krt/collection.go +++ b/pkg/kube/krt/collection.go @@ -187,27 +187,12 @@ func (h *manyCollection[I, O]) dump() CollectionDump { cur.Dependencies = depss inputs[string(k)] = cur } - // var xx Key[I] - // x := h.objectDependencies[xx][0]. return CollectionDump{ Outputs: eraseMap(h.collectionState.outputs), Inputs: inputs, InputCollection: h.parent.(internalCollection[I]).name(), } - //h.log.Errorf(">>> BEGIN DUMP") - //for k, deps := range h.objectDependencies { - // for _, dep := range deps { - // h.log.Errorf("Dependencies for: %v: %v (%v)", k, dep.collectionName, dep.filter) - // } - //} - //for i, os := range h.collectionState.mappings { - // h.log.Errorf("Input %v -> %v", i, os.UnsortedList()) - //} - //for os, o := range h.collectionState.outputs { - // h.log.Errorf("Output %v -> %v", os, o) - //} - //h.log.Errorf("<<< END DUMP") } // nolint: unused // (not true, its to implement an interface) diff --git a/pkg/kube/krt/debug.go b/pkg/kube/krt/debug.go index 6fd890113ee6..3f461b30a0ec 100644 --- a/pkg/kube/krt/debug.go +++ b/pkg/kube/krt/debug.go @@ -71,6 +71,7 @@ func maybeRegisterCollectionForDebugging[T any](c Collection[T], handler *DebugH }) } +// nolint: unused // (not true, not sure why it thinks it is!) func eraseMap[T any](l map[Key[T]]T) map[string]any { nm := make(map[string]any, len(l)) for k, v := range l { diff --git a/pkg/kube/krt/informer.go b/pkg/kube/krt/informer.go index 9997f9b19418..e356c0abd476 100644 --- a/pkg/kube/krt/informer.go +++ b/pkg/kube/krt/informer.go @@ -63,9 +63,7 @@ func (i *informer[I]) Synced() Syncer { // nolint: unused // (not true, its to implement an interface) func (i *informer[I]) dump() CollectionDump { return CollectionDump{ - Outputs: eraseMap(slices.GroupUnique(i.inf.List(metav1.NamespaceAll, klabels.Everything()), func(t I) Key[I] { - return GetKey(t) - })), + Outputs: eraseMap(slices.GroupUnique(i.inf.List(metav1.NamespaceAll, klabels.Everything()), GetKey)), } }