Skip to content

Commit

Permalink
fix: look for sysdig v2 first
Browse files Browse the repository at this point in the history
  • Loading branch information
KatieArmstr committed Dec 21, 2023
1 parent 1c3b076 commit 681f462
Show file tree
Hide file tree
Showing 2 changed files with 364 additions and 210 deletions.
12 changes: 6 additions & 6 deletions src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ config.EXCLUDED_NAMESPACES = loadExcludedNamespaces();
config.WORKERS_COUNT = Number(config.WORKERS_COUNT) || 10;
config.SKOPEO_COMPRESSION_LEVEL = Number(config.SKOPEO_COMPRESSION_LEVEL) || 6;

// return Sysdig v1 endpoint information
if (config.SYSDIG_ENDPOINT && config.SYSDIG_TOKEN) {
config.SYSDIG_ENDPOINT = config.SYSDIG_ENDPOINT.trim();
config.SYSDIG_TOKEN = config.SYSDIG_TOKEN.trim();
}

// return Sysdig v2 endpoint information
if (
config.SYSDIG_RISK_SPOTLIGHT_TOKEN &&
Expand All @@ -65,6 +59,12 @@ if (
config.SYSDIG_CLUSTER_NAME = config.SYSDIG_CLUSTER_NAME.trim();
}

// return Sysdig v1 endpoint information
if (config.SYSDIG_ENDPOINT && config.SYSDIG_TOKEN) {
config.SYSDIG_ENDPOINT = config.SYSDIG_ENDPOINT.trim();
config.SYSDIG_TOKEN = config.SYSDIG_TOKEN.trim();
}

/**
* Important: we delete the following env vars because we don't want to proxy requests to the Kubernetes API server.
* The Kubernetes client library would honor the NO/HTTP/HTTPS_PROXY env vars.
Expand Down
Loading

0 comments on commit 681f462

Please sign in to comment.