Skip to content

Commit

Permalink
Collect pod labels and support reading them via API (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
orishoshan authored Feb 10, 2023
1 parent 8633f5b commit 62aeb13
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 90 deletions.
8 changes: 1 addition & 7 deletions src/mapper/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ func main() {
defer cancelFn()
mgr.GetCache().WaitForCacheSync(initCtx) // needed to let the manager initialize before used in intentsHolder

intentHolderCfg, err := resolvers.IntentsHolderConfigFromViper()
if err != nil {
logrus.Error(intentHolderCfg)
os.Exit(1)
}

intentsHolder := resolvers.NewIntentsHolder(mgr.GetClient(), intentHolderCfg)
intentsHolder := resolvers.NewIntentsHolder(mgr.GetClient())

resolver := resolvers.NewResolver(kubeFinder, serviceidresolver.NewResolver(mgr.GetClient()), intentsHolder)
resolver.Register(e)
Expand Down
3 changes: 1 addition & 2 deletions src/mapper/pkg/clouduploader/cloud_uploader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/golang/mock/gomock"
"github.com/otterize/network-mapper/src/mapper/pkg/cloudclient"
cloudclientmocks "github.com/otterize/network-mapper/src/mapper/pkg/cloudclient/mocks"
"github.com/otterize/network-mapper/src/mapper/pkg/config"
"github.com/otterize/network-mapper/src/mapper/pkg/graph/model"
"github.com/otterize/network-mapper/src/mapper/pkg/resolvers"
"github.com/samber/lo"
Expand All @@ -29,7 +28,7 @@ type CloudUploaderTestSuite struct {

func (s *CloudUploaderTestSuite) SetupTest() {
s.testNamespace = "test-namespace"
s.intentsHolder = resolvers.NewIntentsHolder(nil, resolvers.IntentsHolderConfig{StoreConfigMap: config.StoreConfigMapDefault, Namespace: s.testNamespace})
s.intentsHolder = resolvers.NewIntentsHolder(nil)
}

func (s *CloudUploaderTestSuite) BeforeTest(_, testName string) {
Expand Down
3 changes: 0 additions & 3 deletions src/mapper/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const (
ClusterDomainDefault = kubeutils.DefaultClusterDomain
DebugKey = "debug"
DebugDefault = false
StoreConfigMapKey = "store-config-map"
StoreConfigMapDefault = "otterize-network-mapper-store"
NamespaceKey = "namespace"
CloudApiAddrKey = "api-address"
CloudApiAddrDefault = "https://app.otterize.com/api"
Expand All @@ -26,7 +24,6 @@ const (
func init() {
viper.SetDefault(DebugKey, DebugDefault)
viper.SetDefault(ClusterDomainKey, ClusterDomainDefault) // If not set by the user, the main.go of mapper will try to find the cluster domain and set it itself.
viper.SetDefault(StoreConfigMapKey, StoreConfigMapDefault)
viper.SetDefault(CloudApiAddrKey, CloudApiAddrDefault)
viper.SetDefault(UploadIntervalSecondsKey, UploadIntervalSecondsDefault)
viper.SetEnvPrefix(EnvPrefix)
Expand Down
Loading

0 comments on commit 62aeb13

Please sign in to comment.