Skip to content

[CECO-884] Add sidecar injection basic config in operator #1190

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 155 additions & 135 deletions apis/datadoghq/common/envvar.go

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions apis/datadoghq/v2alpha1/datadogagent_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ const (
defaultAdmissionControllerEnabled bool = true
defaultAdmissionControllerMutateUnlabelled bool = false
defaultAdmissionServiceName string = "datadog-admission-controller"
// DefaultAdmissionControllerCWSInstrumentationEnabled default CWS Instrumentation enabled value
DefaultAdmissionControllerCWSInstrumentationEnabled bool = false
// DefaultAdmissionControllerCWSInstrumentationMode default CWS Instrumentation mode
DefaultAdmissionControllerCWSInstrumentationMode string = "remote_copy"

defaultAdmissionASMThreatsEnabled bool = false
defaultAdmissionASMSCAEnabled bool = false
defaultAdmissionASMIASTEnabled bool = false

defaultOrchestratorExplorerEnabled bool = true
defaultOrchestratorExplorerScrubContainers bool = true
Expand Down Expand Up @@ -261,6 +269,26 @@ func defaultFeaturesConfig(ddaSpec *DatadogAgentSpec) {
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.APM.SingleStepInstrumentation.Enabled, defaultAPMSingleStepInstrEnabled)
}

// ASM Features
if ddaSpec.Features.ASM == nil {
ddaSpec.Features.ASM = &ASMFeatureConfig{}
}

if ddaSpec.Features.ASM.Threats == nil {
ddaSpec.Features.ASM.Threats = &ASMThreatsConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ASM.Threats.Enabled, defaultAdmissionASMThreatsEnabled)

if ddaSpec.Features.ASM.SCA == nil {
ddaSpec.Features.ASM.SCA = &ASMSCAConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ASM.SCA.Enabled, defaultAdmissionASMSCAEnabled)

if ddaSpec.Features.ASM.IAST == nil {
ddaSpec.Features.ASM.IAST = &ASMIASTConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.ASM.IAST.Enabled, defaultAdmissionASMIASTEnabled)

// CSPM (Cloud Security Posture Management) Feature
if ddaSpec.Features.CSPM == nil {
ddaSpec.Features.CSPM = &CSPMFeatureConfig{}
Expand Down Expand Up @@ -387,6 +415,16 @@ func defaultFeaturesConfig(ddaSpec *DatadogAgentSpec) {
apiutils.DefaultStringIfUnset(&ddaSpec.Features.AdmissionController.ServiceName, defaultAdmissionServiceName)
}

// CWS Instrumentation in AdmissionController Feature
if ddaSpec.Features.AdmissionController.CWSInstrumentation == nil {
ddaSpec.Features.AdmissionController.CWSInstrumentation = &CWSInstrumentationConfig{}
}
apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.AdmissionController.CWSInstrumentation.Enabled, DefaultAdmissionControllerCWSInstrumentationEnabled)

if *ddaSpec.Features.AdmissionController.CWSInstrumentation.Enabled {
apiutils.DefaultStringIfUnset(&ddaSpec.Features.AdmissionController.CWSInstrumentation.Mode, DefaultAdmissionControllerCWSInstrumentationMode)
}

// ExternalMetricsServer Feature
if ddaSpec.Features.ExternalMetricsServer == nil {
ddaSpec.Features.ExternalMetricsServer = &ExternalMetricsServerFeatureConfig{}
Expand Down
Loading
Loading