Skip to content

Commit

Permalink
use ViewConnectionInput from humio/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
bderrly committed Oct 29, 2023
1 parent 6840718 commit 6e6344f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/go-logr/zapr v1.2.4
github.com/google/go-cmp v0.5.9
github.com/google/martian v2.1.0+incompatible
github.com/humio/cli v0.32.3
github.com/humio/cli v0.32.4-0.20231025112913-b4dceeab38b6
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.11-0.20230807134635-babe25fc5472
github.com/prometheus/client_golang v1.16.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/humio/cli v0.32.3 h1:iBodQTpwGuadyg9zwCc5zXWNvFELxNxH6M08MO1Y+Ho=
github.com/humio/cli v0.32.3/go.mod h1:I4yilQO5wI6uc7NMLmKSGFATY3AZddCbehIvjESK8WQ=
github.com/humio/cli v0.32.4-0.20231025112913-b4dceeab38b6 h1:fEb+4t483D2QPA4CtcGxCV3SJ4IpGEN3OaU0i7rBMr0=
github.com/humio/cli v0.32.4-0.20231025112913-b4dceeab38b6/go.mod h1:I4yilQO5wI6uc7NMLmKSGFATY3AZddCbehIvjESK8WQ=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
Expand Down
10 changes: 7 additions & 3 deletions pkg/humio/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

graphql "github.com/cli/shurcooL-graphql"
"github.com/go-logr/logr"

humioapi "github.com/humio/cli/api"
Expand Down Expand Up @@ -533,10 +534,13 @@ func (h *ClientConfig) DeleteAction(config *humioapi.Config, req reconcile.Reque
return h.GetHumioClient(config, req).Actions().Delete(ha.Spec.ViewName, ha.Spec.Name)
}

func getConnectionMap(viewConnections []humioapi.ViewConnection) map[string][]string {
connectionMap := make(map[string][]string)
func getConnectionMap(viewConnections []humioapi.ViewConnection) []humioapi.ViewConnectionInput {
connectionMap := make([]humioapi.ViewConnectionInput, 0)
for _, connection := range viewConnections {
connectionMap[connection.RepoName] = append(connectionMap[connection.RepoName], connection.Filter)
connectionMap = append(connectionMap, humioapi.ViewConnectionInput{
RepositoryName: graphql.String(connection.RepoName),
Filter: graphql.String(connection.Filter),
})
}
return connectionMap
}
Expand Down

0 comments on commit 6e6344f

Please sign in to comment.