Skip to content

Commit

Permalink
Switch gql lib
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Sep 8, 2023
1 parent 7aaf77b commit 7b9f496
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ go 1.20
require (
github.com/Masterminds/semver v1.5.0
github.com/cert-manager/cert-manager v1.11.5
github.com/cli/shurcooL-graphql v0.0.3
github.com/go-logr/logr v1.2.4
github.com/go-logr/zapr v1.2.3
github.com/google/go-cmp v0.5.9
github.com/google/martian v2.1.0+incompatible
github.com/humio/cli v0.31.2-0.20230908121429-a9543de089d0
github.com/humio/cli v0.31.2-0.20230908130710-8b07e8c22f4e
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.11-0.20230807134635-babe25fc5472
github.com/openshift/api v3.9.0+incompatible
Expand All @@ -25,7 +26,6 @@ require (
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cli/shurcooL-graphql v0.0.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/humio/cli v0.31.2-0.20230908121429-a9543de089d0 h1:FmAk5x3cPV4MJuxvy2URSfOU4oBj/sp+/2Kn1Ks7fBs=
github.com/humio/cli v0.31.2-0.20230908121429-a9543de089d0/go.mod h1:qJQUzDiJbXCJam0ifTKM0gRw1IDbLCUhZMqDCXteg1I=
github.com/humio/cli v0.31.2-0.20230908130710-8b07e8c22f4e h1:INRMUslqX2Ew5nEwZfk9byKQF96j081ZMV5TDy7FQVA=
github.com/humio/cli v0.31.2-0.20230908130710-8b07e8c22f4e/go.mod h1:qJQUzDiJbXCJam0ifTKM0gRw1IDbLCUhZMqDCXteg1I=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
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=
Expand Down
2 changes: 1 addition & 1 deletion images/helper/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/humio/humio-operator/images/helper
go 1.20

require (
github.com/humio/cli v0.31.2-0.20230908121429-a9543de089d0
github.com/humio/cli v0.31.2-0.20230908130710-8b07e8c22f4e
k8s.io/api v0.26.8
k8s.io/apimachinery v0.26.8
k8s.io/client-go v0.26.8
Expand Down
4 changes: 2 additions & 2 deletions images/helper/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/humio/cli v0.31.2-0.20230908121429-a9543de089d0 h1:FmAk5x3cPV4MJuxvy2URSfOU4oBj/sp+/2Kn1Ks7fBs=
github.com/humio/cli v0.31.2-0.20230908121429-a9543de089d0/go.mod h1:qJQUzDiJbXCJam0ifTKM0gRw1IDbLCUhZMqDCXteg1I=
github.com/humio/cli v0.31.2-0.20230908130710-8b07e8c22f4e h1:INRMUslqX2Ew5nEwZfk9byKQF96j081ZMV5TDy7FQVA=
github.com/humio/cli v0.31.2-0.20230908130710-8b07e8c22f4e/go.mod h1:qJQUzDiJbXCJam0ifTKM0gRw1IDbLCUhZMqDCXteg1I=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
Expand Down
13 changes: 7 additions & 6 deletions pkg/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package helpers
import (
"crypto/sha256"
"fmt"
graphql "github.com/cli/shurcooL-graphql"
"os"
"reflect"
"sort"
Expand Down Expand Up @@ -71,11 +72,11 @@ func MapStoragePartition(vs []humioapi.StoragePartition, f func(partition humioa

func ToStoragePartitionInput(line humioapi.StoragePartition) humioapi.StoragePartitionInput {
var input humioapi.StoragePartitionInput
nodeIds := make([]int32, len(line.NodeIds))
nodeIds := make([]graphql.Int, len(line.NodeIds))
for i, v := range line.NodeIds {
nodeIds[i] = int32(v)
nodeIds[i] = graphql.Int(v)
}
input.ID = int32(line.Id)
input.ID = graphql.Int(line.Id)
input.NodeIDs = nodeIds

return input
Expand All @@ -91,11 +92,11 @@ func MapIngestPartition(vs []humioapi.IngestPartition, f func(partition humioapi

func ToIngestPartitionInput(line humioapi.IngestPartition) humioapi.IngestPartitionInput {
var input humioapi.IngestPartitionInput
nodeIds := make([]int32, len(line.NodeIds))
nodeIds := make([]graphql.Int, len(line.NodeIds))
for i, v := range line.NodeIds {
nodeIds[i] = int32(v)
nodeIds[i] = graphql.Int(v)
}
input.ID = int32(line.Id)
input.ID = graphql.Int(line.Id)
input.NodeIDs = nodeIds

return input
Expand Down
4 changes: 2 additions & 2 deletions pkg/humio/alert_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func AlertTransform(ha *humiov1alpha1.HumioAlert, actionIdMap map[string]string)
QueryString: ha.Spec.Query.QueryString,
QueryStart: ha.Spec.Query.Start,
Description: ha.Spec.Description,
ThrottleTimeMillis: humioapi.Long(ha.Spec.ThrottleTimeMillis),
ThrottleTimeMillis: ha.Spec.ThrottleTimeMillis,
ThrottleField: ha.Spec.ThrottleField,
Enabled: !ha.Spec.Silenced,
Actions: actionIdsFromActionMap(ha.Spec.Actions, actionIdMap),
Expand All @@ -42,7 +42,7 @@ func AlertHydrate(ha *humiov1alpha1.HumioAlert, alert *humioapi.Alert, actionIdM
Start: alert.QueryStart,
},
Description: alert.Description,
ThrottleTimeMillis: int(alert.ThrottleTimeMillis),
ThrottleTimeMillis: alert.ThrottleTimeMillis,
ThrottleField: alert.ThrottleField,
Silenced: !alert.Enabled,
Actions: actionIdsFromActionMap(ha.Spec.Actions, actionIdMap),
Expand Down

0 comments on commit 7b9f496

Please sign in to comment.