Skip to content

Commit

Permalink
Merge branch 'main' into CONTP-379/wassim.dhif/admission_webhook_sett…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
levan-m authored Oct 22, 2024
2 parents b97385e + 86c5b1d commit 951e1f2
Show file tree
Hide file tree
Showing 19 changed files with 620 additions and 277 deletions.
6 changes: 6 additions & 0 deletions api/datadoghq/v2alpha1/test/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type DatadogAgentBuilder struct {
// NewDatadogAgentBuilder creates DatadogAgent and initializes Global, Features, Override properties
func NewDatadogAgentBuilder() *DatadogAgentBuilder {
dda := &v2alpha1.DatadogAgent{
ObjectMeta: metav1.ObjectMeta{},
Spec: v2alpha1.DatadogAgentSpec{
Global: &v2alpha1.GlobalConfig{},
Features: &v2alpha1.DatadogFeatures{},
Expand Down Expand Up @@ -71,6 +72,11 @@ func (builder *DatadogAgentBuilder) WithName(name string) *DatadogAgentBuilder {
return builder
}

func (builder *DatadogAgentBuilder) WithAnnotations(annotations map[string]string) *DatadogAgentBuilder {
builder.datadogAgent.ObjectMeta.Annotations = annotations
return builder
}

// Global environment variable
func (builder *DatadogAgentBuilder) WithEnvVars(envs []corev1.EnvVar) *DatadogAgentBuilder {
builder.datadogAgent.Spec.Global.Env = envs
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/DataDog/datadog-operator

go 1.22
go 1.22.0

toolchain go1.22.7

Expand Down Expand Up @@ -41,7 +41,7 @@ require (
require (
github.com/DataDog/datadog-agent/pkg/config/model v0.55.0-rc.10
github.com/DataDog/datadog-agent/pkg/config/remote v0.55.0-rc.10
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.55.0-rc.10
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.1
github.com/prometheus/client_golang v1.16.0
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ github.com/DataDog/datadog-agent/pkg/proto v0.55.0-rc.10 h1:ERkVmUoDPttyVKSCJM1f
github.com/DataDog/datadog-agent/pkg/proto v0.55.0-rc.10/go.mod h1:gHkSUTn6H6UEZQHY3XWBIGNjfI3Tdi0IxlrxIFBWDwU=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.55.0-rc.10 h1:nwJ2JWfjCmf6tpJD1RYHh4JV5HO2Njg6smxOGi8MyOE=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.55.0-rc.10/go.mod h1:3yFk56PJ57yS1GqI9HAsS4PSlAeGCC9RQA7jxKzYj6g=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.1 h1:CIXKFvUsp5zgE+egvx+QrRTw8r54FMPZVu+z25UNqWs=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.1/go.mod h1:c4th0IFaP0Q1ofRa0GcPB9hJWN+cmUoEfOI1Ub0O50A=
github.com/DataDog/datadog-agent/pkg/util/backoff v0.55.0-rc.10 h1:+CizlqZ6JyXqH8KAy8NVTZaeZXu+Rfa/o+FPNxNSTFU=
github.com/DataDog/datadog-agent/pkg/util/backoff v0.55.0-rc.10/go.mod h1:HcSwqoxWLfevi1vuDZuFeRHfSuHGakTN6/u42WbxQHE=
github.com/DataDog/datadog-agent/pkg/util/cache v0.55.0-rc.10 h1:5S75F/6jCSUCqWhDQzPwPmuuOh3wkUPvkiPKnuKMyag=
Expand Down
12 changes: 12 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ github.com/DataDog/datadog-agent/pkg/config/remote v0.52.0/go.mod h1:3VjunAU6Chi
github.com/DataDog/datadog-agent/pkg/proto v0.55.0-rc.3/go.mod h1:gHkSUTn6H6UEZQHY3XWBIGNjfI3Tdi0IxlrxIFBWDwU=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.43.1/go.mod h1:VVMDDibJxYEkwcLdZBT2g8EHKpbMT4JdOhRbQ9GdjbM=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.52.0/go.mod h1:JhAilx32dkIgoDkFXquCTfaWDsAOfe+vfBaxbiZoPI0=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.1 h1:CIXKFvUsp5zgE+egvx+QrRTw8r54FMPZVu+z25UNqWs=
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.1/go.mod h1:c4th0IFaP0Q1ofRa0GcPB9hJWN+cmUoEfOI1Ub0O50A=
github.com/DataDog/datadog-agent/pkg/util/backoff v0.55.0-rc.3/go.mod h1:HcSwqoxWLfevi1vuDZuFeRHfSuHGakTN6/u42WbxQHE=
github.com/DataDog/datadog-agent/pkg/util/cache v0.55.0-rc.3/go.mod h1:CyE7vd6fco00C7v3R7Vt0kRg3Pz5Ssb29gV5YiEqsaU=
github.com/DataDog/datadog-agent/pkg/util/grpc v0.55.0-rc.3/go.mod h1:Mp2DgImefU2Xz3Wr3fQjBd8hhEem4zNzf+ofm6mHaco=
Expand Down Expand Up @@ -2673,6 +2675,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -2766,6 +2770,8 @@ golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -2855,6 +2861,8 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2 h1:IRJeR9r1pYWsHKTRe/IInb7lYvbBVIqOgsX/u0mbOWY=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk=
Expand All @@ -2867,12 +2875,16 @@ golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import (
"k8s.io/apimachinery/pkg/util/errors"
)

const (
enableOtelAnnotation = "agent.datadoghq.com/otel-agent-enabled"
)

func init() {
err := feature.Register(feature.DefaultIDType, buildDefaultFeature)
if err != nil {
Expand Down Expand Up @@ -126,6 +130,10 @@ func (f *defaultFeature) Configure(dda *v2alpha1.DatadogAgent) feature.RequiredC
f.agent.serviceAccountAnnotations = v2alpha1.GetAgentServiceAccountAnnotations(dda)
f.clusterChecksRunner.serviceAccountAnnotations = v2alpha1.GetClusterChecksRunnerServiceAccountAnnotations(dda)

if dda.ObjectMeta.Annotations != nil {
f.otelAgentEnabled = f.otelAgentEnabled || dda.ObjectMeta.Annotations[enableOtelAnnotation] == "true"
}

if dda.Spec.Global != nil {
if dda.Spec.Global.DisableNonResourceRules != nil && *dda.Spec.Global.DisableNonResourceRules {
f.disableNonResourceRules = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (f *orchestratorExplorerFeature) ID() feature.IDType {
// Configure is used to configure the feature from a v2alpha1.DatadogAgent instance.
func (f *orchestratorExplorerFeature) Configure(dda *v2alpha1.DatadogAgent) (reqComp feature.RequiredComponents) {
f.owner = dda

// Merge configuration from Status.RemoteConfigConfiguration into the Spec
f.mergeConfigs(&dda.Spec, &dda.Status)

orchestratorExplorer := dda.Spec.Features.OrchestratorExplorer

if orchestratorExplorer != nil && apiutils.BoolValue(orchestratorExplorer.Enabled) {
Expand All @@ -92,9 +96,12 @@ func (f *orchestratorExplorerFeature) Configure(dda *v2alpha1.DatadogAgent) (req
Containers: reqContainers,
}

if orchestratorExplorer.Conf != nil {
if orchestratorExplorer.Conf != nil || len(orchestratorExplorer.CustomResources) > 0 {
f.customConfig = orchestratorExplorer.Conf
hash, err := comparison.GenerateMD5ForSpec(f.customConfig)

// Used to force restart of DCA
// use entire orchestratorExplorer to handle custom config and CRDs
hash, err := comparison.GenerateMD5ForSpec(orchestratorExplorer)
if err != nil {
f.logger.Error(err, "couldn't generate hash for orchestrator explorer custom config")
} else {
Expand All @@ -103,6 +110,7 @@ func (f *orchestratorExplorerFeature) Configure(dda *v2alpha1.DatadogAgent) (req
f.customConfigAnnotationValue = hash
f.customConfigAnnotationKey = object.GetChecksumAnnotationKey(feature.OrchestratorExplorerIDType)
}

f.customResources = dda.Spec.Features.OrchestratorExplorer.CustomResources
f.configConfigMapName = v2alpha1.GetConfName(dda, f.customConfig, v2alpha1.DefaultOrchestratorExplorerConf)
f.scrubContainers = apiutils.BoolValue(orchestratorExplorer.ScrubContainers)
Expand All @@ -125,6 +133,25 @@ func (f *orchestratorExplorerFeature) Configure(dda *v2alpha1.DatadogAgent) (req
return reqComp
}

func (f *orchestratorExplorerFeature) mergeConfigs(ddaSpec *v2alpha1.DatadogAgentSpec, ddaStatus *v2alpha1.DatadogAgentStatus) {
if ddaStatus.RemoteConfigConfiguration == nil ||
ddaStatus.RemoteConfigConfiguration.Features == nil ||
ddaStatus.RemoteConfigConfiguration.Features.OrchestratorExplorer == nil ||
ddaStatus.RemoteConfigConfiguration.Features.OrchestratorExplorer.CustomResources == nil {
return
}

if ddaSpec.Features == nil {
ddaSpec.Features = &v2alpha1.DatadogFeatures{}
}

if ddaSpec.Features.OrchestratorExplorer == nil {
ddaSpec.Features.OrchestratorExplorer = &v2alpha1.OrchestratorExplorerFeatureConfig{}
}

ddaSpec.Features.OrchestratorExplorer.CustomResources = append(ddaSpec.Features.OrchestratorExplorer.CustomResources, ddaStatus.RemoteConfigConfiguration.Features.OrchestratorExplorer.CustomResources...)
}

// ManageDependencies allows a feature to manage its dependencies.
// Feature's dependencies should be added in the store.
func (f *orchestratorExplorerFeature) ManageDependencies(managers feature.ResourceManagers, components feature.RequiredComponents) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,17 @@ func orchestratorExplorerClusterAgentWantFuncV2() *test.ComponentTest {
customConfig := v2alpha1.CustomConfig{
ConfigData: apiutils.NewStringPointer(customConfDataV2),
}
hash, err := comparison.GenerateMD5ForSpec(&customConfig)
trueValue := true
url := "https://foo.bar"
orchExp := v2alpha1.OrchestratorExplorerFeatureConfig{
Enabled: &trueValue,
Conf: &customConfig,
ScrubContainers: &trueValue,
CustomResources: []string{},
ExtraTags: []string{"a:z", "b:y", "c:x"},
DDUrl: &url,
}
hash, err := comparison.GenerateMD5ForSpec(&orchExp)
assert.NoError(t, err)
wantAnnotations := map[string]string{
fmt.Sprintf(apicommon.MD5ChecksumAnnotationKey, feature.OrchestratorExplorerIDType): hash,
Expand Down
60 changes: 59 additions & 1 deletion internal/controller/datadogagent/feature/test/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/DataDog/datadog-operator/internal/controller/datadogagent/feature"
_ "github.com/DataDog/datadog-operator/internal/controller/datadogagent/feature/apm"
_ "github.com/DataDog/datadog-operator/internal/controller/datadogagent/feature/cspm"
_ "github.com/DataDog/datadog-operator/internal/controller/datadogagent/feature/enabledefault"
_ "github.com/DataDog/datadog-operator/internal/controller/datadogagent/feature/livecontainer"
_ "github.com/DataDog/datadog-operator/internal/controller/datadogagent/feature/npm"
)
Expand All @@ -20,6 +21,7 @@ func TestBuilder(t *testing.T) {
tests := []struct {
name string
dda *v2alpha1.DatadogAgent
featureOptions feature.Options
wantCoreAgentComponent bool
wantAgentContainer map[common.AgentContainerName]bool
}{
Expand All @@ -36,6 +38,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
Expand All @@ -50,6 +53,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: false,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
Expand All @@ -64,6 +68,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
Expand All @@ -79,6 +84,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: false,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
Expand All @@ -94,6 +100,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: true,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
Expand All @@ -110,6 +117,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: true,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
Expand All @@ -126,6 +134,7 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: true,
common.SecurityAgentContainerName: true,
common.OtelAgent: false,
},
},
{
Expand All @@ -143,13 +152,62 @@ func TestBuilder(t *testing.T) {
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: true,
common.SecurityAgentContainerName: true,
common.OtelAgent: false,
},
},
{
name: "Default DDA, default feature Option, otel-agent-enabled annotation true",
dda: v2alpha1test.NewDatadogAgentBuilder().
WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "true"}).
BuildWithDefaults(),
wantAgentContainer: map[common.AgentContainerName]bool{
common.UnprivilegedSingleAgentContainerName: false,
common.CoreAgentContainerName: true,
common.ProcessAgentContainerName: true,
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: true,
},
},
{
name: "Default DDA, default feature Option, otel-agent-enabled annotation false",
dda: v2alpha1test.NewDatadogAgentBuilder().
WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "false"}).
BuildWithDefaults(),
wantAgentContainer: map[common.AgentContainerName]bool{
common.UnprivilegedSingleAgentContainerName: false,
common.CoreAgentContainerName: true,
common.ProcessAgentContainerName: true,
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: false,
},
},
{
name: "Default DDA, no otel annotation, Operator option enabled",
dda: v2alpha1test.NewDatadogAgentBuilder().
WithAnnotations(map[string]string{"agent.datadoghq.com/otel-agent-enabled": "false"}).
BuildWithDefaults(),
featureOptions: feature.Options{
OtelAgentEnabled: true,
},
wantAgentContainer: map[common.AgentContainerName]bool{
common.UnprivilegedSingleAgentContainerName: false,
common.CoreAgentContainerName: true,
common.ProcessAgentContainerName: true,
common.TraceAgentContainerName: true,
common.SystemProbeContainerName: false,
common.SecurityAgentContainerName: false,
common.OtelAgent: true,
},
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, requiredComponents := feature.BuildFeatures(tt.dda, &feature.Options{})
_, requiredComponents := feature.BuildFeatures(tt.dda, &tt.featureOptions)

assert.True(t, *requiredComponents.Agent.IsRequired)

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/datadogagent/testutils/client_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
policyv1 "k8s.io/api/policy/v1beta1"
policyv1 "k8s.io/api/policy/v1"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/datadogagent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
policyv1 "k8s.io/api/policy/v1"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -194,8 +195,7 @@ func (r *DatadogAgentReconciler) SetupWithManager(mgr ctrl.Manager) error {
Owns(&rbacv1.Role{}).
Owns(&rbacv1.RoleBinding{}).
Owns(&corev1.ServiceAccount{}).
// We let PlatformInfo supply PDB object based on the current API version
Owns(r.PlatformInfo.CreatePDBObject()).
Owns(&policyv1.PodDisruptionBudget{}).
Owns(&networkingv1.NetworkPolicy{})

if r.Options.DatadogAgentProfileEnabled {
Expand Down
4 changes: 2 additions & 2 deletions pkg/defaulting/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type ContainerRegistry string

const (
// AgentLatestVersion corresponds to the latest stable agent release
AgentLatestVersion = "7.57.2"
AgentLatestVersion = "7.58.0"
// ClusterAgentLatestVersion corresponds to the latest stable cluster-agent release
ClusterAgentLatestVersion = "7.57.2"
ClusterAgentLatestVersion = "7.58.0"
// FIPSProxyLatestVersion corresponds to the latest stable fips-proxy release
FIPSProxyLatestVersion = "1.0.1"
// GCRContainerRegistry corresponds to the datadoghq GCR registry
Expand Down
Loading

0 comments on commit 951e1f2

Please sign in to comment.