Skip to content

Commit

Permalink
Merge branch 'main' into celene/forwarder
Browse files Browse the repository at this point in the history
  • Loading branch information
celenechang authored Nov 21, 2024
2 parents 5a1b269 + 9671912 commit 9a990e5
Show file tree
Hide file tree
Showing 34 changed files with 21,940 additions and 114 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ generate: $(CONTROLLER_GEN) generate-openapi generate-docs ## Generate code

.PHONY: generate-docs
generate-docs: manifests
go run ./hack/generate-docs.go
go run ./hack/generate-docs/generate-docs.go

# Build the docker images, for local use
.PHONY: docker-build
Expand Down
3 changes: 3 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
defaultLiveProcessCollectionEnabled bool = false
defaultLiveContainerCollectionEnabled bool = true
defaultProcessDiscoveryEnabled bool = true
defaultRunProcessChecksInCoreAgent bool = false

defaultOOMKillEnabled bool = false
defaultTCPQueueLengthEnabled bool = false
Expand Down Expand Up @@ -182,6 +183,8 @@ func defaultGlobalConfig(ddaSpec *DatadogAgentSpec) {
apiutils.DefaultInt32IfUnset(&ddaSpec.Global.FIPS.PortRange, defaultFIPSPortRange)
apiutils.DefaultBooleanIfUnset(&ddaSpec.Global.FIPS.UseHTTPS, defaultFIPSUseHTTPS)
}

apiutils.DefaultBooleanIfUnset(&ddaSpec.Global.RunProcessChecksInCoreAgent, defaultRunProcessChecksInCoreAgent)
}

// defaultFeaturesConfig sets default values in DatadogAgentSpec.Features.
Expand Down
7 changes: 7 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,13 @@ type GlobalConfig struct {
// Configure the secret backend feature https://docs.datadoghq.com/agent/guide/secrets-management
// See also: https://github.com/DataDog/datadog-operator/blob/main/docs/secret_management.md
SecretBackend *SecretBackendConfig `json:"secretBackend,omitempty"`

// Configure whether the Process Agent or core Agent collects process and/or container information (Linux only).
// The Process Agent container won't spin up if there are no other running checks as a result.
// (Requires Agent 7.57.0+)
// Default: 'false'
// +optional
RunProcessChecksInCoreAgent *bool `json:"runProcessChecksInCoreAgent,omitempty"`
}

// DatadogCredentials is a generic structure that holds credentials to access Datadog.
Expand Down
9 changes: 9 additions & 0 deletions api/datadoghq/v2alpha1/test/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ func (builder *DatadogAgentBuilder) WithLiveProcessScrubStrip(scrubEnabled, stri
return builder
}

func (builder *DatadogAgentBuilder) WithProcessChecksInCoreAgent(enabled bool) *DatadogAgentBuilder {
if builder.datadogAgent.Spec.Global == nil {
builder.datadogAgent.Spec.Global = &v2alpha1.GlobalConfig{}
}

builder.datadogAgent.Spec.Global.RunProcessChecksInCoreAgent = apiutils.NewBoolPointer(enabled)
return builder
}

// Admission Controller
func (builder *DatadogAgentBuilder) initAdmissionController() {
if builder.datadogAgent.Spec.Features.AdmissionController == nil {
Expand Down
5 changes: 5 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 11 additions & 14 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ type options struct {
introspectionEnabled bool
datadogAgentProfileEnabled bool
remoteConfigEnabled bool
processChecksInCoreAgentEnabled bool
otelAgentEnabled bool
datadogDashboardEnabled bool

Expand Down Expand Up @@ -158,7 +157,6 @@ func (opts *options) Parse() {
flag.BoolVar(&opts.introspectionEnabled, "introspectionEnabled", false, "Enable introspection (beta)")
flag.BoolVar(&opts.datadogAgentProfileEnabled, "datadogAgentProfileEnabled", false, "Enable DatadogAgentProfile controller (beta)")
flag.BoolVar(&opts.remoteConfigEnabled, "remoteConfigEnabled", false, "Enable RemoteConfig capabilities in the Operator (beta)")
flag.BoolVar(&opts.processChecksInCoreAgentEnabled, "processChecksInCoreAgentEnabled", false, "Enable running process checks in the core agent (beta)")
flag.BoolVar(&opts.otelAgentEnabled, "otelAgentEnabled", false, "Enable the OTel agent container (beta)")
flag.BoolVar(&opts.datadogDashboardEnabled, "datadogDashboardEnabled", false, "Enable the DatadogDashboard controller")

Expand Down Expand Up @@ -294,18 +292,17 @@ func run(opts *options) error {
CanaryAutoPauseMaxSlowStartDuration: opts.edsCanaryAutoPauseMaxSlowStartDuration,
MaxPodSchedulerFailure: opts.edsMaxPodSchedulerFailure,
},
SupportCilium: opts.supportCilium,
Creds: creds,
DatadogAgentEnabled: opts.datadogAgentEnabled,
DatadogMonitorEnabled: opts.datadogMonitorEnabled,
DatadogSLOEnabled: opts.datadogSLOEnabled,
OperatorMetricsEnabled: opts.operatorMetricsEnabled,
V2APIEnabled: true,
IntrospectionEnabled: opts.introspectionEnabled,
DatadogAgentProfileEnabled: opts.datadogAgentProfileEnabled,
ProcessChecksInCoreAgentEnabled: opts.processChecksInCoreAgentEnabled,
OtelAgentEnabled: opts.otelAgentEnabled,
DatadogDashboardEnabled: opts.datadogDashboardEnabled,
SupportCilium: opts.supportCilium,
Creds: creds,
DatadogAgentEnabled: opts.datadogAgentEnabled,
DatadogMonitorEnabled: opts.datadogMonitorEnabled,
DatadogSLOEnabled: opts.datadogSLOEnabled,
OperatorMetricsEnabled: opts.operatorMetricsEnabled,
V2APIEnabled: true,
IntrospectionEnabled: opts.introspectionEnabled,
DatadogAgentProfileEnabled: opts.datadogAgentProfileEnabled,
OtelAgentEnabled: opts.otelAgentEnabled,
DatadogDashboardEnabled: opts.datadogDashboardEnabled,
}

if err = controller.SetupControllers(setupLog, mgr, options); err != nil {
Expand Down
Loading

0 comments on commit 9a990e5

Please sign in to comment.