Skip to content

Commit

Permalink
Merge branch 'v0.7' of github.com:DataDog/datadog-operator
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed Sep 13, 2021
2 parents 2031a6e + e06da64 commit 1848dd9
Show file tree
Hide file tree
Showing 18 changed files with 24,809 additions and 9,579 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/release.yaml
@@ -1,12 +1,22 @@
name: release
on:
push:
branches:
- "v[0-9]+.[0-9]+"
tags:
- "v*"
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
jobs:
check-ref:
runs-on: ubuntu-latest
steps:
- name: View context attributes
uses: actions/github-script@v4
with:
script: console.log(context)
build:
runs-on: ubuntu-latest
if: ${{ github.event.base_ref == 'refs/heads/main' || github.event.base_ref == 'v[0-9]+.[0-9]+' }}
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -51,5 +61,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new plugin version in krew-index
uses: rajatjindal/krew-release-bot@v0.0.40
continue-on-error: true
with:
krew_template_file: dist/datadog-plugin.yaml
25 changes: 19 additions & 6 deletions api/v1alpha1/datadogagent_default.go
Expand Up @@ -142,18 +142,25 @@ func DefaultDatadogAgent(dda *DatadogAgent) *DatadogAgentStatus {
}

// FeatureOverride defaults the feature section of the DatadogAgent
// TODO surface in the status when Overrides are not possible. Security agent requires the system probe
// TODO surface in the status when Overrides are not possible. Security agent requires the System Probe
func FeatureOverride(dda *DatadogAgentSpec, dso *DatadogAgentSpec) {
if dda.Features.NetworkMonitoring != nil && BoolValue(dda.Features.NetworkMonitoring.Enabled) {
// If the Network monitoring Feature is enable, enable the System Probe.
if !BoolValue(dda.Agent.Enabled) || dda.Agent.SystemProbe != nil {
// If the Network Monitoring Feature is enabled, enable the System Probe.
if !BoolValue(dda.Agent.Enabled) {
if dda.Agent.SystemProbe == nil {
dda.Agent.SystemProbe = DefaultDatadogAgentSpecAgentSystemProbe(&dda.Agent)
}
dda.Agent.SystemProbe.Enabled = NewBoolPointer(true)
dso.Agent.SystemProbe = DefaultDatadogAgentSpecAgentSystemProbe(&dda.Agent)
dso.Agent.SystemProbe.Enabled = NewBoolPointer(true)
}
}
if dda.Features.OrchestratorExplorer != nil && BoolValue(dda.Features.OrchestratorExplorer.Enabled) {
if !BoolValue(dda.Agent.Enabled) || dda.Agent.Process != nil {
// If the Orchestrator Explorer Feature is enabled, enable the Process Agent.
if !BoolValue(dda.Agent.Enabled) {
if dda.Agent.Process == nil {
dda.Agent.Process = DefaultDatadogAgentSpecAgentProcess(&dda.Agent)
}
dda.Agent.Process.Enabled = NewBoolPointer(true)
dso.Agent.Process = DefaultDatadogAgentSpecAgentProcess(&dda.Agent)
dso.Agent.Process.Enabled = NewBoolPointer(true)
Expand Down Expand Up @@ -615,12 +622,18 @@ func DefaultDatadogAgentSpecAgentApmUDS(apm *APMSpec) *APMUnixDomainSocketSpec {
// DefaultDatadogAgentSpecAgentSystemProbe defaults the System Probe
// This method can be re-run as part of the FeatureOverride
func DefaultDatadogAgentSpecAgentSystemProbe(agent *DatadogAgentSpecAgentSpec) *SystemProbeSpec {
sysOverride := &SystemProbeSpec{}

if agent.SystemProbe == nil {
agent.SystemProbe = &SystemProbeSpec{Enabled: NewBoolPointer(defaultSystemProbeEnabled)}
return agent.SystemProbe
sysOverride = agent.SystemProbe
}

if agent.Security != nil && BoolValue(agent.Security.Runtime.Enabled) {
agent.SystemProbe.Enabled = agent.Security.Runtime.Enabled
sysOverride = agent.SystemProbe
}

sysOverride := &SystemProbeSpec{}
if agent.SystemProbe.Enabled == nil {
agent.SystemProbe.Enabled = NewBoolPointer(defaultSystemProbeEnabled)
sysOverride.Enabled = agent.SystemProbe.Enabled
Expand Down
5 changes: 4 additions & 1 deletion api/v1alpha1/datadogagent_types.go
Expand Up @@ -410,7 +410,7 @@ type LogCollectionConfig struct {
// Defaults to `/var/log/containers`
//
// +optional
ContainerSymlinksPath *string `json:"ContainerSymlinksPath,omitempty"`
ContainerSymlinksPath *string `json:"containerSymlinksPath,omitempty"`

// This path (always mounted from the host) is used by Datadog Agent to store information about processed log files.
// If the Datadog Agent is restarted, it starts tailing the log files immediately.
Expand Down Expand Up @@ -722,6 +722,9 @@ 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.
// +optional
// +listType=map
// +listMapKey=key
Items []corev1.KeyToPath `json:"items,omitempty"`
}

Expand Down
10 changes: 9 additions & 1 deletion api/v1alpha1/zz_generated.openapi.go

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

Expand Up @@ -103,7 +103,7 @@ metadata:
operators.operatorframework.io/builder: operator-sdk-v1.4.0+git
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
repository: https://github.com/DataDog/datadog-operator
name: datadog-operator.v0.6.0
name: datadog-operator.v0.7.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -265,6 +265,13 @@ spec:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- replicationcontrollers
verbs:
- list
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -314,6 +321,13 @@ spec:
- mutatingwebhookconfigurations
verbs:
- '*'
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
verbs:
- list
- watch
- apiGroups:
- apiregistration.k8s.io
resources:
Expand Down Expand Up @@ -367,6 +381,16 @@ spec:
- get
- list
- watch
- apiGroups:
- apps
- extensions
resources:
- daemonsets
- deployments
- replicasets
verbs:
- list
- watch
- apiGroups:
- authentication.k8s.io
resources:
Expand Down Expand Up @@ -452,6 +476,13 @@ spec:
- get
- list
- watch
- apiGroups:
- certificates.k8s.io
resources:
- certificatesigningrequests
verbs:
- list
- watch
- apiGroups:
- coordination.k8s.io
resources:
Expand Down Expand Up @@ -556,6 +587,13 @@ spec:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand All @@ -580,6 +618,14 @@ spec:
- patch
- update
- watch
- apiGroups:
- policy
resources:
- podsecuritypolicies
verbs:
- get
- list
- watch
- apiGroups:
- quota.openshift.io
resources:
Expand Down Expand Up @@ -691,6 +737,14 @@ spec:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
- volumeattachments
verbs:
- list
- watch
serviceAccountName: datadog-operator-manager
- rules:
- apiGroups:
Expand Down Expand Up @@ -731,8 +785,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
image: datadog/operator:0.6.0
imagePullPolicy: Always
image: datadog/operator:0.7.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /healthz/
Expand Down Expand Up @@ -820,5 +874,4 @@ spec:
maturity: alpha
provider:
name: Datadog
version: 0.6.0
replaces: datadog-operator.v0.5.1
version: 0.7.0

0 comments on commit 1848dd9

Please sign in to comment.