Skip to content

Commit

Permalink
fix grpc ingestor (backward compat) (#262)
Browse files Browse the repository at this point in the history
* fix grpc ingestor (backward compat)

* removing old ref
  • Loading branch information
jt-dd authored Sep 13, 2024
1 parent 7d6e269 commit 9b3f259
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/kubehound/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ var (
}
)

// If no arg is provided, run the reHydration of the latest snapshots (stored in KHaaS / S3 Bucket)
func isIngestRemoteDefault() bool {
runID := viper.GetString(config.IngestorRunID)
clusterName := viper.GetString(config.IngestorClusterName)
clusterName := viper.GetString(config.DynamicClusterName)

return runID == "" && clusterName == ""
}
Expand Down
1 change: 0 additions & 1 deletion pkg/config/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const (
CollectorNonInteractive = "collector.non_interactive"
CollectorFileArchiveNoCompress = "collector.file.archive.no_compress"
CollectorFileDirectory = "collector.file.directory"
CollectorFileClusterName = "collector.file.cluster_name"
CollectorFileBlobRegion = "collector.file.blob.region"
CollectorFileBlobBucket = "collector.file.blob.bucket"
)
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/ingestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const (

IngestorAPIEndpoint = "ingestor.api.endpoint"
IngestorAPIInsecure = "ingestor.api.insecure"
IngestorClusterName = "ingestor.cluster_name"
IngestorRunID = "ingestor.run_id"
IngestorMaxArchiveSize = "ingestor.max_archive_size"
IngestorTempDir = "ingestor.temp_dir"
IngestorArchiveName = "ingestor.archive_name"
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingestor/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (g *IngestorAPI) Ingest(_ context.Context, path string) error {
if err != nil {
log.I.Warnf("no metadata has been parsed (old dump format from v1.4.0 or below do not embed metadata information): %v", err)
// Backward Compatibility: Extracting the metadata from the path
dumpMetadata, err := dump.ParsePath(archivePath)
dumpMetadata, err := dump.ParsePath(path)
if err != nil {
log.I.Warn("parsing path for metadata", err)

Expand Down
1 change: 0 additions & 1 deletion test/system/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func RunLocal(ctx context.Context, runArgs *runArgs, compress bool, p *providers
// Setting the collectorDir, clusterName and runID needed for the ingestion step
// This information is used by the grpc server to run the ingestion
viper.Set(config.CollectorFileDirectory, collectorDir)
viper.Set(config.CollectorFileClusterName, clusterName)

err := cmd.InitializeKubehoundConfig(ctx, KubeHoundThroughDumpConfigPath, false, false)
if err != nil {
Expand Down

0 comments on commit 9b3f259

Please sign in to comment.