Don't require an App key to start Remote Config #3735
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #3735"
general
weight: 0.35
Mathew-Estafanous
What does this PR do?
Lets the Operator start Remote Configuration with only an API key. Today it fails without
DD_APP_KEY.pkg/remoteconfig/updater.go: newRemoteConfigUpdater.SetupWithCredentials(). It loads credentials withGetCredentialsForMetadata(), which requires the API key and treats the App key as optional, then callsSetup().cmd/main.go: RC is set up withrcUpdater.SetupWithCredentials(credsManager). Before, startup loaded credentials withGetCredentials(), which returns nothing unless both keys are set, and passed the result torcUpdater.Setup(). That startup call is removed, because RC was its only consumer.pkg/config/creds.go:GetCredentials()no longer serves cached API-key-only credentials. Both getters share one cache, andGetCredentialsForMetadata()can fill it without an App key. PreviouslyGetCredentials()would then return an empty App key instead of an error. The metadata forwarder can already trigger this today, and RC would trigger it at every startup.docs/remote_config.md: an App key is no longer listed as required for RC.Motivation
Remote Config authenticates with the API key alone:
RemoteConfigUpdater.Setuponly readscreds.APIKeyand passes it toservice.WithAPIKey(pkg/remoteconfig/updater.go:212-253).pkg/remoteconfigorpkg/fleetreads the App key.The requirement came from reusing
GetCredentials(), which was written for the API-backed controllers (DatadogMonitor,DatadogDashboard,DatadogSLO,DatadogGenericResource). Those still require the App key; this PR doesn't change them.This follows #2550, which made
DD_APP_KEYoptional for metadata for the same reason. It's also groundwork for using Remote Config from Fleet Automation, for example triggering Operator flares remotely, without asking customers for an App key.Additional Notes
DD_API_KEYfrom the Operator's environment. UsingGetCredsWithDDAFallback()so RC also works when the key only lives in theDatadogAgentCR is a possible follow-up. It isn't included here.Refresh()→fetchCredentials()) still requires both keys and keeps the cached credentials when it fails. That's unchanged, and RC doesn't re-read credentials after setup anyway.charts/datadog-operator/values.yaml:111and the README in DataDog/helm-charts). It needs a follow-up there once this ships.Minimum Agent Versions
None. This change is only in the Operator.
Agent: n/a
Cluster Agent: n/a
Describe your test plan
Unit tests.
go test ./pkg/config/ ./pkg/remoteconfig/passes.Test_getCredentialscases cover cached API-key-only credentials. Both fail without thecreds.gochange.TestSetupWithCredentialscovers four cases: API key only, API key and App key, a credentials error, and an empty API key.SetupWithCredentialsandGetCredentialsare both at 100% coverage.golangci-lintv2.15.0 reports 0 issues on./cmd/...,./pkg/config/...and./pkg/remoteconfig/....Manual tests. I ran these on a local kind cluster with RC enabled (
-remoteConfigEnabled=true), with onlyDD_API_KEYset andDD_APP_KEYunset, againstconfig.datadoghq.com:| Build | Result |
|---|---|
| Released v1.31.2 (chart 2.31.0) | ❌
Unable to get credentials: empty API key and/or App key, thenUnable to set up Remote Config service: error obtaining API key||
main(0332fa28) | ❌ Same two errors, and no RC database is created || This branch | ✅
Remote Configuration service started/client started. TheAGENT_CONFIGcallback fires about 1s later. The RC database contains the fetched director targets, the full root chain and the backend state. |I also called the RC backend directly with the same
api.HTTPClientand only an API key:So the backend checks the API key's RC scope, not the App key.
The local runs of
mainand this branch used the binary outside the cluster, with leader election disabled. The released build ran from the chart inside the cluster.Not tested: Fleet rollouts (
UPDATER_TASK), encryptedENC[...]keys through the secret backend, and sites other than US1.To reproduce: install with
remoteConfiguration.enabled=trueandapiKeyExistingSecretset, and withoutappKeyorappKeyExistingSecret. Then check the Operator logs forRemote Configuration client startedand the absence ofUnable to set up Remote Config service.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
🤖 Generated with Claude Code