Skip to content

Commit

Permalink
let there be seqs
Browse files Browse the repository at this point in the history
Signed-off-by: Kristof Gyuracz <kristof.gyuracz@axoflow.com>
  • Loading branch information
kristofgyuracz committed Mar 7, 2024
1 parent 7013688 commit 11e8651
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/siliconbrain/go-mapseqs v0.2.0 // indirect
github.com/siliconbrain/go-seqs v0.1.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/wayneashleyberry/terminal-dimensions v1.1.0 // indirect
go.opentelemetry.io/collector/featuregate v0.77.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwa
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/siliconbrain/go-mapseqs v0.2.0 h1:TQrWhpFMZG6kr8KoNDJAqT83h9fM3DG1C0HsfkAfBNU=
github.com/siliconbrain/go-mapseqs v0.2.0/go.mod h1:IE8lGocwpiXDwm7hWXKz4keUvgYIjApJY+ZAiFwpy8U=
github.com/siliconbrain/go-seqs v0.1.0 h1:6esr7kbXi+zZ+NKM3cdSPBPRoPpxbQw7DBt4g/RGpA4=
github.com/siliconbrain/go-seqs v0.1.0/go.mod h1:C5Kz1fQpLUN6aSGKh4uFFyRSMJBxZtii/3+iRf5MaAk=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand Down
10 changes: 3 additions & 7 deletions internal/controller/telemetry/otel_conf_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/kube-logging/telemetry-controller/api/telemetry/v1alpha1"
"github.com/siliconbrain/go-mapseqs/mapseqs"
"github.com/siliconbrain/go-seqs/seqs"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -135,13 +137,7 @@ func TestOtelColConfComplex(t *testing.T) {
inputCfg.TenantSubscriptionMap = map[string][]v1alpha1.NamespacedName{}
tenant := inputCfg.Tenants[0]

keysOfMap := func(subsMap map[v1alpha1.NamespacedName]v1alpha1.Subscription) (names []v1alpha1.NamespacedName) {
for key := range subsMap {
names = append(names, key)
}
return
}
inputCfg.TenantSubscriptionMap[tenant.Name] = keysOfMap(inputCfg.Subscriptions)
inputCfg.TenantSubscriptionMap[tenant.Name] = seqs.ToSlice(mapseqs.KeysOf(inputCfg.Subscriptions))

// IR
generatedIR := inputCfg.ToIntermediateRepresentation()
Expand Down

0 comments on commit 11e8651

Please sign in to comment.