-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DD_AGENT_IPC_* env vars #1604
base: main
Are you sure you want to change the base?
Conversation
This PR adds DD_AGENT_IPC_PORT and DD_AGENT_IPC_CONFIG_REFRESH_INTERVAL env vars in otel agent and core agent. It does not override them if they are added by the user. THis is necessary for the otel-agent to pull the api key from core config in the case where backend secrets are used.
Value: "60", | ||
} | ||
// don't set env var if it was already set by user. | ||
mergeFunc := func(current, newEnv *corev1.EnvVar) (*corev1.EnvVar, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can be tested by the current test framework, as the env vars added via WithEnvVars
helper don't make it into container env vars.
e.g.
{
Name: "otel agent user provided ipc port",
DDA: testutils.NewDatadogAgentBuilder().
WithOTelCollectorEnabled(true).
WithEnvVars([]corev1.EnvVar{
{
Name: v2alpha1.DDAgentIpcPort,
Value: "3333",
},
}).
Build(),
WantConfigure: true,
WantDependenciesFunc: testExpectedDepsCreatedCM,
Agent: testExpectedAgent(apicommon.OtelAgent, defaultExpectedPorts, defaultLocalObjectReferenceName,
expectedEnvVars{
agent_ipc_port: expectedEnvVar{
present: true,
value: "3333",
},
agent_ipc_refresh: expectedEnvVar{
present: true,
value: "60",
},
},
),
},
will fail.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1604 +/- ##
==========================================
+ Coverage 48.94% 48.97% +0.02%
==========================================
Files 227 227
Lines 20636 20652 +16
==========================================
+ Hits 10101 10114 +13
- Misses 10010 10012 +2
- Partials 525 526 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
What does this PR do?
This PR adds DD_AGENT_IPC_PORT and DD_AGENT_IPC_CONFIG_REFRESH_INTERVAL env vars in otel agent and core agent. It does not override them if they are added by the user. This is necessary for the otel-agent to pull the api key from core config in the case where backend secrets are used.
Motivation
OTEL-2323
Additional Notes
I have an open question about test, see PR comment.
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
Run the otel-agent without API Key in otel collector config, and by providing api key in core agent via backend secret.
Setup 1:
operator config:
Validate config can be fetched by the otel agent by checking otel-agent logs contain:
Setup 2:
Same as above but user provided env vars, make sure these are not overriden.
Operator config:
Validate config can be fetched by the otel agent by checking otel-agent logs contain:
Checklist
bug
,enhancement
,refactoring
,documentation
,tooling
, and/ordependencies
qa/skip-qa
label