From 7d6e269510e8b3994a97e8f9e2e4b6b60cc723c7 Mon Sep 17 00:00:00 2001 From: jt-dd <112463504+jt-dd@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:06:57 +0200 Subject: [PATCH 1/2] running datadog agent only on branch based PR (#263) --- .github/workflows/system-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/system-test.yml b/.github/workflows/system-test.yml index f6e35b763..5c9e26e76 100644 --- a/.github/workflows/system-test.yml +++ b/.github/workflows/system-test.yml @@ -12,11 +12,11 @@ permissions: jobs: system-test: runs-on: - group: Large Runner Shared Public + group: Large Runner Shared Public labels: ubuntu-8-core-latest services: dd-agent: - image: gcr.io/datadoghq/agent:7 + image: ${{ (! github.event.pull_request.head.repo.fork ) && 'gcr.io/datadoghq/agent:7' || '' }} env: DD_API_KEY: ${{ secrets.DD_API_KEY }} DD_TRACE_DEBUG: 1 @@ -46,7 +46,7 @@ jobs: gcr.io:443 repo.maven.apache.org:443 *.datadoghq.com:443 - + - name: Checkout Git Repo uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab @@ -58,12 +58,12 @@ jobs: wait: 5m env: KUBECONFIG: ./test/setup/.kube-config - + - name: Create K8s resources run: make local-cluster-resource-deploy env: KUBECONFIG: ./test/setup/.kube-config - + - name: Setup Golang uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe with: @@ -72,4 +72,4 @@ jobs: - name: Run integration Tests run: make system-test env: - KIND_KUBECONFIG: .kube-config \ No newline at end of file + KIND_KUBECONFIG: .kube-config From 9b3f2599ff7223300a12308862cecefbc5eb531a Mon Sep 17 00:00:00 2001 From: jt-dd <112463504+jt-dd@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:07:55 +0200 Subject: [PATCH 2/2] fix grpc ingestor (backward compat) (#262) * fix grpc ingestor (backward compat) * removing old ref --- cmd/kubehound/ingest.go | 4 ++-- pkg/config/collector.go | 1 - pkg/config/ingestor.go | 2 -- pkg/ingestor/api/api.go | 2 +- test/system/setup_test.go | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cmd/kubehound/ingest.go b/cmd/kubehound/ingest.go index 8605a9ed2..d40a9c5d4 100644 --- a/cmd/kubehound/ingest.go +++ b/cmd/kubehound/ingest.go @@ -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 == "" } diff --git a/pkg/config/collector.go b/pkg/config/collector.go index f669d606d..1f0a1bb73 100644 --- a/pkg/config/collector.go +++ b/pkg/config/collector.go @@ -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" ) diff --git a/pkg/config/ingestor.go b/pkg/config/ingestor.go index 675c306ed..91c9c2c16 100644 --- a/pkg/config/ingestor.go +++ b/pkg/config/ingestor.go @@ -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" diff --git a/pkg/ingestor/api/api.go b/pkg/ingestor/api/api.go index 3e60cdd0f..940011656 100644 --- a/pkg/ingestor/api/api.go +++ b/pkg/ingestor/api/api.go @@ -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) diff --git a/test/system/setup_test.go b/test/system/setup_test.go index b35bd6a17..d949acf8c 100644 --- a/test/system/setup_test.go +++ b/test/system/setup_test.go @@ -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 {