Skip to content

Commit

Permalink
feat(vault): Migrate datadog api/app keys (#29735)
Browse files Browse the repository at this point in the history
  • Loading branch information
chouetz authored Oct 16, 2024
1 parent ea7d8a5 commit 19c2807
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 44 deletions.
14 changes: 8 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,16 @@ variables:
WINGET_PAT: ci.datadog-agent.winget_pat # windows-agent
# End aws ssm variables
# Start vault variables
AGENT_API_KEY_ORG2: agent-api-key-org-2 # agent-devx-infra
AGENT_APP_KEY_ORG2: agent-ci-app-key-org-2 # agent-devx-infra
AGENT_GITHUB_APP: agent-github-app # agent-devx-infra
ATLASSIAN_WRITE: atlassian-write # agent-devx-infra
DOCKER_REGISTRY_RO: dockerhub-readonly # agent-delivery
INSTALL_SCRIPT_API_KEY_ORG2: install-script-api-key-org-2 # agent-devx-infra
MACOS_GITHUB_APP_1: macos-github-app-one # agent-devx-infra
MACOS_GITHUB_APP_2: macos-github-app-two # agent-devx-infra
# End vault variables

ATLASSIAN_WRITE: atlassian-write
AGENT_GITHUB_APP: agent-github-app
MACOS_GITHUB_APP_1: macos-github-app-one
MACOS_GITHUB_APP_2: macos-github-app-two
DOCKER_REGISTRY_RO: dockerhub-readonly

DD_PKG_VERSION: "latest"

# Job stage attempts (see https://docs.gitlab.com/ee/ci/runners/configure_runners.html#job-stages-attempts)
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/e2e_install_packages/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- START_MAJOR_VERSION: [5, 6, 7]
END_MAJOR_VERSION: [7]
script:
- DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $INSTALL_SCRIPT_API_KEY ) || exit $?; export DATADOG_AGENT_API_KEY
- DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $INSTALL_SCRIPT_API_KEY_ORG2 token ) || exit $?; export DATADOG_AGENT_API_KEY
- inv -e new-e2e-tests.run --targets $TARGETS --junit-tar "junit-${CI_JOB_ID}.tgz" ${EXTRA_PARAMS} --src-agent-version $START_MAJOR_VERSION --dest-agent-version $END_MAJOR_VERSION --test-washer

.new-e2e_script_upgrade_persisting_integrations:
Expand All @@ -48,5 +48,5 @@
TEAM: agent-delivery
EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --arch $E2E_ARCH
script:
- DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $INSTALL_SCRIPT_API_KEY) || exit $?; export DATADOG_AGENT_API_KEY
- DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $INSTALL_SCRIPT_API_KEY_ORG2 token) || exit $?; export DATADOG_AGENT_API_KEY
- inv -e new-e2e-tests.run --targets $TARGETS --junit-tar "junit-${CI_JOB_ID}.tgz" ${EXTRA_PARAMS} --test-washer
2 changes: 1 addition & 1 deletion .gitlab/functional_test/regression_detector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ single-machine-performance-regression_detector:
# invoke task has additional logic that does not seem to apply well to SMP's
# JUnit XML. Agent CI seems to use `datadog-agent` as the service name when
# uploading JUnit XML, so the upload command below respects that convention.
- DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$API_KEY_ORG2")" || exit $?; export DATADOG_API_KEY
- DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2" token)" || exit $?; export DATADOG_API_KEY
- datadog-ci junit upload --service datadog-agent outputs/junit.xml
# Finally, exit 1 if the job signals a regression else 0.
- RUST_LOG="${RUST_LOG}" ./smp --team-id ${SMP_AGENT_TEAM_ID} --api-base ${SMP_API} --aws-named-profile ${AWS_NAMED_PROFILE}
Expand Down
12 changes: 6 additions & 6 deletions .gitlab/kernel_matrix_testing/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
- echo "COLLECT_COMPLEXITY=${COLLECT_COMPLEXITY}"

.collect_outcomes_kmt:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- export MICRO_VM_IP=$(jq --exit-status --arg TAG $TAG --arg ARCH $ARCH --arg TEST_SET $TEST_SET -r '.[$ARCH].microvms | map(select(."vmset-tags"| index($TEST_SET))) | map(select(.tag==$TAG)) | .[].ip' $CI_PROJECT_DIR/stack.output)
# Collect setup-ddvm systemd service logs
- mkdir -p $CI_PROJECT_DIR/logs
Expand Down Expand Up @@ -114,7 +114,7 @@
scp $DD_AGENT_TESTING_DIR/kmt-dockers-$ARCH.tar.gz metal_instance:/opt/kernel-version-testing
fi
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.tag_kmt_ci_job]
variables:
AWS_EC2_SSH_KEY_FILE: $CI_PROJECT_DIR/ssh_key
Expand Down Expand Up @@ -144,7 +144,7 @@
VMCONFIG_FILE: "${CI_PROJECT_DIR}/vmconfig-${CI_PIPELINE_ID}-${ARCH}.json"
EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
before_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.retrieve_linux_go_deps]
- !reference [.kmt_new_profile]
- !reference [.write_ssh_key_file]
Expand All @@ -159,7 +159,7 @@
- jq "." $CI_PROJECT_DIR/stack.output
- pulumi logout
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- export AWS_PROFILE=agent-qa-ci
- !reference [.shared_filters_and_queries]
- mkdir -p $CI_PROJECT_DIR/libvirt/log/$ARCH $CI_PROJECT_DIR/libvirt/xml $CI_PROJECT_DIR/libvirt/qemu $CI_PROJECT_DIR/libvirt/dnsmasq
Expand Down Expand Up @@ -217,7 +217,7 @@
aws ec2 terminate-instances --instance-ids "${INSTANCE_ID}"
fi
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.tag_kmt_ci_job]

# Manual cleanup jobs, these will be used to cleanup the instances after the tests
Expand Down Expand Up @@ -247,7 +247,7 @@
RETRY: 2
EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json
before_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.kmt_new_profile]
- !reference [.write_ssh_key_file]
- echo "CI_JOB_URL=${CI_JOB_URL}" >> $DD_AGENT_TESTING_DIR/job_env.txt
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/kernel_matrix_testing/security_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ kmt_setup_env_secagent_x64:
# upload connector to metal instance
- scp $CI_PROJECT_DIR/connector-${ARCH} metal_instance:/home/ubuntu/connector
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.tag_kmt_ci_job]
variables:
AWS_EC2_SSH_KEY_FILE: $CI_PROJECT_DIR/ssh_key
Expand Down
6 changes: 3 additions & 3 deletions .gitlab/kernel_matrix_testing/system_probe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ upload_dependencies_sysprobe_arm64:
- mkdir $KMT_DOCKERS
- inv -e system-probe.save-test-dockers --use-crane --output-dir $KMT_DOCKERS --arch $ARCH
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.tag_kmt_ci_job]
artifacts:
expire_in: 1 day
Expand Down Expand Up @@ -82,7 +82,7 @@ pull_test_dockers_arm64:
- !reference [.setup_ssh_config]
- scp $CI_PROJECT_DIR/kmt-deps/ci/$ARCH/$ARCHIVE_NAME metal_instance:/opt/kernel-version-testing/
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.tag_kmt_ci_job]
variables:
DEPENDENCIES: $CI_PROJECT_DIR/kmt-deps/ci/$ARCH/btfs
Expand Down Expand Up @@ -161,7 +161,7 @@ kmt_setup_env_sysprobe_x64:
# upload connector to metal instance
- scp $CI_PROJECT_DIR/connector-${ARCH} metal_instance:/home/ubuntu/connector
after_script:
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- !reference [.tag_kmt_ci_job]
variables:
AWS_EC2_SSH_KEY_FILE: $CI_PROJECT_DIR/ssh_key
Expand Down
10 changes: 5 additions & 5 deletions .gitlab/notify/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ notify:
timeout: 15 minutes # Added to prevent a stuck job blocking the resource_group defined above
script:
- GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_READ_API_TOKEN) || exit $?; export GITLAB_TOKEN
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- python3 -m pip install -r requirements.txt -r tasks/libs/requirements-notifications.txt
- |
# Do not send notifications if this is a child pipeline of another repo
Expand Down Expand Up @@ -54,7 +54,7 @@ send_pipeline_stats:
dependencies: []
script:
- GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_READ_API_TOKEN) || exit $?; export GITLAB_TOKEN
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- invoke -e notify.send-stats

notify_github:
Expand Down Expand Up @@ -116,7 +116,7 @@ notify_gitlab_ci_changes:
.failure_summary_setup:
- SLACK_API_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $SLACK_AGENT_CI_TOKEN) || exit $?; export SLACK_API_TOKEN
- GITLAB_TOKEN=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $GITLAB_READ_API_TOKEN) || exit $?; export GITLAB_TOKEN
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- python3 -m pip install -r requirements.txt -r tasks/libs/requirements-notifications.txt

# Upload failure summary data to S3 at the end of each main pipeline
Expand Down Expand Up @@ -172,8 +172,8 @@ close_failing_tests_stale_issues:
echo "This script is run weekly on Fridays"
exit
fi
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_APP_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $APP_KEY_ORG2) || exit $?; export DD_APP_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- DD_APP_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_APP_KEY_ORG2 token) || exit $?; export DD_APP_KEY
- ATLASSIAN_PASSWORD=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $ATLASSIAN_WRITE token) || exit $?; export ATLASSIAN_PASSWORD
- ATLASSIAN_USERNAME=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $ATLASSIAN_WRITE user) || exit $?; export ATLASSIAN_USERNAME
- python3 -m pip install -r requirements.txt -r tasks/requirements_release_tasks.txt # For Atlassian / Jira dependencies
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pkg_metrics/pkg_metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ send_pkg_size:
optional: true
script:
# Get API key to send metrics
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY

# Allow failures: some packages are not always built, and therefore stats cannot be sent for them
- set +e
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/setup/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ github_rate_limit_info:
- GITHUB_KEY_B64=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_1 key_b64) || exit $?; export GITHUB_KEY_B64
- GITHUB_APP_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_1 app_id) || exit $?; export GITHUB_APP_ID
- GITHUB_INSTALLATION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_1 installation_id) || exit $?; export GITHUB_INSTALLATION_ID
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- inv github.send-rate-limit-info-datadog --pipeline-id $CI_PIPELINE_ID --app-instance 1
# Send stats for app 2
- GITHUB_KEY_B64=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_2 key_b64) || exit $?; export GITHUB_KEY_B64
- GITHUB_APP_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_2 app_id) || exit $?; export GITHUB_APP_ID
- GITHUB_INSTALLATION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_2 installation_id) || exit $?; export GITHUB_INSTALLATION_ID
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- inv github.send-rate-limit-info-datadog --pipeline-id $CI_PIPELINE_ID --app-instance 2
allow_failure: true
4 changes: 2 additions & 2 deletions .gitlab/source_test/golang_deps_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ golang_deps_diff:
- !reference [.retrieve_linux_go_deps]
script:
# Get API key to send metrics
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- inv -e diff.go-deps --report-file=deps-report.md --report-metrics --git-ref "${CI_COMMIT_REF_NAME}"
artifacts:
paths:
Expand Down Expand Up @@ -64,7 +64,7 @@ golang_deps_send_count_metrics:
- !reference [.retrieve_linux_go_deps]
script:
# Get API key to send metrics
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $API_KEY_ORG2) || exit $?; export DD_API_KEY
- DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_API_KEY_ORG2 token) || exit $?; export DD_API_KEY
- inv -e go-deps.send-count-metrics --git-sha "${CI_COMMIT_SHA}" --git-ref "${CI_COMMIT_REF_NAME}"

golang_deps_test:
Expand Down
32 changes: 19 additions & 13 deletions tasks/libs/common/omnibus.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def env_filter(item):
"HOSTNAME",
"HOST_IP",
"INFOPATH",
"INSTALL_SCRIPT_API_KEY",
"INSTALL_SCRIPT_API_KEY_ORG2",
"INTEGRATION_WHEELS_CACHE_BUCKET",
"IRBRC",
"KITCHEN_INFRASTRUCTURE_FLAKES_RETRY",
Expand Down Expand Up @@ -233,9 +233,7 @@ def should_retry_bundle_install(res):
def send_build_metrics(ctx, overall_duration):
# We only want to generate those metrics from the CI
src_dir = os.environ.get('CI_PROJECT_DIR')
aws_cmd = "aws"
if sys.platform == 'win32':
aws_cmd = "aws.cmd"
if src_dir is None:
src_dir = os.environ.get("REPO_ROOT", os.getcwd())

Expand Down Expand Up @@ -316,10 +314,16 @@ def send_build_metrics(ctx, overall_duration):
'type': 0,
}
)
dd_api_key = ctx.run(
f'{aws_cmd} ssm get-parameter --region us-east-1 --name {os.environ["API_KEY_ORG2"]} --with-decryption --query "Parameter.Value" --out text',
hide=True,
).stdout.strip()
if sys.platform == 'win32':
dd_api_key = ctx.run(
f'aws.cmd ssm get-parameter --region us-east-1 --name {os.environ["API_KEY_ORG2"]} --with-decryption --query "Parameter.Value" --out text',
hide=True,
).stdout.strip()
else:
dd_api_key = ctx.run(
f'vault kv get -field=token kv/k8s/gitlab-runner/datadog-agent/{os.environ["AGENT_API_KEY_ORG2"]}',
hide=True,
).stdout.strip()
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', 'DD-API-KEY': dd_api_key}
r = requests.post("https://api.datadoghq.com/api/v2/series", json={'series': series}, headers=headers)
if r.ok:
Expand All @@ -331,13 +335,15 @@ def send_build_metrics(ctx, overall_duration):

def send_cache_miss_event(ctx, pipeline_id, job_name, job_id):
if sys.platform == 'win32':
aws_cmd = "aws.cmd"
dd_api_key = ctx.run(
f'aws.cmd ssm get-parameter --region us-east-1 --name {os.environ["API_KEY_ORG2"]} --with-decryption --query "Parameter.Value" --out text',
hide=True,
).stdout.strip()
else:
aws_cmd = "aws"
dd_api_key = ctx.run(
f'{aws_cmd} ssm get-parameter --region us-east-1 --name {os.environ["API_KEY_ORG2"]} --with-decryption --query "Parameter.Value" --out text',
hide=True,
).stdout.strip()
dd_api_key = ctx.run(
f'vault kv get -field=token kv/k8s/gitlab-runner/datadog-agent/{os.environ["AGENT_API_KEY_ORG2"]}',
hide=True,
).stdout.strip()
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', 'DD-API-KEY': dd_api_key}
payload = {
'title': 'omnibus cache miss',
Expand Down
2 changes: 1 addition & 1 deletion tasks/unit_tests/linter_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_with_wrapper_no_env(self):
def test_with_wrapper_with_env(self):
with open(self.test_file, "w") as f:
f.write(
"DD_APP_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $APP_KEY_ORG2) || exit $?; export DD_APP_KEY"
"DD_APP_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_APP_KEY_ORG2 token) || exit $?; export DD_APP_KEY"
)
matched = linter.list_get_parameter_calls(self.test_file)
self.assertListEqual([], matched)
Expand Down
2 changes: 2 additions & 0 deletions tasks/unit_tests/omnibus_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def _run_calls_to_string(mock_calls):
'RELEASE_VERSION_7': 'nightly',
'S3_OMNIBUS_CACHE_BUCKET': 'omnibus-cache',
'API_KEY_ORG2': 'api-key',
'AGENT_API_KEY_ORG2': 'agent-api-key',
},
clear=True,
)
Expand All @@ -60,6 +61,7 @@ def _set_up_default_command_mocks(self):
(r'go mod .*', Result()),
(r'grep .*', Result()),
(r'aws ssm .*', Result()),
(r'vault kv get .*', Result()),
]
for pattern, result in patterns:
self.mock_ctx.set_result_for('run', re.compile(pattern), result)
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/junit_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [[ -n "$1" ]]; then
junit_files="$1"
fi

DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$API_KEY_ORG2")"
DATADOG_API_KEY="$("$CI_PROJECT_DIR"/tools/ci/fetch_secret.sh "$AGENT_API_KEY_ORG2" token)"
export DATADOG_API_KEY
error=0
for file in $junit_files; do
Expand Down

0 comments on commit 19c2807

Please sign in to comment.