Skip to content

Commit

Permalink
Support nested path in confd configmap (#335)
Browse files Browse the repository at this point in the history
* Support nested path in `confd` configmap
* Fix conflict between `ksm-core conf` and `confd`
  • Loading branch information
clamoriniere committed Jul 22, 2021
1 parent 17299c9 commit 8f519e8
Show file tree
Hide file tree
Showing 17 changed files with 1,536 additions and 295 deletions.
2 changes: 2 additions & 0 deletions api/v1alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,8 @@ type SyscallMonitorSpec struct {
type ConfigDirSpec struct {
// ConfigMapName name of a ConfigMap used to mount a directory.
ConfigMapName string `json:"configMapName,omitempty"`
// items mapping between configMap data key and file path mount.
Items []corev1.KeyToPath `json:"items,omitempty"`
}

// ConfigFileConfigMapSpec contains configMap information used to store a config file.
Expand Down
7 changes: 6 additions & 1 deletion api/v1alpha1/test/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type NewDatadogAgentOptions struct {
Status *datadoghqv1alpha1.DatadogAgentStatus
UseEDS bool
ClusterAgentEnabled bool
ClusterAgentConfd *datadoghqv1alpha1.ClusterAgentConfig
MetricsServerEnabled bool
MetricsServerPort int32
MetricsServerEndpoint string
Expand Down Expand Up @@ -182,9 +183,13 @@ func NewDefaultedDatadogAgent(ns, name string, options *NewDatadogAgentOptions)
ad.Spec.Agent.Security.VolumeMounts = options.VolumeMounts
}
if options.ClusterAgentEnabled {
config := &datadoghqv1alpha1.ClusterAgentConfig{}
if options.ClusterAgentConfd != nil {
config = options.ClusterAgentConfd
}
ad.Spec.ClusterAgent = datadoghqv1alpha1.DatadogAgentSpecClusterAgentSpec{
Enabled: datadoghqv1alpha1.NewBoolPointer(true),
Config: &datadoghqv1alpha1.ClusterAgentConfig{},
Config: config,
Rbac: &datadoghqv1alpha1.RbacConfig{
Create: datadoghqv1alpha1.NewBoolPointer(true),
},
Expand Down
17 changes: 12 additions & 5 deletions api/v1alpha1/zz_generated.deepcopy.go

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

16 changes: 16 additions & 0 deletions api/v1alpha1/zz_generated.openapi.go

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

336 changes: 336 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml

Large diffs are not rendered by default.

334 changes: 334 additions & 0 deletions config/crd/bases/v1beta1/datadoghq.com_datadogagents.yaml

Large diffs are not rendered by default.

0 comments on commit 8f519e8

Please sign in to comment.