Skip to content

Commit

Permalink
service discovery v2 (#190)
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Malka <amirm@armosec.io>
  • Loading branch information
amirmalka committed Nov 21, 2023
1 parent f71b075 commit 8db988c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
utilsmetadata "github.com/armosec/utils-k8s-go/armometadata"
"github.com/kubescape/backend/pkg/servicediscovery"
"github.com/kubescape/backend/pkg/servicediscovery/schema"
v1 "github.com/kubescape/backend/pkg/servicediscovery/v1"
v2 "github.com/kubescape/backend/pkg/servicediscovery/v2"
"github.com/kubescape/backend/pkg/utils"
"github.com/kubescape/go-logger"
"github.com/kubescape/go-logger/helpers"
Expand Down Expand Up @@ -195,7 +195,7 @@ func LoadConfig(path string) (Config, error) {
viper.SetDefault("workerConcurrency", 3)
viper.SetDefault("triggerSecurityFramework", false)
viper.SetDefault("matchingRulesFilename", "/etc/config/matchingRules.json")
viper.SetDefault("eventDeduplicationInterval", 2 * time.Minute)
viper.SetDefault("eventDeduplicationInterval", 2*time.Minute)

viper.AutomaticEnv()

Expand Down Expand Up @@ -231,7 +231,7 @@ func GetServiceURLs(filePath string) (schema.IBackendServices, error) {
logger.L().Debug("discovery service URLs from file", helpers.String("path", pathAndFileName))

return servicediscovery.GetServices(
v1.NewServiceDiscoveryFileV1(pathAndFileName),
v2.NewServiceDiscoveryFileV2(pathAndFileName),
)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.5.0
github.com/hashicorp/golang-lru/v2 v2.0.6
github.com/kubescape/backend v0.0.13
github.com/kubescape/backend v0.0.15
github.com/kubescape/go-logger v0.0.21
github.com/kubescape/k8s-interface v0.0.148
github.com/kubescape/opa-utils v0.0.270
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubescape/backend v0.0.13 h1:N+fH8giGGqvy3ff2li2AwG5guVduhdiPWyvZaZxrDCU=
github.com/kubescape/backend v0.0.13/go.mod h1:ug9NFmmxT4DcQx3sgdLRzlLPWMKGHE/fpbcYUm5G5Qo=
github.com/kubescape/backend v0.0.15 h1:LOQIhwu+tgXjm4QGOLnKuPxP8zOkqd7NaiQbbnYVoCE=
github.com/kubescape/backend v0.0.15/go.mod h1:ug9NFmmxT4DcQx3sgdLRzlLPWMKGHE/fpbcYUm5G5Qo=
github.com/kubescape/go-logger v0.0.21 h1:4ZRIEw3UGUH6BG/cH3yiqFipzQSfGAoCrxlsZuk37ys=
github.com/kubescape/go-logger v0.0.21/go.mod h1:x3HBpZo3cMT/WIdy18BxvVVd5D0e/PWFVk/HiwBNu3g=
github.com/kubescape/k8s-interface v0.0.148 h1:vtXDUjvCow5wMdDvb5c/Td9SpafeRqsV/LnOd0NVVsE=
Expand Down

0 comments on commit 8db988c

Please sign in to comment.