Skip to content
Open
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
2 changes: 2 additions & 0 deletions api/datadoghq/v1alpha1/datadogagentprofile_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ type CreateStrategy struct {
// +kubebuilder:printcolumn:name="valid",type="string",JSONPath=".status.valid"
// +kubebuilder:printcolumn:name="applied",type="string",JSONPath=".status.applied"
// +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:validation:XValidation:rule="(self.metadata.name.size() + 6) <= 63",message="DatadogAgentProfile name must be less than 57 characters."
// +kubebuilder:note:For the validation rule, 6 represents the length of the "-agent" string, and 63 represents the maximum length of a label value (<DatadogAgentProfile name>-agent) used for the DaemonSet.
// +k8s:openapi-gen=true
type DatadogAgentProfile struct {
metav1.TypeMeta `json:",inline"`
Expand Down
2 changes: 2 additions & 0 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,8 @@ type DatadogAgentStatus struct {
// +kubebuilder:printcolumn:name="cluster-agent",type="string",JSONPath=".status.clusterAgent.status"
// +kubebuilder:printcolumn:name="cluster-checks-runner",type="string",JSONPath=".status.clusterChecksRunner.status"
// +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:validation:XValidation:rule="self.metadata.name.size() + 29 <=63",message="DatadogAgent name must be less than 34 characters."
// +kubebuilder:note:For the validation rule, 29 represents the length of the "-cluster-agent-metrics-server" string, and 63 represents the maximum length of a service name (<DatadogAgent name>-cluster-agent-metrics-server).
// +k8s:openapi-gen=true
// +genclient
type DatadogAgent struct {
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagentprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7765,6 +7765,9 @@ spec:
type: string
type: object
type: object
x-kubernetes-validations:
- message: DatadogAgentProfile name must be less than 57 characters.
rule: (self.metadata.name.size() + 6) <= 63
served: true
storage: true
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7539,5 +7539,11 @@
"type": "object"
}
},
"type": "object"
"type": "object",
"x-kubernetes-validations": [
{
"message": "DatadogAgentProfile name must be less than 57 characters.",
"rule": "(self.metadata.name.size() + 6) \u003c= 63"
}
]
}
3 changes: 3 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10090,6 +10090,9 @@ spec:
type: object
type: object
type: object
x-kubernetes-validations:
- message: DatadogAgent name must be less than 34 characters.
rule: self.metadata.name.size() + 29 <=63
served: true
storage: true
subresources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10055,5 +10055,11 @@
"type": "object"
}
},
"type": "object"
"type": "object",
"x-kubernetes-validations": [
{
"message": "DatadogAgent name must be less than 34 characters.",
"rule": "self.metadata.name.size() + 29 \u003c=63"
}
]
}
50 changes: 25 additions & 25 deletions internal/controller/datadogagent_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,127 +51,127 @@ var _ = Describe("V2 Controller - DatadogAgent Deployment", func() {

Context(
"with admission controller enabled",
testFunction(testutils.NewDatadogAgentWithAdmissionController(namespace, "with-admission-controller")),
testFunction(testutils.NewDatadogAgentWithAdmissionController(namespace, "admission-controller")),
)

Context(
"with admission controller enabled, CWS Instrumentation enabled",
testFunction(testutils.NewDatadogAgentWithCWSInstrumentation(namespace, "with-cws-instrumentation")),
testFunction(testutils.NewDatadogAgentWithCWSInstrumentation(namespace, "cws-instrumentation")),
)

Context(
"with APM enabled",
testFunction(testutils.NewDatadogAgentWithAPM(namespace, "with-apm")),
testFunction(testutils.NewDatadogAgentWithAPM(namespace, "apm")),
)

Context(
"with cluster checks enabled",
testFunction(testutils.NewDatadogAgentWithClusterChecks(namespace, "with-cluster-checks")),
testFunction(testutils.NewDatadogAgentWithClusterChecks(namespace, "cluster-checks")),
)

Context(
"with CSPM enabled",
testFunction(testutils.NewDatadogAgentWithCSPM(namespace, "with-cspm")),
testFunction(testutils.NewDatadogAgentWithCSPM(namespace, "cspm")),
)

Context(
"with CWS enabled",
testFunction(testutils.NewDatadogAgentWithCWS(namespace, "with-cws")),
testFunction(testutils.NewDatadogAgentWithCWS(namespace, "cws")),
)

Context(
"with Dogstatsd enabled",
testFunction(testutils.NewDatadogAgentWithDogstatsd(namespace, "with-dogstatsd")),
testFunction(testutils.NewDatadogAgentWithDogstatsd(namespace, "dogstatsd")),
)

Context(
"with eBPF check enabled",
testFunction(testutils.NewDatadogAgentWithEBPFCheck(namespace, "with-ebpfcheck")),
testFunction(testutils.NewDatadogAgentWithEBPFCheck(namespace, "ebpfcheck")),
)

Context(
"with service discovery enabled",
testFunction(testutils.NewDatadogAgentWithServiceDiscovery(namespace, "with-service-discovery")),
testFunction(testutils.NewDatadogAgentWithServiceDiscovery(namespace, "service-discovery")),
)

Context(
"with Event Collection",
testFunction(testutils.NewDatadogAgentWithEventCollection(namespace, "with-event-collection")),
testFunction(testutils.NewDatadogAgentWithEventCollection(namespace, "event-collection")),
)

Context(
"with External Metrics Server",
testFunction(testutils.NewDatadogAgentWithExternalMetrics(namespace, "with-external-metrics")),
testFunction(testutils.NewDatadogAgentWithExternalMetrics(namespace, "external-metrics")),
)

Context(
"with KSM core",
testFunction(testutils.NewDatadogAgentWithKSM(namespace, "with-ksm")),
testFunction(testutils.NewDatadogAgentWithKSM(namespace, "ksm")),
)

Context(
"with live container collection",
testFunction(testutils.NewDatadogAgentWithLiveContainerCollection(namespace, "with-live-container-collection")),
testFunction(testutils.NewDatadogAgentWithLiveContainerCollection(namespace, "live-container-col")),
)

Context(
"with live process collection",
testFunction(testutils.NewDatadogAgentWithLiveProcessCollection(namespace, "with-live-process-collection")),
testFunction(testutils.NewDatadogAgentWithLiveProcessCollection(namespace, "live-process-col")),
)

Context(
"with log collection",
testFunction(testutils.NewDatadogAgentWithLogCollection(namespace, "with-log-collection")),
testFunction(testutils.NewDatadogAgentWithLogCollection(namespace, "log-collection")),
)

Context(
"with NPM",
testFunction(testutils.NewDatadogAgentWithNPM(namespace, "with-npm")),
testFunction(testutils.NewDatadogAgentWithNPM(namespace, "npm")),
)

Context(
"with OOM Kill",
testFunction(testutils.NewDatadogAgentWithOOMKill(namespace, "with-oom-kill")),
testFunction(testutils.NewDatadogAgentWithOOMKill(namespace, "oom-kill")),
)

Context(
"with orchestrator explorer",
testFunction(testutils.NewDatadogAgentWithOrchestratorExplorer(namespace, "with-orchestrator-explorer")),
testFunction(testutils.NewDatadogAgentWithOrchestratorExplorer(namespace, "orch-explorer")),
)

Context(
"with OTLP",
testFunction(testutils.NewDatadogAgentWithOTLP(namespace, "with-otlp")),
testFunction(testutils.NewDatadogAgentWithOTLP(namespace, "otlp")),
)

Context(
"with Prometheus scrape",
testFunction(testutils.NewDatadogAgentWithPrometheusScrape(namespace, "with-prometheus-scrape")),
testFunction(testutils.NewDatadogAgentWithPrometheusScrape(namespace, "prometheus-scrape")),
)

Context(
"with TCP queue length",
testFunction(testutils.NewDatadogAgentWithTCPQueueLength(namespace, "with-tcp-queue-length")),
testFunction(testutils.NewDatadogAgentWithTCPQueueLength(namespace, "tcp-queue-len")),
)

Context(
"with USM",
testFunction(testutils.NewDatadogAgentWithUSM(namespace, "with-usm")),
testFunction(testutils.NewDatadogAgentWithUSM(namespace, "usm")),
)

Context(
"with some global settings set",
testFunction(testutils.NewDatadogAgentWithGlobalConfigSettings(namespace, "with-global-settings")),
testFunction(testutils.NewDatadogAgentWithGlobalConfigSettings(namespace, "global-settings")),
)

Context(
"with overrides",
testFunction(testutils.NewDatadogAgentWithOverrides(namespace, "with-overrides")),
testFunction(testutils.NewDatadogAgentWithOverrides(namespace, "overrides")),
)

Context(
"with GPU monitoring",
testFunction(testutils.NewDatadogAgentWithGPUMonitoring(namespace, "with-gpu-monitoring")),
testFunction(testutils.NewDatadogAgentWithGPUMonitoring(namespace, "gpu-monitoring")),
)
})

Expand Down
Loading