Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kristof Gyuracz <[email protected]>
  • Loading branch information
kristofgyuracz committed Mar 6, 2024
1 parent bc8ea1a commit 02012da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
20 changes: 0 additions & 20 deletions internal/controller/telemetry/collector_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"reflect"
"slices"
"strings"
"time"

"emperror.dev/errors"
Expand Down Expand Up @@ -440,22 +439,3 @@ func normalizeStringSlice(inputList []string) []string {

return uniqueList
}

func normalizeNamespacedNameSlice(inputList []v1alpha1.NamespacedName) []v1alpha1.NamespacedName {
allKeys := make(map[v1alpha1.NamespacedName]bool)
uniqueList := []v1alpha1.NamespacedName{}
for _, item := range inputList {
if _, value := allKeys[item]; !value {
allKeys[item] = true
uniqueList = append(uniqueList, item)
}
}

cmp := func(a, b v1alpha1.NamespacedName) int {
return strings.Compare(a.String(), b.String())
}

slices.SortFunc(uniqueList, cmp)

return uniqueList
}
3 changes: 2 additions & 1 deletion internal/controller/telemetry/controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package telemetry

import (
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/telemetry/otel_conf_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestOtelColConfComplex(t *testing.T) {
tenant := inputCfg.Tenants[0]

keysOfMap := func(subsMap map[v1alpha1.NamespacedName]v1alpha1.Subscription) (names []v1alpha1.NamespacedName) {
for key, _ := range subsMap {
for key := range subsMap {
names = append(names, key)
}
return
Expand Down

0 comments on commit 02012da

Please sign in to comment.