Skip to content

Commit

Permalink
fix dump remote bucket (#280)
Browse files Browse the repository at this point in the history
* Fix local dev env with datadog

* fix empty bucket name on dump command

* reverting
  • Loading branch information
jt-dd authored Oct 9, 2024
1 parent 5f215eb commit 3de0f7f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions pkg/config/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ type K8SAPICollectorConfig struct {
type FileCollectorConfig struct {
Directory string `mapstructure:"directory"` // Base directory holding the K8s data JSON files
Archive *FileArchiveConfig `mapstructure:"archive"` // Archive configuration
Blob *BlobConfig `mapstructure:"blob"` // Blob storage configuration
}

type FileArchiveConfig struct {
ArchiveName string `mapstructure:"archive_name"` // Name of the output archive
NoCompress bool `mapstructure:"no_compress"` // Disable compression for the dumped data (generates a tar.gz file)
}

type BlobConfig struct {
BucketUrl string `mapstructure:"bucket_url"` // Bucket to use to push k8s resources (e.g.: s3://<your_bucket>)
Region string `mapstructure:"region"` // Region to use for the bucket (only for s3)
}
5 changes: 5 additions & 0 deletions pkg/config/ingestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ type IngestorAPIConfig struct {
Endpoint string `mapstructure:"endpoint"`
Insecure bool `mapstructure:"insecure" validate:"omitempty,boolean"`
}

type BlobConfig struct {
BucketUrl string `mapstructure:"bucket_url"` // Bucket to use to push k8s resources (e.g.: s3://<your_bucket>)
Region string `mapstructure:"region"` // Region to use for the bucket (only for s3)
}
2 changes: 1 addition & 1 deletion pkg/kubehound/core/core_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func DumpCore(ctx context.Context, khCfg *config.KubehoundConfig, upload bool) (
log.I.Errorf("Failed to remove temporary directory: %v", err)
}
}()
puller, err := blob.NewBlobStorage(khCfg, khCfg.Collector.File.Blob)
puller, err := blob.NewBlobStorage(khCfg, khCfg.Ingestor.Blob)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 3de0f7f

Please sign in to comment.